11 #if FW_ENABLE_TEXT_LOGGING
20 COMPCMDSTAT_CMDRESPONSE,
26 CMD_CMD_CLEAR_TRACKING,
40 class ComponentIpcSerializableBuffer :
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
114 this->m_CmdDisp_InputPort[port].setObjName(portName);
124 this->m_compCmdReg_InputPort[port].
init();
129 this->m_compCmdReg_InputPort[port].
setPortNum(port);
131 #if FW_OBJECT_NAMES == 1
146 this->m_compCmdReg_InputPort[port].setObjName(portName);
156 this->m_compCmdStat_InputPort[port].
init();
161 this->m_compCmdStat_InputPort[port].
setPortNum(port);
163 #if FW_OBJECT_NAMES == 1
178 this->m_compCmdStat_InputPort[port].setObjName(portName);
188 this->m_pingIn_InputPort[port].
init();
193 this->m_pingIn_InputPort[port].
setPortNum(port);
195 #if FW_OBJECT_NAMES == 1
210 this->m_pingIn_InputPort[port].setObjName(portName);
220 this->m_seqCmdBuff_InputPort[port].
init();
225 this->m_seqCmdBuff_InputPort[port].
setPortNum(port);
227 #if FW_OBJECT_NAMES == 1
242 this->m_seqCmdBuff_InputPort[port].setObjName(portName);
252 this->m_CmdReg_OutputPort[port].
init();
254 #if FW_OBJECT_NAMES == 1
269 this->m_CmdReg_OutputPort[port].setObjName(portName);
279 this->m_CmdStatus_OutputPort[port].
init();
281 #if FW_OBJECT_NAMES == 1
296 this->m_CmdStatus_OutputPort[port].setObjName(portName);
306 this->m_Log_OutputPort[port].
init();
308 #if FW_OBJECT_NAMES == 1
323 this->m_Log_OutputPort[port].setObjName(portName);
327 #if FW_ENABLE_TEXT_LOGGING == 1
331 port < static_cast<PlatformIntType>(this->getNum_LogText_OutputPorts());
334 this->m_LogText_OutputPort[port].
init();
336 #if FW_OBJECT_NAMES == 1
351 this->m_LogText_OutputPort[port].setObjName(portName);
362 this->m_Time_OutputPort[port].
init();
364 #if FW_OBJECT_NAMES == 1
379 this->m_Time_OutputPort[port].setObjName(portName);
389 this->m_Tlm_OutputPort[port].
init();
391 #if FW_OBJECT_NAMES == 1
406 this->m_Tlm_OutputPort[port].setObjName(portName);
416 this->m_compCmdSend_OutputPort[port].
init();
418 #if FW_OBJECT_NAMES == 1
433 this->m_compCmdSend_OutputPort[port].setObjName(portName);
443 this->m_pingOut_OutputPort[port].
init();
445 #if FW_OBJECT_NAMES == 1
460 this->m_pingOut_OutputPort[port].setObjName(portName);
470 this->m_seqCmdStatus_OutputPort[port].
init();
472 #if FW_OBJECT_NAMES == 1
487 this->m_seqCmdStatus_OutputPort[port].setObjName(portName);
493 ComponentIpcSerializableBuffer::SERIALIZATION_SIZE
513 return &this->m_CmdDisp_InputPort[portNum];
528 return &this->m_compCmdReg_InputPort[portNum];
539 return &this->m_compCmdStat_InputPort[portNum];
550 return &this->m_pingIn_InputPort[portNum];
561 return &this->m_seqCmdBuff_InputPort[portNum];
579 this->m_CmdReg_OutputPort[portNum].
addCallPort(port);
593 this->m_CmdStatus_OutputPort[portNum].
addCallPort(port);
610 #if FW_ENABLE_TEXT_LOGGING == 1
612 void CommandDispatcherComponentBase ::
613 set_LogText_OutputPort(
619 portNum < this->getNum_LogText_OutputPorts(),
623 this->m_LogText_OutputPort[portNum].addCallPort(port);
639 this->m_Time_OutputPort[portNum].
addCallPort(port);
671 this->m_compCmdSend_OutputPort[portNum].
addCallPort(port);
685 this->m_pingOut_OutputPort[portNum].
addCallPort(port);
699 this->m_seqCmdStatus_OutputPort[portNum].
addCallPort(port);
702 #if FW_PORT_SERIALIZATION
711 Fw::InputSerializePort* port
719 this->m_CmdReg_OutputPort[portNum].registerSerialPort(port);
725 Fw::InputSerializePort* port
733 this->m_CmdStatus_OutputPort[portNum].registerSerialPort(port);
739 Fw::InputSerializePort* port
747 this->m_Log_OutputPort[portNum].registerSerialPort(port);
750 #if FW_ENABLE_TEXT_LOGGING == 1
752 void CommandDispatcherComponentBase ::
753 set_LogText_OutputPort(
755 Fw::InputSerializePort* port
759 portNum < this->getNum_LogText_OutputPorts(),
763 this->m_LogText_OutputPort[portNum].registerSerialPort(port);
771 Fw::InputSerializePort* port
779 this->m_Time_OutputPort[portNum].registerSerialPort(port);
785 Fw::InputSerializePort* port
793 this->m_Tlm_OutputPort[portNum].registerSerialPort(port);
798 #if FW_PORT_SERIALIZATION
807 Fw::InputSerializePort* port
815 this->m_compCmdSend_OutputPort[portNum].registerSerialPort(port);
821 Fw::InputSerializePort* port
829 this->m_pingOut_OutputPort[portNum].registerSerialPort(port);
835 Fw::InputSerializePort* port
843 this->m_seqCmdStatus_OutputPort[portNum].registerSerialPort(port);
855 FW_ASSERT(this->m_CmdReg_OutputPort[0].isConnected());
857 this->m_CmdReg_OutputPort[0].
invoke(
861 this->m_CmdReg_OutputPort[0].
invoke(
865 this->m_CmdReg_OutputPort[0].
invoke(
869 this->m_CmdReg_OutputPort[0].
invoke(
880 Fw::ActiveComponentBase(compName)
883 this->m_first_update_CommandsDispatched =
true;
884 this->m_last_CommandsDispatched = 0;
887 this->m_first_update_CommandErrors =
true;
888 this->m_last_CommandErrors = 0;
957 #if FW_ENABLE_TEXT_LOGGING == 1
960 getNum_LogText_OutputPorts()
const
1013 return this->m_CmdReg_OutputPort[portNum].
isConnected();
1024 return this->m_CmdStatus_OutputPort[portNum].
isConnected();
1035 return this->m_Log_OutputPort[portNum].
isConnected();
1038 #if FW_ENABLE_TEXT_LOGGING == 1
1040 bool CommandDispatcherComponentBase ::
1044 portNum < this->getNum_LogText_OutputPorts(),
1048 return this->m_LogText_OutputPort[portNum].isConnected();
1061 return this->m_Time_OutputPort[portNum].
isConnected();
1072 return this->m_Tlm_OutputPort[portNum].
isConnected();
1087 return this->m_compCmdSend_OutputPort[portNum].
isConnected();
1098 return this->m_pingOut_OutputPort[portNum].
isConnected();
1109 return this->m_seqCmdStatus_OutputPort[portNum].
isConnected();
1164 ComponentIpcSerializableBuffer msg;
1168 _status = msg.serialize(
1177 _status = msg.serialize(portNum);
1184 _status = msg.serialize(opCode);
1191 _status = msg.serialize(cmdSeq);
1198 _status = msg.serialize(response);
1231 ComponentIpcSerializableBuffer msg;
1235 _status = msg.serialize(
1244 _status = msg.serialize(portNum);
1251 _status = msg.serialize(key);
1286 ComponentIpcSerializableBuffer msg;
1290 _status = msg.serialize(
1299 _status = msg.serialize(portNum);
1306 _status = msg.serialize(data);
1313 _status = msg.serialize(context);
1383 this->m_compCmdSend_OutputPort[portNum].
invoke(
1400 this->m_pingOut_OutputPort[portNum].
invoke(
1417 this->m_seqCmdStatus_OutputPort[portNum].
invoke(
1435 FW_ASSERT(this->m_CmdStatus_OutputPort[0].isConnected());
1436 this->m_CmdStatus_OutputPort[0].
invoke(opCode, cmdSeq, response);
1457 ComponentIpcSerializableBuffer msg;
1470 _status = msg.serialize(port);
1476 _status = msg.serialize(opCode);
1482 _status = msg.serialize(cmdSeq);
1488 _status = msg.serialize(args);
1516 ComponentIpcSerializableBuffer msg;
1520 _status = msg.serialize(
static_cast<NATIVE_INT_TYPE>(CMD_CMD_NO_OP_STRING));
1529 _status = msg.serialize(port);
1535 _status = msg.serialize(opCode);
1541 _status = msg.serialize(cmdSeq);
1547 _status = msg.serialize(args);
1575 ComponentIpcSerializableBuffer msg;
1579 _status = msg.serialize(
static_cast<NATIVE_INT_TYPE>(CMD_CMD_TEST_CMD_1));
1588 _status = msg.serialize(port);
1594 _status = msg.serialize(opCode);
1600 _status = msg.serialize(cmdSeq);
1606 _status = msg.serialize(args);
1634 ComponentIpcSerializableBuffer msg;
1638 _status = msg.serialize(
static_cast<NATIVE_INT_TYPE>(CMD_CMD_CLEAR_TRACKING));
1647 _status = msg.serialize(port);
1653 _status = msg.serialize(opCode);
1659 _status = msg.serialize(cmdSeq);
1665 _status = msg.serialize(args);
1746 if (this->m_Time_OutputPort[0].isConnected()) {
1747 this->m_Time_OutputPort[0].
invoke(_logTime);
1755 if (this->m_Log_OutputPort[0].isConnected()) {
1759 #if FW_AMPCS_COMPATIBLE
1768 #if FW_AMPCS_COMPATIBLE
1771 static_cast<U8>(
sizeof(U32))
1784 #if FW_AMPCS_COMPATIBLE
1787 static_cast<U8>(
sizeof(I32))
1800 #if FW_AMPCS_COMPATIBLE
1803 static_cast<U8>(
sizeof(I32))
1816 this->m_Log_OutputPort[0].
invoke(
1825 #if FW_ENABLE_TEXT_LOGGING
1826 if (this->m_LogText_OutputPort[0].isConnected()) {
1827 #if FW_OBJECT_NAMES == 1
1828 const char* _formatString =
1829 "(%s) %s: Opcode 0x%" PRIx32
" registered to port %" PRIi32
" slot %" PRIi32
"";
1831 const char* _formatString =
1832 "%s: Opcode 0x%" PRIx32
" registered to port %" PRIi32
" slot %" PRIi32
"";
1844 "OpCodeRegistered ",
1853 this->m_LogText_OutputPort[0].invoke(
1871 if (this->m_Time_OutputPort[0].isConnected()) {
1872 this->m_Time_OutputPort[0].
invoke(_logTime);
1880 if (this->m_Log_OutputPort[0].isConnected()) {
1884 #if FW_AMPCS_COMPATIBLE
1893 #if FW_AMPCS_COMPATIBLE
1896 static_cast<U8>(
sizeof(U32))
1909 #if FW_AMPCS_COMPATIBLE
1912 static_cast<U8>(
sizeof(I32))
1925 this->m_Log_OutputPort[0].
invoke(
1934 #if FW_ENABLE_TEXT_LOGGING
1935 if (this->m_LogText_OutputPort[0].isConnected()) {
1936 #if FW_OBJECT_NAMES == 1
1937 const char* _formatString =
1938 "(%s) %s: Opcode 0x%" PRIx32
" dispatched to port %" PRIi32
"";
1940 const char* _formatString =
1941 "%s: Opcode 0x%" PRIx32
" dispatched to port %" PRIi32
"";
1953 "OpCodeDispatched ",
1961 this->m_LogText_OutputPort[0].invoke(
1976 if (this->m_Time_OutputPort[0].isConnected()) {
1977 this->m_Time_OutputPort[0].
invoke(_logTime);
1985 if (this->m_Log_OutputPort[0].isConnected()) {
1989 #if FW_AMPCS_COMPATIBLE
1998 #if FW_AMPCS_COMPATIBLE
2001 static_cast<U8>(
sizeof(U32))
2014 this->m_Log_OutputPort[0].
invoke(
2023 #if FW_ENABLE_TEXT_LOGGING
2024 if (this->m_LogText_OutputPort[0].isConnected()) {
2025 #if FW_OBJECT_NAMES == 1
2026 const char* _formatString =
2027 "(%s) %s: Opcode 0x%" PRIx32
" completed";
2029 const char* _formatString =
2030 "%s: Opcode 0x%" PRIx32
" completed";
2049 this->m_LogText_OutputPort[0].invoke(
2067 if (this->m_Time_OutputPort[0].isConnected()) {
2068 this->m_Time_OutputPort[0].
invoke(_logTime);
2076 if (this->m_Log_OutputPort[0].isConnected()) {
2080 #if FW_AMPCS_COMPATIBLE
2089 #if FW_AMPCS_COMPATIBLE
2092 static_cast<U8>(
sizeof(U32))
2105 #if FW_AMPCS_COMPATIBLE
2121 this->m_Log_OutputPort[0].
invoke(
2130 #if FW_ENABLE_TEXT_LOGGING
2131 if (this->m_LogText_OutputPort[0].isConnected()) {
2132 #if FW_OBJECT_NAMES == 1
2133 const char* _formatString =
2134 "(%s) %s: Opcode 0x%" PRIx32
" completed with error %s";
2136 const char* _formatString =
2137 "%s: Opcode 0x%" PRIx32
" completed with error %s";
2143 error.toString(errorStr);
2160 this->m_LogText_OutputPort[0].invoke(
2175 if (this->m_Time_OutputPort[0].isConnected()) {
2176 this->m_Time_OutputPort[0].
invoke(_logTime);
2184 if (this->m_Log_OutputPort[0].isConnected()) {
2188 #if FW_AMPCS_COMPATIBLE
2197 #if FW_AMPCS_COMPATIBLE
2213 this->m_Log_OutputPort[0].
invoke(
2222 #if FW_ENABLE_TEXT_LOGGING
2223 if (this->m_LogText_OutputPort[0].isConnected()) {
2224 #if FW_OBJECT_NAMES == 1
2225 const char* _formatString =
2226 "(%s) %s: Received malformed command packet. Status: %s";
2228 const char* _formatString =
2229 "%s: Received malformed command packet. Status: %s";
2235 Status.toString(StatusStr);
2244 "MalformedCommand ",
2251 this->m_LogText_OutputPort[0].invoke(
2266 if (this->m_Time_OutputPort[0].isConnected()) {
2267 this->m_Time_OutputPort[0].
invoke(_logTime);
2275 if (this->m_Log_OutputPort[0].isConnected()) {
2279 #if FW_AMPCS_COMPATIBLE
2288 #if FW_AMPCS_COMPATIBLE
2291 static_cast<U8>(
sizeof(U32))
2304 this->m_Log_OutputPort[0].
invoke(
2313 #if FW_ENABLE_TEXT_LOGGING
2314 if (this->m_LogText_OutputPort[0].isConnected()) {
2315 #if FW_OBJECT_NAMES == 1
2316 const char* _formatString =
2317 "(%s) %s: Invalid opcode 0x%" PRIx32
" received";
2319 const char* _formatString =
2320 "%s: Invalid opcode 0x%" PRIx32
" received";
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
2376 #if FW_AMPCS_COMPATIBLE
2379 static_cast<U8>(
sizeof(U32))
2392 this->m_Log_OutputPort[0].
invoke(
2401 #if FW_ENABLE_TEXT_LOGGING
2402 if (this->m_LogText_OutputPort[0].isConnected()) {
2403 #if FW_OBJECT_NAMES == 1
2404 const char* _formatString =
2405 "(%s) %s: Too many outstanding commands. opcode=0x%" PRIx32
"";
2407 const char* _formatString =
2408 "%s: Too many outstanding commands. opcode=0x%" PRIx32
"";
2427 this->m_LogText_OutputPort[0].invoke(
2442 if (this->m_Time_OutputPort[0].isConnected()) {
2443 this->m_Time_OutputPort[0].
invoke(_logTime);
2451 if (this->m_Log_OutputPort[0].isConnected()) {
2454 #if FW_AMPCS_COMPATIBLE
2464 this->m_Log_OutputPort[0].
invoke(
2473 #if FW_ENABLE_TEXT_LOGGING
2474 if (this->m_LogText_OutputPort[0].isConnected()) {
2475 #if FW_OBJECT_NAMES == 1
2476 const char* _formatString =
2477 "(%s) %s: Received a NO-OP command";
2479 const char* _formatString =
2480 "%s: Received a NO-OP command";
2498 this->m_LogText_OutputPort[0].invoke(
2513 if (this->m_Time_OutputPort[0].isConnected()) {
2514 this->m_Time_OutputPort[0].
invoke(_logTime);
2522 if (this->m_Log_OutputPort[0].isConnected()) {
2526 #if FW_AMPCS_COMPATIBLE
2535 _status = message.
serialize(_logBuff, 40);
2541 this->m_Log_OutputPort[0].
invoke(
2550 #if FW_ENABLE_TEXT_LOGGING
2551 if (this->m_LogText_OutputPort[0].isConnected()) {
2552 #if FW_OBJECT_NAMES == 1
2553 const char* _formatString =
2554 "(%s) %s: Received a NO-OP string=%s";
2556 const char* _formatString =
2557 "%s: Received a NO-OP string=%s";
2569 "NoOpStringReceived ",
2576 this->m_LogText_OutputPort[0].invoke(
2595 if (this->m_Time_OutputPort[0].isConnected()) {
2596 this->m_Time_OutputPort[0].
invoke(_logTime);
2604 if (this->m_Log_OutputPort[0].isConnected()) {
2608 #if FW_AMPCS_COMPATIBLE
2617 #if FW_AMPCS_COMPATIBLE
2620 static_cast<U8>(
sizeof(I32))
2633 #if FW_AMPCS_COMPATIBLE
2636 static_cast<U8>(
sizeof(
F32))
2649 #if FW_AMPCS_COMPATIBLE
2652 static_cast<U8>(
sizeof(
U8))
2665 this->m_Log_OutputPort[0].
invoke(
2674 #if FW_ENABLE_TEXT_LOGGING
2675 if (this->m_LogText_OutputPort[0].isConnected()) {
2676 #if FW_OBJECT_NAMES == 1
2677 const char* _formatString =
2678 "(%s) %s: TEST_CMD_1 args: I32: %" PRIi32
", F32: %f, U8: %" PRIu8
"";
2680 const char* _formatString =
2681 "%s: TEST_CMD_1 args: I32: %" PRIi32
", F32: %f, U8: %" PRIu8
"";
2702 this->m_LogText_OutputPort[0].invoke(
2720 if (this->m_Time_OutputPort[0].isConnected()) {
2721 this->m_Time_OutputPort[0].
invoke(_logTime);
2729 if (this->m_Log_OutputPort[0].isConnected()) {
2733 #if FW_AMPCS_COMPATIBLE
2742 #if FW_AMPCS_COMPATIBLE
2745 static_cast<U8>(
sizeof(U32))
2758 #if FW_AMPCS_COMPATIBLE
2761 static_cast<U8>(
sizeof(I32))
2774 this->m_Log_OutputPort[0].
invoke(
2783 #if FW_ENABLE_TEXT_LOGGING
2784 if (this->m_LogText_OutputPort[0].isConnected()) {
2785 #if FW_OBJECT_NAMES == 1
2786 const char* _formatString =
2787 "(%s) %s: Opcode 0x%" PRIx32
" is already registered to port %" PRIi32
"";
2789 const char* _formatString =
2790 "%s: Opcode 0x%" PRIx32
" is already registered to port %" PRIi32
"";
2802 "OpCodeReregistered ",
2810 this->m_LogText_OutputPort[0].invoke(
2831 if (not this->m_first_update_CommandsDispatched) {
2833 if (arg == this->m_last_CommandsDispatched) {
2837 this->m_last_CommandsDispatched = arg;
2841 this->m_first_update_CommandsDispatched =
false;
2842 this->m_last_CommandsDispatched = arg;
2845 if (this->m_Tlm_OutputPort[0].isConnected()) {
2847 this->m_Time_OutputPort[0].isConnected() &&
2850 this->m_Time_OutputPort[0].
invoke(_tlmTime);
2864 this->m_Tlm_OutputPort[0].
invoke(
2879 if (not this->m_first_update_CommandErrors) {
2881 if (arg == this->m_last_CommandErrors) {
2885 this->m_last_CommandErrors = arg;
2889 this->m_first_update_CommandErrors =
false;
2890 this->m_last_CommandErrors = arg;
2893 if (this->m_Tlm_OutputPort[0].isConnected()) {
2895 this->m_Time_OutputPort[0].isConnected() &&
2898 this->m_Time_OutputPort[0].
invoke(_tlmTime);
2912 this->m_Tlm_OutputPort[0].
invoke(
2927 if (this->m_Time_OutputPort[0].isConnected()) {
2929 this->m_Time_OutputPort[0].
invoke(_time);
2947 this->m_guardedPortMutex.
lock();
2953 this->m_guardedPortMutex.
unLock();
2963 ComponentIpcSerializableBuffer msg;
2986 MsgTypeEnum msgType =
static_cast<MsgTypeEnum
>(desMsg);
2988 if (msgType == COMMANDDISPATCHER_COMPONENT_EXIT) {
2993 deserStatus = msg.deserialize(portNum);
3001 case COMPCMDSTAT_CMDRESPONSE: {
3004 deserStatus = msg.deserialize(opCode);
3012 deserStatus = msg.deserialize(cmdSeq);
3040 deserStatus = msg.deserialize(key);
3055 case SEQCMDBUFF_COM: {
3066 deserStatus = msg.deserialize(context);
3082 case CMD_CMD_NO_OP: {
3085 deserStatus = msg.deserialize(opCode);
3093 deserStatus = msg.deserialize(cmdSeq);
3112 #if FW_CMD_CHECK_RESIDUAL
3114 if (this->m_CmdStatus_OutputPort[0].isConnected()) {
3129 case CMD_CMD_NO_OP_STRING: {
3132 deserStatus = msg.deserialize(opCode);
3140 deserStatus = msg.deserialize(cmdSeq);
3161 if (this->m_CmdStatus_OutputPort[0].isConnected()) {
3174 #if FW_CMD_CHECK_RESIDUAL
3176 if (this->m_CmdStatus_OutputPort[0].isConnected()) {
3194 case CMD_CMD_TEST_CMD_1: {
3197 deserStatus = msg.deserialize(opCode);
3205 deserStatus = msg.deserialize(cmdSeq);
3226 if (this->m_CmdStatus_OutputPort[0].isConnected()) {
3241 if (this->m_CmdStatus_OutputPort[0].isConnected()) {
3256 if (this->m_CmdStatus_OutputPort[0].isConnected()) {
3269 #if FW_CMD_CHECK_RESIDUAL
3271 if (this->m_CmdStatus_OutputPort[0].isConnected()) {
3291 case CMD_CMD_CLEAR_TRACKING: {
3294 deserStatus = msg.deserialize(opCode);
3302 deserStatus = msg.deserialize(cmdSeq);
3321 #if FW_CMD_CHECK_RESIDUAL
3323 if (this->m_CmdStatus_OutputPort[0].isConnected()) {
3348 void CommandDispatcherComponentBase ::
3360 const U32 idBase = callComp->
getIdBase();
3361 FW_ASSERT(opCode >= idBase, opCode, idBase);
3364 switch (opCode - idBase) {
3366 compPtr->CMD_NO_OP_cmdHandlerBase(
3375 compPtr->CMD_NO_OP_STRING_cmdHandlerBase(
3384 compPtr->CMD_TEST_CMD_1_cmdHandlerBase(
3393 compPtr->CMD_CLEAR_TRACKING_cmdHandlerBase(
3407 void CommandDispatcherComponentBase ::
3416 compPtr->compCmdReg_handlerBase(
3422 void CommandDispatcherComponentBase ::
3433 compPtr->compCmdStat_handlerBase(
3441 void CommandDispatcherComponentBase ::
3450 compPtr->pingIn_handlerBase(
3456 void CommandDispatcherComponentBase ::
3466 compPtr->seqCmdBuff_handlerBase(
PlatformIntType NATIVE_INT_TYPE
float F32
32-bit floating point
uint8_t U8
8-bit unsigned integer
#define FW_NUM_ARRAY_ELEMENTS(a)
number of elements in an array
PlatformUIntType NATIVE_UINT_TYPE
int PlatformIntType
DefaultTypes.hpp provides fallback defaults for the platform types.
#define PRI_PlatformIntType
@ TB_NONE
No time base has been established.
PlatformAssertArgType FwAssertArgType
#define FW_LOG_TEXT_BUFFER_SIZE
Max size of string for text log message.
#define FW_OBJ_NAME_MAX_SIZE
Size of object name (if object names enabled). AC Limits to 80, truncation occurs above 80.
#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.
const char * toChar() const override
SerializeStatus serialize(SerializeBufferBase &buffer) const override
serialization function
void init()
Object initializer.
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::QueueStatus createQueue(NATIVE_INT_TYPE depth, NATIVE_INT_TYPE 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 getBuffLeft() const
returns how much deserialization buffer is left
void resetDeser()
reset deserialization to beginning
SerializeStatus deserialize(U8 &val)
deserialize 8-bit unsigned int
SerializeStatus serialize(U8 val)
serialize 8-bit unsigned int
const char * toChar() const
gets char buffer
void unLock()
unlock the mutex
void lock()
lock the mutex
@ QUEUE_OK
message sent/received okay
QueueStatus send(const Fw::SerializeBufferBase &buffer, NATIVE_INT_TYPE priority, QueueBlocking block)
send a message
QueueStatus receive(Fw::SerializeBufferBase &buffer, NATIVE_INT_TYPE &priority, QueueBlocking block)
receive a message
@ QUEUE_BLOCKING
Queue receive blocks until a message arrives.
@ QUEUE_NONBLOCKING
Queue receive always returns even if there is no message.
void log_DIAGNOSTIC_OpCodeReregistered(U32 Opcode, I32 port)
NATIVE_INT_TYPE getNum_compCmdSend_OutputPorts() const
void compCmdSend_out(NATIVE_INT_TYPE portNum, FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
Invoke output port compCmdSend.
virtual void CMD_TEST_CMD_1_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command CMD_TEST_CMD_1.
void log_ACTIVITY_HI_TestCmd1Args(I32 arg1, F32 arg2, U8 arg3)
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.
void set_Tlm_OutputPort(NATIVE_INT_TYPE portNum, Fw::InputTlmPort *port)
Connect port to Tlm[portNum].
void regCommands()
Register commands with the Command Dispatcher.
void CMD_NO_OP_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
NATIVE_INT_TYPE getNum_Log_OutputPorts() const
void log_DIAGNOSTIC_OpCodeRegistered(U32 Opcode, I32 port, I32 slot)
Log event OpCodeRegistered.
CommandDispatcherComponentBase(const char *compName="")
Construct CommandDispatcherComponentBase object.
virtual void CMD_NO_OP_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command CMD_NO_OP.
void log_COMMAND_OpCodeCompleted(U32 Opcode)
bool isConnected_compCmdSend_OutputPort(NATIVE_INT_TYPE portNum)
NATIVE_INT_TYPE getNum_pingOut_OutputPorts() const
virtual void unLock()
Unlock the guarded mutex.
void pingIn_handlerBase(NATIVE_INT_TYPE portNum, U32 key)
Handler base-class function for input port pingIn.
void set_seqCmdStatus_OutputPort(NATIVE_INT_TYPE portNum, Fw::InputCmdResponsePort *port)
Connect port to seqCmdStatus[portNum].
virtual void pingIn_handler(NATIVE_INT_TYPE portNum, U32 key)=0
Handler for input port pingIn.
void tlmWrite_CommandErrors(U32 arg, Fw::Time _tlmTime=Fw::Time())
bool isConnected_Tlm_OutputPort(NATIVE_INT_TYPE portNum)
virtual void pingIn_preMsgHook(NATIVE_INT_TYPE portNum, U32 key)
Pre-message hook for async input port pingIn.
NATIVE_INT_TYPE getNum_CmdReg_OutputPorts() const
virtual void compCmdStat_preMsgHook(NATIVE_INT_TYPE portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response)
Pre-message hook for async input port compCmdStat.
virtual void seqCmdBuff_handler(NATIVE_INT_TYPE portNum, Fw::ComBuffer &data, U32 context)=0
Handler for input port seqCmdBuff.
void seqCmdStatus_out(NATIVE_INT_TYPE portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response)
Invoke output port seqCmdStatus.
virtual void compCmdReg_handler(NATIVE_INT_TYPE portNum, FwOpcodeType opCode)=0
Handler for input port compCmdReg.
void compCmdReg_handlerBase(NATIVE_INT_TYPE portNum, FwOpcodeType opCode)
Handler base-class function for input port compCmdReg.
Fw::InputCmdRegPort * get_compCmdReg_InputPort(NATIVE_INT_TYPE portNum)
void set_Time_OutputPort(NATIVE_INT_TYPE portNum, Fw::InputTimePort *port)
Connect port to Time[portNum].
void log_WARNING_HI_MalformedCommand(Fw::DeserialStatus Status)
@ 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
void pingOut_out(NATIVE_INT_TYPE portNum, U32 key)
Invoke output port pingOut.
NATIVE_INT_TYPE getNum_compCmdReg_InputPorts() const
void log_COMMAND_OpCodeDispatched(U32 Opcode, I32 port)
void set_CmdStatus_OutputPort(NATIVE_INT_TYPE portNum, Fw::InputCmdResponsePort *port)
Connect port to CmdStatus[portNum].
@ CHANNELID_COMMANDSDISPATCHED
Channel ID for CommandsDispatched.
@ CHANNELID_COMMANDERRORS
Channel ID for CommandErrors.
virtual void seqCmdBuff_preMsgHook(NATIVE_INT_TYPE portNum, Fw::ComBuffer &data, U32 context)
Pre-message hook for async input port seqCmdBuff.
void cmdResponse_out(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdResponse response)
Emit command response.
NATIVE_INT_TYPE getNum_seqCmdStatus_OutputPorts() const
Svc::InputPingPort * get_pingIn_InputPort(NATIVE_INT_TYPE portNum)
void log_WARNING_HI_TooManyCommands(U32 Opcode)
void compCmdStat_handlerBase(NATIVE_INT_TYPE portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response)
Handler base-class function for input port compCmdStat.
NATIVE_INT_TYPE getNum_compCmdStat_InputPorts() const
virtual void CMD_CLEAR_TRACKING_cmdHandler(FwOpcodeType opCode, U32 cmdSeq)=0
Fw::InputCmdResponsePort * get_compCmdStat_InputPort(NATIVE_INT_TYPE portNum)
NATIVE_INT_TYPE getNum_pingIn_InputPorts() const
void set_compCmdSend_OutputPort(NATIVE_INT_TYPE portNum, Fw::InputCmdPort *port)
Connect port to compCmdSend[portNum].
virtual void CMD_NO_OP_STRING_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &arg1)=0
void set_CmdReg_OutputPort(NATIVE_INT_TYPE portNum, Fw::InputCmdRegPort *port)
Connect port to CmdReg[portNum].
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.
void set_Log_OutputPort(NATIVE_INT_TYPE portNum, Fw::InputLogPort *port)
Connect port to Log[portNum].
virtual void CMD_NO_OP_cmdHandler(FwOpcodeType opCode, U32 cmdSeq)=0
bool isConnected_CmdReg_OutputPort(NATIVE_INT_TYPE portNum)
bool isConnected_Log_OutputPort(NATIVE_INT_TYPE portNum)
bool isConnected_CmdStatus_OutputPort(NATIVE_INT_TYPE portNum)
bool isConnected_Time_OutputPort(NATIVE_INT_TYPE portNum)
NATIVE_INT_TYPE getNum_CmdStatus_OutputPorts() const
Fw::InputCmdPort * get_CmdDisp_InputPort(NATIVE_INT_TYPE portNum)
void CMD_TEST_CMD_1_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
NATIVE_INT_TYPE getNum_Time_OutputPorts() const
void tlmWrite_CommandsDispatched(U32 arg, Fw::Time _tlmTime=Fw::Time())
void set_pingOut_OutputPort(NATIVE_INT_TYPE portNum, Svc::InputPingPort *port)
Connect port to pingOut[portNum].
NATIVE_INT_TYPE getNum_Tlm_OutputPorts() const
void CMD_NO_OP_STRING_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void seqCmdBuff_handlerBase(NATIVE_INT_TYPE portNum, Fw::ComBuffer &data, U32 context)
Handler base-class function for input port seqCmdBuff.
virtual void lock()
Lock the guarded mutex.
void CMD_CLEAR_TRACKING_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
NATIVE_INT_TYPE getNum_seqCmdBuff_InputPorts() const
bool isConnected_pingOut_OutputPort(NATIVE_INT_TYPE portNum)
virtual void CMD_TEST_CMD_1_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, I32 arg1, F32 arg2, U8 arg3)=0
NATIVE_INT_TYPE getNum_CmdDisp_InputPorts() const
void log_ACTIVITY_HI_NoOpStringReceived(const Fw::LogStringArg &message)
@ 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.
bool isConnected_seqCmdStatus_OutputPort(NATIVE_INT_TYPE portNum)
void log_COMMAND_OpCodeError(U32 Opcode, Fw::CmdResponse error)
Fw::InputComPort * get_seqCmdBuff_InputPort(NATIVE_INT_TYPE portNum)
virtual void compCmdStat_handler(NATIVE_INT_TYPE portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response)=0
Handler for input port compCmdStat.
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.