9 #if FW_ENABLE_TEXT_LOGGING 32 class ComponentIpcSerializableBuffer :
42 MAX_DATA_SIZE =
sizeof(BuffUnion),
44 SERIALIZATION_SIZE = DATA_OFFSET + MAX_DATA_SIZE
47 ComponentIpcSerializableBuffer() :
Fw::LinearBufferBase(m_buff, sizeof(m_buff)) {
53 U8 m_buff[SERIALIZATION_SIZE];
71 #if !FW_DIRECT_PORT_CALLS 78 this->m_Run_InputPort[port].
init();
85 #if FW_OBJECT_NAMES == 1 89 this->m_objName.toChar(),
92 this->m_Run_InputPort[port].setObjName(portName.
toChar());
97 #if !FW_DIRECT_PORT_CALLS 104 this->m_TlmGet_InputPort[port].
init();
109 this->m_TlmGet_InputPort[port].
setPortNum(port);
111 #if FW_OBJECT_NAMES == 1 115 this->m_objName.toChar(),
118 this->m_TlmGet_InputPort[port].setObjName(portName.
toChar());
123 #if !FW_DIRECT_PORT_CALLS 130 this->m_TlmRecv_InputPort[port].
init();
135 this->m_TlmRecv_InputPort[port].
setPortNum(port);
137 #if FW_OBJECT_NAMES == 1 141 this->m_objName.toChar(),
144 this->m_TlmRecv_InputPort[port].setObjName(portName.
toChar());
149 #if !FW_DIRECT_PORT_CALLS 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());
175 #if !FW_DIRECT_PORT_CALLS 182 this->m_eventOut_OutputPort[port].
init();
184 #if FW_OBJECT_NAMES == 1 188 this->m_objName.toChar(),
191 this->m_eventOut_OutputPort[port].setObjName(portName.
toChar());
196 #if !FW_DIRECT_PORT_CALLS && FW_ENABLE_TEXT_LOGGING 200 port < static_cast<FwIndexType>(this->getNum_eventOutText_OutputPorts());
203 this->m_eventOutText_OutputPort[port].
init();
205 #if FW_OBJECT_NAMES == 1 209 this->m_objName.toChar(),
212 this->m_eventOutText_OutputPort[port].setObjName(portName.
toChar());
217 #if !FW_DIRECT_PORT_CALLS 224 this->m_timeCaller_OutputPort[port].
init();
226 #if FW_OBJECT_NAMES == 1 230 this->m_objName.toChar(),
233 this->m_timeCaller_OutputPort[port].setObjName(portName.
toChar());
238 #if !FW_DIRECT_PORT_CALLS 245 this->m_PktSend_OutputPort[port].
init();
247 #if FW_OBJECT_NAMES == 1 251 this->m_objName.toChar(),
254 this->m_PktSend_OutputPort[port].setObjName(portName.
toChar());
259 #if !FW_DIRECT_PORT_CALLS 266 this->m_pingOut_OutputPort[port].
init();
268 #if FW_OBJECT_NAMES == 1 272 this->m_objName.toChar(),
275 this->m_pingOut_OutputPort[port].setObjName(portName.
toChar());
283 static_cast<FwSizeType>(ComponentIpcSerializableBuffer::SERIALIZATION_SIZE)
287 static_cast<FwAssertArgType>(qStat)
291 #if !FW_DIRECT_PORT_CALLS 302 static_cast<FwAssertArgType>(portNum)
305 return &this->m_Run_InputPort[portNum];
313 static_cast<FwAssertArgType>(portNum)
316 return &this->m_TlmGet_InputPort[portNum];
324 static_cast<FwAssertArgType>(portNum)
327 return &this->m_TlmRecv_InputPort[portNum];
335 static_cast<FwAssertArgType>(portNum)
338 return &this->m_pingIn_InputPort[portNum];
343 #if !FW_DIRECT_PORT_CALLS 357 static_cast<FwAssertArgType>(portNum)
360 this->m_eventOut_OutputPort[portNum].
addCallPort(port);
363 #if FW_ENABLE_TEXT_LOGGING == 1 365 void TlmChanComponentBase ::
366 set_eventOutText_OutputPort(
372 (0 <= portNum) && (portNum < this->getNum_eventOutText_OutputPorts()),
373 static_cast<FwAssertArgType>(portNum)
376 this->m_eventOutText_OutputPort[portNum].addCallPort(port);
389 static_cast<FwAssertArgType>(portNum)
392 this->m_timeCaller_OutputPort[portNum].
addCallPort(port);
397 #if !FW_DIRECT_PORT_CALLS 411 static_cast<FwAssertArgType>(portNum)
414 this->m_PktSend_OutputPort[portNum].
addCallPort(port);
425 static_cast<FwAssertArgType>(portNum)
428 this->m_pingOut_OutputPort[portNum].
addCallPort(port);
433 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION 442 Fw::InputSerializePort* port
447 static_cast<FwAssertArgType>(portNum)
450 this->m_eventOut_OutputPort[portNum].registerSerialPort(port);
453 #if FW_ENABLE_TEXT_LOGGING == 1 455 void TlmChanComponentBase ::
456 set_eventOutText_OutputPort(
458 Fw::InputSerializePort* port
462 (0 <= portNum) && (portNum < this->getNum_eventOutText_OutputPorts()),
463 static_cast<FwAssertArgType>(portNum)
466 this->m_eventOutText_OutputPort[portNum].registerSerialPort(port);
474 Fw::InputSerializePort* port
479 static_cast<FwAssertArgType>(portNum)
482 this->m_timeCaller_OutputPort[portNum].registerSerialPort(port);
487 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION 496 Fw::InputSerializePort* port
501 static_cast<FwAssertArgType>(portNum)
504 this->m_PktSend_OutputPort[portNum].registerSerialPort(port);
510 Fw::InputSerializePort* port
515 static_cast<FwAssertArgType>(portNum)
518 this->m_pingOut_OutputPort[portNum].registerSerialPort(port);
529 Fw::ActiveComponentBase(compName)
531 this->m_TlmChanBucketPoolExhaustedThrottle = 0;
540 #if !FW_DIRECT_PORT_CALLS 551 static_cast<FwAssertArgType>(portNum)
554 return this->m_eventOut_OutputPort[portNum].
isConnected();
557 #if FW_ENABLE_TEXT_LOGGING == 1 559 bool TlmChanComponentBase ::
560 isConnected_eventOutText_OutputPort(
FwIndexType portNum)
const 563 (0 <= portNum) && (portNum < this->getNum_eventOutText_OutputPorts()),
564 static_cast<FwAssertArgType>(portNum)
567 return this->m_eventOutText_OutputPort[portNum].isConnected();
577 static_cast<FwAssertArgType>(portNum)
580 return this->m_timeCaller_OutputPort[portNum].
isConnected();
585 #if !FW_DIRECT_PORT_CALLS 596 static_cast<FwAssertArgType>(portNum)
599 return this->m_PktSend_OutputPort[portNum].
isConnected();
607 static_cast<FwAssertArgType>(portNum)
610 return this->m_pingOut_OutputPort[portNum].
isConnected();
630 static_cast<FwAssertArgType>(portNum)
638 ComponentIpcSerializableBuffer msg;
642 _status = msg.serializeFrom(
643 static_cast<FwEnumStoreType>(RUN_SCHED)
647 static_cast<FwAssertArgType>(_status)
651 _status = msg.serializeFrom(portNum);
654 static_cast<FwAssertArgType>(_status)
658 _status = msg.serializeFrom(context);
661 static_cast<FwAssertArgType>(_status)
670 static_cast<FwAssertArgType>(qStatus)
685 static_cast<FwAssertArgType>(portNum)
718 static_cast<FwAssertArgType>(portNum)
745 static_cast<FwAssertArgType>(portNum)
753 ComponentIpcSerializableBuffer msg;
757 _status = msg.serializeFrom(
758 static_cast<FwEnumStoreType>(PINGIN_PING)
762 static_cast<FwAssertArgType>(_status)
766 _status = msg.serializeFrom(portNum);
769 static_cast<FwAssertArgType>(_status)
773 _status = msg.serializeFrom(key);
776 static_cast<FwAssertArgType>(_status)
783 if (qStatus == Os::Queue::Status::FULL) {
790 static_cast<FwAssertArgType>(qStatus)
820 #if !FW_DIRECT_PORT_CALLS 835 static_cast<FwAssertArgType>(portNum)
839 this->m_PktSend_OutputPort[portNum].isConnected(),
840 static_cast<FwAssertArgType>(portNum)
842 this->m_PktSend_OutputPort[portNum].
invoke(
856 static_cast<FwAssertArgType>(portNum)
860 this->m_pingOut_OutputPort[portNum].isConnected(),
861 static_cast<FwAssertArgType>(portNum)
863 this->m_pingOut_OutputPort[portNum].
invoke(
877 U32 numTimesDeferredCountReached
883 this->timeCaller_out(0, _logTime);
893 #if FW_AMPCS_COMPATIBLE 898 static_cast<FwAssertArgType>(_status)
902 #if FW_AMPCS_COMPATIBLE 905 static_cast<U8>(
sizeof(U32))
909 static_cast<FwAssertArgType>(_status)
915 static_cast<FwAssertArgType>(_status)
918 #if FW_AMPCS_COMPATIBLE 921 static_cast<U8>(
sizeof(U32))
925 static_cast<FwAssertArgType>(_status)
928 _status = _logBuff.
serializeFrom(numTimesDeferredCountReached);
931 static_cast<FwAssertArgType>(_status)
944 #if FW_ENABLE_TEXT_LOGGING 945 if (this->isConnected_eventOutText_OutputPort(0)) {
946 #if FW_OBJECT_NAMES == 1 947 const char* _formatString =
948 "(%s) %s: TlmChan epoch processing cap reached: %" PRIu32
" entries deferred (cumulative: %" PRIu32
")";
950 const char* _formatString =
951 "%s: TlmChan epoch processing cap reached: %" PRIu32
" entries deferred (cumulative: %" PRIu32
")";
958 this->m_objName.toChar(),
960 "TlmChanEpochProcessingCapReached ",
962 numTimesDeferredCountReached
965 this->eventOutText_out(
984 this->m_TlmChanBucketPoolExhaustedThrottle++;
990 this->timeCaller_out(0, _logTime);
1000 #if FW_AMPCS_COMPATIBLE 1005 static_cast<FwAssertArgType>(_status)
1009 #if FW_AMPCS_COMPATIBLE 1016 static_cast<FwAssertArgType>(_status)
1022 static_cast<FwAssertArgType>(_status)
1035 #if FW_ENABLE_TEXT_LOGGING 1036 if (this->isConnected_eventOutText_OutputPort(0)) {
1037 #if FW_OBJECT_NAMES == 1 1038 const char* _formatString =
1039 "(%s) %s: TlmChan bucket pool exhausted: dropping new telemetry ID 0x%" PRIx32
"";
1041 const char* _formatString =
1042 "%s: TlmChan bucket pool exhausted: dropping new telemetry ID 0x%" PRIx32
"";
1046 (void) _logString.
format(
1049 this->m_objName.toChar(),
1051 "TlmChanBucketPoolExhausted ",
1055 this->eventOutText_out(
1074 this->m_TlmChanBucketPoolExhaustedThrottle = 0;
1086 this->timeCaller_out(0, _time);
1104 this->m_guardedPortMutex.
lock();
1110 this->m_guardedPortMutex.
unLock();
1120 ComponentIpcSerializableBuffer _msg;
1130 static_cast<FwAssertArgType>(_msgStatus)
1140 static_cast<FwAssertArgType>(_deserStatus)
1143 MsgTypeEnum _msgType =
static_cast<MsgTypeEnum
>(_desMsg);
1145 if (_msgType == TLMCHAN_COMPONENT_EXIT) {
1150 _deserStatus = _msg.deserializeTo(portNum);
1153 static_cast<FwAssertArgType>(_deserStatus)
1161 _deserStatus = _msg.deserializeTo(context);
1164 static_cast<FwAssertArgType>(_deserStatus)
1179 _deserStatus = _msg.deserializeTo(key);
1182 static_cast<FwAssertArgType>(_deserStatus)
1204 void TlmChanComponentBase ::
1213 compPtr->Run_handlerBase(
1230 return compPtr->TlmGet_handlerBase(
1238 void TlmChanComponentBase ::
1249 compPtr->TlmRecv_handlerBase(
1257 void TlmChanComponentBase ::
1266 compPtr->pingIn_handlerBase(
1272 #if !FW_DIRECT_PORT_CALLS 1278 void TlmChanComponentBase ::
1289 static_cast<FwAssertArgType>(portNum)
1293 this->m_eventOut_OutputPort[portNum].isConnected(),
1294 static_cast<FwAssertArgType>(portNum)
1296 this->m_eventOut_OutputPort[portNum].
invoke(
1304 #if FW_ENABLE_TEXT_LOGGING 1306 void TlmChanComponentBase ::
1316 (0 <= portNum) && (portNum < this->getNum_eventOutText_OutputPorts()),
1317 static_cast<FwAssertArgType>(portNum)
1321 this->m_eventOutText_OutputPort[portNum].isConnected(),
1322 static_cast<FwAssertArgType>(portNum)
1324 this->m_eventOutText_OutputPort[portNum].invoke(
1334 void TlmChanComponentBase ::
1342 static_cast<FwAssertArgType>(portNum)
1346 this->m_timeCaller_OutputPort[portNum].isConnected(),
1347 static_cast<FwAssertArgType>(portNum)
1349 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.
void invoke(Fw::ComBuffer &data, U32 context) const
Invoke a port connection.
void init()
Initialization function.
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
BYTE pingInPortSize[Svc::PingPortBuffer::CAPACITY]
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)
SerializeStatus serializeFrom(U8 val, Endianness mode=Endianness::BIG) override
Serialize an 8-bit unsigned integer value.
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.
Throttle reset count for TlmChanBucketPoolExhausted.
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.
Hash bucket pool is exhausted; the new telemetry channel was dropped.
void invoke(Fw::Time &time) const
Invoke a port connection.
static constexpr FwIndexType getNum_pingIn_InputPorts()
void unLock()
unlock the mutex and assert success
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.
void lock()
lock the mutex and assert success
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)
message to exit active component task
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].
void incNumMsgDropped()
increment the number of messages dropped
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 log_WARNING_HI_TlmChanBucketPoolExhausted_ThrottleClear()
Reset throttle value for TlmChanBucketPoolExhausted.
void log_WARNING_HI_TlmChanBucketPoolExhausted(FwChanIdType Id)