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_eventOut_OutputPort[port].
init();
192 #if FW_OBJECT_NAMES == 1 196 this->m_objName.toChar(),
199 this->m_eventOut_OutputPort[port].setObjName(portName.
toChar());
204 #if !FW_DIRECT_PORT_CALLS && FW_ENABLE_TEXT_LOGGING 208 port < static_cast<FwIndexType>(this->getNum_eventOutText_OutputPorts());
211 this->m_eventOutText_OutputPort[port].
init();
213 #if FW_OBJECT_NAMES == 1 217 this->m_objName.toChar(),
220 this->m_eventOutText_OutputPort[port].setObjName(portName.
toChar());
225 #if !FW_DIRECT_PORT_CALLS 232 this->m_timeCaller_OutputPort[port].
init();
234 #if FW_OBJECT_NAMES == 1 238 this->m_objName.toChar(),
241 this->m_timeCaller_OutputPort[port].setObjName(portName.
toChar());
246 #if !FW_DIRECT_PORT_CALLS 253 this->m_PktSend_OutputPort[port].
init();
255 #if FW_OBJECT_NAMES == 1 259 this->m_objName.toChar(),
262 this->m_PktSend_OutputPort[port].setObjName(portName.
toChar());
267 #if !FW_DIRECT_PORT_CALLS 274 this->m_pingOut_OutputPort[port].
init();
276 #if FW_OBJECT_NAMES == 1 280 this->m_objName.toChar(),
283 this->m_pingOut_OutputPort[port].setObjName(portName.
toChar());
291 static_cast<FwSizeType>(ComponentIpcSerializableBuffer::SERIALIZATION_SIZE)
295 static_cast<FwAssertArgType>(qStat)
299 #if !FW_DIRECT_PORT_CALLS 310 static_cast<FwAssertArgType>(portNum)
313 return &this->m_Run_InputPort[portNum];
321 static_cast<FwAssertArgType>(portNum)
324 return &this->m_TlmGet_InputPort[portNum];
332 static_cast<FwAssertArgType>(portNum)
335 return &this->m_TlmRecv_InputPort[portNum];
343 static_cast<FwAssertArgType>(portNum)
346 return &this->m_pingIn_InputPort[portNum];
351 #if !FW_DIRECT_PORT_CALLS 365 static_cast<FwAssertArgType>(portNum)
368 this->m_eventOut_OutputPort[portNum].
addCallPort(port);
371 #if FW_ENABLE_TEXT_LOGGING == 1 373 void TlmChanComponentBase ::
374 set_eventOutText_OutputPort(
380 (0 <= portNum) && (portNum < this->getNum_eventOutText_OutputPorts()),
381 static_cast<FwAssertArgType>(portNum)
384 this->m_eventOutText_OutputPort[portNum].addCallPort(port);
397 static_cast<FwAssertArgType>(portNum)
400 this->m_timeCaller_OutputPort[portNum].
addCallPort(port);
405 #if !FW_DIRECT_PORT_CALLS 419 static_cast<FwAssertArgType>(portNum)
422 this->m_PktSend_OutputPort[portNum].
addCallPort(port);
433 static_cast<FwAssertArgType>(portNum)
436 this->m_pingOut_OutputPort[portNum].
addCallPort(port);
441 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION 450 Fw::InputSerializePort* port
455 static_cast<FwAssertArgType>(portNum)
458 this->m_eventOut_OutputPort[portNum].registerSerialPort(port);
461 #if FW_ENABLE_TEXT_LOGGING == 1 463 void TlmChanComponentBase ::
464 set_eventOutText_OutputPort(
466 Fw::InputSerializePort* port
470 (0 <= portNum) && (portNum < this->getNum_eventOutText_OutputPorts()),
471 static_cast<FwAssertArgType>(portNum)
474 this->m_eventOutText_OutputPort[portNum].registerSerialPort(port);
482 Fw::InputSerializePort* port
487 static_cast<FwAssertArgType>(portNum)
490 this->m_timeCaller_OutputPort[portNum].registerSerialPort(port);
495 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION 504 Fw::InputSerializePort* port
509 static_cast<FwAssertArgType>(portNum)
512 this->m_PktSend_OutputPort[portNum].registerSerialPort(port);
518 Fw::InputSerializePort* port
523 static_cast<FwAssertArgType>(portNum)
526 this->m_pingOut_OutputPort[portNum].registerSerialPort(port);
537 Fw::ActiveComponentBase(compName)
548 #if !FW_DIRECT_PORT_CALLS 559 static_cast<FwAssertArgType>(portNum)
562 return this->m_eventOut_OutputPort[portNum].
isConnected();
565 #if FW_ENABLE_TEXT_LOGGING == 1 567 bool TlmChanComponentBase ::
568 isConnected_eventOutText_OutputPort(
FwIndexType portNum)
const 571 (0 <= portNum) && (portNum < this->getNum_eventOutText_OutputPorts()),
572 static_cast<FwAssertArgType>(portNum)
575 return this->m_eventOutText_OutputPort[portNum].isConnected();
585 static_cast<FwAssertArgType>(portNum)
588 return this->m_timeCaller_OutputPort[portNum].
isConnected();
593 #if !FW_DIRECT_PORT_CALLS 604 static_cast<FwAssertArgType>(portNum)
607 return this->m_PktSend_OutputPort[portNum].
isConnected();
615 static_cast<FwAssertArgType>(portNum)
618 return this->m_pingOut_OutputPort[portNum].
isConnected();
638 static_cast<FwAssertArgType>(portNum)
646 ComponentIpcSerializableBuffer msg;
650 _status = msg.serializeFrom(
651 static_cast<FwEnumStoreType>(RUN_SCHED)
655 static_cast<FwAssertArgType>(_status)
659 _status = msg.serializeFrom(portNum);
662 static_cast<FwAssertArgType>(_status)
666 _status = msg.serializeFrom(context);
669 static_cast<FwAssertArgType>(_status)
678 static_cast<FwAssertArgType>(qStatus)
693 static_cast<FwAssertArgType>(portNum)
726 static_cast<FwAssertArgType>(portNum)
753 static_cast<FwAssertArgType>(portNum)
761 ComponentIpcSerializableBuffer msg;
765 _status = msg.serializeFrom(
766 static_cast<FwEnumStoreType>(PINGIN_PING)
770 static_cast<FwAssertArgType>(_status)
774 _status = msg.serializeFrom(portNum);
777 static_cast<FwAssertArgType>(_status)
781 _status = msg.serializeFrom(key);
784 static_cast<FwAssertArgType>(_status)
793 static_cast<FwAssertArgType>(qStatus)
823 #if !FW_DIRECT_PORT_CALLS 838 static_cast<FwAssertArgType>(portNum)
842 this->m_PktSend_OutputPort[portNum].isConnected(),
843 static_cast<FwAssertArgType>(portNum)
845 this->m_PktSend_OutputPort[portNum].
invoke(
859 static_cast<FwAssertArgType>(portNum)
863 this->m_pingOut_OutputPort[portNum].isConnected(),
864 static_cast<FwAssertArgType>(portNum)
866 this->m_pingOut_OutputPort[portNum].
invoke(
880 U32 numTimesDeferredCountReached
886 this->timeCaller_out(0, _logTime);
896 #if FW_AMPCS_COMPATIBLE 901 static_cast<FwAssertArgType>(_status)
905 #if FW_AMPCS_COMPATIBLE 908 static_cast<U8>(
sizeof(U32))
912 static_cast<FwAssertArgType>(_status)
918 static_cast<FwAssertArgType>(_status)
921 #if FW_AMPCS_COMPATIBLE 924 static_cast<U8>(
sizeof(U32))
928 static_cast<FwAssertArgType>(_status)
931 _status = _logBuff.
serializeFrom(numTimesDeferredCountReached);
934 static_cast<FwAssertArgType>(_status)
947 #if FW_ENABLE_TEXT_LOGGING 948 if (this->isConnected_eventOutText_OutputPort(0)) {
949 #if FW_OBJECT_NAMES == 1 950 const char* _formatString =
951 "(%s) %s: TlmChan epoch processing cap reached: %" PRIu32
" entries deferred (cumulative: %" PRIu32
")";
953 const char* _formatString =
954 "%s: TlmChan epoch processing cap reached: %" PRIu32
" entries deferred (cumulative: %" PRIu32
")";
961 this->m_objName.toChar(),
963 "TlmChanEpochProcessingCapReached ",
965 numTimesDeferredCountReached
968 this->eventOutText_out(
988 this->timeCaller_out(0, _time);
1006 this->m_guardedPortMutex.
lock();
1012 this->m_guardedPortMutex.
unLock();
1022 ComponentIpcSerializableBuffer _msg;
1032 static_cast<FwAssertArgType>(_msgStatus)
1042 static_cast<FwAssertArgType>(_deserStatus)
1045 MsgTypeEnum _msgType =
static_cast<MsgTypeEnum
>(_desMsg);
1047 if (_msgType == TLMCHAN_COMPONENT_EXIT) {
1052 _deserStatus = _msg.deserializeTo(portNum);
1055 static_cast<FwAssertArgType>(_deserStatus)
1063 _deserStatus = _msg.deserializeTo(context);
1066 static_cast<FwAssertArgType>(_deserStatus)
1081 _deserStatus = _msg.deserializeTo(key);
1084 static_cast<FwAssertArgType>(_deserStatus)
1106 void TlmChanComponentBase ::
1115 compPtr->Run_handlerBase(
1132 return compPtr->TlmGet_handlerBase(
1140 void TlmChanComponentBase ::
1151 compPtr->TlmRecv_handlerBase(
1159 void TlmChanComponentBase ::
1168 compPtr->pingIn_handlerBase(
1174 #if !FW_DIRECT_PORT_CALLS 1180 void TlmChanComponentBase ::
1191 static_cast<FwAssertArgType>(portNum)
1195 this->m_eventOut_OutputPort[portNum].isConnected(),
1196 static_cast<FwAssertArgType>(portNum)
1198 this->m_eventOut_OutputPort[portNum].
invoke(
1206 #if FW_ENABLE_TEXT_LOGGING 1208 void TlmChanComponentBase ::
1218 (0 <= portNum) && (portNum < this->getNum_eventOutText_OutputPorts()),
1219 static_cast<FwAssertArgType>(portNum)
1223 this->m_eventOutText_OutputPort[portNum].isConnected(),
1224 static_cast<FwAssertArgType>(portNum)
1226 this->m_eventOutText_OutputPort[portNum].invoke(
1236 void TlmChanComponentBase ::
1244 static_cast<FwAssertArgType>(portNum)
1248 this->m_timeCaller_OutputPort[portNum].isConnected(),
1249 static_cast<FwAssertArgType>(portNum)
1251 this->m_timeCaller_OutputPort[portNum].
invoke(
Serialization/Deserialization operation was successful.
void addCallPort(InputTimePort *callPort)
Register an input port.
virtual void TlmRecv_handler(FwIndexType portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)=0
Handler for input port TlmRecv.
message to exit active component task
void invoke(Fw::ComBuffer &data, U32 context) const
Invoke a port connection.
void init()
Initialization function.
SerializeStatus serializeFrom(U8 val, Endianness mode=Endianness::BIG) override
Serialize an 8-bit unsigned integer value.
FwIdType getIdBase() const
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.
bool isConnected_eventOut_OutputPort(FwIndexType portNum) const
bool isConnected_timeCaller_OutputPort(FwIndexType portNum) const
virtual ~TlmChanComponentBase()
Destroy TlmChanComponentBase object.
static constexpr FwIndexType getNum_Run_InputPorts()
No time base has been established (Required)
void set_eventOut_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to eventOut[portNum].
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.
FwIdType FwEventIdType
The type of an event identifier.
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.
#define FW_OBJECT_NAMES
Indicates whether or not object names are stored (more memory, can be used for tracking objects) ...
void init()
Initialization function.
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.
void invoke(Fw::Time &time) const
Invoke a port connection.
static constexpr FwIndexType getNum_pingIn_InputPorts()
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
void log_WARNING_HI_TlmChanEpochProcessingCapReached(U32 numDeferred, U32 numTimesDeferredCountReached) const
Epoch Processing cap reached; one or more telemetry entries were deferred this cycle.
static constexpr FwIndexType getNum_TlmRecv_InputPorts()
A serious but recoverable event.
Errors dispatching messages.
const char * toChar() const
Convert to a C-style char*.
Enum representing event severity.
void set_PktSend_OutputPort(FwIndexType portNum, Fw::InputComPort *port)
Connect port to PktSend[portNum].
static constexpr FwIndexType getNum_eventOut_OutputPorts()
static constexpr FwIndexType getNum_PktSend_OutputPorts()
FormatStatus format(const CHAR *formatString,...)
write formatted string to buffer
void init()
Initialization function.
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.
void invoke(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args) const
Invoke a port connection.
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.
void set_timeCaller_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to timeCaller[portNum].
PlatformIndexType FwIndexType
virtual void unLock()
Unlock the guarded mutex.
void addCallPort(InputLogPort *callPort)
Register an input port.
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_timeCaller_OutputPorts()
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