10#if FW_ENABLE_TEXT_LOGGING
19 COMPCMDSTAT_CMDRESPONSE,
25 CMD_CMD_CLEAR_TRACKING,
39 class ComponentIpcSerializableBuffer :
49 MAX_DATA_SIZE =
sizeof(BuffUnion),
51 SERIALIZATION_SIZE = DATA_OFFSET + MAX_DATA_SIZE
55 return sizeof(m_buff);
62 const U8* getBuffAddr()
const {
68 U8 m_buff[SERIALIZATION_SIZE];
77 void CommandDispatcherComponentBase ::
89 port < static_cast<FwIndexType>(this->getNum_CmdDisp_InputPorts());
92 this->m_CmdDisp_InputPort[port].init();
93 this->m_CmdDisp_InputPort[port].addCallComp(
97 this->m_CmdDisp_InputPort[port].setPortNum(port);
99#if FW_OBJECT_NAMES == 1
103 this->m_objName.toChar(),
106 this->m_CmdDisp_InputPort[port].setObjName(portName.
toChar());
113 port < static_cast<FwIndexType>(this->getNum_compCmdReg_InputPorts());
116 this->m_compCmdReg_InputPort[port].init();
117 this->m_compCmdReg_InputPort[port].addCallComp(
121 this->m_compCmdReg_InputPort[port].setPortNum(port);
123#if FW_OBJECT_NAMES == 1
127 this->m_objName.toChar(),
130 this->m_compCmdReg_InputPort[port].setObjName(portName.
toChar());
137 port < static_cast<FwIndexType>(this->getNum_compCmdStat_InputPorts());
140 this->m_compCmdStat_InputPort[port].init();
141 this->m_compCmdStat_InputPort[port].addCallComp(
145 this->m_compCmdStat_InputPort[port].setPortNum(port);
147#if FW_OBJECT_NAMES == 1
151 this->m_objName.toChar(),
154 this->m_compCmdStat_InputPort[port].setObjName(portName.
toChar());
161 port < static_cast<FwIndexType>(this->getNum_pingIn_InputPorts());
164 this->m_pingIn_InputPort[port].init();
165 this->m_pingIn_InputPort[port].addCallComp(
169 this->m_pingIn_InputPort[port].setPortNum(port);
171#if FW_OBJECT_NAMES == 1
175 this->m_objName.toChar(),
178 this->m_pingIn_InputPort[port].setObjName(portName.
toChar());
185 port < static_cast<FwIndexType>(this->getNum_seqCmdBuff_InputPorts());
188 this->m_seqCmdBuff_InputPort[port].init();
189 this->m_seqCmdBuff_InputPort[port].addCallComp(
193 this->m_seqCmdBuff_InputPort[port].setPortNum(port);
195#if FW_OBJECT_NAMES == 1
199 this->m_objName.toChar(),
202 this->m_seqCmdBuff_InputPort[port].setObjName(portName.
toChar());
209 port < static_cast<FwIndexType>(this->getNum_CmdReg_OutputPorts());
212 this->m_CmdReg_OutputPort[port].init();
214#if FW_OBJECT_NAMES == 1
218 this->m_objName.toChar(),
221 this->m_CmdReg_OutputPort[port].setObjName(portName.
toChar());
228 port < static_cast<FwIndexType>(this->getNum_CmdStatus_OutputPorts());
231 this->m_CmdStatus_OutputPort[port].init();
233#if FW_OBJECT_NAMES == 1
237 this->m_objName.toChar(),
240 this->m_CmdStatus_OutputPort[port].setObjName(portName.
toChar());
247 port < static_cast<FwIndexType>(this->getNum_Log_OutputPorts());
250 this->m_Log_OutputPort[port].init();
252#if FW_OBJECT_NAMES == 1
256 this->m_objName.toChar(),
259 this->m_Log_OutputPort[port].setObjName(portName.
toChar());
263#if FW_ENABLE_TEXT_LOGGING == 1
267 port < static_cast<FwIndexType>(this->getNum_LogText_OutputPorts());
270 this->m_LogText_OutputPort[port].init();
272#if FW_OBJECT_NAMES == 1
276 this->m_objName.toChar(),
279 this->m_LogText_OutputPort[port].setObjName(portName.
toChar());
287 port < static_cast<FwIndexType>(this->getNum_Time_OutputPorts());
290 this->m_Time_OutputPort[port].init();
292#if FW_OBJECT_NAMES == 1
296 this->m_objName.toChar(),
299 this->m_Time_OutputPort[port].setObjName(portName.
toChar());
306 port < static_cast<FwIndexType>(this->getNum_Tlm_OutputPorts());
309 this->m_Tlm_OutputPort[port].init();
311#if FW_OBJECT_NAMES == 1
315 this->m_objName.toChar(),
318 this->m_Tlm_OutputPort[port].setObjName(portName.
toChar());
325 port < static_cast<FwIndexType>(this->getNum_compCmdSend_OutputPorts());
328 this->m_compCmdSend_OutputPort[port].init();
330#if FW_OBJECT_NAMES == 1
334 this->m_objName.toChar(),
337 this->m_compCmdSend_OutputPort[port].setObjName(portName.
toChar());
344 port < static_cast<FwIndexType>(this->getNum_pingOut_OutputPorts());
347 this->m_pingOut_OutputPort[port].init();
349#if FW_OBJECT_NAMES == 1
353 this->m_objName.toChar(),
356 this->m_pingOut_OutputPort[port].setObjName(portName.
toChar());
363 port < static_cast<FwIndexType>(this->getNum_seqCmdStatus_OutputPorts());
366 this->m_seqCmdStatus_OutputPort[port].init();
368#if FW_OBJECT_NAMES == 1
372 this->m_objName.toChar(),
375 this->m_seqCmdStatus_OutputPort[port].setObjName(portName.
toChar());
382 static_cast<FwSizeType>(ComponentIpcSerializableBuffer::SERIALIZATION_SIZE)
398 portNum < this->getNum_CmdDisp_InputPorts(),
402 return &this->m_CmdDisp_InputPort[portNum];
413 portNum < this->getNum_compCmdReg_InputPorts(),
417 return &this->m_compCmdReg_InputPort[portNum];
424 portNum < this->getNum_compCmdStat_InputPorts(),
428 return &this->m_compCmdStat_InputPort[portNum];
435 portNum < this->getNum_pingIn_InputPorts(),
439 return &this->m_pingIn_InputPort[portNum];
446 portNum < this->getNum_seqCmdBuff_InputPorts(),
450 return &this->m_seqCmdBuff_InputPort[portNum];
457 void CommandDispatcherComponentBase ::
458 set_CmdReg_OutputPort(
464 portNum < this->getNum_CmdReg_OutputPorts(),
468 this->m_CmdReg_OutputPort[portNum].addCallPort(port);
471 void CommandDispatcherComponentBase ::
472 set_CmdStatus_OutputPort(
478 portNum < this->getNum_CmdStatus_OutputPorts(),
482 this->m_CmdStatus_OutputPort[portNum].addCallPort(port);
485 void CommandDispatcherComponentBase ::
492 portNum < this->getNum_Log_OutputPorts(),
496 this->m_Log_OutputPort[portNum].addCallPort(port);
499#if FW_ENABLE_TEXT_LOGGING == 1
501 void CommandDispatcherComponentBase ::
502 set_LogText_OutputPort(
508 portNum < this->getNum_LogText_OutputPorts(),
512 this->m_LogText_OutputPort[portNum].addCallPort(port);
517 void CommandDispatcherComponentBase ::
524 portNum < this->getNum_Time_OutputPorts(),
528 this->m_Time_OutputPort[portNum].addCallPort(port);
531 void CommandDispatcherComponentBase ::
538 portNum < this->getNum_Tlm_OutputPorts(),
542 this->m_Tlm_OutputPort[portNum].addCallPort(port);
549 void CommandDispatcherComponentBase ::
550 set_compCmdSend_OutputPort(
556 portNum < this->getNum_compCmdSend_OutputPorts(),
560 this->m_compCmdSend_OutputPort[portNum].addCallPort(port);
563 void CommandDispatcherComponentBase ::
564 set_pingOut_OutputPort(
570 portNum < this->getNum_pingOut_OutputPorts(),
574 this->m_pingOut_OutputPort[portNum].addCallPort(port);
577 void CommandDispatcherComponentBase ::
578 set_seqCmdStatus_OutputPort(
584 portNum < this->getNum_seqCmdStatus_OutputPorts(),
588 this->m_seqCmdStatus_OutputPort[portNum].addCallPort(port);
591#if FW_PORT_SERIALIZATION
597 void CommandDispatcherComponentBase ::
598 set_CmdReg_OutputPort(
600 Fw::InputSerializePort* port
604 portNum < this->getNum_CmdReg_OutputPorts(),
608 this->m_CmdReg_OutputPort[portNum].registerSerialPort(port);
611 void CommandDispatcherComponentBase ::
612 set_CmdStatus_OutputPort(
614 Fw::InputSerializePort* port
618 portNum < this->getNum_CmdStatus_OutputPorts(),
622 this->m_CmdStatus_OutputPort[portNum].registerSerialPort(port);
625 void CommandDispatcherComponentBase ::
628 Fw::InputSerializePort* port
632 portNum < this->getNum_Log_OutputPorts(),
636 this->m_Log_OutputPort[portNum].registerSerialPort(port);
639#if FW_ENABLE_TEXT_LOGGING == 1
641 void CommandDispatcherComponentBase ::
642 set_LogText_OutputPort(
644 Fw::InputSerializePort* port
648 portNum < this->getNum_LogText_OutputPorts(),
652 this->m_LogText_OutputPort[portNum].registerSerialPort(port);
657 void CommandDispatcherComponentBase ::
660 Fw::InputSerializePort* port
664 portNum < this->getNum_Time_OutputPorts(),
668 this->m_Time_OutputPort[portNum].registerSerialPort(port);
671 void CommandDispatcherComponentBase ::
674 Fw::InputSerializePort* port
678 portNum < this->getNum_Tlm_OutputPorts(),
682 this->m_Tlm_OutputPort[portNum].registerSerialPort(port);
687#if FW_PORT_SERIALIZATION
693 void CommandDispatcherComponentBase ::
694 set_compCmdSend_OutputPort(
696 Fw::InputSerializePort* port
700 portNum < this->getNum_compCmdSend_OutputPorts(),
704 this->m_compCmdSend_OutputPort[portNum].registerSerialPort(port);
707 void CommandDispatcherComponentBase ::
708 set_pingOut_OutputPort(
710 Fw::InputSerializePort* port
714 portNum < this->getNum_pingOut_OutputPorts(),
718 this->m_pingOut_OutputPort[portNum].registerSerialPort(port);
721 void CommandDispatcherComponentBase ::
722 set_seqCmdStatus_OutputPort(
724 Fw::InputSerializePort* port
728 portNum < this->getNum_seqCmdStatus_OutputPorts(),
732 this->m_seqCmdStatus_OutputPort[portNum].registerSerialPort(port);
741 void CommandDispatcherComponentBase ::
744 FW_ASSERT(this->m_CmdReg_OutputPort[0].isConnected());
746 this->m_CmdReg_OutputPort[0].invoke(
747 this->getIdBase() + OPCODE_CMD_NO_OP
750 this->m_CmdReg_OutputPort[0].invoke(
751 this->getIdBase() + OPCODE_CMD_NO_OP_STRING
754 this->m_CmdReg_OutputPort[0].invoke(
755 this->getIdBase() + OPCODE_CMD_TEST_CMD_1
758 this->m_CmdReg_OutputPort[0].invoke(
759 this->getIdBase() + OPCODE_CMD_CLEAR_TRACKING
767 CommandDispatcherComponentBase ::
768 CommandDispatcherComponentBase(
const char* compName) :
769 Fw::ActiveComponentBase(compName)
772 this->m_first_update_CommandsDispatched =
true;
773 this->m_last_CommandsDispatched = 0;
776 this->m_first_update_CommandErrors =
true;
777 this->m_last_CommandErrors = 0;
780 CommandDispatcherComponentBase ::
781 ~CommandDispatcherComponentBase()
791 getNum_CmdDisp_InputPorts()
const
801 getNum_compCmdReg_InputPorts()
const
807 getNum_compCmdStat_InputPorts()
const
813 getNum_pingIn_InputPorts()
const
819 getNum_seqCmdBuff_InputPorts()
const
829 getNum_CmdReg_OutputPorts()
const
835 getNum_CmdStatus_OutputPorts()
const
841 getNum_Log_OutputPorts()
const
846#if FW_ENABLE_TEXT_LOGGING == 1
849 getNum_LogText_OutputPorts()
const
857 getNum_Time_OutputPorts()
const
863 getNum_Tlm_OutputPorts()
const
873 getNum_compCmdSend_OutputPorts()
const
879 getNum_pingOut_OutputPorts()
const
885 getNum_seqCmdStatus_OutputPorts()
const
894 bool CommandDispatcherComponentBase ::
898 portNum < this->getNum_CmdReg_OutputPorts(),
902 return this->m_CmdReg_OutputPort[portNum].isConnected();
905 bool CommandDispatcherComponentBase ::
906 isConnected_CmdStatus_OutputPort(
FwIndexType portNum)
909 portNum < this->getNum_CmdStatus_OutputPorts(),
913 return this->m_CmdStatus_OutputPort[portNum].isConnected();
916 bool CommandDispatcherComponentBase ::
920 portNum < this->getNum_Log_OutputPorts(),
924 return this->m_Log_OutputPort[portNum].isConnected();
927#if FW_ENABLE_TEXT_LOGGING == 1
929 bool CommandDispatcherComponentBase ::
930 isConnected_LogText_OutputPort(
FwIndexType portNum)
933 portNum < this->getNum_LogText_OutputPorts(),
937 return this->m_LogText_OutputPort[portNum].isConnected();
942 bool CommandDispatcherComponentBase ::
946 portNum < this->getNum_Time_OutputPorts(),
950 return this->m_Time_OutputPort[portNum].isConnected();
953 bool CommandDispatcherComponentBase ::
957 portNum < this->getNum_Tlm_OutputPorts(),
961 return this->m_Tlm_OutputPort[portNum].isConnected();
968 bool CommandDispatcherComponentBase ::
969 isConnected_compCmdSend_OutputPort(
FwIndexType portNum)
972 portNum < this->getNum_compCmdSend_OutputPorts(),
976 return this->m_compCmdSend_OutputPort[portNum].isConnected();
979 bool CommandDispatcherComponentBase ::
980 isConnected_pingOut_OutputPort(
FwIndexType portNum)
983 portNum < this->getNum_pingOut_OutputPorts(),
987 return this->m_pingOut_OutputPort[portNum].isConnected();
990 bool CommandDispatcherComponentBase ::
991 isConnected_seqCmdStatus_OutputPort(
FwIndexType portNum)
994 portNum < this->getNum_seqCmdStatus_OutputPorts(),
998 return this->m_seqCmdStatus_OutputPort[portNum].isConnected();
1007 void CommandDispatcherComponentBase ::
1008 compCmdReg_handlerBase(
1015 portNum < this->getNum_compCmdReg_InputPorts(),
1023 this->compCmdReg_handler(
1032 void CommandDispatcherComponentBase ::
1033 compCmdStat_handlerBase(
1042 portNum < this->getNum_compCmdStat_InputPorts(),
1047 compCmdStat_preMsgHook(
1053 ComponentIpcSerializableBuffer msg;
1057 _status = msg.serialize(
1066 _status = msg.serialize(portNum);
1073 _status = msg.serialize(opCode);
1080 _status = msg.serialize(cmdSeq);
1087 _status = msg.serialize(response);
1103 void CommandDispatcherComponentBase ::
1111 portNum < this->getNum_pingIn_InputPorts(),
1120 ComponentIpcSerializableBuffer msg;
1124 _status = msg.serialize(
1133 _status = msg.serialize(portNum);
1140 _status = msg.serialize(key);
1156 void CommandDispatcherComponentBase ::
1157 seqCmdBuff_handlerBase(
1165 portNum < this->getNum_seqCmdBuff_InputPorts(),
1170 seqCmdBuff_preMsgHook(
1175 ComponentIpcSerializableBuffer msg;
1179 _status = msg.serialize(
1188 _status = msg.serialize(portNum);
1195 _status = msg.serialize(data);
1202 _status = msg.serialize(context);
1226 void CommandDispatcherComponentBase ::
1227 compCmdStat_preMsgHook(
1237 void CommandDispatcherComponentBase ::
1246 void CommandDispatcherComponentBase ::
1247 seqCmdBuff_preMsgHook(
1260 void CommandDispatcherComponentBase ::
1269 portNum < this->getNum_compCmdSend_OutputPorts(),
1272 this->m_compCmdSend_OutputPort[portNum].invoke(
1279 void CommandDispatcherComponentBase ::
1286 portNum < this->getNum_pingOut_OutputPorts(),
1289 this->m_pingOut_OutputPort[portNum].invoke(
1294 void CommandDispatcherComponentBase ::
1303 portNum < this->getNum_seqCmdStatus_OutputPorts(),
1306 this->m_seqCmdStatus_OutputPort[portNum].invoke(
1317 void CommandDispatcherComponentBase ::
1324 FW_ASSERT(this->m_CmdStatus_OutputPort[0].isConnected());
1325 this->m_CmdStatus_OutputPort[0].invoke(opCode, cmdSeq, response);
1334 void CommandDispatcherComponentBase ::
1335 CMD_NO_OP_cmdHandlerBase(
1342 this->CMD_NO_OP_preMsgHook(opCode,cmdSeq);
1346 ComponentIpcSerializableBuffer msg;
1359 _status = msg.serialize(port);
1365 _status = msg.serialize(opCode);
1371 _status = msg.serialize(cmdSeq);
1377 _status = msg.serialize(args);
1393 void CommandDispatcherComponentBase ::
1394 CMD_NO_OP_STRING_cmdHandlerBase(
1401 this->CMD_NO_OP_STRING_preMsgHook(opCode,cmdSeq);
1405 ComponentIpcSerializableBuffer msg;
1409 _status = msg.serialize(
static_cast<FwEnumStoreType>(CMD_CMD_NO_OP_STRING));
1418 _status = msg.serialize(port);
1424 _status = msg.serialize(opCode);
1430 _status = msg.serialize(cmdSeq);
1436 _status = msg.serialize(args);
1452 void CommandDispatcherComponentBase ::
1453 CMD_TEST_CMD_1_cmdHandlerBase(
1460 this->CMD_TEST_CMD_1_preMsgHook(opCode,cmdSeq);
1464 ComponentIpcSerializableBuffer msg;
1468 _status = msg.serialize(
static_cast<FwEnumStoreType>(CMD_CMD_TEST_CMD_1));
1477 _status = msg.serialize(port);
1483 _status = msg.serialize(opCode);
1489 _status = msg.serialize(cmdSeq);
1495 _status = msg.serialize(args);
1511 void CommandDispatcherComponentBase ::
1512 CMD_CLEAR_TRACKING_cmdHandlerBase(
1519 this->CMD_CLEAR_TRACKING_preMsgHook(opCode,cmdSeq);
1523 ComponentIpcSerializableBuffer msg;
1527 _status = msg.serialize(
static_cast<FwEnumStoreType>(CMD_CMD_CLEAR_TRACKING));
1536 _status = msg.serialize(port);
1542 _status = msg.serialize(opCode);
1548 _status = msg.serialize(cmdSeq);
1554 _status = msg.serialize(args);
1578 void CommandDispatcherComponentBase ::
1579 CMD_NO_OP_preMsgHook(
1589 void CommandDispatcherComponentBase ::
1590 CMD_NO_OP_STRING_preMsgHook(
1600 void CommandDispatcherComponentBase ::
1601 CMD_TEST_CMD_1_preMsgHook(
1611 void CommandDispatcherComponentBase ::
1612 CMD_CLEAR_TRACKING_preMsgHook(
1626 void CommandDispatcherComponentBase ::
1627 log_DIAGNOSTIC_OpCodeRegistered(
1635 if (this->m_Time_OutputPort[0].isConnected()) {
1636 this->m_Time_OutputPort[0].invoke(_logTime);
1641 _id = this->getIdBase() + EVENTID_OPCODEREGISTERED;
1644 if (this->m_Log_OutputPort[0].isConnected()) {
1648#if FW_AMPCS_COMPATIBLE
1657#if FW_AMPCS_COMPATIBLE
1660 static_cast<U8>(
sizeof(U32))
1673#if FW_AMPCS_COMPATIBLE
1676 static_cast<U8>(
sizeof(I32))
1689#if FW_AMPCS_COMPATIBLE
1692 static_cast<U8>(
sizeof(I32))
1705 this->m_Log_OutputPort[0].invoke(
1714#if FW_ENABLE_TEXT_LOGGING
1715 if (this->m_LogText_OutputPort[0].isConnected()) {
1716#if FW_OBJECT_NAMES == 1
1717 const char* _formatString =
1718 "(%s) %s: Opcode 0x%" PRIx32
" registered to port %" PRIi32
" slot %" PRIi32
"";
1720 const char* _formatString =
1721 "%s: Opcode 0x%" PRIx32
" registered to port %" PRIi32
" slot %" PRIi32
"";
1728 this->m_objName.toChar(),
1730 "OpCodeRegistered ",
1736 this->m_LogText_OutputPort[0].invoke(
1746 void CommandDispatcherComponentBase ::
1747 log_COMMAND_OpCodeDispatched(
1754 if (this->m_Time_OutputPort[0].isConnected()) {
1755 this->m_Time_OutputPort[0].invoke(_logTime);
1760 _id = this->getIdBase() + EVENTID_OPCODEDISPATCHED;
1763 if (this->m_Log_OutputPort[0].isConnected()) {
1767#if FW_AMPCS_COMPATIBLE
1776#if FW_AMPCS_COMPATIBLE
1779 static_cast<U8>(
sizeof(U32))
1792#if FW_AMPCS_COMPATIBLE
1795 static_cast<U8>(
sizeof(I32))
1808 this->m_Log_OutputPort[0].invoke(
1817#if FW_ENABLE_TEXT_LOGGING
1818 if (this->m_LogText_OutputPort[0].isConnected()) {
1819#if FW_OBJECT_NAMES == 1
1820 const char* _formatString =
1821 "(%s) %s: Opcode 0x%" PRIx32
" dispatched to port %" PRIi32
"";
1823 const char* _formatString =
1824 "%s: Opcode 0x%" PRIx32
" dispatched to port %" PRIi32
"";
1831 this->m_objName.toChar(),
1833 "OpCodeDispatched ",
1838 this->m_LogText_OutputPort[0].invoke(
1848 void CommandDispatcherComponentBase ::
1849 log_COMMAND_OpCodeCompleted(U32 Opcode)
const
1853 if (this->m_Time_OutputPort[0].isConnected()) {
1854 this->m_Time_OutputPort[0].invoke(_logTime);
1859 _id = this->getIdBase() + EVENTID_OPCODECOMPLETED;
1862 if (this->m_Log_OutputPort[0].isConnected()) {
1866#if FW_AMPCS_COMPATIBLE
1875#if FW_AMPCS_COMPATIBLE
1878 static_cast<U8>(
sizeof(U32))
1891 this->m_Log_OutputPort[0].invoke(
1900#if FW_ENABLE_TEXT_LOGGING
1901 if (this->m_LogText_OutputPort[0].isConnected()) {
1902#if FW_OBJECT_NAMES == 1
1903 const char* _formatString =
1904 "(%s) %s: Opcode 0x%" PRIx32
" completed";
1906 const char* _formatString =
1907 "%s: Opcode 0x%" PRIx32
" completed";
1914 this->m_objName.toChar(),
1920 this->m_LogText_OutputPort[0].invoke(
1930 void CommandDispatcherComponentBase ::
1931 log_COMMAND_OpCodeError(
1938 if (this->m_Time_OutputPort[0].isConnected()) {
1939 this->m_Time_OutputPort[0].invoke(_logTime);
1944 _id = this->getIdBase() + EVENTID_OPCODEERROR;
1947 if (this->m_Log_OutputPort[0].isConnected()) {
1951#if FW_AMPCS_COMPATIBLE
1960#if FW_AMPCS_COMPATIBLE
1963 static_cast<U8>(
sizeof(U32))
1976#if FW_AMPCS_COMPATIBLE
1992 this->m_Log_OutputPort[0].invoke(
2001#if FW_ENABLE_TEXT_LOGGING
2002 if (this->m_LogText_OutputPort[0].isConnected()) {
2003#if FW_OBJECT_NAMES == 1
2004 const char* _formatString =
2005 "(%s) %s: Opcode 0x%" PRIx32
" completed with error %s";
2007 const char* _formatString =
2008 "%s: Opcode 0x%" PRIx32
" completed with error %s";
2012 error.toString(errorStr);
2018 this->m_objName.toChar(),
2025 this->m_LogText_OutputPort[0].invoke(
2035 void CommandDispatcherComponentBase ::
2040 if (this->m_Time_OutputPort[0].isConnected()) {
2041 this->m_Time_OutputPort[0].invoke(_logTime);
2046 _id = this->getIdBase() + EVENTID_MALFORMEDCOMMAND;
2049 if (this->m_Log_OutputPort[0].isConnected()) {
2053#if FW_AMPCS_COMPATIBLE
2062#if FW_AMPCS_COMPATIBLE
2078 this->m_Log_OutputPort[0].invoke(
2087#if FW_ENABLE_TEXT_LOGGING
2088 if (this->m_LogText_OutputPort[0].isConnected()) {
2089#if FW_OBJECT_NAMES == 1
2090 const char* _formatString =
2091 "(%s) %s: Received malformed command packet. Status: %s";
2093 const char* _formatString =
2094 "%s: Received malformed command packet. Status: %s";
2098 Status.toString(StatusStr);
2104 this->m_objName.toChar(),
2106 "MalformedCommand ",
2110 this->m_LogText_OutputPort[0].invoke(
2120 void CommandDispatcherComponentBase ::
2121 log_WARNING_HI_InvalidCommand(U32 Opcode)
const
2125 if (this->m_Time_OutputPort[0].isConnected()) {
2126 this->m_Time_OutputPort[0].invoke(_logTime);
2131 _id = this->getIdBase() + EVENTID_INVALIDCOMMAND;
2134 if (this->m_Log_OutputPort[0].isConnected()) {
2138#if FW_AMPCS_COMPATIBLE
2147#if FW_AMPCS_COMPATIBLE
2150 static_cast<U8>(
sizeof(U32))
2163 this->m_Log_OutputPort[0].invoke(
2172#if FW_ENABLE_TEXT_LOGGING
2173 if (this->m_LogText_OutputPort[0].isConnected()) {
2174#if FW_OBJECT_NAMES == 1
2175 const char* _formatString =
2176 "(%s) %s: Invalid opcode 0x%" PRIx32
" received";
2178 const char* _formatString =
2179 "%s: Invalid opcode 0x%" PRIx32
" received";
2186 this->m_objName.toChar(),
2192 this->m_LogText_OutputPort[0].invoke(
2202 void CommandDispatcherComponentBase ::
2203 log_WARNING_HI_TooManyCommands(U32 Opcode)
const
2207 if (this->m_Time_OutputPort[0].isConnected()) {
2208 this->m_Time_OutputPort[0].invoke(_logTime);
2213 _id = this->getIdBase() + EVENTID_TOOMANYCOMMANDS;
2216 if (this->m_Log_OutputPort[0].isConnected()) {
2220#if FW_AMPCS_COMPATIBLE
2229#if FW_AMPCS_COMPATIBLE
2232 static_cast<U8>(
sizeof(U32))
2245 this->m_Log_OutputPort[0].invoke(
2254#if FW_ENABLE_TEXT_LOGGING
2255 if (this->m_LogText_OutputPort[0].isConnected()) {
2256#if FW_OBJECT_NAMES == 1
2257 const char* _formatString =
2258 "(%s) %s: Too many outstanding commands. opcode=0x%" PRIx32
"";
2260 const char* _formatString =
2261 "%s: Too many outstanding commands. opcode=0x%" PRIx32
"";
2268 this->m_objName.toChar(),
2274 this->m_LogText_OutputPort[0].invoke(
2284 void CommandDispatcherComponentBase ::
2285 log_ACTIVITY_HI_NoOpReceived()
const
2289 if (this->m_Time_OutputPort[0].isConnected()) {
2290 this->m_Time_OutputPort[0].invoke(_logTime);
2295 _id = this->getIdBase() + EVENTID_NOOPRECEIVED;
2298 if (this->m_Log_OutputPort[0].isConnected()) {
2301#if FW_AMPCS_COMPATIBLE
2311 this->m_Log_OutputPort[0].invoke(
2320#if FW_ENABLE_TEXT_LOGGING
2321 if (this->m_LogText_OutputPort[0].isConnected()) {
2322#if FW_OBJECT_NAMES == 1
2323 const char* _formatString =
2324 "(%s) %s: Received a NO-OP command";
2326 const char* _formatString =
2327 "%s: Received a NO-OP command";
2334 this->m_objName.toChar(),
2339 this->m_LogText_OutputPort[0].invoke(
2349 void CommandDispatcherComponentBase ::
2350 log_ACTIVITY_HI_NoOpStringReceived(
const Fw::StringBase& message)
const
2354 if (this->m_Time_OutputPort[0].isConnected()) {
2355 this->m_Time_OutputPort[0].invoke(_logTime);
2360 _id = this->getIdBase() + EVENTID_NOOPSTRINGRECEIVED;
2363 if (this->m_Log_OutputPort[0].isConnected()) {
2367#if FW_AMPCS_COMPATIBLE
2382 this->m_Log_OutputPort[0].invoke(
2391#if FW_ENABLE_TEXT_LOGGING
2392 if (this->m_LogText_OutputPort[0].isConnected()) {
2393#if FW_OBJECT_NAMES == 1
2394 const char* _formatString =
2395 "(%s) %s: Received a NO-OP string=%s";
2397 const char* _formatString =
2398 "%s: Received a NO-OP string=%s";
2405 this->m_objName.toChar(),
2407 "NoOpStringReceived ",
2411 this->m_LogText_OutputPort[0].invoke(
2421 void CommandDispatcherComponentBase ::
2422 log_ACTIVITY_HI_TestCmd1Args(
2430 if (this->m_Time_OutputPort[0].isConnected()) {
2431 this->m_Time_OutputPort[0].invoke(_logTime);
2436 _id = this->getIdBase() + EVENTID_TESTCMD1ARGS;
2439 if (this->m_Log_OutputPort[0].isConnected()) {
2443#if FW_AMPCS_COMPATIBLE
2452#if FW_AMPCS_COMPATIBLE
2455 static_cast<U8>(
sizeof(I32))
2468#if FW_AMPCS_COMPATIBLE
2471 static_cast<U8>(
sizeof(
F32))
2484#if FW_AMPCS_COMPATIBLE
2487 static_cast<U8>(
sizeof(
U8))
2500 this->m_Log_OutputPort[0].invoke(
2509#if FW_ENABLE_TEXT_LOGGING
2510 if (this->m_LogText_OutputPort[0].isConnected()) {
2511#if FW_OBJECT_NAMES == 1
2512 const char* _formatString =
2513 "(%s) %s: TEST_CMD_1 args: I32: %" PRIi32
", F32: %f, U8: %" PRIu8
"";
2515 const char* _formatString =
2516 "%s: TEST_CMD_1 args: I32: %" PRIi32
", F32: %f, U8: %" PRIu8
"";
2523 this->m_objName.toChar(),
2531 this->m_LogText_OutputPort[0].invoke(
2541 void CommandDispatcherComponentBase ::
2542 log_DIAGNOSTIC_OpCodeReregistered(
2549 if (this->m_Time_OutputPort[0].isConnected()) {
2550 this->m_Time_OutputPort[0].invoke(_logTime);
2555 _id = this->getIdBase() + EVENTID_OPCODEREREGISTERED;
2558 if (this->m_Log_OutputPort[0].isConnected()) {
2562#if FW_AMPCS_COMPATIBLE
2571#if FW_AMPCS_COMPATIBLE
2574 static_cast<U8>(
sizeof(U32))
2587#if FW_AMPCS_COMPATIBLE
2590 static_cast<U8>(
sizeof(I32))
2603 this->m_Log_OutputPort[0].invoke(
2612#if FW_ENABLE_TEXT_LOGGING
2613 if (this->m_LogText_OutputPort[0].isConnected()) {
2614#if FW_OBJECT_NAMES == 1
2615 const char* _formatString =
2616 "(%s) %s: Opcode 0x%" PRIx32
" is already registered to port %" PRIi32
"";
2618 const char* _formatString =
2619 "%s: Opcode 0x%" PRIx32
" is already registered to port %" PRIi32
"";
2626 this->m_objName.toChar(),
2628 "OpCodeReregistered ",
2633 this->m_LogText_OutputPort[0].invoke(
2647 void CommandDispatcherComponentBase ::
2648 tlmWrite_CommandsDispatched(
2654 if (not this->m_first_update_CommandsDispatched) {
2656 if (arg == this->m_last_CommandsDispatched) {
2660 this->m_last_CommandsDispatched = arg;
2664 this->m_first_update_CommandsDispatched =
false;
2665 this->m_last_CommandsDispatched = arg;
2668 if (this->m_Tlm_OutputPort[0].isConnected()) {
2670 this->m_Time_OutputPort[0].isConnected() &&
2673 this->m_Time_OutputPort[0].invoke(_tlmTime);
2685 _id = this->getIdBase() + CHANNELID_COMMANDSDISPATCHED;
2687 this->m_Tlm_OutputPort[0].invoke(
2695 void CommandDispatcherComponentBase ::
2696 tlmWrite_CommandErrors(
2702 if (not this->m_first_update_CommandErrors) {
2704 if (arg == this->m_last_CommandErrors) {
2708 this->m_last_CommandErrors = arg;
2712 this->m_first_update_CommandErrors =
false;
2713 this->m_last_CommandErrors = arg;
2716 if (this->m_Tlm_OutputPort[0].isConnected()) {
2718 this->m_Time_OutputPort[0].isConnected() &&
2721 this->m_Time_OutputPort[0].invoke(_tlmTime);
2733 _id = this->getIdBase() + CHANNELID_COMMANDERRORS;
2735 this->m_Tlm_OutputPort[0].invoke(
2750 if (this->m_Time_OutputPort[0].isConnected()) {
2752 this->m_Time_OutputPort[0].invoke(_time);
2767 void CommandDispatcherComponentBase ::
2770 this->m_guardedPortMutex.lock();
2773 void CommandDispatcherComponentBase ::
2776 this->m_guardedPortMutex.unLock();
2786 ComponentIpcSerializableBuffer msg;
2809 MsgTypeEnum msgType =
static_cast<MsgTypeEnum
>(desMsg);
2811 if (msgType == COMMANDDISPATCHER_COMPONENT_EXIT) {
2812 return MSG_DISPATCH_EXIT;
2816 deserStatus = msg.deserialize(portNum);
2824 case COMPCMDSTAT_CMDRESPONSE: {
2827 deserStatus = msg.deserialize(opCode);
2835 deserStatus = msg.deserialize(cmdSeq);
2843 deserStatus = msg.deserialize(response);
2849 this->compCmdStat_handler(
2863 deserStatus = msg.deserialize(key);
2869 this->pingIn_handler(
2878 case SEQCMDBUFF_COM: {
2881 deserStatus = msg.deserialize(data);
2889 deserStatus = msg.deserialize(context);
2895 this->seqCmdBuff_handler(
2905 case CMD_CMD_NO_OP: {
2908 deserStatus = msg.deserialize(opCode);
2916 deserStatus = msg.deserialize(cmdSeq);
2924 deserStatus = msg.deserialize(args);
2935#if FW_CMD_CHECK_RESIDUAL
2937 if (this->m_CmdStatus_OutputPort[0].isConnected()) {
2946 this->CMD_NO_OP_cmdHandler(opCode, cmdSeq);
2952 case CMD_CMD_NO_OP_STRING: {
2955 deserStatus = msg.deserialize(opCode);
2963 deserStatus = msg.deserialize(cmdSeq);
2971 deserStatus = msg.deserialize(args);
2984 if (this->m_CmdStatus_OutputPort[0].isConnected()) {
2985 this->cmdResponse_out(
2997#if FW_CMD_CHECK_RESIDUAL
2999 if (this->m_CmdStatus_OutputPort[0].isConnected()) {
3008 this->CMD_NO_OP_STRING_cmdHandler(
3017 case CMD_CMD_TEST_CMD_1: {
3020 deserStatus = msg.deserialize(opCode);
3028 deserStatus = msg.deserialize(cmdSeq);
3036 deserStatus = msg.deserialize(args);
3049 if (this->m_CmdStatus_OutputPort[0].isConnected()) {
3050 this->cmdResponse_out(
3064 if (this->m_CmdStatus_OutputPort[0].isConnected()) {
3065 this->cmdResponse_out(
3079 if (this->m_CmdStatus_OutputPort[0].isConnected()) {
3080 this->cmdResponse_out(
3092#if FW_CMD_CHECK_RESIDUAL
3094 if (this->m_CmdStatus_OutputPort[0].isConnected()) {
3103 this->CMD_TEST_CMD_1_cmdHandler(
3114 case CMD_CMD_CLEAR_TRACKING: {
3117 deserStatus = msg.deserialize(opCode);
3125 deserStatus = msg.deserialize(cmdSeq);
3133 deserStatus = msg.deserialize(args);
3144#if FW_CMD_CHECK_RESIDUAL
3146 if (this->m_CmdStatus_OutputPort[0].isConnected()) {
3155 this->CMD_CLEAR_TRACKING_cmdHandler(opCode, cmdSeq);
3161 return MSG_DISPATCH_ERROR;
3164 return MSG_DISPATCH_OK;
3171 void CommandDispatcherComponentBase ::
3181 CommandDispatcherComponentBase* compPtr =
static_cast<CommandDispatcherComponentBase*
>(callComp);
3183 const U32 idBase = callComp->
getIdBase();
3187 switch (opCode - idBase) {
3188 case OPCODE_CMD_NO_OP: {
3189 compPtr->CMD_NO_OP_cmdHandlerBase(
3197 case OPCODE_CMD_NO_OP_STRING: {
3198 compPtr->CMD_NO_OP_STRING_cmdHandlerBase(
3206 case OPCODE_CMD_TEST_CMD_1: {
3207 compPtr->CMD_TEST_CMD_1_cmdHandlerBase(
3215 case OPCODE_CMD_CLEAR_TRACKING: {
3216 compPtr->CMD_CLEAR_TRACKING_cmdHandlerBase(
3230 void CommandDispatcherComponentBase ::
3238 CommandDispatcherComponentBase* compPtr =
static_cast<CommandDispatcherComponentBase*
>(callComp);
3239 compPtr->compCmdReg_handlerBase(
3245 void CommandDispatcherComponentBase ::
3255 CommandDispatcherComponentBase* compPtr =
static_cast<CommandDispatcherComponentBase*
>(callComp);
3256 compPtr->compCmdStat_handlerBase(
3264 void CommandDispatcherComponentBase ::
3272 CommandDispatcherComponentBase* compPtr =
static_cast<CommandDispatcherComponentBase*
>(callComp);
3273 compPtr->pingIn_handlerBase(
3279 void CommandDispatcherComponentBase ::
3288 CommandDispatcherComponentBase* compPtr =
static_cast<CommandDispatcherComponentBase*
>(callComp);
3289 compPtr->seqCmdBuff_handlerBase(
float F32
32-bit floating point
#define FW_MIN(a, b)
MIN macro.
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
#define FW_LOG_STRING_MAX_SIZE
Max size of log string parameter type.
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
Enum representing a command response.
@ FORMAT_ERROR
Command failed to deserialize.
@ SERIALIZED_SIZE
The size of the serial representation.
@ SERIALIZED_SIZE
The size of the serial representation.
@ WARNING_HI
A serious but recoverable event.
@ ACTIVITY_HI
Important informational events.
@ DIAGNOSTIC
Software diagnostic events.
@ COMMAND
An activity related to commanding.
void init()
Object initializer.
const char * toChar() const
NATIVE_UINT_TYPE SizeType
void resetDeser()
reset deserialization to beginning
Serializable::SizeType getBuffLeft() const
returns how much deserialization buffer is left
SerializeStatus deserialize(U8 &val)
deserialize 8-bit unsigned int
SerializeStatus serialize(U8 val)
serialize 8-bit unsigned int
void format(const CHAR *formatString,...)
write formatted string to buffer
virtual SerializeStatus serialize(SerializeBufferBase &buffer) const
serialization function
virtual const CHAR * toChar() const =0
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
@ OP_OK
message sent/received okay
SerializeStatus
forward declaration for string
@ FW_SERIALIZE_OK
Serialization/Deserialization operation was successful.