9 #if FW_ENABLE_TEXT_LOGGING 32 class ComponentIpcSerializableBuffer :
42 MAX_DATA_SIZE =
sizeof(BuffUnion),
44 SERIALIZATION_SIZE = DATA_OFFSET + MAX_DATA_SIZE
48 return sizeof(m_buff);
55 const U8* getBuffAddr()
const {
61 U8 m_buff[SERIALIZATION_SIZE];
79 #if !FW_DIRECT_PORT_CALLS 86 this->m_Run_InputPort[port].
init();
93 #if FW_OBJECT_NAMES == 1 97 this->m_objName.toChar(),
100 this->m_Run_InputPort[port].setObjName(portName.
toChar());
105 #if !FW_DIRECT_PORT_CALLS 112 this->m_TlmGet_InputPort[port].
init();
117 this->m_TlmGet_InputPort[port].
setPortNum(port);
119 #if FW_OBJECT_NAMES == 1 123 this->m_objName.toChar(),
126 this->m_TlmGet_InputPort[port].setObjName(portName.
toChar());
131 #if !FW_DIRECT_PORT_CALLS 138 this->m_TlmRecv_InputPort[port].
init();
143 this->m_TlmRecv_InputPort[port].
setPortNum(port);
145 #if FW_OBJECT_NAMES == 1 149 this->m_objName.toChar(),
152 this->m_TlmRecv_InputPort[port].setObjName(portName.
toChar());
157 #if !FW_DIRECT_PORT_CALLS 164 this->m_pingIn_InputPort[port].
init();
169 this->m_pingIn_InputPort[port].
setPortNum(port);
171 #if FW_OBJECT_NAMES == 1 175 this->m_objName.toChar(),
178 this->m_pingIn_InputPort[port].setObjName(portName.
toChar());
183 #if !FW_DIRECT_PORT_CALLS 190 this->m_PktSend_OutputPort[port].
init();
192 #if FW_OBJECT_NAMES == 1 196 this->m_objName.toChar(),
199 this->m_PktSend_OutputPort[port].setObjName(portName.
toChar());
204 #if !FW_DIRECT_PORT_CALLS 211 this->m_pingOut_OutputPort[port].
init();
213 #if FW_OBJECT_NAMES == 1 217 this->m_objName.toChar(),
220 this->m_pingOut_OutputPort[port].setObjName(portName.
toChar());
228 static_cast<FwSizeType>(ComponentIpcSerializableBuffer::SERIALIZATION_SIZE)
232 static_cast<FwAssertArgType>(qStat)
236 #if !FW_DIRECT_PORT_CALLS 247 static_cast<FwAssertArgType>(portNum)
250 return &this->m_Run_InputPort[portNum];
258 static_cast<FwAssertArgType>(portNum)
261 return &this->m_TlmGet_InputPort[portNum];
269 static_cast<FwAssertArgType>(portNum)
272 return &this->m_TlmRecv_InputPort[portNum];
280 static_cast<FwAssertArgType>(portNum)
283 return &this->m_pingIn_InputPort[portNum];
288 #if !FW_DIRECT_PORT_CALLS 302 static_cast<FwAssertArgType>(portNum)
305 this->m_PktSend_OutputPort[portNum].
addCallPort(port);
316 static_cast<FwAssertArgType>(portNum)
319 this->m_pingOut_OutputPort[portNum].
addCallPort(port);
324 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION 333 Fw::InputSerializePort* port
338 static_cast<FwAssertArgType>(portNum)
341 this->m_PktSend_OutputPort[portNum].registerSerialPort(port);
347 Fw::InputSerializePort* port
352 static_cast<FwAssertArgType>(portNum)
355 this->m_pingOut_OutputPort[portNum].registerSerialPort(port);
366 Fw::ActiveComponentBase(compName)
377 #if !FW_DIRECT_PORT_CALLS 388 static_cast<FwAssertArgType>(portNum)
391 return this->m_PktSend_OutputPort[portNum].
isConnected();
399 static_cast<FwAssertArgType>(portNum)
402 return this->m_pingOut_OutputPort[portNum].
isConnected();
422 static_cast<FwAssertArgType>(portNum)
430 ComponentIpcSerializableBuffer msg;
434 _status = msg.serializeFrom(
435 static_cast<FwEnumStoreType>(RUN_SCHED)
439 static_cast<FwAssertArgType>(_status)
443 _status = msg.serializeFrom(portNum);
446 static_cast<FwAssertArgType>(_status)
450 _status = msg.serializeFrom(context);
453 static_cast<FwAssertArgType>(_status)
462 static_cast<FwAssertArgType>(qStatus)
477 static_cast<FwAssertArgType>(portNum)
510 static_cast<FwAssertArgType>(portNum)
537 static_cast<FwAssertArgType>(portNum)
545 ComponentIpcSerializableBuffer msg;
549 _status = msg.serializeFrom(
550 static_cast<FwEnumStoreType>(PINGIN_PING)
554 static_cast<FwAssertArgType>(_status)
558 _status = msg.serializeFrom(portNum);
561 static_cast<FwAssertArgType>(_status)
565 _status = msg.serializeFrom(key);
568 static_cast<FwAssertArgType>(_status)
577 static_cast<FwAssertArgType>(qStatus)
607 #if !FW_DIRECT_PORT_CALLS 622 static_cast<FwAssertArgType>(portNum)
626 this->m_PktSend_OutputPort[portNum].isConnected(),
627 static_cast<FwAssertArgType>(portNum)
629 this->m_PktSend_OutputPort[portNum].
invoke(
643 static_cast<FwAssertArgType>(portNum)
647 this->m_pingOut_OutputPort[portNum].isConnected(),
648 static_cast<FwAssertArgType>(portNum)
650 this->m_pingOut_OutputPort[portNum].
invoke(
667 this->m_guardedPortMutex.
lock();
673 this->m_guardedPortMutex.
unLock();
683 ComponentIpcSerializableBuffer _msg;
693 static_cast<FwAssertArgType>(_msgStatus)
703 static_cast<FwAssertArgType>(_deserStatus)
706 MsgTypeEnum _msgType =
static_cast<MsgTypeEnum
>(_desMsg);
708 if (_msgType == TLMCHAN_COMPONENT_EXIT) {
713 _deserStatus = _msg.deserializeTo(portNum);
716 static_cast<FwAssertArgType>(_deserStatus)
724 _deserStatus = _msg.deserializeTo(context);
727 static_cast<FwAssertArgType>(_deserStatus)
742 _deserStatus = _msg.deserializeTo(key);
745 static_cast<FwAssertArgType>(_deserStatus)
767 void TlmChanComponentBase ::
776 compPtr->Run_handlerBase(
793 return compPtr->TlmGet_handlerBase(
801 void TlmChanComponentBase ::
812 compPtr->TlmRecv_handlerBase(
820 void TlmChanComponentBase ::
829 compPtr->pingIn_handlerBase(
Serialization/Deserialization operation was successful.
virtual void TlmRecv_handler(FwIndexType portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)=0
Handler for input port TlmRecv.
void invoke(Fw::ComBuffer &data, U32 context) const
Invoke a port connection.
void init()
Initialization function.
virtual Fw::TlmValid TlmGet_handler(FwIndexType portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)=0
Handler for input port TlmGet.
PlatformSizeType FwSizeType
void pingIn_handlerBase(FwIndexType portNum, U32 key)
Handler base-class function for input port pingIn.
Fw::InputTlmPort * get_TlmRecv_InputPort(FwIndexType portNum)
Status receive(U8 *destination, FwSizeType capacity, BlockingType blockType, FwSizeType &actualSize, FwQueuePriorityType &priority) override
receive a message from the queue through delegate
Status
status returned from the queue send function
Fw::TlmValid TlmGet_handlerBase(FwIndexType portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)
Handler base-class function for input port TlmGet.
bool isConnected_pingOut_OutputPort(FwIndexType portNum) const
void unLock()
unlock the mutex and assert success
bool isConnected_PktSend_OutputPort(FwIndexType portNum) const
void invoke(U32 key) const
Invoke a port connection.
virtual ~TlmChanComponentBase()
Destroy TlmChanComponentBase object.
static constexpr FwIndexType getNum_Run_InputPorts()
Os::Queue m_queue
queue object for active component
void init()
Object initializer.
SerializeStatus
forward declaration for string
virtual void pingIn_handler(FwIndexType portNum, U32 key)=0
Handler for input port pingIn.
Message will block until space is available.
void PktSend_out(FwIndexType portNum, Fw::ComBuffer &data, U32 context) const
Invoke output port PktSend.
static constexpr FwSizeType CAPACITY
virtual void lock()
Lock the guarded mutex.
Svc::InputSchedPort * get_Run_InputPort(FwIndexType portNum)
void pingOut_out(FwIndexType portNum, U32 key) const
Invoke output port pingOut.
Os::Queue::Status createQueue(FwSizeType depth, FwSizeType msgSize)
void init()
Initialization function.
static constexpr FwIndexType getNum_pingIn_InputPorts()
const char * toChar() const
Convert to a C-style char*.
FwIdType FwChanIdType
The type of a telemetry channel identifier.
void addCallPort(InputPingPort *callPort)
Register an input port.
Status send(const U8 *buffer, FwSizeType size, FwQueuePriorityType priority, BlockingType blockType) override
send a message into the queue through delegate
static constexpr FwIndexType getNum_TlmRecv_InputPorts()
Errors dispatching messages.
void set_PktSend_OutputPort(FwIndexType portNum, Fw::InputComPort *port)
Connect port to PktSend[portNum].
static constexpr FwIndexType getNum_PktSend_OutputPorts()
FormatStatus format(const CHAR *formatString,...)
write formatted string to buffer
uint8_t U8
8-bit unsigned integer
virtual void Run_preMsgHook(FwIndexType portNum, U32 context)
Pre-message hook for async input port Run.
virtual void Run_handler(FwIndexType portNum, U32 context)=0
Handler for input port Run.
PlatformQueuePriorityType FwQueuePriorityType
The type of queue priorities used.
static constexpr FwIndexType getNum_pingOut_OutputPorts()
Svc::InputPingPort * get_pingIn_InputPort(FwIndexType portNum)
A message was sent requesting an exit of the loop.
virtual void pingIn_preMsgHook(FwIndexType portNum, U32 key)
Pre-message hook for async input port pingIn.
void TlmRecv_handlerBase(FwIndexType portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)
Handler base-class function for input port TlmRecv.
PlatformIndexType FwIndexType
virtual void unLock()
Unlock the guarded mutex.
void set_pingOut_OutputPort(FwIndexType portNum, Svc::InputPingPort *port)
Connect port to pingOut[portNum].
RateGroupDivider component implementation.
message sent/received okay
Fw::InputTlmGetPort * get_TlmGet_InputPort(FwIndexType portNum)
void addCallPort(InputComPort *callPort)
Register an input port.
static constexpr FwIndexType getNum_TlmGet_InputPorts()
Message will return with status when space is unavailable.
Implementation of malloc based allocator.
TlmChanComponentBase(const char *compName="")
Construct TlmChanComponentBase object.
static constexpr FwSizeType CAPACITY
void Run_handlerBase(FwIndexType portNum, U32 context)
Handler base-class function for input port Run.
void lock()
lock the mutex and assert success
message to exit active component task