10 #if FW_ENABLE_TEXT_LOGGING
32 class ComponentIpcSerializableBuffer :
47 return sizeof(m_buff);
54 const U8* getBuffAddr()
const {
60 U8 m_buff[SERIALIZATION_SIZE];
84 this->m_Run_InputPort[port].
init();
91 #if FW_OBJECT_NAMES == 1
95 this->m_objName.toChar(),
98 this->m_Run_InputPort[port].setObjName(portName.
toChar());
108 this->m_TlmGet_InputPort[port].
init();
113 this->m_TlmGet_InputPort[port].
setPortNum(port);
115 #if FW_OBJECT_NAMES == 1
119 this->m_objName.toChar(),
122 this->m_TlmGet_InputPort[port].setObjName(portName.
toChar());
132 this->m_TlmRecv_InputPort[port].
init();
137 this->m_TlmRecv_InputPort[port].
setPortNum(port);
139 #if FW_OBJECT_NAMES == 1
143 this->m_objName.toChar(),
146 this->m_TlmRecv_InputPort[port].setObjName(portName.
toChar());
156 this->m_pingIn_InputPort[port].
init();
161 this->m_pingIn_InputPort[port].
setPortNum(port);
163 #if FW_OBJECT_NAMES == 1
167 this->m_objName.toChar(),
170 this->m_pingIn_InputPort[port].setObjName(portName.
toChar());
180 this->m_PktSend_OutputPort[port].
init();
182 #if FW_OBJECT_NAMES == 1
186 this->m_objName.toChar(),
189 this->m_PktSend_OutputPort[port].setObjName(portName.
toChar());
199 this->m_pingOut_OutputPort[port].
init();
201 #if FW_OBJECT_NAMES == 1
205 this->m_objName.toChar(),
208 this->m_pingOut_OutputPort[port].setObjName(portName.
toChar());
214 static_cast<FwSizeType>(ComponentIpcSerializableBuffer::SERIALIZATION_SIZE)
234 return &this->m_Run_InputPort[portNum];
245 return &this->m_TlmGet_InputPort[portNum];
256 return &this->m_TlmRecv_InputPort[portNum];
267 return &this->m_pingIn_InputPort[portNum];
285 this->m_PktSend_OutputPort[portNum].
addCallPort(port);
299 this->m_pingOut_OutputPort[portNum].
addCallPort(port);
302 #if FW_PORT_SERIALIZATION
311 Fw::InputSerializePort* port
319 this->m_PktSend_OutputPort[portNum].registerSerialPort(port);
325 Fw::InputSerializePort* port
333 this->m_pingOut_OutputPort[portNum].registerSerialPort(port);
344 Fw::ActiveComponentBase(compName)
411 return this->m_PktSend_OutputPort[portNum].
isConnected();
422 return this->m_pingOut_OutputPort[portNum].
isConnected();
448 ComponentIpcSerializableBuffer msg;
452 _status = msg.serialize(
461 _status = msg.serialize(portNum);
468 _status = msg.serialize(context);
559 ComponentIpcSerializableBuffer msg;
563 _status = msg.serialize(
572 _status = msg.serialize(portNum);
579 _status = msg.serialize(key);
636 this->m_PktSend_OutputPort[portNum].
invoke(
652 this->m_pingOut_OutputPort[portNum].
invoke(
667 this->m_guardedPortMutex.
lock();
673 this->m_guardedPortMutex.
unLock();
683 ComponentIpcSerializableBuffer msg;
706 MsgTypeEnum msgType =
static_cast<MsgTypeEnum
>(desMsg);
708 if (msgType == TLMCHAN_COMPONENT_EXIT) {
713 deserStatus = msg.deserialize(portNum);
724 deserStatus = msg.deserialize(context);
742 deserStatus = msg.deserialize(key);
767 void TlmChanComponentBase ::
776 compPtr->Run_handlerBase(
782 void TlmChanComponentBase ::
793 compPtr->TlmGet_handlerBase(
801 void TlmChanComponentBase ::
812 compPtr->TlmRecv_handlerBase(
820 void TlmChanComponentBase ::
829 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
PlatformAssertArgType FwAssertArgType
PlatformSizeType FwSizeType
PlatformQueuePriorityType FwQueuePriorityType
PlatformIndexType FwIndexType
@ ACTIVE_COMPONENT_EXIT
message to exit active component task
void init()
Object initializer.
const char * toChar() const
void addCallPort(InputComPort *callPort)
Register an input port.
void init()
Initialization function.
void invoke(Fw::ComBuffer &data, U32 context)
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 format(const CHAR *formatString,...)
write formatted string to buffer
void unLock()
unlock the mutex and assert success
void lock()
lock the mutex and assert success
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_PktSend_OutputPorts() const
virtual void Run_preMsgHook(FwIndexType portNum, U32 context)
Pre-message hook for async input port Run.
FwIndexType getNum_TlmGet_InputPorts() const
void set_pingOut_OutputPort(FwIndexType portNum, Svc::InputPingPort *port)
Connect port to pingOut[portNum].
virtual void unLock()
Unlock the guarded mutex.
virtual void Run_handler(FwIndexType portNum, U32 context)=0
Handler for input port Run.
Svc::InputPingPort * get_pingIn_InputPort(FwIndexType portNum)
virtual ~TlmChanComponentBase()
Destroy TlmChanComponentBase object.
virtual void TlmRecv_handler(FwIndexType portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)=0
Handler for input port TlmRecv.
void TlmRecv_handlerBase(FwIndexType portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)
Handler base-class function for input port TlmRecv.
void PktSend_out(FwIndexType portNum, Fw::ComBuffer &data, U32 context)
Invoke output port PktSend.
bool isConnected_PktSend_OutputPort(FwIndexType portNum)
FwIndexType getNum_pingIn_InputPorts() const
virtual void pingIn_handler(FwIndexType portNum, U32 key)=0
Handler for input port pingIn.
void pingIn_handlerBase(FwIndexType portNum, U32 key)
Handler base-class function for input port pingIn.
void Run_handlerBase(FwIndexType portNum, U32 context)
Handler base-class function for input port Run.
virtual void pingIn_preMsgHook(FwIndexType portNum, U32 key)
Pre-message hook for async input port pingIn.
FwIndexType getNum_TlmRecv_InputPorts() const
TlmChanComponentBase(const char *compName="")
Construct TlmChanComponentBase object.
Fw::InputTlmGetPort * get_TlmGet_InputPort(FwIndexType portNum)
virtual void TlmGet_handler(FwIndexType portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)=0
Handler for input port TlmGet.
void pingOut_out(FwIndexType portNum, U32 key)
Invoke output port pingOut.
bool isConnected_pingOut_OutputPort(FwIndexType portNum)
Svc::InputSchedPort * get_Run_InputPort(FwIndexType portNum)
FwIndexType getNum_Run_InputPorts() const
Fw::InputTlmPort * get_TlmRecv_InputPort(FwIndexType portNum)
FwIndexType getNum_pingOut_OutputPorts() const
virtual void lock()
Lock the guarded mutex.
void TlmGet_handlerBase(FwIndexType portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)
Handler base-class function for input port TlmGet.
void set_PktSend_OutputPort(FwIndexType portNum, Fw::InputComPort *port)
Connect port to PktSend[portNum].
SerializeStatus
forward declaration for string
@ FW_SERIALIZE_OK
Serialization/Deserialization operation was successful.
@ OP_OK
Operation succeeded.