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];
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 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 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 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.serialize(
1058 static_cast<FwEnumStoreType>(COMPCMDSTAT_CMDRESPONSE)
1062 static_cast<FwAssertArgType>(_status)
1066 _status = msg.serialize(portNum);
1069 static_cast<FwAssertArgType>(_status)
1073 _status = msg.serialize(opCode);
1076 static_cast<FwAssertArgType>(_status)
1080 _status = msg.serialize(cmdSeq);
1083 static_cast<FwAssertArgType>(_status)
1087 _status = msg.serialize(response);
1090 static_cast<FwAssertArgType>(_status)
1099 static_cast<FwAssertArgType>(qStatus)
1112 static_cast<FwAssertArgType>(portNum)
1120 ComponentIpcSerializableBuffer msg;
1124 _status = msg.serialize(
1125 static_cast<FwEnumStoreType>(PINGIN_PING)
1129 static_cast<FwAssertArgType>(_status)
1133 _status = msg.serialize(portNum);
1136 static_cast<FwAssertArgType>(_status)
1140 _status = msg.serialize(key);
1143 static_cast<FwAssertArgType>(_status)
1152 static_cast<FwAssertArgType>(qStatus)
1166 static_cast<FwAssertArgType>(portNum)
1175 ComponentIpcSerializableBuffer msg;
1179 _status = msg.serialize(
1180 static_cast<FwEnumStoreType>(SEQCMDBUFF_COM)
1184 static_cast<FwAssertArgType>(_status)
1188 _status = msg.serialize(portNum);
1191 static_cast<FwAssertArgType>(_status)
1195 _status = msg.serialize(data);
1198 static_cast<FwAssertArgType>(_status)
1202 _status = msg.serialize(context);
1205 static_cast<FwAssertArgType>(_status)
1214 static_cast<FwAssertArgType>(qStatus)
1270 static_cast<FwAssertArgType>(portNum)
1272 this->m_compCmdSend_OutputPort[portNum].
invoke(
1287 static_cast<FwAssertArgType>(portNum)
1289 this->m_pingOut_OutputPort[portNum].
invoke(
1304 static_cast<FwAssertArgType>(portNum)
1306 this->m_seqCmdStatus_OutputPort[portNum].
invoke(
1324 FW_ASSERT(this->m_CmdStatus_OutputPort[0].isConnected());
1325 this->m_CmdStatus_OutputPort[0].
invoke(opCode, cmdSeq, response);
1346 ComponentIpcSerializableBuffer msg;
1350 _status = msg.serialize(static_cast<FwEnumStoreType>(CMD_CMD_NO_OP));
1353 static_cast<FwAssertArgType>(_status)
1359 _status = msg.serialize(port);
1362 static_cast<FwAssertArgType>(_status)
1365 _status = msg.serialize(opCode);
1368 static_cast<FwAssertArgType>(_status)
1371 _status = msg.serialize(cmdSeq);
1374 static_cast<FwAssertArgType>(_status)
1377 _status = msg.serialize(args);
1380 static_cast<FwAssertArgType>(_status)
1389 static_cast<FwAssertArgType>(qStatus)
1405 ComponentIpcSerializableBuffer msg;
1409 _status = msg.serialize(static_cast<FwEnumStoreType>(CMD_CMD_NO_OP_STRING));
1412 static_cast<FwAssertArgType>(_status)
1418 _status = msg.serialize(port);
1421 static_cast<FwAssertArgType>(_status)
1424 _status = msg.serialize(opCode);
1427 static_cast<FwAssertArgType>(_status)
1430 _status = msg.serialize(cmdSeq);
1433 static_cast<FwAssertArgType>(_status)
1436 _status = msg.serialize(args);
1439 static_cast<FwAssertArgType>(_status)
1448 static_cast<FwAssertArgType>(qStatus)
1464 ComponentIpcSerializableBuffer msg;
1468 _status = msg.serialize(static_cast<FwEnumStoreType>(CMD_CMD_TEST_CMD_1));
1471 static_cast<FwAssertArgType>(_status)
1477 _status = msg.serialize(port);
1480 static_cast<FwAssertArgType>(_status)
1483 _status = msg.serialize(opCode);
1486 static_cast<FwAssertArgType>(_status)
1489 _status = msg.serialize(cmdSeq);
1492 static_cast<FwAssertArgType>(_status)
1495 _status = msg.serialize(args);
1498 static_cast<FwAssertArgType>(_status)
1507 static_cast<FwAssertArgType>(qStatus)
1523 ComponentIpcSerializableBuffer msg;
1527 _status = msg.serialize(static_cast<FwEnumStoreType>(CMD_CMD_CLEAR_TRACKING));
1530 static_cast<FwAssertArgType>(_status)
1536 _status = msg.serialize(port);
1539 static_cast<FwAssertArgType>(_status)
1542 _status = msg.serialize(opCode);
1545 static_cast<FwAssertArgType>(_status)
1548 _status = msg.serialize(cmdSeq);
1551 static_cast<FwAssertArgType>(_status)
1554 _status = msg.serialize(args);
1557 static_cast<FwAssertArgType>(_status)
1566 static_cast<FwAssertArgType>(qStatus)
1635 if (this->m_Time_OutputPort[0].isConnected()) {
1636 this->m_Time_OutputPort[0].
invoke(_logTime);
1644 if (this->m_Log_OutputPort[0].isConnected()) {
1648 #if FW_AMPCS_COMPATIBLE 1650 _status = _logBuff.
serialize(static_cast<U8>(3));
1653 static_cast<FwAssertArgType>(_status)
1657 #if FW_AMPCS_COMPATIBLE 1660 static_cast<U8>(
sizeof(U32))
1664 static_cast<FwAssertArgType>(_status)
1670 static_cast<FwAssertArgType>(_status)
1673 #if FW_AMPCS_COMPATIBLE 1676 static_cast<U8>(
sizeof(I32))
1680 static_cast<FwAssertArgType>(_status)
1686 static_cast<FwAssertArgType>(_status)
1689 #if FW_AMPCS_COMPATIBLE 1692 static_cast<U8>(
sizeof(I32))
1696 static_cast<FwAssertArgType>(_status)
1702 static_cast<FwAssertArgType>(_status)
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(
1754 if (this->m_Time_OutputPort[0].isConnected()) {
1755 this->m_Time_OutputPort[0].
invoke(_logTime);
1763 if (this->m_Log_OutputPort[0].isConnected()) {
1767 #if FW_AMPCS_COMPATIBLE 1769 _status = _logBuff.
serialize(static_cast<U8>(2));
1772 static_cast<FwAssertArgType>(_status)
1776 #if FW_AMPCS_COMPATIBLE 1779 static_cast<U8>(
sizeof(U32))
1783 static_cast<FwAssertArgType>(_status)
1789 static_cast<FwAssertArgType>(_status)
1792 #if FW_AMPCS_COMPATIBLE 1795 static_cast<U8>(
sizeof(I32))
1799 static_cast<FwAssertArgType>(_status)
1805 static_cast<FwAssertArgType>(_status)
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(
1853 if (this->m_Time_OutputPort[0].isConnected()) {
1854 this->m_Time_OutputPort[0].
invoke(_logTime);
1862 if (this->m_Log_OutputPort[0].isConnected()) {
1866 #if FW_AMPCS_COMPATIBLE 1868 _status = _logBuff.
serialize(static_cast<U8>(1));
1871 static_cast<FwAssertArgType>(_status)
1875 #if FW_AMPCS_COMPATIBLE 1878 static_cast<U8>(
sizeof(U32))
1882 static_cast<FwAssertArgType>(_status)
1888 static_cast<FwAssertArgType>(_status)
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(
1938 if (this->m_Time_OutputPort[0].isConnected()) {
1939 this->m_Time_OutputPort[0].
invoke(_logTime);
1947 if (this->m_Log_OutputPort[0].isConnected()) {
1951 #if FW_AMPCS_COMPATIBLE 1953 _status = _logBuff.
serialize(static_cast<U8>(2));
1956 static_cast<FwAssertArgType>(_status)
1960 #if FW_AMPCS_COMPATIBLE 1963 static_cast<U8>(
sizeof(U32))
1967 static_cast<FwAssertArgType>(_status)
1973 static_cast<FwAssertArgType>(_status)
1976 #if FW_AMPCS_COMPATIBLE 1983 static_cast<FwAssertArgType>(_status)
1989 static_cast<FwAssertArgType>(_status)
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(
2040 if (this->m_Time_OutputPort[0].isConnected()) {
2041 this->m_Time_OutputPort[0].
invoke(_logTime);
2049 if (this->m_Log_OutputPort[0].isConnected()) {
2053 #if FW_AMPCS_COMPATIBLE 2055 _status = _logBuff.
serialize(static_cast<U8>(1));
2058 static_cast<FwAssertArgType>(_status)
2062 #if FW_AMPCS_COMPATIBLE 2069 static_cast<FwAssertArgType>(_status)
2075 static_cast<FwAssertArgType>(_status)
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(
2125 if (this->m_Time_OutputPort[0].isConnected()) {
2126 this->m_Time_OutputPort[0].
invoke(_logTime);
2134 if (this->m_Log_OutputPort[0].isConnected()) {
2138 #if FW_AMPCS_COMPATIBLE 2140 _status = _logBuff.
serialize(static_cast<U8>(1));
2143 static_cast<FwAssertArgType>(_status)
2147 #if FW_AMPCS_COMPATIBLE 2150 static_cast<U8>(
sizeof(U32))
2154 static_cast<FwAssertArgType>(_status)
2160 static_cast<FwAssertArgType>(_status)
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(
2207 if (this->m_Time_OutputPort[0].isConnected()) {
2208 this->m_Time_OutputPort[0].
invoke(_logTime);
2216 if (this->m_Log_OutputPort[0].isConnected()) {
2220 #if FW_AMPCS_COMPATIBLE 2222 _status = _logBuff.
serialize(static_cast<U8>(1));
2225 static_cast<FwAssertArgType>(_status)
2229 #if FW_AMPCS_COMPATIBLE 2232 static_cast<U8>(
sizeof(U32))
2236 static_cast<FwAssertArgType>(_status)
2242 static_cast<FwAssertArgType>(_status)
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(
2289 if (this->m_Time_OutputPort[0].isConnected()) {
2290 this->m_Time_OutputPort[0].
invoke(_logTime);
2298 if (this->m_Log_OutputPort[0].isConnected()) {
2301 #if FW_AMPCS_COMPATIBLE 2304 _status = _logBuff.
serialize(static_cast<U8>(0));
2307 static_cast<FwAssertArgType>(_status)
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(
2354 if (this->m_Time_OutputPort[0].isConnected()) {
2355 this->m_Time_OutputPort[0].
invoke(_logTime);
2363 if (this->m_Log_OutputPort[0].isConnected()) {
2367 #if FW_AMPCS_COMPATIBLE 2369 _status = _logBuff.
serialize(static_cast<U8>(1));
2372 static_cast<FwAssertArgType>(_status)
2379 static_cast<FwAssertArgType>(_status)
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(
2430 if (this->m_Time_OutputPort[0].isConnected()) {
2431 this->m_Time_OutputPort[0].
invoke(_logTime);
2439 if (this->m_Log_OutputPort[0].isConnected()) {
2443 #if FW_AMPCS_COMPATIBLE 2445 _status = _logBuff.
serialize(static_cast<U8>(3));
2448 static_cast<FwAssertArgType>(_status)
2452 #if FW_AMPCS_COMPATIBLE 2455 static_cast<U8>(
sizeof(I32))
2459 static_cast<FwAssertArgType>(_status)
2465 static_cast<FwAssertArgType>(_status)
2468 #if FW_AMPCS_COMPATIBLE 2471 static_cast<U8>(
sizeof(
F32))
2475 static_cast<FwAssertArgType>(_status)
2481 static_cast<FwAssertArgType>(_status)
2484 #if FW_AMPCS_COMPATIBLE 2487 static_cast<U8>(
sizeof(
U8))
2491 static_cast<FwAssertArgType>(_status)
2497 static_cast<FwAssertArgType>(_status)
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(
2549 if (this->m_Time_OutputPort[0].isConnected()) {
2550 this->m_Time_OutputPort[0].
invoke(_logTime);
2558 if (this->m_Log_OutputPort[0].isConnected()) {
2562 #if FW_AMPCS_COMPATIBLE 2564 _status = _logBuff.
serialize(static_cast<U8>(2));
2567 static_cast<FwAssertArgType>(_status)
2571 #if FW_AMPCS_COMPATIBLE 2574 static_cast<U8>(
sizeof(U32))
2578 static_cast<FwAssertArgType>(_status)
2584 static_cast<FwAssertArgType>(_status)
2587 #if FW_AMPCS_COMPATIBLE 2590 static_cast<U8>(
sizeof(I32))
2594 static_cast<FwAssertArgType>(_status)
2600 static_cast<FwAssertArgType>(_status)
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(
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);
2680 static_cast<FwAssertArgType>(_stat)
2687 this->m_Tlm_OutputPort[0].
invoke(
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);
2728 static_cast<FwAssertArgType>(_stat)
2735 this->m_Tlm_OutputPort[0].
invoke(
2750 if (this->m_Time_OutputPort[0].isConnected()) {
2752 this->m_Time_OutputPort[0].
invoke(_time);
2770 this->m_guardedPortMutex.
lock();
2776 this->m_guardedPortMutex.
unLock();
2786 ComponentIpcSerializableBuffer msg;
2796 static_cast<FwAssertArgType>(msgStatus)
2806 static_cast<FwAssertArgType>(deserStatus)
2809 MsgTypeEnum msgType =
static_cast<MsgTypeEnum
>(desMsg);
2811 if (msgType == COMMANDDISPATCHER_COMPONENT_EXIT) {
2816 deserStatus = msg.deserialize(portNum);
2819 static_cast<FwAssertArgType>(deserStatus)
2824 case COMPCMDSTAT_CMDRESPONSE: {
2827 deserStatus = msg.deserialize(opCode);
2830 static_cast<FwAssertArgType>(deserStatus)
2835 deserStatus = msg.deserialize(cmdSeq);
2838 static_cast<FwAssertArgType>(deserStatus)
2843 deserStatus = msg.deserialize(response);
2846 static_cast<FwAssertArgType>(deserStatus)
2863 deserStatus = msg.deserialize(key);
2866 static_cast<FwAssertArgType>(deserStatus)
2878 case SEQCMDBUFF_COM: {
2881 deserStatus = msg.deserialize(data);
2884 static_cast<FwAssertArgType>(deserStatus)
2889 deserStatus = msg.deserialize(context);
2892 static_cast<FwAssertArgType>(deserStatus)
2905 case CMD_CMD_NO_OP: {
2908 deserStatus = msg.deserialize(opCode);
2911 static_cast<FwAssertArgType>(deserStatus)
2916 deserStatus = msg.deserialize(cmdSeq);
2919 static_cast<FwAssertArgType>(deserStatus)
2924 deserStatus = msg.deserialize(args);
2927 static_cast<FwAssertArgType>(deserStatus)
2935 #if FW_CMD_CHECK_RESIDUAL 2937 if (this->m_CmdStatus_OutputPort[0].isConnected()) {
2952 case CMD_CMD_NO_OP_STRING: {
2955 deserStatus = msg.deserialize(opCode);
2958 static_cast<FwAssertArgType>(deserStatus)
2963 deserStatus = msg.deserialize(cmdSeq);
2966 static_cast<FwAssertArgType>(deserStatus)
2971 deserStatus = msg.deserialize(args);
2974 static_cast<FwAssertArgType>(deserStatus)
2984 if (this->m_CmdStatus_OutputPort[0].isConnected()) {
2997 #if FW_CMD_CHECK_RESIDUAL 2999 if (this->m_CmdStatus_OutputPort[0].isConnected()) {
3017 case CMD_CMD_TEST_CMD_1: {
3020 deserStatus = msg.deserialize(opCode);
3023 static_cast<FwAssertArgType>(deserStatus)
3028 deserStatus = msg.deserialize(cmdSeq);
3031 static_cast<FwAssertArgType>(deserStatus)
3036 deserStatus = msg.deserialize(args);
3039 static_cast<FwAssertArgType>(deserStatus)
3049 if (this->m_CmdStatus_OutputPort[0].isConnected()) {
3064 if (this->m_CmdStatus_OutputPort[0].isConnected()) {
3079 if (this->m_CmdStatus_OutputPort[0].isConnected()) {
3092 #if FW_CMD_CHECK_RESIDUAL 3094 if (this->m_CmdStatus_OutputPort[0].isConnected()) {
3114 case CMD_CMD_CLEAR_TRACKING: {
3117 deserStatus = msg.deserialize(opCode);
3120 static_cast<FwAssertArgType>(deserStatus)
3125 deserStatus = msg.deserialize(cmdSeq);
3128 static_cast<FwAssertArgType>(deserStatus)
3133 deserStatus = msg.deserialize(args);
3136 static_cast<FwAssertArgType>(deserStatus)
3144 #if FW_CMD_CHECK_RESIDUAL 3146 if (this->m_CmdStatus_OutputPort[0].isConnected()) {
3171 void CommandDispatcherComponentBase ::
3183 const U32 idBase = callComp->
getIdBase();
3184 FW_ASSERT(opCode >= idBase, static_cast<FwAssertArgType>(opCode), static_cast<FwAssertArgType>(idBase));
3187 switch (opCode - idBase) {
3189 compPtr->CMD_NO_OP_cmdHandlerBase(
3198 compPtr->CMD_NO_OP_STRING_cmdHandlerBase(
3207 compPtr->CMD_TEST_CMD_1_cmdHandlerBase(
3216 compPtr->CMD_CLEAR_TRACKING_cmdHandlerBase(
3230 void CommandDispatcherComponentBase ::
3239 compPtr->compCmdReg_handlerBase(
3245 void CommandDispatcherComponentBase ::
3256 compPtr->compCmdStat_handlerBase(
3264 void CommandDispatcherComponentBase ::
3273 compPtr->pingIn_handlerBase(
3279 void CommandDispatcherComponentBase ::
3289 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.
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
void log_WARNING_HI_InvalidCommand(U32 Opcode) const
void pingIn_handlerBase(FwIndexType portNum, U32 key)
Handler base-class function for input port pingIn.
CommandDispatcherComponentBase(const char *compName="")
Construct CommandDispatcherComponentBase object.
void regCommands()
Register commands with the Command Dispatcher.
NATIVE_UINT_TYPE SizeType
Status
status returned from the queue send function
Received a malformed command packet.
SerializeStatus serialize(U8 val)
serialize 8-bit unsigned int
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)
PlatformSizeType FwSizeType
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.
void log_WARNING_HI_TooManyCommands(U32 Opcode) const
Exceeded the number of commands that can be simultaneously executed.
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.
Op code completed with error event.
FwIndexType getNum_seqCmdBuff_InputPorts() const
void init()
Initialization function.
Enum representing a command response.
void addCallPort(InputCmdRegPort *callPort)
Register an input port.
virtual void pingIn_handler(FwIndexType portNum, U32 key)=0
Handler for input port pingIn.
PlatformIndexType FwIndexType
bool isConnected_CmdStatus_OutputPort(FwIndexType portNum)
void compCmdSend_out(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
Invoke output port compCmdSend.
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.
Channel ID for CommandsDispatched.
virtual void CMD_TEST_CMD_1_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command CMD_TEST_CMD_1.
This log event message returns the TEST_CMD_1 arguments.
SerializeStatus
forward declaration for string
float F32
32-bit floating point
Message will block until space is available.
The size of the serial representation.
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())
The command dispatcher has successfully received a NO-OP command from GUI with a string.
void invoke(FwOpcodeType opCode) const
Invoke a port interface.
void set_CmdReg_OutputPort(FwIndexType portNum, Fw::InputCmdRegPort *port)
Connect port to CmdReg[portNum].
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.
Channel ID for CommandErrors.
void invoke(Fw::Time &time) const
Invoke a port interface.
virtual ~CommandDispatcherComponentBase()
Destroy CommandDispatcherComponentBase object.
Status
Generic OK/ERROR status.
void log_COMMAND_OpCodeDispatched(U32 Opcode, I32 port) const
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.
No time base has been established.
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
virtual void CMD_TEST_CMD_1_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, I32 arg1, F32 arg2, U8 arg3)=0
void init()
Initialization function.
void log_COMMAND_OpCodeCompleted(U32 Opcode) const
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
The command dispatcher has successfully received a NO-OP command.
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.
void invoke(FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val) const
Invoke a port interface.
bool isConnected_Time_OutputPort(FwIndexType portNum)
Received an invalid opcode.
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
FwIndexType getNum_compCmdStat_InputPorts() const
uint8_t U8
8-bit unsigned integer
#define PRI_PlatformIntType
void log_DIAGNOSTIC_OpCodeReregistered(U32 Opcode, I32 port) const
FwIndexType getNum_pingIn_InputPorts() const
Command failed to deserialize.
Important informational events.
void invoke(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args) const
Invoke a port interface.
FwIndexType getNum_seqCmdStatus_OutputPorts() const
PlatformQueuePriorityType FwQueuePriorityType
message to exit active component task
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.
SerializeStatus deserialize(U8 &val)
deserialize 8-bit unsigned int
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)
#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)
Op code reregistered event.
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
Op code dispatched event.
message sent/received okay
FwIndexType getNum_pingOut_OutputPorts() const
virtual void CMD_CLEAR_TRACKING_cmdHandler(FwOpcodeType opCode, U32 cmdSeq)=0
The size of the serial representation.
virtual SerializeStatus serialize(SerializeBufferBase &buffer) const
serialization function
void log_COMMAND_OpCodeError(U32 Opcode, Fw::CmdResponse error) const
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)
Status receive(U8 *destination, FwSizeType capacity, BlockingType blockType, FwSizeType &actualSize, FwQueuePriorityType &priority) override
receive a message from the queue through delegate
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].
bool isConnected_compCmdSend_OutputPort(FwIndexType portNum)
#define FW_OBJECT_NAMES
Indicates whether or not object names are stored (more memory, can be used for tracking objects) ...
virtual void lock()
Lock the guarded mutex.
void cmdResponse_out(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdResponse response)
Emit command response.
void log_DIAGNOSTIC_OpCodeRegistered(U32 Opcode, I32 port, I32 slot) const
Log event OpCodeRegistered.
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].
#define FW_LOG_STRING_MAX_SIZE
Max size of log string parameter type.
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.
void CMD_TEST_CMD_1_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)