9 #if FW_ENABLE_TEXT_LOGGING 31 class ComponentIpcSerializableBuffer :
41 MAX_DATA_SIZE =
sizeof(BuffUnion),
43 SERIALIZATION_SIZE = DATA_OFFSET + MAX_DATA_SIZE
47 return sizeof(m_buff);
54 const U8* getBuffAddr()
const {
60 U8 m_buff[SERIALIZATION_SIZE];
78 #if !FW_DIRECT_PORT_CALLS 85 this->m_CycleIn_InputPort[port].
init();
90 this->m_CycleIn_InputPort[port].
setPortNum(port);
92 #if FW_OBJECT_NAMES == 1 96 this->m_objName.toChar(),
99 this->m_CycleIn_InputPort[port].setObjName(portName.
toChar());
104 #if !FW_DIRECT_PORT_CALLS 111 this->m_logOut_OutputPort[port].
init();
113 #if FW_OBJECT_NAMES == 1 117 this->m_objName.toChar(),
120 this->m_logOut_OutputPort[port].setObjName(portName.
toChar());
125 #if !FW_DIRECT_PORT_CALLS && FW_ENABLE_TEXT_LOGGING 129 port < static_cast<FwIndexType>(this->getNum_logTextOut_OutputPorts());
132 this->m_logTextOut_OutputPort[port].
init();
134 #if FW_OBJECT_NAMES == 1 138 this->m_objName.toChar(),
141 this->m_logTextOut_OutputPort[port].setObjName(portName.
toChar());
146 #if !FW_DIRECT_PORT_CALLS 153 this->m_timeCaller_OutputPort[port].
init();
155 #if FW_OBJECT_NAMES == 1 159 this->m_objName.toChar(),
162 this->m_timeCaller_OutputPort[port].setObjName(portName.
toChar());
167 #if !FW_DIRECT_PORT_CALLS 174 this->m_tlmOut_OutputPort[port].
init();
176 #if FW_OBJECT_NAMES == 1 180 this->m_objName.toChar(),
183 this->m_tlmOut_OutputPort[port].setObjName(portName.
toChar());
188 #if !FW_DIRECT_PORT_CALLS 195 this->m_PhaserMemberOut_OutputPort[port].
init();
197 #if FW_OBJECT_NAMES == 1 201 this->m_objName.toChar(),
204 this->m_PhaserMemberOut_OutputPort[port].setObjName(portName.
toChar());
212 static_cast<FwSizeType>(ComponentIpcSerializableBuffer::SERIALIZATION_SIZE)
216 static_cast<FwAssertArgType>(qStat)
220 #if !FW_DIRECT_PORT_CALLS 231 static_cast<FwAssertArgType>(portNum)
234 return &this->m_CycleIn_InputPort[portNum];
239 #if !FW_DIRECT_PORT_CALLS 253 static_cast<FwAssertArgType>(portNum)
256 this->m_logOut_OutputPort[portNum].
addCallPort(port);
259 #if FW_ENABLE_TEXT_LOGGING == 1 261 void ActivePhaserComponentBase ::
262 set_logTextOut_OutputPort(
268 (0 <= portNum) && (portNum < this->getNum_logTextOut_OutputPorts()),
269 static_cast<FwAssertArgType>(portNum)
272 this->m_logTextOut_OutputPort[portNum].addCallPort(port);
285 static_cast<FwAssertArgType>(portNum)
288 this->m_timeCaller_OutputPort[portNum].
addCallPort(port);
299 static_cast<FwAssertArgType>(portNum)
302 this->m_tlmOut_OutputPort[portNum].
addCallPort(port);
307 #if !FW_DIRECT_PORT_CALLS 321 static_cast<FwAssertArgType>(portNum)
324 this->m_PhaserMemberOut_OutputPort[portNum].
addCallPort(port);
329 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION 338 Fw::InputSerializePort* port
343 static_cast<FwAssertArgType>(portNum)
346 this->m_logOut_OutputPort[portNum].registerSerialPort(port);
349 #if FW_ENABLE_TEXT_LOGGING == 1 351 void ActivePhaserComponentBase ::
352 set_logTextOut_OutputPort(
354 Fw::InputSerializePort* port
358 (0 <= portNum) && (portNum < this->getNum_logTextOut_OutputPorts()),
359 static_cast<FwAssertArgType>(portNum)
362 this->m_logTextOut_OutputPort[portNum].registerSerialPort(port);
370 Fw::InputSerializePort* port
375 static_cast<FwAssertArgType>(portNum)
378 this->m_timeCaller_OutputPort[portNum].registerSerialPort(port);
384 Fw::InputSerializePort* port
389 static_cast<FwAssertArgType>(portNum)
392 this->m_tlmOut_OutputPort[portNum].registerSerialPort(port);
397 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION 406 Fw::InputSerializePort* port
411 static_cast<FwAssertArgType>(portNum)
414 this->m_PhaserMemberOut_OutputPort[portNum].registerSerialPort(port);
425 Fw::ActiveComponentBase(compName)
427 this->m_MissedDeadlineThrottle = 0;
436 #if !FW_DIRECT_PORT_CALLS 447 static_cast<FwAssertArgType>(portNum)
450 return this->m_logOut_OutputPort[portNum].
isConnected();
453 #if FW_ENABLE_TEXT_LOGGING == 1 455 bool ActivePhaserComponentBase ::
456 isConnected_logTextOut_OutputPort(
FwIndexType portNum)
const 459 (0 <= portNum) && (portNum < this->getNum_logTextOut_OutputPorts()),
460 static_cast<FwAssertArgType>(portNum)
463 return this->m_logTextOut_OutputPort[portNum].isConnected();
473 static_cast<FwAssertArgType>(portNum)
476 return this->m_timeCaller_OutputPort[portNum].
isConnected();
484 static_cast<FwAssertArgType>(portNum)
487 return this->m_tlmOut_OutputPort[portNum].
isConnected();
492 #if !FW_DIRECT_PORT_CALLS 503 static_cast<FwAssertArgType>(portNum)
506 return this->m_PhaserMemberOut_OutputPort[portNum].
isConnected();
526 static_cast<FwAssertArgType>(portNum)
534 ComponentIpcSerializableBuffer msg;
538 _status = msg.serializeFrom(
539 static_cast<FwEnumStoreType>(CYCLEIN_CYCLE)
543 static_cast<FwAssertArgType>(_status)
547 _status = msg.serializeFrom(portNum);
550 static_cast<FwAssertArgType>(_status)
554 _status = msg.serializeFrom(cycleStart);
557 static_cast<FwAssertArgType>(_status)
564 if (qStatus == Os::Queue::Status::FULL) {
571 static_cast<FwAssertArgType>(qStatus)
592 #if !FW_DIRECT_PORT_CALLS 606 static_cast<FwAssertArgType>(portNum)
610 this->m_PhaserMemberOut_OutputPort[portNum].isConnected(),
611 static_cast<FwAssertArgType>(portNum)
613 this->m_PhaserMemberOut_OutputPort[portNum].
invoke(
627 ComponentIpcSerializableBuffer msg;
631 _status = msg.serializeFrom(static_cast<FwEnumStoreType>(INT_IF_TICK));
634 static_cast<FwAssertArgType>(_status)
638 _status = msg.serializeFrom(static_cast<FwIndexType>(0));
641 static_cast<FwAssertArgType>(_status)
648 if (qStatus == Os::Queue::Status::FULL) {
655 static_cast<FwAssertArgType>(qStatus)
676 this->m_MissedDeadlineThrottle++;
682 this->timeCaller_out(0, _logTime);
692 #if FW_AMPCS_COMPATIBLE 697 static_cast<FwAssertArgType>(_status)
701 #if FW_AMPCS_COMPATIBLE 708 static_cast<FwAssertArgType>(_status)
714 static_cast<FwAssertArgType>(_status)
717 #if FW_AMPCS_COMPATIBLE 720 static_cast<U8>(
sizeof(U32))
724 static_cast<FwAssertArgType>(_status)
730 static_cast<FwAssertArgType>(_status)
733 #if FW_AMPCS_COMPATIBLE 736 static_cast<U8>(
sizeof(U32))
740 static_cast<FwAssertArgType>(_status)
746 static_cast<FwAssertArgType>(_status)
749 #if FW_AMPCS_COMPATIBLE 752 static_cast<U8>(
sizeof(U32))
756 static_cast<FwAssertArgType>(_status)
762 static_cast<FwAssertArgType>(_status)
775 #if FW_ENABLE_TEXT_LOGGING 776 if (this->isConnected_logTextOut_OutputPort(0)) {
777 #if FW_OBJECT_NAMES == 1 778 const char* _formatString =
779 "(%s) %s: Port %" PRIi16
" schedule at %" PRIu32
" for %" PRIu32
" ticks was long by %" PRIu32
" ticks";
781 const char* _formatString =
782 "%s: Port %" PRIi16
" schedule at %" PRIu32
" for %" PRIu32
" ticks was long by %" PRIu32
" ticks";
789 this->m_objName.toChar(),
798 this->logTextOut_out(
817 this->m_MissedDeadlineThrottle = 0;
829 this->timeCaller_out(0, _time);
844 ComponentIpcSerializableBuffer _msg;
854 static_cast<FwAssertArgType>(_msgStatus)
864 static_cast<FwAssertArgType>(_deserStatus)
867 MsgTypeEnum _msgType =
static_cast<MsgTypeEnum
>(_desMsg);
869 if (_msgType == ACTIVEPHASER_COMPONENT_EXIT) {
874 _deserStatus = _msg.deserializeTo(portNum);
877 static_cast<FwAssertArgType>(_deserStatus)
882 case CYCLEIN_CYCLE: {
885 _deserStatus = _msg.deserializeTo(cycleStart);
888 static_cast<FwAssertArgType>(_deserStatus)
904 _msg.getDeserializeSizeLeft() == 0,
925 void ActivePhaserComponentBase ::
934 compPtr->CycleIn_handlerBase(
940 #if !FW_DIRECT_PORT_CALLS 946 void ActivePhaserComponentBase ::
957 static_cast<FwAssertArgType>(portNum)
961 this->m_logOut_OutputPort[portNum].isConnected(),
962 static_cast<FwAssertArgType>(portNum)
964 this->m_logOut_OutputPort[portNum].
invoke(
972 #if FW_ENABLE_TEXT_LOGGING 974 void ActivePhaserComponentBase ::
984 (0 <= portNum) && (portNum < this->getNum_logTextOut_OutputPorts()),
985 static_cast<FwAssertArgType>(portNum)
989 this->m_logTextOut_OutputPort[portNum].isConnected(),
990 static_cast<FwAssertArgType>(portNum)
992 this->m_logTextOut_OutputPort[portNum].invoke(
1002 void ActivePhaserComponentBase ::
1010 static_cast<FwAssertArgType>(portNum)
1014 this->m_timeCaller_OutputPort[portNum].isConnected(),
1015 static_cast<FwAssertArgType>(portNum)
1017 this->m_timeCaller_OutputPort[portNum].
invoke(
Serialization/Deserialization operation was successful.
static constexpr FwIndexType getNum_CycleIn_InputPorts()
void addCallPort(InputTimePort *callPort)
Register an input port.
message to exit active component task
void set_tlmOut_OutputPort(FwIndexType portNum, Fw::InputTlmPort *port)
Connect port to tlmOut[portNum].
SerializeStatus serializeFrom(U8 val, Endianness mode=Endianness::BIG) override
Serialize an 8-bit unsigned integer value.
FwIdType getIdBase() const
PlatformSizeType FwSizeType
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
void set_logOut_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to logOut[portNum].
void set_PhaserMemberOut_OutputPort(FwIndexType portNum, Svc::InputSchedPort *port)
Connect port to PhaserMemberOut[portNum].
void PhaserMemberOut_out(FwIndexType portNum, U32 context) const
Invoke output port PhaserMemberOut.
void init()
Initialization function.
No time base has been established (Required)
bool isConnected_logOut_OutputPort(FwIndexType portNum) const
bool isConnected_tlmOut_OutputPort(FwIndexType portNum) const
Os::Queue m_queue
queue object for active component
Warning event that rate group has had a missed deadline.
void addCallPort(InputTlmPort *callPort)
Register an input port.
void init()
Object initializer.
SerializeStatus
forward declaration for string
Message will block until space is available.
FwIdType FwEventIdType
The type of an event identifier.
#define FW_OBJECT_NAMES
Indicates whether or not object names are stored (more memory, can be used for tracking objects) ...
void init()
Initialization function.
Os::Queue::Status createQueue(FwSizeType depth, FwSizeType msgSize)
void invoke(U32 context) const
Invoke a port connection.
ActivePhaserComponentBase(const char *compName="")
Construct ActivePhaserComponentBase object.
void invoke(Fw::Time &time) const
Invoke a port connection.
static constexpr FwIndexType getNum_tlmOut_OutputPorts()
virtual ~ActivePhaserComponentBase()
Destroy ActivePhaserComponentBase object.
Status send(const U8 *buffer, FwSizeType size, FwQueuePriorityType priority, BlockingType blockType) override
send a message into the queue through delegate
A serious but recoverable event.
Errors dispatching messages.
const char * toChar() const
Convert to a C-style char*.
Enum representing event severity.
FormatStatus format(const CHAR *formatString,...)
write formatted string to buffer
void init()
Initialization function.
void Tick_internalInterfaceInvoke()
Internal interface base-class function for Tick.
uint8_t U8
8-bit unsigned integer
Throttle reset count for MissedDeadline.
Svc::InputCyclePort * get_CycleIn_InputPort(FwIndexType portNum)
bool isConnected_PhaserMemberOut_OutputPort(FwIndexType portNum) const
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 FwSizeType CAPACITY
A message was sent requesting an exit of the loop.
PlatformIndexType FwIndexType
virtual void Tick_internalInterfaceHandler()=0
Internal interface handler for Tick.
static constexpr FwIndexType getNum_PhaserMemberOut_OutputPorts()
void addCallPort(InputLogPort *callPort)
Register an input port.
void log_WARNING_HI_MissedDeadline_ThrottleClear()
Reset throttle value for MissedDeadline.
void init()
Initialization function.
void CycleIn_handlerBase(FwIndexType portNum, Os::RawTime &cycleStart)
Handler base-class function for input port CycleIn.
virtual void CycleIn_handler(FwIndexType portNum, Os::RawTime &cycleStart)=0
Handler for input port CycleIn.
void incNumMsgDropped()
increment the number of messages dropped
RateGroupDivider component implementation.
message sent/received okay
void set_timeCaller_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to timeCaller[portNum].
virtual void CycleIn_preMsgHook(FwIndexType portNum, Os::RawTime &cycleStart)
Pre-message hook for async input port CycleIn.
void start(FwTaskPriorityType priority=Os::Task::TASK_PRIORITY_DEFAULT, FwSizeType stackSize=Os::Task::TASK_DEFAULT, FwSizeType cpuAffinity=Os::Task::TASK_DEFAULT, FwTaskIdType identifier=static_cast< FwTaskIdType >(Os::Task::TASK_DEFAULT))
called by instantiator when task is to be started
Message will return with status when space is unavailable.
static constexpr FwIndexType getNum_timeCaller_OutputPorts()
Implementation of malloc based allocator.
bool isConnected_timeCaller_OutputPort(FwIndexType portNum) const
PlatformAssertArgType FwAssertArgType
The type of arguments to assert functions.
static constexpr FwIndexType getNum_logOut_OutputPorts()
void addCallPort(InputSchedPort *callPort)
Register an input port.
void log_WARNING_HI_MissedDeadline(FwIndexType p, U32 start, U32 length, U32 ticks)