My Project
 All Classes Files Functions Variables Enumerations Enumerator Friends Macros Pages
ScannerMsg.h
1 #ifndef SCANNERMSG_H
2 #define SCANNERMSG_H
3 
11 #include "gcp/util/common/GenericTaskMsg.h"
12 
13 #include "gcp/mediator/specific/DioMsg.h"
14 
15 namespace gcp {
16 namespace mediator {
17 
18  class ScannerMsg :
20 
21  public:
22 
26  enum MsgType {
27  START_DATAFRAME, // A message to start a new data frame.
28  DISPATCH_DATAFRAME, // A message to dispatch a pending data frame.
29  PACK_BOLO_DATAFRAME,// A mesage that a bolometer frame is
30  // ready to be packed
31  CONNECT, // A message to connect to the archiver port.
32  FEATURE,
33 
34  DIO_MSG
35  };
36 
41 
42  union body {
43 
44  struct {
45  unsigned seq;
46  unsigned mode;
47  unsigned mask;
48  } feature;
49 
50  DioMsg dioMsg;
51 
52  } body;
53 
54  inline DioMsg* getDioMsg()
55  {
57  gcp::util::GenericTaskMsg::TASK_SPECIFIC;
58 
59  type = DIO_MSG;
60 
61  return &body.dioMsg;
62  }
63 
64 
65  //------------------------------------------------------------
66  // Methods for packing messages intended for the
67  // Scanner task
68  //------------------------------------------------------------
69 
73  inline void packStartDataFrameMsg() {
74 
76  gcp::util::GenericTaskMsg::TASK_SPECIFIC;
77 
78  type = START_DATAFRAME;
79  }
80 
84  inline void packDispatchDataFrameMsg() {
85 
87  gcp::util::GenericTaskMsg::TASK_SPECIFIC;
88 
89  type = DISPATCH_DATAFRAME;
90  }
91 
95  inline void packPackBoloDataFrameMsg() {
96 
98  gcp::util::GenericTaskMsg::TASK_SPECIFIC;
99 
100  type = PACK_BOLO_DATAFRAME;
101  }
102 
106  inline void packConnectMsg() {
107 
108  genericMsgType_ =
109  gcp::util::GenericTaskMsg::TASK_SPECIFIC;
110 
111  type = CONNECT;
112  }
113 
117  inline void packFeatureMsg(unsigned seq,
118  unsigned mode,
119  unsigned mask) {
120 
121  genericMsgType_ =
122  gcp::util::GenericTaskMsg::TASK_SPECIFIC;
123 
124  type = FEATURE;
125 
126  body.feature.seq = seq;
127  body.feature.mode = mode;
128  body.feature.mask = mask;
129  }
130 
131 
132  }; // End class ScannerMsg
133 
134 
135 } // End namespace mediator
136 } // End namespace gcp
137 
138 #endif // End #ifndef
Definition: GenericTaskMsg.h:31
Definition: DioMsg.h:16
void packFeatureMsg(unsigned seq, unsigned mode, unsigned mask)
Definition: ScannerMsg.h:117
Definition: ScannerMsg.h:42
Definition: ScannerMsg.h:18
void packStartDataFrameMsg()
Definition: ScannerMsg.h:73
GenericMsgType genericMsgType_
Definition: GenericTaskMsg.h:50
MsgType
Definition: ScannerMsg.h:26
MsgType type
Definition: ScannerMsg.h:40
void packConnectMsg()
Definition: ScannerMsg.h:106
void packDispatchDataFrameMsg()
Definition: ScannerMsg.h:84
void packPackBoloDataFrameMsg()
Definition: ScannerMsg.h:95