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)
785 static_cast<FwAssertArgType>(qStatus)
815 #if !FW_DIRECT_PORT_CALLS 830 static_cast<FwAssertArgType>(portNum)
834 this->m_PktSend_OutputPort[portNum].isConnected(),
835 static_cast<FwAssertArgType>(portNum)
837 this->m_PktSend_OutputPort[portNum].
invoke(
851 static_cast<FwAssertArgType>(portNum)
855 this->m_pingOut_OutputPort[portNum].isConnected(),
856 static_cast<FwAssertArgType>(portNum)
858 this->m_pingOut_OutputPort[portNum].
invoke(
872 U32 numTimesDeferredCountReached
878 this->timeCaller_out(0, _logTime);
888 #if FW_AMPCS_COMPATIBLE 893 static_cast<FwAssertArgType>(_status)
897 #if FW_AMPCS_COMPATIBLE 900 static_cast<U8>(
sizeof(U32))
904 static_cast<FwAssertArgType>(_status)
910 static_cast<FwAssertArgType>(_status)
913 #if FW_AMPCS_COMPATIBLE 916 static_cast<U8>(
sizeof(U32))
920 static_cast<FwAssertArgType>(_status)
923 _status = _logBuff.
serializeFrom(numTimesDeferredCountReached);
926 static_cast<FwAssertArgType>(_status)
939 #if FW_ENABLE_TEXT_LOGGING 940 if (this->isConnected_eventOutText_OutputPort(0)) {
941 #if FW_OBJECT_NAMES == 1 942 const char* _formatString =
943 "(%s) %s: TlmChan epoch processing cap reached: %" PRIu32
" entries deferred (cumulative: %" PRIu32
")";
945 const char* _formatString =
946 "%s: TlmChan epoch processing cap reached: %" PRIu32
" entries deferred (cumulative: %" PRIu32
")";
953 this->m_objName.toChar(),
955 "TlmChanEpochProcessingCapReached ",
957 numTimesDeferredCountReached
960 this->eventOutText_out(
979 this->m_TlmChanBucketPoolExhaustedThrottle++;
985 this->timeCaller_out(0, _logTime);
995 #if FW_AMPCS_COMPATIBLE 1000 static_cast<FwAssertArgType>(_status)
1004 #if FW_AMPCS_COMPATIBLE 1011 static_cast<FwAssertArgType>(_status)
1017 static_cast<FwAssertArgType>(_status)
1030 #if FW_ENABLE_TEXT_LOGGING 1031 if (this->isConnected_eventOutText_OutputPort(0)) {
1032 #if FW_OBJECT_NAMES == 1 1033 const char* _formatString =
1034 "(%s) %s: TlmChan bucket pool exhausted: dropping new telemetry ID 0x%" PRIx32
"";
1036 const char* _formatString =
1037 "%s: TlmChan bucket pool exhausted: dropping new telemetry ID 0x%" PRIx32
"";
1041 (void) _logString.
format(
1044 this->m_objName.toChar(),
1046 "TlmChanBucketPoolExhausted ",
1050 this->eventOutText_out(
1069 this->m_TlmChanBucketPoolExhaustedThrottle = 0;
1081 this->timeCaller_out(0, _time);
1099 this->m_guardedPortMutex.
lock();
1105 this->m_guardedPortMutex.
unLock();
1115 ComponentIpcSerializableBuffer _msg;
1125 static_cast<FwAssertArgType>(_msgStatus)
1135 static_cast<FwAssertArgType>(_deserStatus)
1138 MsgTypeEnum _msgType =
static_cast<MsgTypeEnum
>(_desMsg);
1140 if (_msgType == TLMCHAN_COMPONENT_EXIT) {
1145 _deserStatus = _msg.deserializeTo(portNum);
1148 static_cast<FwAssertArgType>(_deserStatus)
1156 _deserStatus = _msg.deserializeTo(context);
1159 static_cast<FwAssertArgType>(_deserStatus)
1174 _deserStatus = _msg.deserializeTo(key);
1177 static_cast<FwAssertArgType>(_deserStatus)
1199 void TlmChanComponentBase ::
1208 compPtr->Run_handlerBase(
1225 return compPtr->TlmGet_handlerBase(
1233 void TlmChanComponentBase ::
1244 compPtr->TlmRecv_handlerBase(
1252 void TlmChanComponentBase ::
1261 compPtr->pingIn_handlerBase(
1267 #if !FW_DIRECT_PORT_CALLS 1273 void TlmChanComponentBase ::
1284 static_cast<FwAssertArgType>(portNum)
1288 this->m_eventOut_OutputPort[portNum].isConnected(),
1289 static_cast<FwAssertArgType>(portNum)
1291 this->m_eventOut_OutputPort[portNum].
invoke(
1299 #if FW_ENABLE_TEXT_LOGGING 1301 void TlmChanComponentBase ::
1311 (0 <= portNum) && (portNum < this->getNum_eventOutText_OutputPorts()),
1312 static_cast<FwAssertArgType>(portNum)
1316 this->m_eventOutText_OutputPort[portNum].isConnected(),
1317 static_cast<FwAssertArgType>(portNum)
1319 this->m_eventOutText_OutputPort[portNum].invoke(
1329 void TlmChanComponentBase ::
1337 static_cast<FwAssertArgType>(portNum)
1341 this->m_timeCaller_OutputPort[portNum].isConnected(),
1342 static_cast<FwAssertArgType>(portNum)
1344 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.
message to exit active component task
bool isConnected_pingOut_OutputPort(FwIndexType portNum) const
BYTE pingInPortSize[Svc::PingPortBuffer::CAPACITY]
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.
Epoch Processing cap reached; one or more telemetry entries were deferred this cycle.
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.
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
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
Throttle reset count for TlmChanBucketPoolExhausted.
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.
Hash bucket pool is exhausted; the new telemetry channel was dropped.
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
void log_WARNING_HI_TlmChanBucketPoolExhausted_ThrottleClear()
Reset throttle value for TlmChanBucketPoolExhausted.
void log_WARNING_HI_TlmChanBucketPoolExhausted(FwChanIdType Id)