10 #if FW_ENABLE_TEXT_LOGGING 19 BUFFQUEUEIN_BUFFERSEND,
21 COMSTATUSIN_SUCCESSCONDITION,
36 class ComponentIpcSerializableBuffer :
46 MAX_DATA_SIZE =
sizeof(BuffUnion),
48 SERIALIZATION_SIZE = DATA_OFFSET + MAX_DATA_SIZE
52 return sizeof(m_buff);
59 const U8* getBuffAddr()
const {
65 U8 m_buff[SERIALIZATION_SIZE];
89 this->m_buffQueueIn_InputPort[port].
init();
94 this->m_buffQueueIn_InputPort[port].
setPortNum(port);
96 #if FW_OBJECT_NAMES == 1 100 this->m_objName.toChar(),
103 this->m_buffQueueIn_InputPort[port].setObjName(portName.
toChar());
113 this->m_comQueueIn_InputPort[port].
init();
118 this->m_comQueueIn_InputPort[port].
setPortNum(port);
120 #if FW_OBJECT_NAMES == 1 124 this->m_objName.toChar(),
127 this->m_comQueueIn_InputPort[port].setObjName(portName.
toChar());
137 this->m_comStatusIn_InputPort[port].
init();
142 this->m_comStatusIn_InputPort[port].
setPortNum(port);
144 #if FW_OBJECT_NAMES == 1 148 this->m_objName.toChar(),
151 this->m_comStatusIn_InputPort[port].setObjName(portName.
toChar());
161 this->m_run_InputPort[port].
init();
168 #if FW_OBJECT_NAMES == 1 172 this->m_objName.toChar(),
175 this->m_run_InputPort[port].setObjName(portName.
toChar());
185 this->m_Log_OutputPort[port].
init();
187 #if FW_OBJECT_NAMES == 1 191 this->m_objName.toChar(),
194 this->m_Log_OutputPort[port].setObjName(portName.
toChar());
198 #if FW_ENABLE_TEXT_LOGGING == 1 202 port < static_cast<FwIndexType>(this->getNum_LogText_OutputPorts());
205 this->m_LogText_OutputPort[port].
init();
207 #if FW_OBJECT_NAMES == 1 211 this->m_objName.toChar(),
214 this->m_LogText_OutputPort[port].setObjName(portName.
toChar());
225 this->m_Time_OutputPort[port].
init();
227 #if FW_OBJECT_NAMES == 1 231 this->m_objName.toChar(),
234 this->m_Time_OutputPort[port].setObjName(portName.
toChar());
244 this->m_Tlm_OutputPort[port].
init();
246 #if FW_OBJECT_NAMES == 1 250 this->m_objName.toChar(),
253 this->m_Tlm_OutputPort[port].setObjName(portName.
toChar());
263 this->m_buffQueueSend_OutputPort[port].
init();
265 #if FW_OBJECT_NAMES == 1 269 this->m_objName.toChar(),
272 this->m_buffQueueSend_OutputPort[port].setObjName(portName.
toChar());
282 this->m_comQueueSend_OutputPort[port].
init();
284 #if FW_OBJECT_NAMES == 1 288 this->m_objName.toChar(),
291 this->m_comQueueSend_OutputPort[port].setObjName(portName.
toChar());
301 this->m_deallocate_OutputPort[port].
init();
303 #if FW_OBJECT_NAMES == 1 307 this->m_objName.toChar(),
310 this->m_deallocate_OutputPort[port].setObjName(portName.
toChar());
317 static_cast<FwSizeType>(ComponentIpcSerializableBuffer::SERIALIZATION_SIZE)
321 static_cast<FwAssertArgType>(qStat)
334 static_cast<FwAssertArgType>(portNum)
337 return &this->m_buffQueueIn_InputPort[portNum];
345 static_cast<FwAssertArgType>(portNum)
348 return &this->m_comQueueIn_InputPort[portNum];
356 static_cast<FwAssertArgType>(portNum)
359 return &this->m_comStatusIn_InputPort[portNum];
367 static_cast<FwAssertArgType>(portNum)
370 return &this->m_run_InputPort[portNum];
385 static_cast<FwAssertArgType>(portNum)
391 #if FW_ENABLE_TEXT_LOGGING == 1 393 void ComQueueComponentBase ::
394 set_LogText_OutputPort(
400 portNum < this->getNum_LogText_OutputPorts(),
401 static_cast<FwAssertArgType>(portNum)
404 this->m_LogText_OutputPort[portNum].addCallPort(port);
417 static_cast<FwAssertArgType>(portNum)
420 this->m_Time_OutputPort[portNum].
addCallPort(port);
431 static_cast<FwAssertArgType>(portNum)
449 static_cast<FwAssertArgType>(portNum)
452 this->m_buffQueueSend_OutputPort[portNum].
addCallPort(port);
463 static_cast<FwAssertArgType>(portNum)
466 this->m_comQueueSend_OutputPort[portNum].
addCallPort(port);
477 static_cast<FwAssertArgType>(portNum)
480 this->m_deallocate_OutputPort[portNum].
addCallPort(port);
483 #if FW_PORT_SERIALIZATION 492 Fw::InputSerializePort* port
497 static_cast<FwAssertArgType>(portNum)
500 this->m_Log_OutputPort[portNum].registerSerialPort(port);
503 #if FW_ENABLE_TEXT_LOGGING == 1 505 void ComQueueComponentBase ::
506 set_LogText_OutputPort(
508 Fw::InputSerializePort* port
512 portNum < this->getNum_LogText_OutputPorts(),
513 static_cast<FwAssertArgType>(portNum)
516 this->m_LogText_OutputPort[portNum].registerSerialPort(port);
524 Fw::InputSerializePort* port
529 static_cast<FwAssertArgType>(portNum)
532 this->m_Time_OutputPort[portNum].registerSerialPort(port);
538 Fw::InputSerializePort* port
543 static_cast<FwAssertArgType>(portNum)
546 this->m_Tlm_OutputPort[portNum].registerSerialPort(port);
551 #if FW_PORT_SERIALIZATION 560 Fw::InputSerializePort* port
565 static_cast<FwAssertArgType>(portNum)
568 this->m_buffQueueSend_OutputPort[portNum].registerSerialPort(port);
574 Fw::InputSerializePort* port
579 static_cast<FwAssertArgType>(portNum)
582 this->m_comQueueSend_OutputPort[portNum].registerSerialPort(port);
588 Fw::InputSerializePort* port
593 static_cast<FwAssertArgType>(portNum)
596 this->m_deallocate_OutputPort[portNum].registerSerialPort(port);
607 Fw::ActiveComponentBase(compName)
656 #if FW_ENABLE_TEXT_LOGGING == 1 659 getNum_LogText_OutputPorts()
const 709 static_cast<FwAssertArgType>(portNum)
712 return this->m_Log_OutputPort[portNum].
isConnected();
715 #if FW_ENABLE_TEXT_LOGGING == 1 717 bool ComQueueComponentBase ::
718 isConnected_LogText_OutputPort(
FwIndexType portNum)
721 portNum < this->getNum_LogText_OutputPorts(),
722 static_cast<FwAssertArgType>(portNum)
725 return this->m_LogText_OutputPort[portNum].isConnected();
735 static_cast<FwAssertArgType>(portNum)
738 return this->m_Time_OutputPort[portNum].
isConnected();
746 static_cast<FwAssertArgType>(portNum)
749 return this->m_Tlm_OutputPort[portNum].
isConnected();
761 static_cast<FwAssertArgType>(portNum)
764 return this->m_buffQueueSend_OutputPort[portNum].
isConnected();
772 static_cast<FwAssertArgType>(portNum)
775 return this->m_comQueueSend_OutputPort[portNum].
isConnected();
783 static_cast<FwAssertArgType>(portNum)
786 return this->m_deallocate_OutputPort[portNum].
isConnected();
804 static_cast<FwAssertArgType>(portNum)
812 ComponentIpcSerializableBuffer msg;
816 _status = msg.serialize(
817 static_cast<FwEnumStoreType>(BUFFQUEUEIN_BUFFERSEND)
821 static_cast<FwAssertArgType>(_status)
825 _status = msg.serialize(portNum);
828 static_cast<FwAssertArgType>(_status)
832 _status = msg.serialize(fwBuffer);
835 static_cast<FwAssertArgType>(_status)
842 if (qStatus == Os::Queue::Status::FULL) {
849 static_cast<FwAssertArgType>(qStatus)
863 static_cast<FwAssertArgType>(portNum)
872 ComponentIpcSerializableBuffer msg;
876 _status = msg.serialize(
877 static_cast<FwEnumStoreType>(COMQUEUEIN_COM)
881 static_cast<FwAssertArgType>(_status)
885 _status = msg.serialize(portNum);
888 static_cast<FwAssertArgType>(_status)
892 _status = msg.serialize(data);
895 static_cast<FwAssertArgType>(_status)
899 _status = msg.serialize(context);
902 static_cast<FwAssertArgType>(_status)
909 if (qStatus == Os::Queue::Status::FULL) {
916 static_cast<FwAssertArgType>(qStatus)
929 static_cast<FwAssertArgType>(portNum)
937 ComponentIpcSerializableBuffer msg;
941 _status = msg.serialize(
942 static_cast<FwEnumStoreType>(COMSTATUSIN_SUCCESSCONDITION)
946 static_cast<FwAssertArgType>(_status)
950 _status = msg.serialize(portNum);
953 static_cast<FwAssertArgType>(_status)
957 _status = msg.serialize(condition);
960 static_cast<FwAssertArgType>(_status)
969 static_cast<FwAssertArgType>(qStatus)
982 static_cast<FwAssertArgType>(portNum)
990 ComponentIpcSerializableBuffer msg;
994 _status = msg.serialize(
995 static_cast<FwEnumStoreType>(RUN_SCHED)
999 static_cast<FwAssertArgType>(_status)
1003 _status = msg.serialize(portNum);
1006 static_cast<FwAssertArgType>(_status)
1010 _status = msg.serialize(context);
1013 static_cast<FwAssertArgType>(_status)
1020 if (qStatus == Os::Queue::Status::FULL) {
1027 static_cast<FwAssertArgType>(qStatus)
1088 static_cast<FwAssertArgType>(portNum)
1090 this->m_buffQueueSend_OutputPort[portNum].
invoke(
1104 static_cast<FwAssertArgType>(portNum)
1106 this->m_comQueueSend_OutputPort[portNum].
invoke(
1120 static_cast<FwAssertArgType>(portNum)
1122 this->m_deallocate_OutputPort[portNum].
invoke(
1139 if (this->m_Time_OutputPort[0].isConnected()) {
1140 this->m_Time_OutputPort[0].
invoke(_logTime);
1148 if (this->m_Log_OutputPort[0].isConnected()) {
1152 #if FW_AMPCS_COMPATIBLE 1154 _status = _logBuff.
serialize(static_cast<U8>(2));
1157 static_cast<FwAssertArgType>(_status)
1161 #if FW_AMPCS_COMPATIBLE 1168 static_cast<FwAssertArgType>(_status)
1171 _status = _logBuff.
serialize(queueType);
1174 static_cast<FwAssertArgType>(_status)
1177 #if FW_AMPCS_COMPATIBLE 1180 static_cast<U8>(
sizeof(U32))
1184 static_cast<FwAssertArgType>(_status)
1190 static_cast<FwAssertArgType>(_status)
1193 this->m_Log_OutputPort[0].
invoke(
1202 #if FW_ENABLE_TEXT_LOGGING 1203 if (this->m_LogText_OutputPort[0].isConnected()) {
1204 #if FW_OBJECT_NAMES == 1 1205 const char* _formatString =
1206 "(%s) %s: The %s queue at index %" PRIu32
" overflowed";
1208 const char* _formatString =
1209 "%s: The %s queue at index %" PRIu32
" overflowed";
1213 queueType.toString(queueTypeStr);
1219 this->m_objName.toChar(),
1226 this->m_LogText_OutputPort[0].invoke(
1246 if (this->m_Tlm_OutputPort[0].isConnected()) {
1248 this->m_Time_OutputPort[0].isConnected() &&
1251 this->m_Time_OutputPort[0].
invoke(_tlmTime);
1258 static_cast<FwAssertArgType>(_stat)
1265 this->m_Tlm_OutputPort[0].
invoke(
1279 if (this->m_Tlm_OutputPort[0].isConnected()) {
1281 this->m_Time_OutputPort[0].isConnected() &&
1284 this->m_Time_OutputPort[0].
invoke(_tlmTime);
1291 static_cast<FwAssertArgType>(_stat)
1298 this->m_Tlm_OutputPort[0].
invoke(
1313 if (this->m_Time_OutputPort[0].isConnected()) {
1315 this->m_Time_OutputPort[0].
invoke(_time);
1330 ComponentIpcSerializableBuffer msg;
1340 static_cast<FwAssertArgType>(msgStatus)
1350 static_cast<FwAssertArgType>(deserStatus)
1353 MsgTypeEnum msgType =
static_cast<MsgTypeEnum
>(desMsg);
1355 if (msgType == COMQUEUE_COMPONENT_EXIT) {
1360 deserStatus = msg.deserialize(portNum);
1363 static_cast<FwAssertArgType>(deserStatus)
1368 case BUFFQUEUEIN_BUFFERSEND: {
1371 deserStatus = msg.deserialize(fwBuffer);
1374 static_cast<FwAssertArgType>(deserStatus)
1386 case COMQUEUEIN_COM: {
1389 deserStatus = msg.deserialize(data);
1392 static_cast<FwAssertArgType>(deserStatus)
1397 deserStatus = msg.deserialize(context);
1400 static_cast<FwAssertArgType>(deserStatus)
1413 case COMSTATUSIN_SUCCESSCONDITION: {
1416 deserStatus = msg.deserialize(condition);
1419 static_cast<FwAssertArgType>(deserStatus)
1434 deserStatus = msg.deserialize(context);
1437 static_cast<FwAssertArgType>(deserStatus)
1459 void ComQueueComponentBase ::
1468 compPtr->buffQueueIn_handlerBase(
1474 void ComQueueComponentBase ::
1484 compPtr->comQueueIn_handlerBase(
1491 void ComQueueComponentBase ::
1500 compPtr->comStatusIn_handlerBase(
1506 void ComQueueComponentBase ::
1515 compPtr->run_handlerBase(
Serialization/Deserialization operation was successful.
virtual void comStatusIn_handler(FwIndexType portNum, Fw::Success &condition)=0
Handler for input port comStatusIn.
void set_comQueueSend_OutputPort(FwIndexType portNum, Fw::InputComPort *port)
Connect port to comQueueSend[portNum].
void addCallPort(InputTimePort *callPort)
Register an input port.
virtual ~ComQueueComponentBase()
Destroy ComQueueComponentBase object.
void invoke(Fw::ComBuffer &data, U32 context) const
Invoke a port interface.
void init()
Initialization function.
void tlmWrite_buffQueueDepth(const Svc::BuffQueueDepth &arg, Fw::Time _tlmTime=Fw::Time()) const
void set_Log_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to Log[portNum].
NATIVE_UINT_TYPE SizeType
Status
status returned from the queue send function
SerializeStatus serialize(U8 val)
serialize 8-bit unsigned int
const char * toChar() const
virtual void buffQueueIn_handler(FwIndexType portNum, Fw::Buffer &fwBuffer)=0
Handler for input port buffQueueIn.
FwIndexType getNum_Log_OutputPorts() const
Svc::InputSchedPort * get_run_InputPort(FwIndexType portNum)
PlatformSizeType FwSizeType
void init()
Initialization function.
PlatformIndexType FwIndexType
bool isConnected_buffQueueSend_OutputPort(FwIndexType portNum)
FwIndexType getNum_deallocate_OutputPorts() const
Os::Queue m_queue
queue object for active component
Array of queue depths for Fw::Com types.
void addCallPort(InputTlmPort *callPort)
Register an input port.
An enumeration of queue data types.
bool isConnected_Log_OutputPort(FwIndexType portNum)
void init()
Object initializer.
void comStatusIn_handlerBase(FwIndexType portNum, Fw::Success &condition)
Handler base-class function for input port comStatusIn.
SerializeStatus
forward declaration for string
Channel ID for comQueueDepth.
Message will block until space is available.
The size of the serial representation.
void set_Tlm_OutputPort(FwIndexType portNum, Fw::InputTlmPort *port)
Connect port to Tlm[portNum].
void init()
Initialization function.
Os::Queue::Status createQueue(FwSizeType depth, FwSizeType msgSize)
bool isConnected_Time_OutputPort(FwIndexType portNum)
void invoke(Fw::Buffer &fwBuffer) const
Invoke a port interface.
virtual void run_handler(FwIndexType portNum, U32 context)=0
Handler for input port run.
void set_buffQueueSend_OutputPort(FwIndexType portNum, Fw::InputBufferSendPort *port)
Connect port to buffQueueSend[portNum].
void run_handlerBase(FwIndexType portNum, U32 context)
Handler base-class function for input port run.
Fw::InputBufferSendPort * get_buffQueueIn_InputPort(FwIndexType portNum)
void addCallPort(InputBufferSendPort *callPort)
Register an input port.
void invoke(Fw::Time &time) const
Invoke a port interface.
Channel ID for buffQueueDepth.
Array of queue depths for Fw::Buffer types.
void set_deallocate_OutputPort(FwIndexType portNum, Fw::InputBufferSendPort *port)
Connect port to deallocate[portNum].
virtual void run_preMsgHook(FwIndexType portNum, U32 context)
Pre-message hook for async input port run.
const char * toChar() const
No time base has been established.
void log_WARNING_HI_QueueOverflow(Svc::QueueType queueType, U32 index) const
Status send(const U8 *buffer, FwSizeType size, FwQueuePriorityType priority, BlockingType blockType) override
send a message into the queue through delegate
void set_Time_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to Time[portNum].
FwIndexType getNum_buffQueueIn_InputPorts() const
void deallocate_out(FwIndexType portNum, Fw::Buffer &fwBuffer)
Invoke output port deallocate.
A serious but recoverable event.
Errors dispatching messages.
virtual void comQueueIn_handler(FwIndexType portNum, Fw::ComBuffer &data, U32 context)=0
Handler for input port comQueueIn.
void invoke(FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val) const
Invoke a port interface.
void comQueueIn_handlerBase(FwIndexType portNum, Fw::ComBuffer &data, U32 context)
Handler base-class function for input port comQueueIn.
FormatStatus format(const CHAR *formatString,...)
write formatted string to buffer
void init()
Initialization function.
uint8_t U8
8-bit unsigned integer
#define PRI_PlatformIntType
virtual void buffQueueIn_preMsgHook(FwIndexType portNum, Fw::Buffer &fwBuffer)
Pre-message hook for async input port buffQueueIn.
void buffQueueSend_out(FwIndexType portNum, Fw::Buffer &fwBuffer)
Invoke output port buffQueueSend.
void init()
Initialization function.
FwIndexType getNum_buffQueueSend_OutputPorts() const
Fw::InputSuccessConditionPort * get_comStatusIn_InputPort(FwIndexType portNum)
void invoke(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args) const
Invoke a port interface.
PlatformQueuePriorityType FwQueuePriorityType
virtual void buffQueueIn_overflowHook(FwIndexType portNum, Fw::Buffer &fwBuffer)=0
Overflow hook for async input port buffQueueIn.
message to exit active component task
A message was sent requesting an exit of the loop.
bool isConnected_Tlm_OutputPort(FwIndexType portNum)
FwIndexType getNum_Time_OutputPorts() const
ComQueueComponentBase(const char *compName="")
Construct ComQueueComponentBase object.
bool isConnected_comQueueSend_OutputPort(FwIndexType portNum)
#define FW_NUM_ARRAY_ELEMENTS(a)
number of elements in an array
void addCallPort(InputLogPort *callPort)
Register an input port.
FwIndexType getNum_Tlm_OutputPorts() const
FwIndexType getNum_comStatusIn_InputPorts() const
void incNumMsgDropped()
increment the number of messages dropped
void tlmWrite_comQueueDepth(const Svc::ComQueueDepth &arg, Fw::Time _tlmTime=Fw::Time()) const
message sent/received okay
void addCallPort(InputComPort *callPort)
Register an input port.
void buffQueueIn_handlerBase(FwIndexType portNum, Fw::Buffer &fwBuffer)
Handler base-class function for input port buffQueueIn.
FwIndexType getNum_comQueueIn_InputPorts() const
virtual void comStatusIn_preMsgHook(FwIndexType portNum, Fw::Success &condition)
Pre-message hook for async input port comStatusIn.
void comQueueSend_out(FwIndexType portNum, Fw::ComBuffer &data, U32 context)
Invoke output port comQueueSend.
Message will return with status when space is unavailable.
Status receive(U8 *destination, FwSizeType capacity, BlockingType blockType, FwSizeType &actualSize, FwQueuePriorityType &priority) override
receive a message from the queue through delegate
Fw::InputComPort * get_comQueueIn_InputPort(FwIndexType portNum)
virtual void comQueueIn_preMsgHook(FwIndexType portNum, Fw::ComBuffer &data, U32 context)
Pre-message hook for async input port comQueueIn.
#define FW_OBJECT_NAMES
Indicates whether or not object names are stored (more memory, can be used for tracking objects) ...
FwIndexType getNum_comQueueSend_OutputPorts() const
bool isConnected_deallocate_OutputPort(FwIndexType portNum)
FwIndexType getNum_run_InputPorts() const