#ifndef __SYSTEMBULLETIN_HPP__
#define __SYSTEMBULLETIN_HPP__

#define MAX_EVENT_TEXT  50
#define MAX_AMCS_SUFFIX 6

#define AMCS_FLAG_TRUE     1
#define AMCS_FLAG_FALSE    0

// ** TEventCmdUnion **
typedef struct TCmdEventData
{
   unsigned int   ipAddress;
   unsigned short portNumber;
   // others to be added
}TCmdEventData;

typedef struct TEventData
{
   char  eventEnglishText[MAX_EVENT_TEXT];
   char  eventFrenchText[MAX_EVENT_TEXT];
}TEventData;

typedef union TEventCmdUnion
{
   TEventData     eventData;
   TCmdEventData  cmdData;
}TEventCmdUnion;
// ** END TEventCmdUnion

// ** TStatusData
typedef struct TSystemStatus
{
   unsigned char  systemMode;
   unsigned char  systemState;
   unsigned int   percentFreeSpace;
}TSystemStatus;

typedef struct TReaderStatus
{
   unsigned char  flagReader;
   unsigned char  portStatus;
   unsigned char  readerMode;
   unsigned int   radar3ACode;
   char           amcsSuffix[MAX_AMCS_SUFFIX];
}TReaderStatus;

typedef union TStatusData
{
   TSystemStatus  statusSystem;
   TReaderStatus  statusReader;
}TStatusData;
// ** END TStatusData

typedef struct TEventQueueStructure
{
   unsigned char  eventID     :8;
   unsigned char  eventCMD    :8;
   unsigned int   sessionID   :16;
   TEventCmdUnion data;
}TEventQueueStructure;

typedef struct TSystemBulletinRecord
{
   unsigned char           flagAMCS;
   TEventQueueStructure    eventData;
   TStatusData             statusData;
}TSystemBulletinRecord;

#endif

