9 #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];
92 this->m_CmdDisp_InputPort[port].
init();
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());
116 this->m_compCmdReg_InputPort[port].
init();
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());
140 this->m_compCmdStat_InputPort[port].
init();
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());
164 this->m_pingIn_InputPort[port].
init();
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());
188 this->m_seqCmdBuff_InputPort[port].
init();
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());
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());
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());
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());
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());
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());
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());
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());
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)
386 static_cast<FwAssertArgType>(qStat)
399 static_cast<FwAssertArgType>(portNum)
402 return &this->m_CmdDisp_InputPort[portNum];
414 static_cast<FwAssertArgType>(portNum)
417 return &this->m_compCmdReg_InputPort[portNum];
425 static_cast<FwAssertArgType>(portNum)
428 return &this->m_compCmdStat_InputPort[portNum];
436 static_cast<FwAssertArgType>(portNum)
439 return &this->m_pingIn_InputPort[portNum];
447 static_cast<FwAssertArgType>(portNum)
450 return &this->m_seqCmdBuff_InputPort[portNum];
465 static_cast<FwAssertArgType>(portNum)
468 this->m_CmdReg_OutputPort[portNum].
addCallPort(port);
479 static_cast<FwAssertArgType>(portNum)
482 this->m_CmdStatus_OutputPort[portNum].
addCallPort(port);
493 static_cast<FwAssertArgType>(portNum)
499 #if FW_ENABLE_TEXT_LOGGING == 1 501 void CommandDispatcherComponentBase ::
502 set_LogText_OutputPort(
508 (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
509 static_cast<FwAssertArgType>(portNum)
512 this->m_LogText_OutputPort[portNum].addCallPort(port);
525 static_cast<FwAssertArgType>(portNum)
528 this->m_Time_OutputPort[portNum].
addCallPort(port);
539 static_cast<FwAssertArgType>(portNum)
557 static_cast<FwAssertArgType>(portNum)
560 this->m_compCmdSend_OutputPort[portNum].
addCallPort(port);
571 static_cast<FwAssertArgType>(portNum)
574 this->m_pingOut_OutputPort[portNum].
addCallPort(port);
585 static_cast<FwAssertArgType>(portNum)
588 this->m_seqCmdStatus_OutputPort[portNum].
addCallPort(port);
591 #if FW_PORT_SERIALIZATION 600 Fw::InputSerializePort* port
605 static_cast<FwAssertArgType>(portNum)
608 this->m_CmdReg_OutputPort[portNum].registerSerialPort(port);
614 Fw::InputSerializePort* port
619 static_cast<FwAssertArgType>(portNum)
622 this->m_CmdStatus_OutputPort[portNum].registerSerialPort(port);
628 Fw::InputSerializePort* port
633 static_cast<FwAssertArgType>(portNum)
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 (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
649 static_cast<FwAssertArgType>(portNum)
652 this->m_LogText_OutputPort[portNum].registerSerialPort(port);
660 Fw::InputSerializePort* port
665 static_cast<FwAssertArgType>(portNum)
668 this->m_Time_OutputPort[portNum].registerSerialPort(port);
674 Fw::InputSerializePort* port
679 static_cast<FwAssertArgType>(portNum)
682 this->m_Tlm_OutputPort[portNum].registerSerialPort(port);
687 #if FW_PORT_SERIALIZATION 696 Fw::InputSerializePort* port
701 static_cast<FwAssertArgType>(portNum)
704 this->m_compCmdSend_OutputPort[portNum].registerSerialPort(port);
710 Fw::InputSerializePort* port
715 static_cast<FwAssertArgType>(portNum)
718 this->m_pingOut_OutputPort[portNum].registerSerialPort(port);
724 Fw::InputSerializePort* port
729 static_cast<FwAssertArgType>(portNum)
732 this->m_seqCmdStatus_OutputPort[portNum].registerSerialPort(port);
744 FW_ASSERT(this->m_CmdReg_OutputPort[0].isConnected());
746 this->m_CmdReg_OutputPort[0].
invoke(
750 this->m_CmdReg_OutputPort[0].
invoke(
754 this->m_CmdReg_OutputPort[0].
invoke(
758 this->m_CmdReg_OutputPort[0].
invoke(
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;
846 #if FW_ENABLE_TEXT_LOGGING == 1 849 getNum_LogText_OutputPorts()
const 899 static_cast<FwAssertArgType>(portNum)
902 return this->m_CmdReg_OutputPort[portNum].
isConnected();
910 static_cast<FwAssertArgType>(portNum)
913 return this->m_CmdStatus_OutputPort[portNum].
isConnected();
921 static_cast<FwAssertArgType>(portNum)
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 (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
934 static_cast<FwAssertArgType>(portNum)
937 return this->m_LogText_OutputPort[portNum].isConnected();
947 static_cast<FwAssertArgType>(portNum)
950 return this->m_Time_OutputPort[portNum].
isConnected();
958 static_cast<FwAssertArgType>(portNum)
961 return this->m_Tlm_OutputPort[portNum].
isConnected();
973 static_cast<FwAssertArgType>(portNum)
976 return this->m_compCmdSend_OutputPort[portNum].
isConnected();
984 static_cast<FwAssertArgType>(portNum)
987 return this->m_pingOut_OutputPort[portNum].
isConnected();
995 static_cast<FwAssertArgType>(portNum)
998 return this->m_seqCmdStatus_OutputPort[portNum].
isConnected();
1016 static_cast<FwAssertArgType>(portNum)
1043 static_cast<FwAssertArgType>(portNum)
1053 ComponentIpcSerializableBuffer msg;
1057 _status = msg.serializeFrom(
1058 static_cast<FwEnumStoreType>(COMPCMDSTAT_CMDRESPONSE)
1062 static_cast<FwAssertArgType>(_status)
1066 _status = msg.serializeFrom(portNum);
1069 static_cast<FwAssertArgType>(_status)
1073 _status = msg.serializeFrom(opCode);
1076 static_cast<FwAssertArgType>(_status)
1080 _status = msg.serializeFrom(cmdSeq);
1083 static_cast<FwAssertArgType>(_status)
1087 _status = msg.serializeFrom(response);
1090 static_cast<FwAssertArgType>(_status)
1099 static_cast<FwAssertArgType>(qStatus)
1112 static_cast<FwAssertArgType>(portNum)
1120 ComponentIpcSerializableBuffer msg;
1124 _status = msg.serializeFrom(
1125 static_cast<FwEnumStoreType>(PINGIN_PING)
1129 static_cast<FwAssertArgType>(_status)
1133 _status = msg.serializeFrom(portNum);
1136 static_cast<FwAssertArgType>(_status)
1140 _status = msg.serializeFrom(key);
1143 static_cast<FwAssertArgType>(_status)
1152 static_cast<FwAssertArgType>(qStatus)
1166 static_cast<FwAssertArgType>(portNum)
1175 ComponentIpcSerializableBuffer msg;
1179 _status = msg.serializeFrom(
1180 static_cast<FwEnumStoreType>(SEQCMDBUFF_COM)
1184 static_cast<FwAssertArgType>(_status)
1188 _status = msg.serializeFrom(portNum);
1191 static_cast<FwAssertArgType>(_status)
1195 _status = msg.serializeFrom(data);
1198 static_cast<FwAssertArgType>(_status)
1202 _status = msg.serializeFrom(context);
1205 static_cast<FwAssertArgType>(_status)
1214 static_cast<FwAssertArgType>(qStatus)
1270 static_cast<FwAssertArgType>(portNum)
1274 this->m_compCmdSend_OutputPort[portNum].isConnected(),
1275 static_cast<FwAssertArgType>(portNum)
1277 this->m_compCmdSend_OutputPort[portNum].
invoke(
1292 static_cast<FwAssertArgType>(portNum)
1296 this->m_pingOut_OutputPort[portNum].isConnected(),
1297 static_cast<FwAssertArgType>(portNum)
1299 this->m_pingOut_OutputPort[portNum].
invoke(
1314 static_cast<FwAssertArgType>(portNum)
1318 this->m_seqCmdStatus_OutputPort[portNum].isConnected(),
1319 static_cast<FwAssertArgType>(portNum)
1321 this->m_seqCmdStatus_OutputPort[portNum].
invoke(
1339 FW_ASSERT(this->m_CmdStatus_OutputPort[0].isConnected());
1340 this->m_CmdStatus_OutputPort[0].
invoke(opCode, cmdSeq, response);
1361 ComponentIpcSerializableBuffer msg;
1365 _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_CMD_NO_OP));
1368 static_cast<FwAssertArgType>(_status)
1374 _status = msg.serializeFrom(port);
1377 static_cast<FwAssertArgType>(_status)
1380 _status = msg.serializeFrom(opCode);
1383 static_cast<FwAssertArgType>(_status)
1386 _status = msg.serializeFrom(cmdSeq);
1389 static_cast<FwAssertArgType>(_status)
1392 _status = msg.serializeFrom(args);
1395 static_cast<FwAssertArgType>(_status)
1404 static_cast<FwAssertArgType>(qStatus)
1420 ComponentIpcSerializableBuffer msg;
1424 _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_CMD_NO_OP_STRING));
1427 static_cast<FwAssertArgType>(_status)
1433 _status = msg.serializeFrom(port);
1436 static_cast<FwAssertArgType>(_status)
1439 _status = msg.serializeFrom(opCode);
1442 static_cast<FwAssertArgType>(_status)
1445 _status = msg.serializeFrom(cmdSeq);
1448 static_cast<FwAssertArgType>(_status)
1451 _status = msg.serializeFrom(args);
1454 static_cast<FwAssertArgType>(_status)
1463 static_cast<FwAssertArgType>(qStatus)
1479 ComponentIpcSerializableBuffer msg;
1483 _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_CMD_TEST_CMD_1));
1486 static_cast<FwAssertArgType>(_status)
1492 _status = msg.serializeFrom(port);
1495 static_cast<FwAssertArgType>(_status)
1498 _status = msg.serializeFrom(opCode);
1501 static_cast<FwAssertArgType>(_status)
1504 _status = msg.serializeFrom(cmdSeq);
1507 static_cast<FwAssertArgType>(_status)
1510 _status = msg.serializeFrom(args);
1513 static_cast<FwAssertArgType>(_status)
1522 static_cast<FwAssertArgType>(qStatus)
1538 ComponentIpcSerializableBuffer msg;
1542 _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_CMD_CLEAR_TRACKING));
1545 static_cast<FwAssertArgType>(_status)
1551 _status = msg.serializeFrom(port);
1554 static_cast<FwAssertArgType>(_status)
1557 _status = msg.serializeFrom(opCode);
1560 static_cast<FwAssertArgType>(_status)
1563 _status = msg.serializeFrom(cmdSeq);
1566 static_cast<FwAssertArgType>(_status)
1569 _status = msg.serializeFrom(args);
1572 static_cast<FwAssertArgType>(_status)
1581 static_cast<FwAssertArgType>(qStatus)
1650 if (this->m_Time_OutputPort[0].isConnected()) {
1651 this->m_Time_OutputPort[0].
invoke(_logTime);
1659 if (this->m_Log_OutputPort[0].isConnected()) {
1663 #if FW_AMPCS_COMPATIBLE 1668 static_cast<FwAssertArgType>(_status)
1672 #if FW_AMPCS_COMPATIBLE 1679 static_cast<FwAssertArgType>(_status)
1685 static_cast<FwAssertArgType>(_status)
1688 #if FW_AMPCS_COMPATIBLE 1691 static_cast<U8>(
sizeof(I32))
1695 static_cast<FwAssertArgType>(_status)
1701 static_cast<FwAssertArgType>(_status)
1704 #if FW_AMPCS_COMPATIBLE 1707 static_cast<U8>(
sizeof(I32))
1711 static_cast<FwAssertArgType>(_status)
1717 static_cast<FwAssertArgType>(_status)
1720 this->m_Log_OutputPort[0].
invoke(
1729 #if FW_ENABLE_TEXT_LOGGING 1730 if (this->m_LogText_OutputPort[0].isConnected()) {
1731 #if FW_OBJECT_NAMES == 1 1732 const char* _formatString =
1733 "(%s) %s: Opcode 0x%" PRIx32
" registered to port %" PRIi32
" slot %" PRIi32
"";
1735 const char* _formatString =
1736 "%s: Opcode 0x%" PRIx32
" registered to port %" PRIi32
" slot %" PRIi32
"";
1743 this->m_objName.toChar(),
1745 "OpCodeRegistered ",
1751 this->m_LogText_OutputPort[0].invoke(
1769 if (this->m_Time_OutputPort[0].isConnected()) {
1770 this->m_Time_OutputPort[0].
invoke(_logTime);
1778 if (this->m_Log_OutputPort[0].isConnected()) {
1782 #if FW_AMPCS_COMPATIBLE 1787 static_cast<FwAssertArgType>(_status)
1791 #if FW_AMPCS_COMPATIBLE 1798 static_cast<FwAssertArgType>(_status)
1804 static_cast<FwAssertArgType>(_status)
1807 #if FW_AMPCS_COMPATIBLE 1810 static_cast<U8>(
sizeof(I32))
1814 static_cast<FwAssertArgType>(_status)
1820 static_cast<FwAssertArgType>(_status)
1823 this->m_Log_OutputPort[0].
invoke(
1832 #if FW_ENABLE_TEXT_LOGGING 1833 if (this->m_LogText_OutputPort[0].isConnected()) {
1834 #if FW_OBJECT_NAMES == 1 1835 const char* _formatString =
1836 "(%s) %s: Opcode 0x%" PRIx32
" dispatched to port %" PRIi32
"";
1838 const char* _formatString =
1839 "%s: Opcode 0x%" PRIx32
" dispatched to port %" PRIi32
"";
1846 this->m_objName.toChar(),
1848 "OpCodeDispatched ",
1853 this->m_LogText_OutputPort[0].invoke(
1868 if (this->m_Time_OutputPort[0].isConnected()) {
1869 this->m_Time_OutputPort[0].
invoke(_logTime);
1877 if (this->m_Log_OutputPort[0].isConnected()) {
1881 #if FW_AMPCS_COMPATIBLE 1886 static_cast<FwAssertArgType>(_status)
1890 #if FW_AMPCS_COMPATIBLE 1897 static_cast<FwAssertArgType>(_status)
1903 static_cast<FwAssertArgType>(_status)
1906 this->m_Log_OutputPort[0].
invoke(
1915 #if FW_ENABLE_TEXT_LOGGING 1916 if (this->m_LogText_OutputPort[0].isConnected()) {
1917 #if FW_OBJECT_NAMES == 1 1918 const char* _formatString =
1919 "(%s) %s: Opcode 0x%" PRIx32
" completed";
1921 const char* _formatString =
1922 "%s: Opcode 0x%" PRIx32
" completed";
1929 this->m_objName.toChar(),
1935 this->m_LogText_OutputPort[0].invoke(
1953 if (this->m_Time_OutputPort[0].isConnected()) {
1954 this->m_Time_OutputPort[0].
invoke(_logTime);
1962 if (this->m_Log_OutputPort[0].isConnected()) {
1966 #if FW_AMPCS_COMPATIBLE 1971 static_cast<FwAssertArgType>(_status)
1975 #if FW_AMPCS_COMPATIBLE 1982 static_cast<FwAssertArgType>(_status)
1988 static_cast<FwAssertArgType>(_status)
1991 #if FW_AMPCS_COMPATIBLE 1998 static_cast<FwAssertArgType>(_status)
2004 static_cast<FwAssertArgType>(_status)
2007 this->m_Log_OutputPort[0].
invoke(
2016 #if FW_ENABLE_TEXT_LOGGING 2017 if (this->m_LogText_OutputPort[0].isConnected()) {
2018 #if FW_OBJECT_NAMES == 1 2019 const char* _formatString =
2020 "(%s) %s: Opcode 0x%" PRIx32
" completed with error %s";
2022 const char* _formatString =
2023 "%s: Opcode 0x%" PRIx32
" completed with error %s";
2027 error.toString(errorStr);
2033 this->m_objName.toChar(),
2040 this->m_LogText_OutputPort[0].invoke(
2055 if (this->m_Time_OutputPort[0].isConnected()) {
2056 this->m_Time_OutputPort[0].
invoke(_logTime);
2064 if (this->m_Log_OutputPort[0].isConnected()) {
2068 #if FW_AMPCS_COMPATIBLE 2073 static_cast<FwAssertArgType>(_status)
2077 #if FW_AMPCS_COMPATIBLE 2084 static_cast<FwAssertArgType>(_status)
2090 static_cast<FwAssertArgType>(_status)
2093 this->m_Log_OutputPort[0].
invoke(
2102 #if FW_ENABLE_TEXT_LOGGING 2103 if (this->m_LogText_OutputPort[0].isConnected()) {
2104 #if FW_OBJECT_NAMES == 1 2105 const char* _formatString =
2106 "(%s) %s: Received malformed command packet. Status: %s";
2108 const char* _formatString =
2109 "%s: Received malformed command packet. Status: %s";
2113 Status.toString(StatusStr);
2119 this->m_objName.toChar(),
2121 "MalformedCommand ",
2125 this->m_LogText_OutputPort[0].invoke(
2140 if (this->m_Time_OutputPort[0].isConnected()) {
2141 this->m_Time_OutputPort[0].
invoke(_logTime);
2149 if (this->m_Log_OutputPort[0].isConnected()) {
2153 #if FW_AMPCS_COMPATIBLE 2158 static_cast<FwAssertArgType>(_status)
2162 #if FW_AMPCS_COMPATIBLE 2169 static_cast<FwAssertArgType>(_status)
2175 static_cast<FwAssertArgType>(_status)
2178 this->m_Log_OutputPort[0].
invoke(
2187 #if FW_ENABLE_TEXT_LOGGING 2188 if (this->m_LogText_OutputPort[0].isConnected()) {
2189 #if FW_OBJECT_NAMES == 1 2190 const char* _formatString =
2191 "(%s) %s: Invalid opcode 0x%" PRIx32
" received";
2193 const char* _formatString =
2194 "%s: Invalid opcode 0x%" PRIx32
" received";
2201 this->m_objName.toChar(),
2207 this->m_LogText_OutputPort[0].invoke(
2222 if (this->m_Time_OutputPort[0].isConnected()) {
2223 this->m_Time_OutputPort[0].
invoke(_logTime);
2231 if (this->m_Log_OutputPort[0].isConnected()) {
2235 #if FW_AMPCS_COMPATIBLE 2240 static_cast<FwAssertArgType>(_status)
2244 #if FW_AMPCS_COMPATIBLE 2251 static_cast<FwAssertArgType>(_status)
2257 static_cast<FwAssertArgType>(_status)
2260 this->m_Log_OutputPort[0].
invoke(
2269 #if FW_ENABLE_TEXT_LOGGING 2270 if (this->m_LogText_OutputPort[0].isConnected()) {
2271 #if FW_OBJECT_NAMES == 1 2272 const char* _formatString =
2273 "(%s) %s: Too many outstanding commands. opcode=0x%" PRIx32
"";
2275 const char* _formatString =
2276 "%s: Too many outstanding commands. opcode=0x%" PRIx32
"";
2283 this->m_objName.toChar(),
2289 this->m_LogText_OutputPort[0].invoke(
2304 if (this->m_Time_OutputPort[0].isConnected()) {
2305 this->m_Time_OutputPort[0].
invoke(_logTime);
2313 if (this->m_Log_OutputPort[0].isConnected()) {
2316 #if FW_AMPCS_COMPATIBLE 2322 static_cast<FwAssertArgType>(_status)
2326 this->m_Log_OutputPort[0].
invoke(
2335 #if FW_ENABLE_TEXT_LOGGING 2336 if (this->m_LogText_OutputPort[0].isConnected()) {
2337 #if FW_OBJECT_NAMES == 1 2338 const char* _formatString =
2339 "(%s) %s: Received a NO-OP command";
2341 const char* _formatString =
2342 "%s: Received a NO-OP command";
2349 this->m_objName.toChar(),
2354 this->m_LogText_OutputPort[0].invoke(
2369 if (this->m_Time_OutputPort[0].isConnected()) {
2370 this->m_Time_OutputPort[0].
invoke(_logTime);
2378 if (this->m_Log_OutputPort[0].isConnected()) {
2382 #if FW_AMPCS_COMPATIBLE 2387 static_cast<FwAssertArgType>(_status)
2394 static_cast<FwAssertArgType>(_status)
2397 this->m_Log_OutputPort[0].
invoke(
2406 #if FW_ENABLE_TEXT_LOGGING 2407 if (this->m_LogText_OutputPort[0].isConnected()) {
2408 #if FW_OBJECT_NAMES == 1 2409 const char* _formatString =
2410 "(%s) %s: Received a NO-OP string=%s";
2412 const char* _formatString =
2413 "%s: Received a NO-OP string=%s";
2420 this->m_objName.toChar(),
2422 "NoOpStringReceived ",
2426 this->m_LogText_OutputPort[0].invoke(
2445 if (this->m_Time_OutputPort[0].isConnected()) {
2446 this->m_Time_OutputPort[0].
invoke(_logTime);
2454 if (this->m_Log_OutputPort[0].isConnected()) {
2458 #if FW_AMPCS_COMPATIBLE 2463 static_cast<FwAssertArgType>(_status)
2467 #if FW_AMPCS_COMPATIBLE 2470 static_cast<U8>(
sizeof(I32))
2474 static_cast<FwAssertArgType>(_status)
2480 static_cast<FwAssertArgType>(_status)
2483 #if FW_AMPCS_COMPATIBLE 2486 static_cast<U8>(
sizeof(
F32))
2490 static_cast<FwAssertArgType>(_status)
2496 static_cast<FwAssertArgType>(_status)
2499 #if FW_AMPCS_COMPATIBLE 2502 static_cast<U8>(
sizeof(
U8))
2506 static_cast<FwAssertArgType>(_status)
2512 static_cast<FwAssertArgType>(_status)
2515 this->m_Log_OutputPort[0].
invoke(
2524 #if FW_ENABLE_TEXT_LOGGING 2525 if (this->m_LogText_OutputPort[0].isConnected()) {
2526 #if FW_OBJECT_NAMES == 1 2527 const char* _formatString =
2528 "(%s) %s: TEST_CMD_1 args: I32: %" PRIi32
", F32: %f, U8: %" PRIu8
"";
2530 const char* _formatString =
2531 "%s: TEST_CMD_1 args: I32: %" PRIi32
", F32: %f, U8: %" PRIu8
"";
2538 this->m_objName.toChar(),
2542 static_cast<F64>(arg2),
2546 this->m_LogText_OutputPort[0].invoke(
2564 if (this->m_Time_OutputPort[0].isConnected()) {
2565 this->m_Time_OutputPort[0].
invoke(_logTime);
2573 if (this->m_Log_OutputPort[0].isConnected()) {
2577 #if FW_AMPCS_COMPATIBLE 2582 static_cast<FwAssertArgType>(_status)
2586 #if FW_AMPCS_COMPATIBLE 2593 static_cast<FwAssertArgType>(_status)
2599 static_cast<FwAssertArgType>(_status)
2602 #if FW_AMPCS_COMPATIBLE 2605 static_cast<U8>(
sizeof(I32))
2609 static_cast<FwAssertArgType>(_status)
2615 static_cast<FwAssertArgType>(_status)
2618 this->m_Log_OutputPort[0].
invoke(
2627 #if FW_ENABLE_TEXT_LOGGING 2628 if (this->m_LogText_OutputPort[0].isConnected()) {
2629 #if FW_OBJECT_NAMES == 1 2630 const char* _formatString =
2631 "(%s) %s: Opcode 0x%" PRIx32
" is already registered to port %" PRIi32
"";
2633 const char* _formatString =
2634 "%s: Opcode 0x%" PRIx32
" is already registered to port %" PRIi32
"";
2641 this->m_objName.toChar(),
2643 "OpCodeReregistered ",
2648 this->m_LogText_OutputPort[0].invoke(
2669 if (not this->m_first_update_CommandsDispatched) {
2671 if (arg == this->m_last_CommandsDispatched) {
2675 this->m_last_CommandsDispatched = arg;
2679 this->m_first_update_CommandsDispatched =
false;
2680 this->m_last_CommandsDispatched = arg;
2683 if (this->m_Tlm_OutputPort[0].isConnected()) {
2685 this->m_Time_OutputPort[0].isConnected() &&
2688 this->m_Time_OutputPort[0].
invoke(_tlmTime);
2695 static_cast<FwAssertArgType>(_stat)
2702 this->m_Tlm_OutputPort[0].
invoke(
2717 if (not this->m_first_update_CommandErrors) {
2719 if (arg == this->m_last_CommandErrors) {
2723 this->m_last_CommandErrors = arg;
2727 this->m_first_update_CommandErrors =
false;
2728 this->m_last_CommandErrors = arg;
2731 if (this->m_Tlm_OutputPort[0].isConnected()) {
2733 this->m_Time_OutputPort[0].isConnected() &&
2736 this->m_Time_OutputPort[0].
invoke(_tlmTime);
2743 static_cast<FwAssertArgType>(_stat)
2750 this->m_Tlm_OutputPort[0].
invoke(
2765 if (this->m_Time_OutputPort[0].isConnected()) {
2767 this->m_Time_OutputPort[0].
invoke(_time);
2785 this->m_guardedPortMutex.
lock();
2791 this->m_guardedPortMutex.
unLock();
2801 ComponentIpcSerializableBuffer _msg;
2811 static_cast<FwAssertArgType>(_msgStatus)
2821 static_cast<FwAssertArgType>(_deserStatus)
2824 MsgTypeEnum _msgType =
static_cast<MsgTypeEnum
>(_desMsg);
2826 if (_msgType == COMMANDDISPATCHER_COMPONENT_EXIT) {
2831 _deserStatus = _msg.deserializeTo(portNum);
2834 static_cast<FwAssertArgType>(_deserStatus)
2839 case COMPCMDSTAT_CMDRESPONSE: {
2842 _deserStatus = _msg.deserializeTo(opCode);
2845 static_cast<FwAssertArgType>(_deserStatus)
2850 _deserStatus = _msg.deserializeTo(cmdSeq);
2853 static_cast<FwAssertArgType>(_deserStatus)
2858 _deserStatus = _msg.deserializeTo(response);
2861 static_cast<FwAssertArgType>(_deserStatus)
2878 _deserStatus = _msg.deserializeTo(key);
2881 static_cast<FwAssertArgType>(_deserStatus)
2893 case SEQCMDBUFF_COM: {
2896 _deserStatus = _msg.deserializeTo(data);
2899 static_cast<FwAssertArgType>(_deserStatus)
2904 _deserStatus = _msg.deserializeTo(context);
2907 static_cast<FwAssertArgType>(_deserStatus)
2920 case CMD_CMD_NO_OP: {
2923 _deserStatus = _msg.deserializeTo(_opCode);
2926 static_cast<FwAssertArgType>(_deserStatus)
2931 _deserStatus = _msg.deserializeTo(_cmdSeq);
2934 static_cast<FwAssertArgType>(_deserStatus)
2939 _deserStatus = _msg.deserializeTo(args);
2942 static_cast<FwAssertArgType>(_deserStatus)
2950 #if FW_CMD_CHECK_RESIDUAL 2952 if (this->m_CmdStatus_OutputPort[0].isConnected()) {
2967 case CMD_CMD_NO_OP_STRING: {
2970 _deserStatus = _msg.deserializeTo(_opCode);
2973 static_cast<FwAssertArgType>(_deserStatus)
2978 _deserStatus = _msg.deserializeTo(_cmdSeq);
2981 static_cast<FwAssertArgType>(_deserStatus)
2986 _deserStatus = _msg.deserializeTo(args);
2989 static_cast<FwAssertArgType>(_deserStatus)
2999 if (this->m_CmdStatus_OutputPort[0].isConnected()) {
3012 #if FW_CMD_CHECK_RESIDUAL 3014 if (this->m_CmdStatus_OutputPort[0].isConnected()) {
3032 case CMD_CMD_TEST_CMD_1: {
3035 _deserStatus = _msg.deserializeTo(_opCode);
3038 static_cast<FwAssertArgType>(_deserStatus)
3043 _deserStatus = _msg.deserializeTo(_cmdSeq);
3046 static_cast<FwAssertArgType>(_deserStatus)
3051 _deserStatus = _msg.deserializeTo(args);
3054 static_cast<FwAssertArgType>(_deserStatus)
3064 if (this->m_CmdStatus_OutputPort[0].isConnected()) {
3079 if (this->m_CmdStatus_OutputPort[0].isConnected()) {
3094 if (this->m_CmdStatus_OutputPort[0].isConnected()) {
3107 #if FW_CMD_CHECK_RESIDUAL 3109 if (this->m_CmdStatus_OutputPort[0].isConnected()) {
3129 case CMD_CMD_CLEAR_TRACKING: {
3132 _deserStatus = _msg.deserializeTo(_opCode);
3135 static_cast<FwAssertArgType>(_deserStatus)
3140 _deserStatus = _msg.deserializeTo(_cmdSeq);
3143 static_cast<FwAssertArgType>(_deserStatus)
3148 _deserStatus = _msg.deserializeTo(args);
3151 static_cast<FwAssertArgType>(_deserStatus)
3159 #if FW_CMD_CHECK_RESIDUAL 3161 if (this->m_CmdStatus_OutputPort[0].isConnected()) {
3186 void CommandDispatcherComponentBase ::
3198 const U32 idBase = callComp->
getIdBase();
3199 FW_ASSERT(opCode >= idBase, static_cast<FwAssertArgType>(opCode), static_cast<FwAssertArgType>(idBase));
3202 switch (opCode - idBase) {
3204 compPtr->CMD_NO_OP_cmdHandlerBase(
3213 compPtr->CMD_NO_OP_STRING_cmdHandlerBase(
3222 compPtr->CMD_TEST_CMD_1_cmdHandlerBase(
3231 compPtr->CMD_CLEAR_TRACKING_cmdHandlerBase(
3245 void CommandDispatcherComponentBase ::
3254 compPtr->compCmdReg_handlerBase(
3260 void CommandDispatcherComponentBase ::
3271 compPtr->compCmdStat_handlerBase(
3279 void CommandDispatcherComponentBase ::
3288 compPtr->pingIn_handlerBase(
3294 void CommandDispatcherComponentBase ::
3304 compPtr->seqCmdBuff_handlerBase(
Serialization/Deserialization operation was successful.
void addCallPort(InputTimePort *callPort)
Register an input port.
void set_seqCmdStatus_OutputPort(FwIndexType portNum, Fw::InputCmdResponsePort *port)
Connect port to seqCmdStatus[portNum].
virtual void CMD_NO_OP_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command CMD_NO_OP.
FwIdType FwOpcodeType
The type of a command opcode.
FwIndexType getNum_Log_OutputPorts() const
FwIndexType getNum_Time_OutputPorts() const
void invoke(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args) const
Invoke a port interface.
void log_ACTIVITY_HI_NoOpReceived() const
FwIdType getIdBase() const
PlatformSizeType FwSizeType
void pingIn_handlerBase(FwIndexType portNum, U32 key)
Handler base-class function for input port pingIn.
Status receive(U8 *destination, FwSizeType capacity, BlockingType blockType, FwSizeType &actualSize, FwQueuePriorityType &priority) override
receive a message from the queue through delegate
CommandDispatcherComponentBase(const char *compName="")
Construct CommandDispatcherComponentBase object.
void regCommands()
Register commands with the Command Dispatcher.
Status
status returned from the queue send function
#define FW_LOG_STRING_MAX_SIZE
Max size of log string parameter type.
Fw::InputCmdRegPort * get_compCmdReg_InputPort(FwIndexType portNum)
void CMD_NO_OP_STRING_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
const char * toChar() const
virtual void unLock()
Unlock the guarded mutex.
void unLock()
unlock the mutex and assert success
Fw::InputCmdPort * get_CmdDisp_InputPort(FwIndexType portNum)
void invoke(U32 key) const
Invoke a port interface.
virtual void pingIn_preMsgHook(FwIndexType portNum, U32 key)
Pre-message hook for async input port pingIn.
virtual void compCmdStat_handler(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response)=0
Handler for input port compCmdStat.
virtual void CMD_NO_OP_cmdHandler(FwOpcodeType opCode, U32 cmdSeq)=0
void log_ACTIVITY_HI_TestCmd1Args(I32 arg1, F32 arg2, U8 arg3) const
void pingOut_out(FwIndexType portNum, U32 key)
Invoke output port pingOut.
FwIndexType getNum_seqCmdBuff_InputPorts() const
void init()
Initialization function.
Enum representing a command response.
No time base has been established (Required)
void addCallPort(InputCmdRegPort *callPort)
Register an input port.
virtual void pingIn_handler(FwIndexType portNum, U32 key)=0
Handler for input port pingIn.
bool isConnected_CmdStatus_OutputPort(FwIndexType portNum)
void compCmdSend_out(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
Invoke output port compCmdSend.
The command dispatcher has successfully received a NO-OP command.
void log_DIAGNOSTIC_OpCodeReregistered(FwOpcodeType Opcode, I32 port) const
Os::Queue m_queue
queue object for active component
bool isConnected_CmdReg_OutputPort(FwIndexType portNum)
Software diagnostic events.
Svc::InputPingPort * get_pingIn_InputPort(FwIndexType portNum)
void addCallPort(InputTlmPort *callPort)
Register an input port.
void init()
Object initializer.
virtual void CMD_TEST_CMD_1_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command CMD_TEST_CMD_1.
SerializeStatus
forward declaration for string
float F32
32-bit floating point
Op code reregistered event.
Message will block until space is available.
void log_COMMAND_OpCodeCompleted(FwOpcodeType Opcode) const
FwIdType FwEventIdType
The type of an event identifier.
void log_ACTIVITY_HI_NoOpStringReceived(const Fw::StringBase &message) const
bool isConnected_Tlm_OutputPort(FwIndexType portNum)
void tlmWrite_CommandsDispatched(U32 arg, Fw::Time _tlmTime=Fw::Time())
void invoke(FwOpcodeType opCode) const
Invoke a port interface.
void set_CmdReg_OutputPort(FwIndexType portNum, Fw::InputCmdRegPort *port)
Connect port to CmdReg[portNum].
#define FW_OBJECT_NAMES
Indicates whether or not object names are stored (more memory, can be used for tracking objects) ...
Serializable::SizeType getBuffLeft() const
returns how much deserialization buffer is left
void init()
Initialization function.
Os::Queue::Status createQueue(FwSizeType depth, FwSizeType msgSize)
#define FW_MIN(a, b)
MIN macro.
An activity related to commanding.
void set_compCmdSend_OutputPort(FwIndexType portNum, Fw::InputCmdPort *port)
Connect port to compCmdSend[portNum].
void log_WARNING_HI_MalformedCommand(Fw::DeserialStatus Status) const
void init()
Initialization function.
void addCallPort(InputCmdPort *callPort)
Register an input port.
void invoke(Fw::Time &time) const
Invoke a port interface.
Channel ID for CommandsDispatched.
virtual ~CommandDispatcherComponentBase()
Destroy CommandDispatcherComponentBase object.
Status
Generic OK/ERROR status.
FwIndexType getNum_CmdDisp_InputPorts() const
Fw::InputCmdResponsePort * get_compCmdStat_InputPort(FwIndexType portNum)
const char * toChar() const
void invoke(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response) const
Invoke a port interface.
FwIdType FwChanIdType
The type of a telemetry channel identifier.
void addCallPort(InputPingPort *callPort)
Register an input port.
Status send(const U8 *buffer, FwSizeType size, FwQueuePriorityType priority, BlockingType blockType) override
send a message into the queue through delegate
This log event message returns the TEST_CMD_1 arguments.
The command dispatcher has successfully received a NO-OP command from GUI with a string.
virtual void CMD_TEST_CMD_1_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, I32 arg1, F32 arg2, U8 arg3)=0
void init()
Initialization function.
virtual void compCmdReg_handler(FwIndexType portNum, FwOpcodeType opCode)=0
Handler for input port compCmdReg.
void tlmWrite_CommandErrors(U32 arg, Fw::Time _tlmTime=Fw::Time())
void resetDeser()
reset deserialization to beginning
virtual void compCmdStat_preMsgHook(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response)
Pre-message hook for async input port compCmdStat.
FwIndexType getNum_CmdReg_OutputPorts() const
A serious but recoverable event.
Errors dispatching messages.
Received a malformed command packet.
void invoke(FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val) const
Invoke a port interface.
void log_WARNING_HI_InvalidCommand(FwOpcodeType Opcode) const
bool isConnected_Time_OutputPort(FwIndexType portNum)
The size of the serial representation.
FormatStatus format(const CHAR *formatString,...)
write formatted string to buffer
void init()
Initialization function.
void compCmdStat_handlerBase(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response)
Handler base-class function for input port compCmdStat.
FwIndexType getNum_CmdStatus_OutputPorts() const
The size of the serial representation.
FwIndexType getNum_compCmdStat_InputPorts() const
uint8_t U8
8-bit unsigned integer
Exceeded the number of commands that can be simultaneously executed.
void log_COMMAND_OpCodeError(FwOpcodeType Opcode, Fw::CmdResponse error) const
SerializeStatus serializeTo(SerializeBufferBase &buffer) const override
serialize contents to buffer
FwIndexType getNum_pingIn_InputPorts() const
Command failed to deserialize.
PlatformQueuePriorityType FwQueuePriorityType
The type of queue priorities used.
Important informational events.
Op code completed with error event.
void invoke(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args) const
Invoke a port interface.
FwIndexType getNum_seqCmdStatus_OutputPorts() const
Channel ID for CommandErrors.
A message was sent requesting an exit of the loop.
void seqCmdStatus_out(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response)
Invoke output port seqCmdStatus.
PlatformIndexType FwIndexType
void log_DIAGNOSTIC_OpCodeRegistered(FwOpcodeType Opcode, I32 port, I32 slot) const
Log event OpCodeRegistered.
virtual void CMD_CLEAR_TRACKING_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command CMD_CLEAR_TRACKING.
void set_Tlm_OutputPort(FwIndexType portNum, Fw::InputTlmPort *port)
Connect port to Tlm[portNum].
void CMD_CLEAR_TRACKING_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
double F64
64-bit floating point (double). Required for compiler-supplied double promotion.
#define FW_NUM_ARRAY_ELEMENTS(a)
number of elements in an array
void addCallPort(InputLogPort *callPort)
Register an input port.
void seqCmdBuff_handlerBase(FwIndexType portNum, Fw::ComBuffer &data, U32 context)
Handler base-class function for input port seqCmdBuff.
virtual void CMD_NO_OP_STRING_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &arg1)=0
bool isConnected_seqCmdStatus_OutputPort(FwIndexType portNum)
void init()
Initialization function.
virtual void CMD_NO_OP_STRING_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command CMD_NO_OP_STRING.
FwIndexType getNum_compCmdSend_OutputPorts() const
RateGroupDivider component implementation.
message sent/received okay
Received an invalid opcode.
Op code dispatched event.
FwIndexType getNum_pingOut_OutputPorts() const
virtual void CMD_CLEAR_TRACKING_cmdHandler(FwOpcodeType opCode, U32 cmdSeq)=0
SerializeStatus serializeFrom(U8 val)
serialize 8-bit unsigned int
message to exit active component task
bool isConnected_pingOut_OutputPort(FwIndexType portNum)
bool isConnected_Log_OutputPort(FwIndexType portNum)
Message will return with status when space is unavailable.
void CMD_NO_OP_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
virtual void seqCmdBuff_handler(FwIndexType portNum, Fw::ComBuffer &data, U32 context)=0
Handler for input port seqCmdBuff.
FwIndexType getNum_compCmdReg_InputPorts() const
virtual void seqCmdBuff_preMsgHook(FwIndexType portNum, Fw::ComBuffer &data, U32 context)
Pre-message hook for async input port seqCmdBuff.
void init()
Initialization function.
Fw::InputComPort * get_seqCmdBuff_InputPort(FwIndexType portNum)
void compCmdReg_handlerBase(FwIndexType portNum, FwOpcodeType opCode)
Handler base-class function for input port compCmdReg.
FwIndexType getNum_Tlm_OutputPorts() const
void set_pingOut_OutputPort(FwIndexType portNum, Svc::InputPingPort *port)
Connect port to pingOut[portNum].
void log_WARNING_HI_TooManyCommands(FwOpcodeType Opcode) const
bool isConnected_compCmdSend_OutputPort(FwIndexType portNum)
virtual void lock()
Lock the guarded mutex.
void cmdResponse_out(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdResponse response)
Emit command response.
void log_COMMAND_OpCodeDispatched(FwOpcodeType Opcode, I32 port) const
void set_Log_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to Log[portNum].
void set_Time_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to Time[portNum].
virtual const CHAR * toChar() const =0
void set_CmdStatus_OutputPort(FwIndexType portNum, Fw::InputCmdResponsePort *port)
Connect port to CmdStatus[portNum].
void addCallPort(InputCmdResponsePort *callPort)
Register an input port.
void lock()
lock the mutex and assert success
Clear command tracking info to recover from components not returning status.
SerializeStatus deserializeTo(U8 &val)
deserialize 8-bit unsigned int
void CMD_TEST_CMD_1_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)