10 #if FW_ENABLE_TEXT_LOGGING
19 BUFFQUEUEIN_BUFFERSEND,
21 COMSTATUSIN_SUCCESSCONDITION,
36 class ComponentIpcSerializableBuffer :
51 return sizeof(m_buff);
58 const U8* getBuffAddr()
const {
64 U8 m_buff[SERIALIZATION_SIZE];
88 this->m_buffQueueIn_InputPort[port].
init();
93 this->m_buffQueueIn_InputPort[port].
setPortNum(port);
95 #if FW_OBJECT_NAMES == 1
99 this->m_objName.toChar(),
102 this->m_buffQueueIn_InputPort[port].setObjName(portName.
toChar());
112 this->m_comQueueIn_InputPort[port].
init();
117 this->m_comQueueIn_InputPort[port].
setPortNum(port);
119 #if FW_OBJECT_NAMES == 1
123 this->m_objName.toChar(),
126 this->m_comQueueIn_InputPort[port].setObjName(portName.
toChar());
136 this->m_comStatusIn_InputPort[port].
init();
141 this->m_comStatusIn_InputPort[port].
setPortNum(port);
143 #if FW_OBJECT_NAMES == 1
147 this->m_objName.toChar(),
150 this->m_comStatusIn_InputPort[port].setObjName(portName.
toChar());
160 this->m_run_InputPort[port].
init();
167 #if FW_OBJECT_NAMES == 1
171 this->m_objName.toChar(),
174 this->m_run_InputPort[port].setObjName(portName.
toChar());
184 this->m_Log_OutputPort[port].
init();
186 #if FW_OBJECT_NAMES == 1
190 this->m_objName.toChar(),
193 this->m_Log_OutputPort[port].setObjName(portName.
toChar());
197 #if FW_ENABLE_TEXT_LOGGING == 1
201 port < static_cast<FwIndexType>(this->getNum_LogText_OutputPorts());
204 this->m_LogText_OutputPort[port].
init();
206 #if FW_OBJECT_NAMES == 1
210 this->m_objName.toChar(),
213 this->m_LogText_OutputPort[port].setObjName(portName.
toChar());
224 this->m_Time_OutputPort[port].
init();
226 #if FW_OBJECT_NAMES == 1
230 this->m_objName.toChar(),
233 this->m_Time_OutputPort[port].setObjName(portName.
toChar());
243 this->m_Tlm_OutputPort[port].
init();
245 #if FW_OBJECT_NAMES == 1
249 this->m_objName.toChar(),
252 this->m_Tlm_OutputPort[port].setObjName(portName.
toChar());
262 this->m_buffQueueSend_OutputPort[port].
init();
264 #if FW_OBJECT_NAMES == 1
268 this->m_objName.toChar(),
271 this->m_buffQueueSend_OutputPort[port].setObjName(portName.
toChar());
281 this->m_comQueueSend_OutputPort[port].
init();
283 #if FW_OBJECT_NAMES == 1
287 this->m_objName.toChar(),
290 this->m_comQueueSend_OutputPort[port].setObjName(portName.
toChar());
300 this->m_deallocate_OutputPort[port].
init();
302 #if FW_OBJECT_NAMES == 1
306 this->m_objName.toChar(),
309 this->m_deallocate_OutputPort[port].setObjName(portName.
toChar());
315 static_cast<FwSizeType>(ComponentIpcSerializableBuffer::SERIALIZATION_SIZE)
335 return &this->m_buffQueueIn_InputPort[portNum];
346 return &this->m_comQueueIn_InputPort[portNum];
357 return &this->m_comStatusIn_InputPort[portNum];
368 return &this->m_run_InputPort[portNum];
389 #if FW_ENABLE_TEXT_LOGGING == 1
391 void ComQueueComponentBase ::
392 set_LogText_OutputPort(
398 portNum < this->getNum_LogText_OutputPorts(),
402 this->m_LogText_OutputPort[portNum].addCallPort(port);
418 this->m_Time_OutputPort[portNum].
addCallPort(port);
450 this->m_buffQueueSend_OutputPort[portNum].
addCallPort(port);
464 this->m_comQueueSend_OutputPort[portNum].
addCallPort(port);
478 this->m_deallocate_OutputPort[portNum].
addCallPort(port);
481 #if FW_PORT_SERIALIZATION
490 Fw::InputSerializePort* port
498 this->m_Log_OutputPort[portNum].registerSerialPort(port);
501 #if FW_ENABLE_TEXT_LOGGING == 1
503 void ComQueueComponentBase ::
504 set_LogText_OutputPort(
506 Fw::InputSerializePort* port
510 portNum < this->getNum_LogText_OutputPorts(),
514 this->m_LogText_OutputPort[portNum].registerSerialPort(port);
522 Fw::InputSerializePort* port
530 this->m_Time_OutputPort[portNum].registerSerialPort(port);
536 Fw::InputSerializePort* port
544 this->m_Tlm_OutputPort[portNum].registerSerialPort(port);
549 #if FW_PORT_SERIALIZATION
558 Fw::InputSerializePort* port
566 this->m_buffQueueSend_OutputPort[portNum].registerSerialPort(port);
572 Fw::InputSerializePort* port
580 this->m_comQueueSend_OutputPort[portNum].registerSerialPort(port);
586 Fw::InputSerializePort* port
594 this->m_deallocate_OutputPort[portNum].registerSerialPort(port);
605 Fw::ActiveComponentBase(compName)
654 #if FW_ENABLE_TEXT_LOGGING == 1
657 getNum_LogText_OutputPorts()
const
710 return this->m_Log_OutputPort[portNum].
isConnected();
713 #if FW_ENABLE_TEXT_LOGGING == 1
715 bool ComQueueComponentBase ::
716 isConnected_LogText_OutputPort(
FwIndexType portNum)
719 portNum < this->getNum_LogText_OutputPorts(),
723 return this->m_LogText_OutputPort[portNum].isConnected();
736 return this->m_Time_OutputPort[portNum].
isConnected();
747 return this->m_Tlm_OutputPort[portNum].
isConnected();
762 return this->m_buffQueueSend_OutputPort[portNum].
isConnected();
773 return this->m_comQueueSend_OutputPort[portNum].
isConnected();
784 return this->m_deallocate_OutputPort[portNum].
isConnected();
810 ComponentIpcSerializableBuffer msg;
814 _status = msg.serialize(
823 _status = msg.serialize(portNum);
830 _status = msg.serialize(fwBuffer);
840 if (qStatus == Os::Queue::Status::FULL) {
870 ComponentIpcSerializableBuffer msg;
874 _status = msg.serialize(
883 _status = msg.serialize(portNum);
890 _status = msg.serialize(data);
897 _status = msg.serialize(context);
907 if (qStatus == Os::Queue::Status::FULL) {
935 ComponentIpcSerializableBuffer msg;
939 _status = msg.serialize(
948 _status = msg.serialize(portNum);
955 _status = msg.serialize(condition);
988 ComponentIpcSerializableBuffer msg;
992 _status = msg.serialize(
1001 _status = msg.serialize(portNum);
1008 _status = msg.serialize(context);
1018 if (qStatus == Os::Queue::Status::FULL) {
1088 this->m_buffQueueSend_OutputPort[portNum].
invoke(
1104 this->m_comQueueSend_OutputPort[portNum].
invoke(
1120 this->m_deallocate_OutputPort[portNum].
invoke(
1137 if (this->m_Time_OutputPort[0].isConnected()) {
1138 this->m_Time_OutputPort[0].
invoke(_logTime);
1146 if (this->m_Log_OutputPort[0].isConnected()) {
1150 #if FW_AMPCS_COMPATIBLE
1159 #if FW_AMPCS_COMPATIBLE
1169 _status = _logBuff.
serialize(queueType);
1175 #if FW_AMPCS_COMPATIBLE
1178 static_cast<U8>(
sizeof(U32))
1191 this->m_Log_OutputPort[0].
invoke(
1200 #if FW_ENABLE_TEXT_LOGGING
1201 if (this->m_LogText_OutputPort[0].isConnected()) {
1202 #if FW_OBJECT_NAMES == 1
1203 const char* _formatString =
1204 "(%s) %s: The %s queue at index %" PRIu32
" overflowed";
1206 const char* _formatString =
1207 "%s: The %s queue at index %" PRIu32
" overflowed";
1211 queueType.toString(queueTypeStr);
1217 this->m_objName.toChar(),
1224 this->m_LogText_OutputPort[0].invoke(
1244 if (this->m_Tlm_OutputPort[0].isConnected()) {
1246 this->m_Time_OutputPort[0].isConnected() &&
1249 this->m_Time_OutputPort[0].
invoke(_tlmTime);
1263 this->m_Tlm_OutputPort[0].
invoke(
1277 if (this->m_Tlm_OutputPort[0].isConnected()) {
1279 this->m_Time_OutputPort[0].isConnected() &&
1282 this->m_Time_OutputPort[0].
invoke(_tlmTime);
1296 this->m_Tlm_OutputPort[0].
invoke(
1311 if (this->m_Time_OutputPort[0].isConnected()) {
1313 this->m_Time_OutputPort[0].
invoke(_time);
1328 ComponentIpcSerializableBuffer msg;
1351 MsgTypeEnum msgType =
static_cast<MsgTypeEnum
>(desMsg);
1353 if (msgType == COMQUEUE_COMPONENT_EXIT) {
1358 deserStatus = msg.deserialize(portNum);
1366 case BUFFQUEUEIN_BUFFERSEND: {
1384 case COMQUEUEIN_COM: {
1395 deserStatus = msg.deserialize(context);
1411 case COMSTATUSIN_SUCCESSCONDITION: {
1432 deserStatus = msg.deserialize(context);
1457 void ComQueueComponentBase ::
1466 compPtr->buffQueueIn_handlerBase(
1472 void ComQueueComponentBase ::
1482 compPtr->comQueueIn_handlerBase(
1489 void ComQueueComponentBase ::
1498 compPtr->comStatusIn_handlerBase(
1504 void ComQueueComponentBase ::
1513 compPtr->run_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
Fw::SerializeStatus deserialize(Fw::SerializeBufferBase &buffer)
@ WARNING_HI
A serious but recoverable event.
void init()
Object initializer.
const char * toChar() const
void addCallPort(InputBufferSendPort *callPort)
Register an input port.
void invoke(Fw::Buffer &fwBuffer)
Invoke a port interface.
void init()
Initialization function.
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
void incNumMsgDropped()
increment the number of messages dropped
@ 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
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
const char * toChar() const
Fw::SerializeStatus deserialize(Fw::SerializeBufferBase &buffer)
Deserialize raw enum value from SerialType.
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
Array of queue depths for Fw::Buffer types.
virtual void comStatusIn_preMsgHook(FwIndexType portNum, Fw::Success &condition)
Pre-message hook for async input port comStatusIn.
FwIndexType getNum_Time_OutputPorts() const
virtual void comQueueIn_preMsgHook(FwIndexType portNum, Fw::ComBuffer &data, U32 context)
Pre-message hook for async input port comQueueIn.
void deallocate_out(FwIndexType portNum, Fw::Buffer &fwBuffer)
Invoke output port deallocate.
bool isConnected_comQueueSend_OutputPort(FwIndexType portNum)
void tlmWrite_comQueueDepth(const Svc::ComQueueDepth &arg, Fw::Time _tlmTime=Fw::Time())
virtual void run_handler(FwIndexType portNum, U32 context)=0
Handler for input port run.
FwIndexType getNum_comQueueSend_OutputPorts() const
FwIndexType getNum_buffQueueIn_InputPorts() const
void tlmWrite_buffQueueDepth(const Svc::BuffQueueDepth &arg, Fw::Time _tlmTime=Fw::Time())
FwIndexType getNum_deallocate_OutputPorts() const
FwIndexType getNum_buffQueueSend_OutputPorts() const
void comStatusIn_handlerBase(FwIndexType portNum, Fw::Success &condition)
Handler base-class function for input port comStatusIn.
void buffQueueIn_handlerBase(FwIndexType portNum, Fw::Buffer &fwBuffer)
Handler base-class function for input port buffQueueIn.
ComQueueComponentBase(const char *compName="")
Construct ComQueueComponentBase object.
void set_Tlm_OutputPort(FwIndexType portNum, Fw::InputTlmPort *port)
Connect port to Tlm[portNum].
void run_handlerBase(FwIndexType portNum, U32 context)
Handler base-class function for input port run.
FwIndexType getNum_comStatusIn_InputPorts() const
void buffQueueSend_out(FwIndexType portNum, Fw::Buffer &fwBuffer)
Invoke output port buffQueueSend.
virtual void buffQueueIn_preMsgHook(FwIndexType portNum, Fw::Buffer &fwBuffer)
Pre-message hook for async input port buffQueueIn.
FwIndexType getNum_comQueueIn_InputPorts() const
FwIndexType getNum_run_InputPorts() const
void comQueueSend_out(FwIndexType portNum, Fw::ComBuffer &data, U32 context)
Invoke output port comQueueSend.
virtual void buffQueueIn_handler(FwIndexType portNum, Fw::Buffer &fwBuffer)=0
Handler for input port buffQueueIn.
Fw::InputBufferSendPort * get_buffQueueIn_InputPort(FwIndexType portNum)
virtual ~ComQueueComponentBase()
Destroy ComQueueComponentBase object.
bool isConnected_Log_OutputPort(FwIndexType portNum)
bool isConnected_buffQueueSend_OutputPort(FwIndexType portNum)
void set_deallocate_OutputPort(FwIndexType portNum, Fw::InputBufferSendPort *port)
Connect port to deallocate[portNum].
@ CHANNELID_BUFFQUEUEDEPTH
Channel ID for buffQueueDepth.
@ CHANNELID_COMQUEUEDEPTH
Channel ID for comQueueDepth.
bool isConnected_deallocate_OutputPort(FwIndexType portNum)
virtual void buffQueueIn_overflowHook(FwIndexType portNum, Fw::Buffer &fwBuffer)=0
Overflow hook for async input port buffQueueIn.
void set_buffQueueSend_OutputPort(FwIndexType portNum, Fw::InputBufferSendPort *port)
Connect port to buffQueueSend[portNum].
FwIndexType getNum_Log_OutputPorts() const
virtual void comQueueIn_handler(FwIndexType portNum, Fw::ComBuffer &data, U32 context)=0
Handler for input port comQueueIn.
void comQueueIn_handlerBase(FwIndexType portNum, Fw::ComBuffer &data, U32 context)
Handler base-class function for input port comQueueIn.
Fw::InputSuccessConditionPort * get_comStatusIn_InputPort(FwIndexType portNum)
@ EVENTID_QUEUEOVERFLOW
Queue overflow event.
FwIndexType getNum_Tlm_OutputPorts() const
void set_Log_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to Log[portNum].
void log_WARNING_HI_QueueOverflow(Svc::QueueType queueType, U32 index)
bool isConnected_Tlm_OutputPort(FwIndexType portNum)
void set_Time_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to Time[portNum].
Svc::InputSchedPort * get_run_InputPort(FwIndexType portNum)
virtual void run_preMsgHook(FwIndexType portNum, U32 context)
Pre-message hook for async input port run.
virtual void comStatusIn_handler(FwIndexType portNum, Fw::Success &condition)=0
Handler for input port comStatusIn.
bool isConnected_Time_OutputPort(FwIndexType portNum)
Fw::InputComPort * get_comQueueIn_InputPort(FwIndexType portNum)
void set_comQueueSend_OutputPort(FwIndexType portNum, Fw::InputComPort *port)
Connect port to comQueueSend[portNum].
Array of queue depths for Fw::Com types.
An enumeration of queue data types.
@ SERIALIZED_SIZE
The size of the serial representation.
SerializeStatus
forward declaration for string
@ FW_SERIALIZE_OK
Serialization/Deserialization operation was successful.
@ OP_OK
Operation succeeded.