10#if FW_ENABLE_TEXT_LOGGING
19 BUFFQUEUEIN_BUFFERSEND,
21 COMSTATUSIN_SUCCESSCONDITION,
36 class ComponentIpcSerializableBuffer :
46 MAX_DATA_SIZE =
sizeof(BuffUnion),
48 SERIALIZATION_SIZE = DATA_OFFSET + MAX_DATA_SIZE
52 return sizeof(m_buff);
59 const U8* getBuffAddr()
const {
65 U8 m_buff[SERIALIZATION_SIZE];
74 void ComQueueComponentBase ::
86 port < static_cast<FwIndexType>(this->getNum_buffQueueIn_InputPorts());
89 this->m_buffQueueIn_InputPort[port].init();
90 this->m_buffQueueIn_InputPort[port].addCallComp(
94 this->m_buffQueueIn_InputPort[port].setPortNum(port);
96#if FW_OBJECT_NAMES == 1
100 this->m_objName.toChar(),
103 this->m_buffQueueIn_InputPort[port].setObjName(portName.
toChar());
110 port < static_cast<FwIndexType>(this->getNum_comQueueIn_InputPorts());
113 this->m_comQueueIn_InputPort[port].init();
114 this->m_comQueueIn_InputPort[port].addCallComp(
118 this->m_comQueueIn_InputPort[port].setPortNum(port);
120#if FW_OBJECT_NAMES == 1
124 this->m_objName.toChar(),
127 this->m_comQueueIn_InputPort[port].setObjName(portName.
toChar());
134 port < static_cast<FwIndexType>(this->getNum_comStatusIn_InputPorts());
137 this->m_comStatusIn_InputPort[port].init();
138 this->m_comStatusIn_InputPort[port].addCallComp(
142 this->m_comStatusIn_InputPort[port].setPortNum(port);
144#if FW_OBJECT_NAMES == 1
148 this->m_objName.toChar(),
151 this->m_comStatusIn_InputPort[port].setObjName(portName.
toChar());
158 port < static_cast<FwIndexType>(this->getNum_run_InputPorts());
161 this->m_run_InputPort[port].init();
162 this->m_run_InputPort[port].addCallComp(
166 this->m_run_InputPort[port].setPortNum(port);
168#if FW_OBJECT_NAMES == 1
172 this->m_objName.toChar(),
175 this->m_run_InputPort[port].setObjName(portName.
toChar());
182 port < static_cast<FwIndexType>(this->getNum_Log_OutputPorts());
185 this->m_Log_OutputPort[port].init();
187#if FW_OBJECT_NAMES == 1
191 this->m_objName.toChar(),
194 this->m_Log_OutputPort[port].setObjName(portName.
toChar());
198#if FW_ENABLE_TEXT_LOGGING == 1
202 port < static_cast<FwIndexType>(this->getNum_LogText_OutputPorts());
205 this->m_LogText_OutputPort[port].init();
207#if FW_OBJECT_NAMES == 1
211 this->m_objName.toChar(),
214 this->m_LogText_OutputPort[port].setObjName(portName.
toChar());
222 port < static_cast<FwIndexType>(this->getNum_Time_OutputPorts());
225 this->m_Time_OutputPort[port].init();
227#if FW_OBJECT_NAMES == 1
231 this->m_objName.toChar(),
234 this->m_Time_OutputPort[port].setObjName(portName.
toChar());
241 port < static_cast<FwIndexType>(this->getNum_Tlm_OutputPorts());
244 this->m_Tlm_OutputPort[port].init();
246#if FW_OBJECT_NAMES == 1
250 this->m_objName.toChar(),
253 this->m_Tlm_OutputPort[port].setObjName(portName.
toChar());
260 port < static_cast<FwIndexType>(this->getNum_buffQueueSend_OutputPorts());
263 this->m_buffQueueSend_OutputPort[port].init();
265#if FW_OBJECT_NAMES == 1
269 this->m_objName.toChar(),
272 this->m_buffQueueSend_OutputPort[port].setObjName(portName.
toChar());
279 port < static_cast<FwIndexType>(this->getNum_comQueueSend_OutputPorts());
282 this->m_comQueueSend_OutputPort[port].init();
284#if FW_OBJECT_NAMES == 1
288 this->m_objName.toChar(),
291 this->m_comQueueSend_OutputPort[port].setObjName(portName.
toChar());
298 port < static_cast<FwIndexType>(this->getNum_deallocate_OutputPorts());
301 this->m_deallocate_OutputPort[port].init();
303#if FW_OBJECT_NAMES == 1
307 this->m_objName.toChar(),
310 this->m_deallocate_OutputPort[port].setObjName(portName.
toChar());
317 static_cast<FwSizeType>(ComponentIpcSerializableBuffer::SERIALIZATION_SIZE)
333 portNum < this->getNum_buffQueueIn_InputPorts(),
337 return &this->m_buffQueueIn_InputPort[portNum];
344 portNum < this->getNum_comQueueIn_InputPorts(),
348 return &this->m_comQueueIn_InputPort[portNum];
355 portNum < this->getNum_comStatusIn_InputPorts(),
359 return &this->m_comStatusIn_InputPort[portNum];
366 portNum < this->getNum_run_InputPorts(),
370 return &this->m_run_InputPort[portNum];
377 void ComQueueComponentBase ::
384 portNum < this->getNum_Log_OutputPorts(),
388 this->m_Log_OutputPort[portNum].addCallPort(port);
391#if FW_ENABLE_TEXT_LOGGING == 1
393 void ComQueueComponentBase ::
394 set_LogText_OutputPort(
400 portNum < this->getNum_LogText_OutputPorts(),
404 this->m_LogText_OutputPort[portNum].addCallPort(port);
409 void ComQueueComponentBase ::
416 portNum < this->getNum_Time_OutputPorts(),
420 this->m_Time_OutputPort[portNum].addCallPort(port);
423 void ComQueueComponentBase ::
430 portNum < this->getNum_Tlm_OutputPorts(),
434 this->m_Tlm_OutputPort[portNum].addCallPort(port);
441 void ComQueueComponentBase ::
442 set_buffQueueSend_OutputPort(
448 portNum < this->getNum_buffQueueSend_OutputPorts(),
452 this->m_buffQueueSend_OutputPort[portNum].addCallPort(port);
455 void ComQueueComponentBase ::
456 set_comQueueSend_OutputPort(
462 portNum < this->getNum_comQueueSend_OutputPorts(),
466 this->m_comQueueSend_OutputPort[portNum].addCallPort(port);
469 void ComQueueComponentBase ::
470 set_deallocate_OutputPort(
476 portNum < this->getNum_deallocate_OutputPorts(),
480 this->m_deallocate_OutputPort[portNum].addCallPort(port);
483#if FW_PORT_SERIALIZATION
489 void ComQueueComponentBase ::
492 Fw::InputSerializePort* port
496 portNum < this->getNum_Log_OutputPorts(),
500 this->m_Log_OutputPort[portNum].registerSerialPort(port);
503#if FW_ENABLE_TEXT_LOGGING == 1
505 void ComQueueComponentBase ::
506 set_LogText_OutputPort(
508 Fw::InputSerializePort* port
512 portNum < this->getNum_LogText_OutputPorts(),
516 this->m_LogText_OutputPort[portNum].registerSerialPort(port);
521 void ComQueueComponentBase ::
524 Fw::InputSerializePort* port
528 portNum < this->getNum_Time_OutputPorts(),
532 this->m_Time_OutputPort[portNum].registerSerialPort(port);
535 void ComQueueComponentBase ::
538 Fw::InputSerializePort* port
542 portNum < this->getNum_Tlm_OutputPorts(),
546 this->m_Tlm_OutputPort[portNum].registerSerialPort(port);
551#if FW_PORT_SERIALIZATION
557 void ComQueueComponentBase ::
558 set_buffQueueSend_OutputPort(
560 Fw::InputSerializePort* port
564 portNum < this->getNum_buffQueueSend_OutputPorts(),
568 this->m_buffQueueSend_OutputPort[portNum].registerSerialPort(port);
571 void ComQueueComponentBase ::
572 set_comQueueSend_OutputPort(
574 Fw::InputSerializePort* port
578 portNum < this->getNum_comQueueSend_OutputPorts(),
582 this->m_comQueueSend_OutputPort[portNum].registerSerialPort(port);
585 void ComQueueComponentBase ::
586 set_deallocate_OutputPort(
588 Fw::InputSerializePort* port
592 portNum < this->getNum_deallocate_OutputPorts(),
596 this->m_deallocate_OutputPort[portNum].registerSerialPort(port);
605 ComQueueComponentBase ::
606 ComQueueComponentBase(
const char* compName) :
607 Fw::ActiveComponentBase(compName)
612 ComQueueComponentBase ::
613 ~ComQueueComponentBase()
623 getNum_buffQueueIn_InputPorts()
const
629 getNum_comQueueIn_InputPorts()
const
635 getNum_comStatusIn_InputPorts()
const
641 getNum_run_InputPorts()
const
651 getNum_Log_OutputPorts()
const
656#if FW_ENABLE_TEXT_LOGGING == 1
659 getNum_LogText_OutputPorts()
const
667 getNum_Time_OutputPorts()
const
673 getNum_Tlm_OutputPorts()
const
683 getNum_buffQueueSend_OutputPorts()
const
689 getNum_comQueueSend_OutputPorts()
const
695 getNum_deallocate_OutputPorts()
const
704 bool ComQueueComponentBase ::
708 portNum < this->getNum_Log_OutputPorts(),
712 return this->m_Log_OutputPort[portNum].isConnected();
715#if FW_ENABLE_TEXT_LOGGING == 1
717 bool ComQueueComponentBase ::
718 isConnected_LogText_OutputPort(
FwIndexType portNum)
721 portNum < this->getNum_LogText_OutputPorts(),
725 return this->m_LogText_OutputPort[portNum].isConnected();
730 bool ComQueueComponentBase ::
734 portNum < this->getNum_Time_OutputPorts(),
738 return this->m_Time_OutputPort[portNum].isConnected();
741 bool ComQueueComponentBase ::
745 portNum < this->getNum_Tlm_OutputPorts(),
749 return this->m_Tlm_OutputPort[portNum].isConnected();
756 bool ComQueueComponentBase ::
757 isConnected_buffQueueSend_OutputPort(
FwIndexType portNum)
760 portNum < this->getNum_buffQueueSend_OutputPorts(),
764 return this->m_buffQueueSend_OutputPort[portNum].isConnected();
767 bool ComQueueComponentBase ::
768 isConnected_comQueueSend_OutputPort(
FwIndexType portNum)
771 portNum < this->getNum_comQueueSend_OutputPorts(),
775 return this->m_comQueueSend_OutputPort[portNum].isConnected();
778 bool ComQueueComponentBase ::
779 isConnected_deallocate_OutputPort(
FwIndexType portNum)
782 portNum < this->getNum_deallocate_OutputPorts(),
786 return this->m_deallocate_OutputPort[portNum].isConnected();
795 void ComQueueComponentBase ::
796 buffQueueIn_handlerBase(
803 portNum < this->getNum_buffQueueIn_InputPorts(),
808 buffQueueIn_preMsgHook(
812 ComponentIpcSerializableBuffer msg;
816 _status = msg.serialize(
825 _status = msg.serialize(portNum);
832 _status = msg.serialize(fwBuffer);
843 this->buffQueueIn_overflowHook(portNum, fwBuffer);
853 void ComQueueComponentBase ::
854 comQueueIn_handlerBase(
862 portNum < this->getNum_comQueueIn_InputPorts(),
867 comQueueIn_preMsgHook(
872 ComponentIpcSerializableBuffer msg;
876 _status = msg.serialize(
885 _status = msg.serialize(portNum);
892 _status = msg.serialize(data);
899 _status = msg.serialize(context);
910 this->incNumMsgDropped();
920 void ComQueueComponentBase ::
921 comStatusIn_handlerBase(
928 portNum < this->getNum_comStatusIn_InputPorts(),
933 comStatusIn_preMsgHook(
937 ComponentIpcSerializableBuffer msg;
941 _status = msg.serialize(
950 _status = msg.serialize(portNum);
957 _status = msg.serialize(condition);
973 void ComQueueComponentBase ::
981 portNum < this->getNum_run_InputPorts(),
990 ComponentIpcSerializableBuffer msg;
994 _status = msg.serialize(
1003 _status = msg.serialize(portNum);
1010 _status = msg.serialize(context);
1021 this->incNumMsgDropped();
1039 void ComQueueComponentBase ::
1040 buffQueueIn_preMsgHook(
1048 void ComQueueComponentBase ::
1049 comQueueIn_preMsgHook(
1058 void ComQueueComponentBase ::
1059 comStatusIn_preMsgHook(
1067 void ComQueueComponentBase ::
1080 void ComQueueComponentBase ::
1087 portNum < this->getNum_buffQueueSend_OutputPorts(),
1090 this->m_buffQueueSend_OutputPort[portNum].invoke(
1095 void ComQueueComponentBase ::
1103 portNum < this->getNum_comQueueSend_OutputPorts(),
1106 this->m_comQueueSend_OutputPort[portNum].invoke(
1112 void ComQueueComponentBase ::
1119 portNum < this->getNum_deallocate_OutputPorts(),
1122 this->m_deallocate_OutputPort[portNum].invoke(
1131 void ComQueueComponentBase ::
1132 log_WARNING_HI_QueueOverflow(
1139 if (this->m_Time_OutputPort[0].isConnected()) {
1140 this->m_Time_OutputPort[0].invoke(_logTime);
1145 _id = this->getIdBase() + EVENTID_QUEUEOVERFLOW;
1148 if (this->m_Log_OutputPort[0].isConnected()) {
1152#if FW_AMPCS_COMPATIBLE
1161#if FW_AMPCS_COMPATIBLE
1171 _status = _logBuff.
serialize(queueType);
1177#if FW_AMPCS_COMPATIBLE
1180 static_cast<U8>(
sizeof(U32))
1193 this->m_Log_OutputPort[0].invoke(
1202#if FW_ENABLE_TEXT_LOGGING
1203 if (this->m_LogText_OutputPort[0].isConnected()) {
1204#if FW_OBJECT_NAMES == 1
1205 const char* _formatString =
1206 "(%s) %s: The %s queue at index %" PRIu32
" overflowed";
1208 const char* _formatString =
1209 "%s: The %s queue at index %" PRIu32
" overflowed";
1213 queueType.toString(queueTypeStr);
1219 this->m_objName.toChar(),
1226 this->m_LogText_OutputPort[0].invoke(
1240 void ComQueueComponentBase ::
1241 tlmWrite_comQueueDepth(
1246 if (this->m_Tlm_OutputPort[0].isConnected()) {
1248 this->m_Time_OutputPort[0].isConnected() &&
1251 this->m_Time_OutputPort[0].invoke(_tlmTime);
1263 _id = this->getIdBase() + CHANNELID_COMQUEUEDEPTH;
1265 this->m_Tlm_OutputPort[0].invoke(
1273 void ComQueueComponentBase ::
1274 tlmWrite_buffQueueDepth(
1279 if (this->m_Tlm_OutputPort[0].isConnected()) {
1281 this->m_Time_OutputPort[0].isConnected() &&
1284 this->m_Time_OutputPort[0].invoke(_tlmTime);
1296 _id = this->getIdBase() + CHANNELID_BUFFQUEUEDEPTH;
1298 this->m_Tlm_OutputPort[0].invoke(
1313 if (this->m_Time_OutputPort[0].isConnected()) {
1315 this->m_Time_OutputPort[0].invoke(_time);
1330 ComponentIpcSerializableBuffer msg;
1353 MsgTypeEnum msgType =
static_cast<MsgTypeEnum
>(desMsg);
1355 if (msgType == COMQUEUE_COMPONENT_EXIT) {
1356 return MSG_DISPATCH_EXIT;
1360 deserStatus = msg.deserialize(portNum);
1368 case BUFFQUEUEIN_BUFFERSEND: {
1371 deserStatus = msg.deserialize(fwBuffer);
1377 this->buffQueueIn_handler(
1386 case COMQUEUEIN_COM: {
1389 deserStatus = msg.deserialize(data);
1397 deserStatus = msg.deserialize(context);
1403 this->comQueueIn_handler(
1413 case COMSTATUSIN_SUCCESSCONDITION: {
1416 deserStatus = msg.deserialize(condition);
1422 this->comStatusIn_handler(
1434 deserStatus = msg.deserialize(context);
1449 return MSG_DISPATCH_ERROR;
1452 return MSG_DISPATCH_OK;
1459 void ComQueueComponentBase ::
1467 ComQueueComponentBase* compPtr =
static_cast<ComQueueComponentBase*
>(callComp);
1468 compPtr->buffQueueIn_handlerBase(
1474 void ComQueueComponentBase ::
1483 ComQueueComponentBase* compPtr =
static_cast<ComQueueComponentBase*
>(callComp);
1484 compPtr->comQueueIn_handlerBase(
1491 void ComQueueComponentBase ::
1499 ComQueueComponentBase* compPtr =
static_cast<ComQueueComponentBase*
>(callComp);
1500 compPtr->comStatusIn_handlerBase(
1506 void ComQueueComponentBase ::
1514 ComQueueComponentBase* compPtr =
static_cast<ComQueueComponentBase*
>(callComp);
1515 compPtr->run_handlerBase(
uint8_t U8
8-bit unsigned integer
#define FW_NUM_ARRAY_ELEMENTS(a)
number of elements in an array
#define PRI_PlatformIntType
@ TB_NONE
No time base has been established.
PlatformAssertArgType FwAssertArgType
PlatformSizeType FwSizeType
PlatformQueuePriorityType FwQueuePriorityType
PlatformIndexType FwIndexType
#define FW_OBJECT_NAMES
Indicates whether or not object names are stored (more memory, can be used for tracking objects)/*#en...
@ ACTIVE_COMPONENT_EXIT
message to exit active component task
@ WARNING_HI
A serious but recoverable event.
void init()
Object initializer.
const char * toChar() const
NATIVE_UINT_TYPE SizeType
SerializeStatus serialize(U8 val)
serialize 8-bit unsigned int
void format(const CHAR *formatString,...)
write formatted string to buffer
const char * toChar() const
@ BLOCKING
Message will block until space is available.
@ NONBLOCKING
Message will return with status when space is unavailable.
Status
status returned from the queue send function
@ FULL
queue was full when attempting to send a message
@ OP_OK
message sent/received okay
Array of queue depths for Fw::Buffer types.
Array of queue depths for Fw::Com types.
An enumeration of queue data types.
@ SERIALIZED_SIZE
The size of the serial representation.
SerializeStatus
forward declaration for string
@ FW_SERIALIZE_OK
Serialization/Deserialization operation was successful.