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());
296 ComponentIpcSerializableBuffer::SERIALIZATION_SIZE
316 return &this->m_buffQueueIn_InputPort[portNum];
327 return &this->m_comQueueIn_InputPort[portNum];
338 return &this->m_comStatusIn_InputPort[portNum];
349 return &this->m_run_InputPort[portNum];
370 #if FW_ENABLE_TEXT_LOGGING == 1
372 void ComQueueComponentBase ::
373 set_LogText_OutputPort(
379 portNum < this->getNum_LogText_OutputPorts(),
383 this->m_LogText_OutputPort[portNum].addCallPort(port);
399 this->m_Time_OutputPort[portNum].
addCallPort(port);
431 this->m_buffQueueSend_OutputPort[portNum].
addCallPort(port);
445 this->m_comQueueSend_OutputPort[portNum].
addCallPort(port);
448 #if FW_PORT_SERIALIZATION
457 Fw::InputSerializePort* port
465 this->m_Log_OutputPort[portNum].registerSerialPort(port);
468 #if FW_ENABLE_TEXT_LOGGING == 1
470 void ComQueueComponentBase ::
471 set_LogText_OutputPort(
473 Fw::InputSerializePort* port
477 portNum < this->getNum_LogText_OutputPorts(),
481 this->m_LogText_OutputPort[portNum].registerSerialPort(port);
489 Fw::InputSerializePort* port
497 this->m_Time_OutputPort[portNum].registerSerialPort(port);
503 Fw::InputSerializePort* port
511 this->m_Tlm_OutputPort[portNum].registerSerialPort(port);
516 #if FW_PORT_SERIALIZATION
525 Fw::InputSerializePort* port
533 this->m_buffQueueSend_OutputPort[portNum].registerSerialPort(port);
539 Fw::InputSerializePort* port
547 this->m_comQueueSend_OutputPort[portNum].registerSerialPort(port);
558 Fw::ActiveComponentBase(compName)
607 #if FW_ENABLE_TEXT_LOGGING == 1
610 getNum_LogText_OutputPorts()
const
657 return this->m_Log_OutputPort[portNum].
isConnected();
660 #if FW_ENABLE_TEXT_LOGGING == 1
662 bool ComQueueComponentBase ::
663 isConnected_LogText_OutputPort(
FwIndexType portNum)
666 portNum < this->getNum_LogText_OutputPorts(),
670 return this->m_LogText_OutputPort[portNum].isConnected();
683 return this->m_Time_OutputPort[portNum].
isConnected();
694 return this->m_Tlm_OutputPort[portNum].
isConnected();
709 return this->m_buffQueueSend_OutputPort[portNum].
isConnected();
720 return this->m_comQueueSend_OutputPort[portNum].
isConnected();
746 ComponentIpcSerializableBuffer msg;
750 _status = msg.serialize(
759 _status = msg.serialize(portNum);
766 _status = msg.serialize(fwBuffer);
806 ComponentIpcSerializableBuffer msg;
810 _status = msg.serialize(
819 _status = msg.serialize(portNum);
826 _status = msg.serialize(data);
833 _status = msg.serialize(context);
871 ComponentIpcSerializableBuffer msg;
875 _status = msg.serialize(
884 _status = msg.serialize(portNum);
891 _status = msg.serialize(condition);
924 ComponentIpcSerializableBuffer msg;
928 _status = msg.serialize(
937 _status = msg.serialize(portNum);
944 _status = msg.serialize(context);
1024 this->m_buffQueueSend_OutputPort[portNum].
invoke(
1040 this->m_comQueueSend_OutputPort[portNum].
invoke(
1058 if (this->m_Time_OutputPort[0].isConnected()) {
1059 this->m_Time_OutputPort[0].
invoke(_logTime);
1067 if (this->m_Log_OutputPort[0].isConnected()) {
1071 #if FW_AMPCS_COMPATIBLE
1080 #if FW_AMPCS_COMPATIBLE
1090 _status = _logBuff.
serialize(queueType);
1096 #if FW_AMPCS_COMPATIBLE
1099 static_cast<U8>(
sizeof(U32))
1112 this->m_Log_OutputPort[0].
invoke(
1121 #if FW_ENABLE_TEXT_LOGGING
1122 if (this->m_LogText_OutputPort[0].isConnected()) {
1123 #if FW_OBJECT_NAMES == 1
1124 const char* _formatString =
1125 "(%s) %s: The %s queue at index %" PRIu32
" overflowed";
1127 const char* _formatString =
1128 "%s: The %s queue at index %" PRIu32
" overflowed";
1132 queueType.toString(queueTypeStr);
1138 this->m_objName.toChar(),
1145 this->m_LogText_OutputPort[0].invoke(
1165 if (this->m_Tlm_OutputPort[0].isConnected()) {
1167 this->m_Time_OutputPort[0].isConnected() &&
1170 this->m_Time_OutputPort[0].
invoke(_tlmTime);
1184 this->m_Tlm_OutputPort[0].
invoke(
1198 if (this->m_Tlm_OutputPort[0].isConnected()) {
1200 this->m_Time_OutputPort[0].isConnected() &&
1203 this->m_Time_OutputPort[0].
invoke(_tlmTime);
1217 this->m_Tlm_OutputPort[0].
invoke(
1232 if (this->m_Time_OutputPort[0].isConnected()) {
1234 this->m_Time_OutputPort[0].
invoke(_time);
1249 ComponentIpcSerializableBuffer msg;
1272 MsgTypeEnum msgType =
static_cast<MsgTypeEnum
>(desMsg);
1274 if (msgType == COMQUEUE_COMPONENT_EXIT) {
1279 deserStatus = msg.deserialize(portNum);
1287 case BUFFQUEUEIN_BUFFERSEND: {
1305 case COMQUEUEIN_COM: {
1316 deserStatus = msg.deserialize(context);
1332 case COMSTATUSIN_SUCCESSCONDITION: {
1353 deserStatus = msg.deserialize(context);
1378 void ComQueueComponentBase ::
1387 compPtr->buffQueueIn_handlerBase(
1393 void ComQueueComponentBase ::
1403 compPtr->comQueueIn_handlerBase(
1410 void ComQueueComponentBase ::
1419 compPtr->comStatusIn_handlerBase(
1425 void ComQueueComponentBase ::
1434 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
FwIndexType FwQueueSizeType
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::QueueStatus createQueue(NATIVE_INT_TYPE depth, NATIVE_INT_TYPE 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.
@ QUEUE_OK
message sent/received okay
@ QUEUE_FULL
queue was full when attempting to send a message
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.
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.
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())
@ EVENTID_QUEUEOVERFLOW
Queue overflow event.
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)
@ CHANNELID_BUFFQUEUEDEPTH
Channel ID for buffQueueDepth.
@ CHANNELID_COMQUEUEDEPTH
Channel ID for comQueueDepth.
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)
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.