10 #if FW_ENABLE_TEXT_LOGGING
35 class ComponentIpcSerializableBuffer :
50 return sizeof(m_buff);
57 const U8* getBuffAddr()
const {
63 U8 m_buff[SERIALIZATION_SIZE];
87 this->m_cmdIn_InputPort[port].
init();
92 this->m_cmdIn_InputPort[port].
setPortNum(port);
94 #if FW_OBJECT_NAMES == 1
98 this->m_objName.toChar(),
101 this->m_cmdIn_InputPort[port].setObjName(portName.
toChar());
111 this->m_Run_InputPort[port].
init();
118 #if FW_OBJECT_NAMES == 1
122 this->m_objName.toChar(),
125 this->m_Run_InputPort[port].setObjName(portName.
toChar());
135 this->m_TlmRecv_InputPort[port].
init();
140 this->m_TlmRecv_InputPort[port].
setPortNum(port);
142 #if FW_OBJECT_NAMES == 1
146 this->m_objName.toChar(),
149 this->m_TlmRecv_InputPort[port].setObjName(portName.
toChar());
159 this->m_pingIn_InputPort[port].
init();
164 this->m_pingIn_InputPort[port].
setPortNum(port);
166 #if FW_OBJECT_NAMES == 1
170 this->m_objName.toChar(),
173 this->m_pingIn_InputPort[port].setObjName(portName.
toChar());
183 this->m_cmdRegOut_OutputPort[port].
init();
185 #if FW_OBJECT_NAMES == 1
189 this->m_objName.toChar(),
192 this->m_cmdRegOut_OutputPort[port].setObjName(portName.
toChar());
202 this->m_cmdResponseOut_OutputPort[port].
init();
204 #if FW_OBJECT_NAMES == 1
208 this->m_objName.toChar(),
211 this->m_cmdResponseOut_OutputPort[port].setObjName(portName.
toChar());
221 this->m_eventOut_OutputPort[port].
init();
223 #if FW_OBJECT_NAMES == 1
227 this->m_objName.toChar(),
230 this->m_eventOut_OutputPort[port].setObjName(portName.
toChar());
234 #if FW_ENABLE_TEXT_LOGGING == 1
238 port < static_cast<FwIndexType>(this->getNum_textEventOut_OutputPorts());
241 this->m_textEventOut_OutputPort[port].
init();
243 #if FW_OBJECT_NAMES == 1
247 this->m_objName.toChar(),
250 this->m_textEventOut_OutputPort[port].setObjName(portName.
toChar());
261 this->m_timeGetOut_OutputPort[port].
init();
263 #if FW_OBJECT_NAMES == 1
267 this->m_objName.toChar(),
270 this->m_timeGetOut_OutputPort[port].setObjName(portName.
toChar());
280 this->m_tlmOut_OutputPort[port].
init();
282 #if FW_OBJECT_NAMES == 1
286 this->m_objName.toChar(),
289 this->m_tlmOut_OutputPort[port].setObjName(portName.
toChar());
299 this->m_PktSend_OutputPort[port].
init();
301 #if FW_OBJECT_NAMES == 1
305 this->m_objName.toChar(),
308 this->m_PktSend_OutputPort[port].setObjName(portName.
toChar());
318 this->m_pingOut_OutputPort[port].
init();
320 #if FW_OBJECT_NAMES == 1
324 this->m_objName.toChar(),
327 this->m_pingOut_OutputPort[port].setObjName(portName.
toChar());
333 static_cast<FwSizeType>(ComponentIpcSerializableBuffer::SERIALIZATION_SIZE)
353 return &this->m_cmdIn_InputPort[portNum];
368 return &this->m_Run_InputPort[portNum];
379 return &this->m_TlmRecv_InputPort[portNum];
390 return &this->m_pingIn_InputPort[portNum];
408 this->m_cmdRegOut_OutputPort[portNum].
addCallPort(port);
422 this->m_cmdResponseOut_OutputPort[portNum].
addCallPort(port);
436 this->m_eventOut_OutputPort[portNum].
addCallPort(port);
439 #if FW_ENABLE_TEXT_LOGGING == 1
441 void TlmPacketizerComponentBase ::
442 set_textEventOut_OutputPort(
448 portNum < this->getNum_textEventOut_OutputPorts(),
452 this->m_textEventOut_OutputPort[portNum].addCallPort(port);
468 this->m_timeGetOut_OutputPort[portNum].
addCallPort(port);
482 this->m_tlmOut_OutputPort[portNum].
addCallPort(port);
500 this->m_PktSend_OutputPort[portNum].
addCallPort(port);
514 this->m_pingOut_OutputPort[portNum].
addCallPort(port);
517 #if FW_PORT_SERIALIZATION
526 Fw::InputSerializePort* port
534 this->m_cmdRegOut_OutputPort[portNum].registerSerialPort(port);
540 Fw::InputSerializePort* port
548 this->m_cmdResponseOut_OutputPort[portNum].registerSerialPort(port);
554 Fw::InputSerializePort* port
562 this->m_eventOut_OutputPort[portNum].registerSerialPort(port);
565 #if FW_ENABLE_TEXT_LOGGING == 1
567 void TlmPacketizerComponentBase ::
568 set_textEventOut_OutputPort(
570 Fw::InputSerializePort* port
574 portNum < this->getNum_textEventOut_OutputPorts(),
578 this->m_textEventOut_OutputPort[portNum].registerSerialPort(port);
586 Fw::InputSerializePort* port
594 this->m_timeGetOut_OutputPort[portNum].registerSerialPort(port);
600 Fw::InputSerializePort* port
608 this->m_tlmOut_OutputPort[portNum].registerSerialPort(port);
613 #if FW_PORT_SERIALIZATION
622 Fw::InputSerializePort* port
630 this->m_PktSend_OutputPort[portNum].registerSerialPort(port);
636 Fw::InputSerializePort* port
644 this->m_pingOut_OutputPort[portNum].registerSerialPort(port);
656 FW_ASSERT(this->m_cmdRegOut_OutputPort[0].isConnected());
658 this->m_cmdRegOut_OutputPort[0].
invoke(
662 this->m_cmdRegOut_OutputPort[0].
invoke(
673 Fw::ActiveComponentBase(compName)
738 #if FW_ENABLE_TEXT_LOGGING == 1
741 getNum_textEventOut_OutputPorts()
const
788 return this->m_cmdRegOut_OutputPort[portNum].
isConnected();
799 return this->m_cmdResponseOut_OutputPort[portNum].
isConnected();
810 return this->m_eventOut_OutputPort[portNum].
isConnected();
813 #if FW_ENABLE_TEXT_LOGGING == 1
815 bool TlmPacketizerComponentBase ::
816 isConnected_textEventOut_OutputPort(
FwIndexType portNum)
819 portNum < this->getNum_textEventOut_OutputPorts(),
823 return this->m_textEventOut_OutputPort[portNum].isConnected();
836 return this->m_timeGetOut_OutputPort[portNum].
isConnected();
847 return this->m_tlmOut_OutputPort[portNum].
isConnected();
862 return this->m_PktSend_OutputPort[portNum].
isConnected();
873 return this->m_pingOut_OutputPort[portNum].
isConnected();
899 ComponentIpcSerializableBuffer msg;
903 _status = msg.serialize(
912 _status = msg.serialize(portNum);
919 _status = msg.serialize(context);
975 ComponentIpcSerializableBuffer msg;
979 _status = msg.serialize(
988 _status = msg.serialize(portNum);
995 _status = msg.serialize(key);
1052 this->m_PktSend_OutputPort[portNum].
invoke(
1068 this->m_pingOut_OutputPort[portNum].
invoke(
1084 FW_ASSERT(this->m_cmdResponseOut_OutputPort[0].isConnected());
1085 this->m_cmdResponseOut_OutputPort[0].
invoke(opCode, cmdSeq, response);
1106 ComponentIpcSerializableBuffer msg;
1119 _status = msg.serialize(port);
1125 _status = msg.serialize(opCode);
1131 _status = msg.serialize(cmdSeq);
1137 _status = msg.serialize(args);
1165 ComponentIpcSerializableBuffer msg;
1178 _status = msg.serialize(port);
1184 _status = msg.serialize(opCode);
1190 _status = msg.serialize(cmdSeq);
1196 _status = msg.serialize(args);
1251 if (this->m_timeGetOut_OutputPort[0].isConnected()) {
1252 this->m_timeGetOut_OutputPort[0].
invoke(_logTime);
1260 if (this->m_eventOut_OutputPort[0].isConnected()) {
1264 #if FW_AMPCS_COMPATIBLE
1273 #if FW_AMPCS_COMPATIBLE
1276 static_cast<U8>(
sizeof(U32))
1289 this->m_eventOut_OutputPort[0].
invoke(
1298 #if FW_ENABLE_TEXT_LOGGING
1299 if (this->m_textEventOut_OutputPort[0].isConnected()) {
1300 #if FW_OBJECT_NAMES == 1
1301 const char* _formatString =
1302 "(%s) %s: Telemetry ID 0x%" PRIx32
" not packetized";
1304 const char* _formatString =
1305 "%s: Telemetry ID 0x%" PRIx32
" not packetized";
1312 this->m_objName.toChar(),
1318 this->m_textEventOut_OutputPort[0].invoke(
1333 if (this->m_timeGetOut_OutputPort[0].isConnected()) {
1334 this->m_timeGetOut_OutputPort[0].
invoke(_logTime);
1342 if (this->m_eventOut_OutputPort[0].isConnected()) {
1346 #if FW_AMPCS_COMPATIBLE
1355 #if FW_AMPCS_COMPATIBLE
1358 static_cast<U8>(
sizeof(U32))
1371 this->m_eventOut_OutputPort[0].
invoke(
1380 #if FW_ENABLE_TEXT_LOGGING
1381 if (this->m_textEventOut_OutputPort[0].isConnected()) {
1382 #if FW_OBJECT_NAMES == 1
1383 const char* _formatString =
1384 "(%s) %s: Telemetry send level to %" PRIu32
"";
1386 const char* _formatString =
1387 "%s: Telemetry send level to %" PRIu32
"";
1394 this->m_objName.toChar(),
1400 this->m_textEventOut_OutputPort[0].invoke(
1418 if (this->m_timeGetOut_OutputPort[0].isConnected()) {
1419 this->m_timeGetOut_OutputPort[0].
invoke(_logTime);
1427 if (this->m_eventOut_OutputPort[0].isConnected()) {
1431 #if FW_AMPCS_COMPATIBLE
1440 #if FW_AMPCS_COMPATIBLE
1443 static_cast<U8>(
sizeof(U32))
1456 #if FW_AMPCS_COMPATIBLE
1459 static_cast<U8>(
sizeof(U32))
1472 this->m_eventOut_OutputPort[0].
invoke(
1481 #if FW_ENABLE_TEXT_LOGGING
1482 if (this->m_textEventOut_OutputPort[0].isConnected()) {
1483 #if FW_OBJECT_NAMES == 1
1484 const char* _formatString =
1485 "(%s) %s: Requested send level %" PRIu32
" higher than max packet level of %" PRIu32
"";
1487 const char* _formatString =
1488 "%s: Requested send level %" PRIu32
" higher than max packet level of %" PRIu32
"";
1495 this->m_objName.toChar(),
1502 this->m_textEventOut_OutputPort[0].invoke(
1517 if (this->m_timeGetOut_OutputPort[0].isConnected()) {
1518 this->m_timeGetOut_OutputPort[0].
invoke(_logTime);
1526 if (this->m_eventOut_OutputPort[0].isConnected()) {
1530 #if FW_AMPCS_COMPATIBLE
1539 #if FW_AMPCS_COMPATIBLE
1542 static_cast<U8>(
sizeof(U32))
1555 this->m_eventOut_OutputPort[0].
invoke(
1564 #if FW_ENABLE_TEXT_LOGGING
1565 if (this->m_textEventOut_OutputPort[0].isConnected()) {
1566 #if FW_OBJECT_NAMES == 1
1567 const char* _formatString =
1568 "(%s) %s: Sent packet ID %" PRIu32
"";
1570 const char* _formatString =
1571 "%s: Sent packet ID %" PRIu32
"";
1578 this->m_objName.toChar(),
1584 this->m_textEventOut_OutputPort[0].invoke(
1599 if (this->m_timeGetOut_OutputPort[0].isConnected()) {
1600 this->m_timeGetOut_OutputPort[0].
invoke(_logTime);
1608 if (this->m_eventOut_OutputPort[0].isConnected()) {
1612 #if FW_AMPCS_COMPATIBLE
1621 #if FW_AMPCS_COMPATIBLE
1624 static_cast<U8>(
sizeof(U32))
1637 this->m_eventOut_OutputPort[0].
invoke(
1646 #if FW_ENABLE_TEXT_LOGGING
1647 if (this->m_textEventOut_OutputPort[0].isConnected()) {
1648 #if FW_OBJECT_NAMES == 1
1649 const char* _formatString =
1650 "(%s) %s: Could not find packet ID %" PRIu32
"";
1652 const char* _formatString =
1653 "%s: Could not find packet ID %" PRIu32
"";
1660 this->m_objName.toChar(),
1666 this->m_textEventOut_OutputPort[0].invoke(
1686 if (this->m_tlmOut_OutputPort[0].isConnected()) {
1688 this->m_timeGetOut_OutputPort[0].isConnected() &&
1691 this->m_timeGetOut_OutputPort[0].
invoke(_tlmTime);
1705 this->m_tlmOut_OutputPort[0].
invoke(
1720 if (this->m_timeGetOut_OutputPort[0].isConnected()) {
1722 this->m_timeGetOut_OutputPort[0].
invoke(_time);
1737 ComponentIpcSerializableBuffer msg;
1760 MsgTypeEnum msgType =
static_cast<MsgTypeEnum
>(desMsg);
1762 if (msgType == TLMPACKETIZER_COMPONENT_EXIT) {
1767 deserStatus = msg.deserialize(portNum);
1778 deserStatus = msg.deserialize(context);
1796 deserStatus = msg.deserialize(key);
1811 case CMD_SET_LEVEL: {
1814 deserStatus = msg.deserialize(opCode);
1822 deserStatus = msg.deserialize(cmdSeq);
1843 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
1856 #if FW_CMD_CHECK_RESIDUAL
1858 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
1876 case CMD_SEND_PKT: {
1879 deserStatus = msg.deserialize(opCode);
1887 deserStatus = msg.deserialize(cmdSeq);
1908 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
1921 #if FW_CMD_CHECK_RESIDUAL
1923 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
1951 void TlmPacketizerComponentBase ::
1963 const U32 idBase = callComp->
getIdBase();
1967 switch (opCode - idBase) {
1969 compPtr->SET_LEVEL_cmdHandlerBase(
1978 compPtr->SEND_PKT_cmdHandlerBase(
1992 void TlmPacketizerComponentBase ::
2001 compPtr->Run_handlerBase(
2007 void TlmPacketizerComponentBase ::
2018 compPtr->TlmRecv_handlerBase(
2026 void TlmPacketizerComponentBase ::
2035 compPtr->pingIn_handlerBase(
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
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.
@ ACTIVITY_HI
Important informational events.
@ WARNING_LO
A less serious but recoverable event.
@ ACTIVITY_LO
Less important informational events.
void init()
Object initializer.
const char * toChar() const
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 addCallPort(InputComPort *callPort)
Register an input port.
void init()
Initialization function.
void invoke(Fw::ComBuffer &data, U32 context)
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
void format(const CHAR *formatString,...)
write formatted string to buffer
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 invoke(U32 key)
Invoke a port interface.
void init()
Initialization function.
void addCallPort(InputPingPort *callPort)
Register an input port.
FwIndexType getNum_timeGetOut_OutputPorts() const
void PktSend_out(FwIndexType portNum, Fw::ComBuffer &data, U32 context)
Invoke output port PktSend.
void set_eventOut_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to eventOut[portNum].
void cmdResponse_out(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdResponse response)
Emit command response.
bool isConnected_cmdResponseOut_OutputPort(FwIndexType portNum)
bool isConnected_eventOut_OutputPort(FwIndexType portNum)
void regCommands()
Register commands with the Command Dispatcher.
FwIndexType getNum_TlmRecv_InputPorts() const
virtual void SET_LEVEL_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command SET_LEVEL.
FwIndexType getNum_PktSend_OutputPorts() const
void set_timeGetOut_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to timeGetOut[portNum].
@ EVENTID_NOCHAN
Telemetry channel is not part of a telemetry packet.
@ EVENTID_LEVELSET
Telemetry send level set.
@ EVENTID_PACKETSENT
Packet manually sent.
@ EVENTID_PACKETNOTFOUND
Couldn't find the packet to send.
@ EVENTID_MAXLEVELEXCEED
Telemetry send level set.
virtual void Run_handler(FwIndexType portNum, U32 context)=0
Handler for input port Run.
void set_pingOut_OutputPort(FwIndexType portNum, Svc::InputPingPort *port)
Connect port to pingOut[portNum].
FwIndexType getNum_cmdResponseOut_OutputPorts() const
void TlmRecv_handlerBase(FwIndexType portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)
Handler base-class function for input port TlmRecv.
void set_cmdRegOut_OutputPort(FwIndexType portNum, Fw::InputCmdRegPort *port)
Connect port to cmdRegOut[portNum].
virtual void pingIn_preMsgHook(FwIndexType portNum, U32 key)
Pre-message hook for async input port pingIn.
bool isConnected_PktSend_OutputPort(FwIndexType portNum)
FwIndexType getNum_cmdRegOut_OutputPorts() const
void tlmWrite_SendLevel(U32 arg, Fw::Time _tlmTime=Fw::Time())
Fw::InputTlmPort * get_TlmRecv_InputPort(FwIndexType portNum)
FwIndexType getNum_cmdIn_InputPorts() const
void set_PktSend_OutputPort(FwIndexType portNum, Fw::InputComPort *port)
Connect port to PktSend[portNum].
void log_WARNING_LO_PacketNotFound(U32 id)
FwIndexType getNum_pingIn_InputPorts() const
virtual void SEND_PKT_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, U32 id)=0
void pingOut_out(FwIndexType portNum, U32 key)
Invoke output port pingOut.
FwIndexType getNum_eventOut_OutputPorts() const
void log_WARNING_LO_NoChan(U32 Id)
void log_ACTIVITY_LO_PacketSent(U32 id)
void SET_LEVEL_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
virtual ~TlmPacketizerComponentBase()
Destroy TlmPacketizerComponentBase object.
FwIndexType getNum_Run_InputPorts() const
virtual void Run_preMsgHook(FwIndexType portNum, U32 context)
Pre-message hook for async input port Run.
Svc::InputSchedPort * get_Run_InputPort(FwIndexType portNum)
void log_ACTIVITY_HI_LevelSet(U32 id)
virtual void TlmRecv_handler(FwIndexType portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)=0
Handler for input port TlmRecv.
void log_WARNING_LO_MaxLevelExceed(U32 level, U32 max)
Svc::InputPingPort * get_pingIn_InputPort(FwIndexType portNum)
void pingIn_handlerBase(FwIndexType portNum, U32 key)
Handler base-class function for input port pingIn.
TlmPacketizerComponentBase(const char *compName="")
Construct TlmPacketizerComponentBase object.
FwIndexType getNum_tlmOut_OutputPorts() const
virtual void SEND_PKT_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command SEND_PKT.
bool isConnected_tlmOut_OutputPort(FwIndexType portNum)
virtual void pingIn_handler(FwIndexType portNum, U32 key)=0
Handler for input port pingIn.
FwIndexType getNum_pingOut_OutputPorts() const
bool isConnected_pingOut_OutputPort(FwIndexType portNum)
@ CHANNELID_SENDLEVEL
Channel ID for SendLevel.
bool isConnected_cmdRegOut_OutputPort(FwIndexType portNum)
bool isConnected_timeGetOut_OutputPort(FwIndexType portNum)
void Run_handlerBase(FwIndexType portNum, U32 context)
Handler base-class function for input port Run.
void set_cmdResponseOut_OutputPort(FwIndexType portNum, Fw::InputCmdResponsePort *port)
Connect port to cmdResponseOut[portNum].
Fw::InputCmdPort * get_cmdIn_InputPort(FwIndexType portNum)
void SEND_PKT_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void set_tlmOut_OutputPort(FwIndexType portNum, Fw::InputTlmPort *port)
Connect port to tlmOut[portNum].
virtual void SET_LEVEL_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, U32 level)=0
@ OPCODE_SEND_PKT
Force a packet to be sent.
@ OPCODE_SET_LEVEL
Set telemetry send level.
SerializeStatus
forward declaration for string
@ FW_SERIALIZE_OK
Serialization/Deserialization operation was successful.
@ OP_OK
Operation succeeded.