/************************************************************
 *  File Name:  AVICReceivePackager.h
 *
 *  Version: V1.0
 *
 *  Requirements:
 *      AVIC
 *
 *  Description:
 *      This file contains the AVIC Receive Packager definitions.
 *
 *  History:
 *
 *      Original          24-MAY-2001        R. Caldbeck
 *
 *
 ************************************************************/


#ifndef _AVICRECEIVEPACKAGER_H
#define _AVICRECEIVEPACKAGER_H

#include "system.h"
#include "AVICDriver.h"


#define MSIZE 76                /* Message size, in bytes */

typedef struct {
    UINT16 last;                /* Pointer to last-used byte in msg */
    UINT8  msg[MSIZE];          /* Latest complete message */
    UINT8  AVIC_Receive_Status; /* ACK = valid message received
                                   NAK = no valid message received
                                   NOR = no response */
    UINT8  AVIC_Handshake_Rcv;  /* the ACK/NAK byte in msg[] */
} AVICReceivePackagerType;

extern AVICReceivePackagerType AVICReceivePackager1;
extern AVICReceivePackagerType AVICReceivePackager2;


extern const UINT8 NOR;     /* NOR = 0x00 */
extern const UINT8 ACK;     /* ACK = 0x06 */
extern const UINT8 NAK;     /* NAK = 0x15 */


void AVICReceivePackager_Initialize (void);
BOOL AVICReceivePackager_UnpackNewMessages
                (AVICDriverReceiveQueueStruct * const RXbuff);


#endif /* ifndef _AVICRECEIVEPACKAGER_H */
