10 #if FW_ENABLE_TEXT_LOGGING
19 COMPCMDSTAT_CMDRESPONSE,
25 CMD_CMD_CLEAR_TRACKING,
39 class ComponentIpcSerializableBuffer :
54 return sizeof(m_buff);
61 const U8* getBuffAddr()
const {
67 U8 m_buff[SERIALIZATION_SIZE];
91 this->m_CmdDisp_InputPort[port].
init();
96 this->m_CmdDisp_InputPort[port].
setPortNum(port);
98 #if FW_OBJECT_NAMES == 1
102 this->m_objName.toChar(),
105 this->m_CmdDisp_InputPort[port].setObjName(portName.
toChar());
115 this->m_compCmdReg_InputPort[port].
init();
120 this->m_compCmdReg_InputPort[port].
setPortNum(port);
122 #if FW_OBJECT_NAMES == 1
126 this->m_objName.toChar(),
129 this->m_compCmdReg_InputPort[port].setObjName(portName.
toChar());
139 this->m_compCmdStat_InputPort[port].
init();
144 this->m_compCmdStat_InputPort[port].
setPortNum(port);
146 #if FW_OBJECT_NAMES == 1
150 this->m_objName.toChar(),
153 this->m_compCmdStat_InputPort[port].setObjName(portName.
toChar());
163 this->m_pingIn_InputPort[port].
init();
168 this->m_pingIn_InputPort[port].
setPortNum(port);
170 #if FW_OBJECT_NAMES == 1
174 this->m_objName.toChar(),
177 this->m_pingIn_InputPort[port].setObjName(portName.
toChar());
187 this->m_seqCmdBuff_InputPort[port].
init();
192 this->m_seqCmdBuff_InputPort[port].
setPortNum(port);
194 #if FW_OBJECT_NAMES == 1
198 this->m_objName.toChar(),
201 this->m_seqCmdBuff_InputPort[port].setObjName(portName.
toChar());
211 this->m_CmdReg_OutputPort[port].
init();
213 #if FW_OBJECT_NAMES == 1
217 this->m_objName.toChar(),
220 this->m_CmdReg_OutputPort[port].setObjName(portName.
toChar());
230 this->m_CmdStatus_OutputPort[port].
init();
232 #if FW_OBJECT_NAMES == 1
236 this->m_objName.toChar(),
239 this->m_CmdStatus_OutputPort[port].setObjName(portName.
toChar());
249 this->m_Log_OutputPort[port].
init();
251 #if FW_OBJECT_NAMES == 1
255 this->m_objName.toChar(),
258 this->m_Log_OutputPort[port].setObjName(portName.
toChar());
262 #if FW_ENABLE_TEXT_LOGGING == 1
266 port < static_cast<FwIndexType>(this->getNum_LogText_OutputPorts());
269 this->m_LogText_OutputPort[port].
init();
271 #if FW_OBJECT_NAMES == 1
275 this->m_objName.toChar(),
278 this->m_LogText_OutputPort[port].setObjName(portName.
toChar());
289 this->m_Time_OutputPort[port].
init();
291 #if FW_OBJECT_NAMES == 1
295 this->m_objName.toChar(),
298 this->m_Time_OutputPort[port].setObjName(portName.
toChar());
308 this->m_Tlm_OutputPort[port].
init();
310 #if FW_OBJECT_NAMES == 1
314 this->m_objName.toChar(),
317 this->m_Tlm_OutputPort[port].setObjName(portName.
toChar());
327 this->m_compCmdSend_OutputPort[port].
init();
329 #if FW_OBJECT_NAMES == 1
333 this->m_objName.toChar(),
336 this->m_compCmdSend_OutputPort[port].setObjName(portName.
toChar());
346 this->m_pingOut_OutputPort[port].
init();
348 #if FW_OBJECT_NAMES == 1
352 this->m_objName.toChar(),
355 this->m_pingOut_OutputPort[port].setObjName(portName.
toChar());
365 this->m_seqCmdStatus_OutputPort[port].
init();
367 #if FW_OBJECT_NAMES == 1
371 this->m_objName.toChar(),
374 this->m_seqCmdStatus_OutputPort[port].setObjName(portName.
toChar());
380 static_cast<FwSizeType>(ComponentIpcSerializableBuffer::SERIALIZATION_SIZE)
400 return &this->m_CmdDisp_InputPort[portNum];
415 return &this->m_compCmdReg_InputPort[portNum];
426 return &this->m_compCmdStat_InputPort[portNum];
437 return &this->m_pingIn_InputPort[portNum];
448 return &this->m_seqCmdBuff_InputPort[portNum];
466 this->m_CmdReg_OutputPort[portNum].
addCallPort(port);
480 this->m_CmdStatus_OutputPort[portNum].
addCallPort(port);
497 #if FW_ENABLE_TEXT_LOGGING == 1
499 void CommandDispatcherComponentBase ::
500 set_LogText_OutputPort(
506 portNum < this->getNum_LogText_OutputPorts(),
510 this->m_LogText_OutputPort[portNum].addCallPort(port);
526 this->m_Time_OutputPort[portNum].
addCallPort(port);
558 this->m_compCmdSend_OutputPort[portNum].
addCallPort(port);
572 this->m_pingOut_OutputPort[portNum].
addCallPort(port);
586 this->m_seqCmdStatus_OutputPort[portNum].
addCallPort(port);
589 #if FW_PORT_SERIALIZATION
598 Fw::InputSerializePort* port
606 this->m_CmdReg_OutputPort[portNum].registerSerialPort(port);
612 Fw::InputSerializePort* port
620 this->m_CmdStatus_OutputPort[portNum].registerSerialPort(port);
626 Fw::InputSerializePort* port
634 this->m_Log_OutputPort[portNum].registerSerialPort(port);
637 #if FW_ENABLE_TEXT_LOGGING == 1
639 void CommandDispatcherComponentBase ::
640 set_LogText_OutputPort(
642 Fw::InputSerializePort* port
646 portNum < this->getNum_LogText_OutputPorts(),
650 this->m_LogText_OutputPort[portNum].registerSerialPort(port);
658 Fw::InputSerializePort* port
666 this->m_Time_OutputPort[portNum].registerSerialPort(port);
672 Fw::InputSerializePort* port
680 this->m_Tlm_OutputPort[portNum].registerSerialPort(port);
685 #if FW_PORT_SERIALIZATION
694 Fw::InputSerializePort* port
702 this->m_compCmdSend_OutputPort[portNum].registerSerialPort(port);
708 Fw::InputSerializePort* port
716 this->m_pingOut_OutputPort[portNum].registerSerialPort(port);
722 Fw::InputSerializePort* port
730 this->m_seqCmdStatus_OutputPort[portNum].registerSerialPort(port);
742 FW_ASSERT(this->m_CmdReg_OutputPort[0].isConnected());
744 this->m_CmdReg_OutputPort[0].
invoke(
748 this->m_CmdReg_OutputPort[0].
invoke(
752 this->m_CmdReg_OutputPort[0].
invoke(
756 this->m_CmdReg_OutputPort[0].
invoke(
767 Fw::ActiveComponentBase(compName)
770 this->m_first_update_CommandsDispatched =
true;
771 this->m_last_CommandsDispatched = 0;
774 this->m_first_update_CommandErrors =
true;
775 this->m_last_CommandErrors = 0;
844 #if FW_ENABLE_TEXT_LOGGING == 1
847 getNum_LogText_OutputPorts()
const
900 return this->m_CmdReg_OutputPort[portNum].
isConnected();
911 return this->m_CmdStatus_OutputPort[portNum].
isConnected();
922 return this->m_Log_OutputPort[portNum].
isConnected();
925 #if FW_ENABLE_TEXT_LOGGING == 1
927 bool CommandDispatcherComponentBase ::
928 isConnected_LogText_OutputPort(
FwIndexType portNum)
931 portNum < this->getNum_LogText_OutputPorts(),
935 return this->m_LogText_OutputPort[portNum].isConnected();
948 return this->m_Time_OutputPort[portNum].
isConnected();
959 return this->m_Tlm_OutputPort[portNum].
isConnected();
974 return this->m_compCmdSend_OutputPort[portNum].
isConnected();
985 return this->m_pingOut_OutputPort[portNum].
isConnected();
996 return this->m_seqCmdStatus_OutputPort[portNum].
isConnected();
1051 ComponentIpcSerializableBuffer msg;
1055 _status = msg.serialize(
1064 _status = msg.serialize(portNum);
1071 _status = msg.serialize(opCode);
1078 _status = msg.serialize(cmdSeq);
1085 _status = msg.serialize(response);
1118 ComponentIpcSerializableBuffer msg;
1122 _status = msg.serialize(
1131 _status = msg.serialize(portNum);
1138 _status = msg.serialize(key);
1173 ComponentIpcSerializableBuffer msg;
1177 _status = msg.serialize(
1186 _status = msg.serialize(portNum);
1193 _status = msg.serialize(data);
1200 _status = msg.serialize(context);
1270 this->m_compCmdSend_OutputPort[portNum].
invoke(
1287 this->m_pingOut_OutputPort[portNum].
invoke(
1304 this->m_seqCmdStatus_OutputPort[portNum].
invoke(
1322 FW_ASSERT(this->m_CmdStatus_OutputPort[0].isConnected());
1323 this->m_CmdStatus_OutputPort[0].
invoke(opCode, cmdSeq, response);
1344 ComponentIpcSerializableBuffer msg;
1357 _status = msg.serialize(port);
1363 _status = msg.serialize(opCode);
1369 _status = msg.serialize(cmdSeq);
1375 _status = msg.serialize(args);
1403 ComponentIpcSerializableBuffer msg;
1407 _status = msg.serialize(
static_cast<FwEnumStoreType>(CMD_CMD_NO_OP_STRING));
1416 _status = msg.serialize(port);
1422 _status = msg.serialize(opCode);
1428 _status = msg.serialize(cmdSeq);
1434 _status = msg.serialize(args);
1462 ComponentIpcSerializableBuffer msg;
1466 _status = msg.serialize(
static_cast<FwEnumStoreType>(CMD_CMD_TEST_CMD_1));
1475 _status = msg.serialize(port);
1481 _status = msg.serialize(opCode);
1487 _status = msg.serialize(cmdSeq);
1493 _status = msg.serialize(args);
1521 ComponentIpcSerializableBuffer msg;
1525 _status = msg.serialize(
static_cast<FwEnumStoreType>(CMD_CMD_CLEAR_TRACKING));
1534 _status = msg.serialize(port);
1540 _status = msg.serialize(opCode);
1546 _status = msg.serialize(cmdSeq);
1552 _status = msg.serialize(args);
1633 if (this->m_Time_OutputPort[0].isConnected()) {
1634 this->m_Time_OutputPort[0].
invoke(_logTime);
1642 if (this->m_Log_OutputPort[0].isConnected()) {
1646 #if FW_AMPCS_COMPATIBLE
1655 #if FW_AMPCS_COMPATIBLE
1658 static_cast<U8>(
sizeof(U32))
1671 #if FW_AMPCS_COMPATIBLE
1674 static_cast<U8>(
sizeof(I32))
1687 #if FW_AMPCS_COMPATIBLE
1690 static_cast<U8>(
sizeof(I32))
1703 this->m_Log_OutputPort[0].
invoke(
1712 #if FW_ENABLE_TEXT_LOGGING
1713 if (this->m_LogText_OutputPort[0].isConnected()) {
1714 #if FW_OBJECT_NAMES == 1
1715 const char* _formatString =
1716 "(%s) %s: Opcode 0x%" PRIx32
" registered to port %" PRIi32
" slot %" PRIi32
"";
1718 const char* _formatString =
1719 "%s: Opcode 0x%" PRIx32
" registered to port %" PRIi32
" slot %" PRIi32
"";
1726 this->m_objName.toChar(),
1728 "OpCodeRegistered ",
1734 this->m_LogText_OutputPort[0].invoke(
1752 if (this->m_Time_OutputPort[0].isConnected()) {
1753 this->m_Time_OutputPort[0].
invoke(_logTime);
1761 if (this->m_Log_OutputPort[0].isConnected()) {
1765 #if FW_AMPCS_COMPATIBLE
1774 #if FW_AMPCS_COMPATIBLE
1777 static_cast<U8>(
sizeof(U32))
1790 #if FW_AMPCS_COMPATIBLE
1793 static_cast<U8>(
sizeof(I32))
1806 this->m_Log_OutputPort[0].
invoke(
1815 #if FW_ENABLE_TEXT_LOGGING
1816 if (this->m_LogText_OutputPort[0].isConnected()) {
1817 #if FW_OBJECT_NAMES == 1
1818 const char* _formatString =
1819 "(%s) %s: Opcode 0x%" PRIx32
" dispatched to port %" PRIi32
"";
1821 const char* _formatString =
1822 "%s: Opcode 0x%" PRIx32
" dispatched to port %" PRIi32
"";
1829 this->m_objName.toChar(),
1831 "OpCodeDispatched ",
1836 this->m_LogText_OutputPort[0].invoke(
1851 if (this->m_Time_OutputPort[0].isConnected()) {
1852 this->m_Time_OutputPort[0].
invoke(_logTime);
1860 if (this->m_Log_OutputPort[0].isConnected()) {
1864 #if FW_AMPCS_COMPATIBLE
1873 #if FW_AMPCS_COMPATIBLE
1876 static_cast<U8>(
sizeof(U32))
1889 this->m_Log_OutputPort[0].
invoke(
1898 #if FW_ENABLE_TEXT_LOGGING
1899 if (this->m_LogText_OutputPort[0].isConnected()) {
1900 #if FW_OBJECT_NAMES == 1
1901 const char* _formatString =
1902 "(%s) %s: Opcode 0x%" PRIx32
" completed";
1904 const char* _formatString =
1905 "%s: Opcode 0x%" PRIx32
" completed";
1912 this->m_objName.toChar(),
1918 this->m_LogText_OutputPort[0].invoke(
1936 if (this->m_Time_OutputPort[0].isConnected()) {
1937 this->m_Time_OutputPort[0].
invoke(_logTime);
1945 if (this->m_Log_OutputPort[0].isConnected()) {
1949 #if FW_AMPCS_COMPATIBLE
1958 #if FW_AMPCS_COMPATIBLE
1961 static_cast<U8>(
sizeof(U32))
1974 #if FW_AMPCS_COMPATIBLE
1990 this->m_Log_OutputPort[0].
invoke(
1999 #if FW_ENABLE_TEXT_LOGGING
2000 if (this->m_LogText_OutputPort[0].isConnected()) {
2001 #if FW_OBJECT_NAMES == 1
2002 const char* _formatString =
2003 "(%s) %s: Opcode 0x%" PRIx32
" completed with error %s";
2005 const char* _formatString =
2006 "%s: Opcode 0x%" PRIx32
" completed with error %s";
2010 error.toString(errorStr);
2016 this->m_objName.toChar(),
2023 this->m_LogText_OutputPort[0].invoke(
2038 if (this->m_Time_OutputPort[0].isConnected()) {
2039 this->m_Time_OutputPort[0].
invoke(_logTime);
2047 if (this->m_Log_OutputPort[0].isConnected()) {
2051 #if FW_AMPCS_COMPATIBLE
2060 #if FW_AMPCS_COMPATIBLE
2076 this->m_Log_OutputPort[0].
invoke(
2085 #if FW_ENABLE_TEXT_LOGGING
2086 if (this->m_LogText_OutputPort[0].isConnected()) {
2087 #if FW_OBJECT_NAMES == 1
2088 const char* _formatString =
2089 "(%s) %s: Received malformed command packet. Status: %s";
2091 const char* _formatString =
2092 "%s: Received malformed command packet. Status: %s";
2096 Status.toString(StatusStr);
2102 this->m_objName.toChar(),
2104 "MalformedCommand ",
2108 this->m_LogText_OutputPort[0].invoke(
2123 if (this->m_Time_OutputPort[0].isConnected()) {
2124 this->m_Time_OutputPort[0].
invoke(_logTime);
2132 if (this->m_Log_OutputPort[0].isConnected()) {
2136 #if FW_AMPCS_COMPATIBLE
2145 #if FW_AMPCS_COMPATIBLE
2148 static_cast<U8>(
sizeof(U32))
2161 this->m_Log_OutputPort[0].
invoke(
2170 #if FW_ENABLE_TEXT_LOGGING
2171 if (this->m_LogText_OutputPort[0].isConnected()) {
2172 #if FW_OBJECT_NAMES == 1
2173 const char* _formatString =
2174 "(%s) %s: Invalid opcode 0x%" PRIx32
" received";
2176 const char* _formatString =
2177 "%s: Invalid opcode 0x%" PRIx32
" received";
2184 this->m_objName.toChar(),
2190 this->m_LogText_OutputPort[0].invoke(
2205 if (this->m_Time_OutputPort[0].isConnected()) {
2206 this->m_Time_OutputPort[0].
invoke(_logTime);
2214 if (this->m_Log_OutputPort[0].isConnected()) {
2218 #if FW_AMPCS_COMPATIBLE
2227 #if FW_AMPCS_COMPATIBLE
2230 static_cast<U8>(
sizeof(U32))
2243 this->m_Log_OutputPort[0].
invoke(
2252 #if FW_ENABLE_TEXT_LOGGING
2253 if (this->m_LogText_OutputPort[0].isConnected()) {
2254 #if FW_OBJECT_NAMES == 1
2255 const char* _formatString =
2256 "(%s) %s: Too many outstanding commands. opcode=0x%" PRIx32
"";
2258 const char* _formatString =
2259 "%s: Too many outstanding commands. opcode=0x%" PRIx32
"";
2266 this->m_objName.toChar(),
2272 this->m_LogText_OutputPort[0].invoke(
2287 if (this->m_Time_OutputPort[0].isConnected()) {
2288 this->m_Time_OutputPort[0].
invoke(_logTime);
2296 if (this->m_Log_OutputPort[0].isConnected()) {
2299 #if FW_AMPCS_COMPATIBLE
2309 this->m_Log_OutputPort[0].
invoke(
2318 #if FW_ENABLE_TEXT_LOGGING
2319 if (this->m_LogText_OutputPort[0].isConnected()) {
2320 #if FW_OBJECT_NAMES == 1
2321 const char* _formatString =
2322 "(%s) %s: Received a NO-OP command";
2324 const char* _formatString =
2325 "%s: Received a NO-OP command";
2332 this->m_objName.toChar(),
2337 this->m_LogText_OutputPort[0].invoke(
2352 if (this->m_Time_OutputPort[0].isConnected()) {
2353 this->m_Time_OutputPort[0].
invoke(_logTime);
2361 if (this->m_Log_OutputPort[0].isConnected()) {
2365 #if FW_AMPCS_COMPATIBLE
2380 this->m_Log_OutputPort[0].
invoke(
2389 #if FW_ENABLE_TEXT_LOGGING
2390 if (this->m_LogText_OutputPort[0].isConnected()) {
2391 #if FW_OBJECT_NAMES == 1
2392 const char* _formatString =
2393 "(%s) %s: Received a NO-OP string=%s";
2395 const char* _formatString =
2396 "%s: Received a NO-OP string=%s";
2403 this->m_objName.toChar(),
2405 "NoOpStringReceived ",
2409 this->m_LogText_OutputPort[0].invoke(
2428 if (this->m_Time_OutputPort[0].isConnected()) {
2429 this->m_Time_OutputPort[0].
invoke(_logTime);
2437 if (this->m_Log_OutputPort[0].isConnected()) {
2441 #if FW_AMPCS_COMPATIBLE
2450 #if FW_AMPCS_COMPATIBLE
2453 static_cast<U8>(
sizeof(I32))
2466 #if FW_AMPCS_COMPATIBLE
2469 static_cast<U8>(
sizeof(
F32))
2482 #if FW_AMPCS_COMPATIBLE
2485 static_cast<U8>(
sizeof(
U8))
2498 this->m_Log_OutputPort[0].
invoke(
2507 #if FW_ENABLE_TEXT_LOGGING
2508 if (this->m_LogText_OutputPort[0].isConnected()) {
2509 #if FW_OBJECT_NAMES == 1
2510 const char* _formatString =
2511 "(%s) %s: TEST_CMD_1 args: I32: %" PRIi32
", F32: %f, U8: %" PRIu8
"";
2513 const char* _formatString =
2514 "%s: TEST_CMD_1 args: I32: %" PRIi32
", F32: %f, U8: %" PRIu8
"";
2521 this->m_objName.toChar(),
2529 this->m_LogText_OutputPort[0].invoke(
2547 if (this->m_Time_OutputPort[0].isConnected()) {
2548 this->m_Time_OutputPort[0].
invoke(_logTime);
2556 if (this->m_Log_OutputPort[0].isConnected()) {
2560 #if FW_AMPCS_COMPATIBLE
2569 #if FW_AMPCS_COMPATIBLE
2572 static_cast<U8>(
sizeof(U32))
2585 #if FW_AMPCS_COMPATIBLE
2588 static_cast<U8>(
sizeof(I32))
2601 this->m_Log_OutputPort[0].
invoke(
2610 #if FW_ENABLE_TEXT_LOGGING
2611 if (this->m_LogText_OutputPort[0].isConnected()) {
2612 #if FW_OBJECT_NAMES == 1
2613 const char* _formatString =
2614 "(%s) %s: Opcode 0x%" PRIx32
" is already registered to port %" PRIi32
"";
2616 const char* _formatString =
2617 "%s: Opcode 0x%" PRIx32
" is already registered to port %" PRIi32
"";
2624 this->m_objName.toChar(),
2626 "OpCodeReregistered ",
2631 this->m_LogText_OutputPort[0].invoke(
2652 if (not this->m_first_update_CommandsDispatched) {
2654 if (arg == this->m_last_CommandsDispatched) {
2658 this->m_last_CommandsDispatched = arg;
2662 this->m_first_update_CommandsDispatched =
false;
2663 this->m_last_CommandsDispatched = arg;
2666 if (this->m_Tlm_OutputPort[0].isConnected()) {
2668 this->m_Time_OutputPort[0].isConnected() &&
2671 this->m_Time_OutputPort[0].
invoke(_tlmTime);
2685 this->m_Tlm_OutputPort[0].
invoke(
2700 if (not this->m_first_update_CommandErrors) {
2702 if (arg == this->m_last_CommandErrors) {
2706 this->m_last_CommandErrors = arg;
2710 this->m_first_update_CommandErrors =
false;
2711 this->m_last_CommandErrors = arg;
2714 if (this->m_Tlm_OutputPort[0].isConnected()) {
2716 this->m_Time_OutputPort[0].isConnected() &&
2719 this->m_Time_OutputPort[0].
invoke(_tlmTime);
2733 this->m_Tlm_OutputPort[0].
invoke(
2748 if (this->m_Time_OutputPort[0].isConnected()) {
2750 this->m_Time_OutputPort[0].
invoke(_time);
2768 this->m_guardedPortMutex.
lock();
2774 this->m_guardedPortMutex.
unLock();
2784 ComponentIpcSerializableBuffer msg;
2807 MsgTypeEnum msgType =
static_cast<MsgTypeEnum
>(desMsg);
2809 if (msgType == COMMANDDISPATCHER_COMPONENT_EXIT) {
2814 deserStatus = msg.deserialize(portNum);
2822 case COMPCMDSTAT_CMDRESPONSE: {
2825 deserStatus = msg.deserialize(opCode);
2833 deserStatus = msg.deserialize(cmdSeq);
2861 deserStatus = msg.deserialize(key);
2876 case SEQCMDBUFF_COM: {
2887 deserStatus = msg.deserialize(context);
2903 case CMD_CMD_NO_OP: {
2906 deserStatus = msg.deserialize(opCode);
2914 deserStatus = msg.deserialize(cmdSeq);
2933 #if FW_CMD_CHECK_RESIDUAL
2935 if (this->m_CmdStatus_OutputPort[0].isConnected()) {
2950 case CMD_CMD_NO_OP_STRING: {
2953 deserStatus = msg.deserialize(opCode);
2961 deserStatus = msg.deserialize(cmdSeq);
2982 if (this->m_CmdStatus_OutputPort[0].isConnected()) {
2995 #if FW_CMD_CHECK_RESIDUAL
2997 if (this->m_CmdStatus_OutputPort[0].isConnected()) {
3015 case CMD_CMD_TEST_CMD_1: {
3018 deserStatus = msg.deserialize(opCode);
3026 deserStatus = msg.deserialize(cmdSeq);
3047 if (this->m_CmdStatus_OutputPort[0].isConnected()) {
3062 if (this->m_CmdStatus_OutputPort[0].isConnected()) {
3077 if (this->m_CmdStatus_OutputPort[0].isConnected()) {
3090 #if FW_CMD_CHECK_RESIDUAL
3092 if (this->m_CmdStatus_OutputPort[0].isConnected()) {
3112 case CMD_CMD_CLEAR_TRACKING: {
3115 deserStatus = msg.deserialize(opCode);
3123 deserStatus = msg.deserialize(cmdSeq);
3142 #if FW_CMD_CHECK_RESIDUAL
3144 if (this->m_CmdStatus_OutputPort[0].isConnected()) {
3169 void CommandDispatcherComponentBase ::
3181 const U32 idBase = callComp->
getIdBase();
3185 switch (opCode - idBase) {
3187 compPtr->CMD_NO_OP_cmdHandlerBase(
3196 compPtr->CMD_NO_OP_STRING_cmdHandlerBase(
3205 compPtr->CMD_TEST_CMD_1_cmdHandlerBase(
3214 compPtr->CMD_CLEAR_TRACKING_cmdHandlerBase(
3228 void CommandDispatcherComponentBase ::
3237 compPtr->compCmdReg_handlerBase(
3243 void CommandDispatcherComponentBase ::
3254 compPtr->compCmdStat_handlerBase(
3262 void CommandDispatcherComponentBase ::
3271 compPtr->pingIn_handlerBase(
3277 void CommandDispatcherComponentBase ::
3287 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)
@ 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.
Fw::SerializeStatus deserialize(Fw::SerializeBufferBase &buffer)
Deserialize raw enum value from SerialType.
@ 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
void addCallPort(InputCmdPort *callPort)
Register an input port.
void invoke(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
Invoke a port interface.
void init()
Initialization function.
void addCallPort(InputCmdRegPort *callPort)
Register an input port.
void invoke(FwOpcodeType opCode)
Invoke a port interface.
void init()
Initialization function.
void init()
Initialization function.
void addCallPort(InputCmdResponsePort *callPort)
Register an input port.
void invoke(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response)
Invoke a port interface.
void init()
Initialization function.
void invoke(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args)
Invoke a port interface.
void addCallPort(InputLogPort *callPort)
Register an input port.
void addCallPort(InputTimePort *callPort)
Register an input port.
void invoke(Fw::Time &time)
Invoke a port interface.
void init()
Initialization function.
void addCallPort(InputTlmPort *callPort)
Register an input port.
void init()
Initialization function.
void invoke(FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)
Invoke a port interface.
Os::Queue::Status createQueue(FwSizeType depth, FwSizeType msgSize)
Os::Queue m_queue
queue object for active component
@ MSG_DISPATCH_OK
Dispatch was normal.
@ MSG_DISPATCH_EXIT
A message was sent requesting an exit of the loop.
@ MSG_DISPATCH_ERROR
Errors dispatching messages.
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
virtual const CHAR * toChar() const =0
void format(const CHAR *formatString,...)
write formatted string to buffer
virtual SerializeStatus serialize(SerializeBufferBase &buffer) const
serialization function
const char * toChar() const
void unLock()
unlock the mutex and assert success
void lock()
lock the mutex and assert success
Status send(const U8 *buffer, FwSizeType size, FwQueuePriorityType priority, BlockingType blockType) override
send a message into the queue through delegate
Status receive(U8 *destination, FwSizeType capacity, BlockingType blockType, FwSizeType &actualSize, FwQueuePriorityType &priority) override
receive a message from the queue through delegate
@ 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
void set_CmdStatus_OutputPort(FwIndexType portNum, Fw::InputCmdResponsePort *port)
Connect port to CmdStatus[portNum].
virtual void pingIn_preMsgHook(FwIndexType portNum, U32 key)
Pre-message hook for async input port pingIn.
void log_DIAGNOSTIC_OpCodeReregistered(U32 Opcode, I32 port)
bool isConnected_seqCmdStatus_OutputPort(FwIndexType portNum)
virtual void CMD_TEST_CMD_1_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command CMD_TEST_CMD_1.
FwIndexType getNum_Time_OutputPorts() const
void log_ACTIVITY_HI_TestCmd1Args(I32 arg1, F32 arg2, U8 arg3)
virtual void compCmdStat_handler(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response)=0
Handler for input port compCmdStat.
void log_ACTIVITY_HI_NoOpReceived()
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
void regCommands()
Register commands with the Command Dispatcher.
void CMD_NO_OP_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void log_DIAGNOSTIC_OpCodeRegistered(U32 Opcode, I32 port, I32 slot)
Log event OpCodeRegistered.
CommandDispatcherComponentBase(const char *compName="")
Construct CommandDispatcherComponentBase object.
FwIndexType getNum_compCmdReg_InputPorts() const
virtual void CMD_NO_OP_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command CMD_NO_OP.
bool isConnected_pingOut_OutputPort(FwIndexType portNum)
void log_COMMAND_OpCodeCompleted(U32 Opcode)
virtual void compCmdReg_handler(FwIndexType portNum, FwOpcodeType opCode)=0
Handler for input port compCmdReg.
@ EVENTID_OPCODEDISPATCHED
Op code dispatched event.
@ EVENTID_MALFORMEDCOMMAND
Received a malformed command packet.
@ EVENTID_INVALIDCOMMAND
Received an invalid opcode.
@ EVENTID_NOOPRECEIVED
The command dispatcher has successfully received a NO-OP command.
@ EVENTID_TOOMANYCOMMANDS
Exceeded the number of commands that can be simultaneously executed.
@ EVENTID_NOOPSTRINGRECEIVED
The command dispatcher has successfully received a NO-OP command from GUI with a string.
@ EVENTID_TESTCMD1ARGS
This log event message returns the TEST_CMD_1 arguments.
@ EVENTID_OPCODECOMPLETED
Op code completed event.
@ EVENTID_OPCODEREREGISTERED
Op code reregistered event.
@ EVENTID_OPCODEERROR
Op code completed with error event.
@ EVENTID_OPCODEREGISTERED
FwIndexType getNum_CmdReg_OutputPorts() const
void seqCmdBuff_handlerBase(FwIndexType portNum, Fw::ComBuffer &data, U32 context)
Handler base-class function for input port seqCmdBuff.
void set_Log_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to Log[portNum].
virtual void unLock()
Unlock the guarded mutex.
Fw::InputCmdResponsePort * get_compCmdStat_InputPort(FwIndexType portNum)
virtual void seqCmdBuff_preMsgHook(FwIndexType portNum, Fw::ComBuffer &data, U32 context)
Pre-message hook for async input port seqCmdBuff.
void tlmWrite_CommandErrors(U32 arg, Fw::Time _tlmTime=Fw::Time())
void set_Tlm_OutputPort(FwIndexType portNum, Fw::InputTlmPort *port)
Connect port to Tlm[portNum].
FwIndexType getNum_seqCmdBuff_InputPorts() const
virtual void pingIn_handler(FwIndexType portNum, U32 key)=0
Handler for input port pingIn.
FwIndexType getNum_CmdDisp_InputPorts() const
FwIndexType getNum_seqCmdStatus_OutputPorts() const
void compCmdReg_handlerBase(FwIndexType portNum, FwOpcodeType opCode)
Handler base-class function for input port compCmdReg.
void set_Time_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to Time[portNum].
bool isConnected_compCmdSend_OutputPort(FwIndexType portNum)
void log_WARNING_HI_MalformedCommand(Fw::DeserialStatus Status)
void log_ACTIVITY_HI_NoOpStringReceived(const Fw::StringBase &message)
void log_COMMAND_OpCodeDispatched(U32 Opcode, I32 port)
void set_seqCmdStatus_OutputPort(FwIndexType portNum, Fw::InputCmdResponsePort *port)
Connect port to seqCmdStatus[portNum].
void cmdResponse_out(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdResponse response)
Emit command response.
Svc::InputPingPort * get_pingIn_InputPort(FwIndexType portNum)
Fw::InputCmdRegPort * get_compCmdReg_InputPort(FwIndexType portNum)
void log_WARNING_HI_TooManyCommands(U32 Opcode)
Fw::InputCmdPort * get_CmdDisp_InputPort(FwIndexType portNum)
bool isConnected_CmdReg_OutputPort(FwIndexType portNum)
virtual void CMD_CLEAR_TRACKING_cmdHandler(FwOpcodeType opCode, U32 cmdSeq)=0
void compCmdStat_handlerBase(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response)
Handler base-class function for input port compCmdStat.
virtual void compCmdStat_preMsgHook(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response)
Pre-message hook for async input port compCmdStat.
virtual void CMD_NO_OP_STRING_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &arg1)=0
void set_CmdReg_OutputPort(FwIndexType portNum, Fw::InputCmdRegPort *port)
Connect port to CmdReg[portNum].
void pingOut_out(FwIndexType portNum, U32 key)
Invoke output port pingOut.
virtual void CMD_CLEAR_TRACKING_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command CMD_CLEAR_TRACKING.
void log_WARNING_HI_InvalidCommand(U32 Opcode)
virtual ~CommandDispatcherComponentBase()
Destroy CommandDispatcherComponentBase object.
FwIndexType getNum_Tlm_OutputPorts() const
virtual void CMD_NO_OP_cmdHandler(FwOpcodeType opCode, U32 cmdSeq)=0
void seqCmdStatus_out(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response)
Invoke output port seqCmdStatus.
void set_compCmdSend_OutputPort(FwIndexType portNum, Fw::InputCmdPort *port)
Connect port to compCmdSend[portNum].
bool isConnected_CmdStatus_OutputPort(FwIndexType portNum)
@ CHANNELID_COMMANDSDISPATCHED
Channel ID for CommandsDispatched.
@ CHANNELID_COMMANDERRORS
Channel ID for CommandErrors.
void compCmdSend_out(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
Invoke output port compCmdSend.
virtual void seqCmdBuff_handler(FwIndexType portNum, Fw::ComBuffer &data, U32 context)=0
Handler for input port seqCmdBuff.
void CMD_TEST_CMD_1_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
bool isConnected_Tlm_OutputPort(FwIndexType portNum)
FwIndexType getNum_pingIn_InputPorts() const
void tlmWrite_CommandsDispatched(U32 arg, Fw::Time _tlmTime=Fw::Time())
FwIndexType getNum_pingOut_OutputPorts() const
void set_pingOut_OutputPort(FwIndexType portNum, Svc::InputPingPort *port)
Connect port to pingOut[portNum].
void CMD_NO_OP_STRING_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
FwIndexType getNum_Log_OutputPorts() const
bool isConnected_Time_OutputPort(FwIndexType portNum)
virtual void lock()
Lock the guarded mutex.
void CMD_CLEAR_TRACKING_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
virtual void CMD_TEST_CMD_1_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, I32 arg1, F32 arg2, U8 arg3)=0
@ OPCODE_CMD_NO_OP
No-op command.
@ OPCODE_CMD_NO_OP_STRING
No-op string command.
@ OPCODE_CMD_CLEAR_TRACKING
Clear command tracking info to recover from components not returning status.
@ OPCODE_CMD_TEST_CMD_1
No-op command.
FwIndexType getNum_compCmdStat_InputPorts() const
Fw::InputComPort * get_seqCmdBuff_InputPort(FwIndexType portNum)
void log_COMMAND_OpCodeError(U32 Opcode, Fw::CmdResponse error)
void pingIn_handlerBase(FwIndexType portNum, U32 key)
Handler base-class function for input port pingIn.
bool isConnected_Log_OutputPort(FwIndexType portNum)
FwIndexType getNum_CmdStatus_OutputPorts() const
void invoke(U32 key)
Invoke a port interface.
void init()
Initialization function.
void addCallPort(InputPingPort *callPort)
Register an input port.
SerializeStatus
forward declaration for string
@ FW_SERIALIZE_OK
Serialization/Deserialization operation was successful.
Status
Generic OK/ERROR status.
@ OP_OK
Operation succeeded.