9 #if FW_ENABLE_TEXT_LOGGING 31 class ComponentIpcSerializableBuffer :
41 MAX_DATA_SIZE =
sizeof(BuffUnion),
43 SERIALIZATION_SIZE = DATA_OFFSET + MAX_DATA_SIZE
46 ComponentIpcSerializableBuffer() :
Fw::LinearBufferBase(m_buff, sizeof(m_buff)) {
52 U8 m_buff[SERIALIZATION_SIZE];
70 #if !FW_DIRECT_PORT_CALLS 77 this->m_CycleIn_InputPort[port].
init();
82 this->m_CycleIn_InputPort[port].
setPortNum(port);
84 #if FW_OBJECT_NAMES == 1 88 this->m_objName.toChar(),
91 this->m_CycleIn_InputPort[port].setObjName(portName.
toChar());
96 #if !FW_DIRECT_PORT_CALLS 103 this->m_logOut_OutputPort[port].
init();
105 #if FW_OBJECT_NAMES == 1 109 this->m_objName.toChar(),
112 this->m_logOut_OutputPort[port].setObjName(portName.
toChar());
117 #if !FW_DIRECT_PORT_CALLS && FW_ENABLE_TEXT_LOGGING 121 port < static_cast<FwIndexType>(this->getNum_logTextOut_OutputPorts());
124 this->m_logTextOut_OutputPort[port].
init();
126 #if FW_OBJECT_NAMES == 1 130 this->m_objName.toChar(),
133 this->m_logTextOut_OutputPort[port].setObjName(portName.
toChar());
138 #if !FW_DIRECT_PORT_CALLS 145 this->m_timeCaller_OutputPort[port].
init();
147 #if FW_OBJECT_NAMES == 1 151 this->m_objName.toChar(),
154 this->m_timeCaller_OutputPort[port].setObjName(portName.
toChar());
159 #if !FW_DIRECT_PORT_CALLS 166 this->m_tlmOut_OutputPort[port].
init();
168 #if FW_OBJECT_NAMES == 1 172 this->m_objName.toChar(),
175 this->m_tlmOut_OutputPort[port].setObjName(portName.
toChar());
180 #if !FW_DIRECT_PORT_CALLS 187 this->m_PhaserMemberOut_OutputPort[port].
init();
189 #if FW_OBJECT_NAMES == 1 193 this->m_objName.toChar(),
196 this->m_PhaserMemberOut_OutputPort[port].setObjName(portName.
toChar());
204 static_cast<FwSizeType>(ComponentIpcSerializableBuffer::SERIALIZATION_SIZE)
208 static_cast<FwAssertArgType>(qStat)
212 #if !FW_DIRECT_PORT_CALLS 223 static_cast<FwAssertArgType>(portNum)
226 return &this->m_CycleIn_InputPort[portNum];
231 #if !FW_DIRECT_PORT_CALLS 245 static_cast<FwAssertArgType>(portNum)
248 this->m_logOut_OutputPort[portNum].
addCallPort(port);
251 #if FW_ENABLE_TEXT_LOGGING == 1 253 void ActivePhaserComponentBase ::
254 set_logTextOut_OutputPort(
260 (0 <= portNum) && (portNum < this->getNum_logTextOut_OutputPorts()),
261 static_cast<FwAssertArgType>(portNum)
264 this->m_logTextOut_OutputPort[portNum].addCallPort(port);
277 static_cast<FwAssertArgType>(portNum)
280 this->m_timeCaller_OutputPort[portNum].
addCallPort(port);
291 static_cast<FwAssertArgType>(portNum)
294 this->m_tlmOut_OutputPort[portNum].
addCallPort(port);
299 #if !FW_DIRECT_PORT_CALLS 313 static_cast<FwAssertArgType>(portNum)
316 this->m_PhaserMemberOut_OutputPort[portNum].
addCallPort(port);
321 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION 330 Fw::InputSerializePort* port
335 static_cast<FwAssertArgType>(portNum)
338 this->m_logOut_OutputPort[portNum].registerSerialPort(port);
341 #if FW_ENABLE_TEXT_LOGGING == 1 343 void ActivePhaserComponentBase ::
344 set_logTextOut_OutputPort(
346 Fw::InputSerializePort* port
350 (0 <= portNum) && (portNum < this->getNum_logTextOut_OutputPorts()),
351 static_cast<FwAssertArgType>(portNum)
354 this->m_logTextOut_OutputPort[portNum].registerSerialPort(port);
362 Fw::InputSerializePort* port
367 static_cast<FwAssertArgType>(portNum)
370 this->m_timeCaller_OutputPort[portNum].registerSerialPort(port);
376 Fw::InputSerializePort* port
381 static_cast<FwAssertArgType>(portNum)
384 this->m_tlmOut_OutputPort[portNum].registerSerialPort(port);
389 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION 398 Fw::InputSerializePort* port
403 static_cast<FwAssertArgType>(portNum)
406 this->m_PhaserMemberOut_OutputPort[portNum].registerSerialPort(port);
417 Fw::ActiveComponentBase(compName)
419 this->m_MissedDeadlineThrottle = 0;
428 #if !FW_DIRECT_PORT_CALLS 439 static_cast<FwAssertArgType>(portNum)
442 return this->m_logOut_OutputPort[portNum].
isConnected();
445 #if FW_ENABLE_TEXT_LOGGING == 1 447 bool ActivePhaserComponentBase ::
448 isConnected_logTextOut_OutputPort(
FwIndexType portNum)
const 451 (0 <= portNum) && (portNum < this->getNum_logTextOut_OutputPorts()),
452 static_cast<FwAssertArgType>(portNum)
455 return this->m_logTextOut_OutputPort[portNum].isConnected();
465 static_cast<FwAssertArgType>(portNum)
468 return this->m_timeCaller_OutputPort[portNum].
isConnected();
476 static_cast<FwAssertArgType>(portNum)
479 return this->m_tlmOut_OutputPort[portNum].
isConnected();
484 #if !FW_DIRECT_PORT_CALLS 495 static_cast<FwAssertArgType>(portNum)
498 return this->m_PhaserMemberOut_OutputPort[portNum].
isConnected();
518 static_cast<FwAssertArgType>(portNum)
526 ComponentIpcSerializableBuffer msg;
530 _status = msg.serializeFrom(
531 static_cast<FwEnumStoreType>(CYCLEIN_CYCLE)
535 static_cast<FwAssertArgType>(_status)
539 _status = msg.serializeFrom(portNum);
542 static_cast<FwAssertArgType>(_status)
546 _status = msg.serializeFrom(cycleStart);
549 static_cast<FwAssertArgType>(_status)
556 if (qStatus == Os::Queue::Status::FULL) {
563 static_cast<FwAssertArgType>(qStatus)
584 #if !FW_DIRECT_PORT_CALLS 598 static_cast<FwAssertArgType>(portNum)
602 this->m_PhaserMemberOut_OutputPort[portNum].isConnected(),
603 static_cast<FwAssertArgType>(portNum)
605 this->m_PhaserMemberOut_OutputPort[portNum].
invoke(
619 ComponentIpcSerializableBuffer msg;
623 _status = msg.serializeFrom(static_cast<FwEnumStoreType>(INT_IF_TICK));
626 static_cast<FwAssertArgType>(_status)
630 _status = msg.serializeFrom(static_cast<FwIndexType>(0));
633 static_cast<FwAssertArgType>(_status)
640 if (qStatus == Os::Queue::Status::FULL) {
647 static_cast<FwAssertArgType>(qStatus)
668 this->m_MissedDeadlineThrottle++;
674 this->timeCaller_out(0, _logTime);
684 #if FW_AMPCS_COMPATIBLE 689 static_cast<FwAssertArgType>(_status)
693 #if FW_AMPCS_COMPATIBLE 700 static_cast<FwAssertArgType>(_status)
706 static_cast<FwAssertArgType>(_status)
709 #if FW_AMPCS_COMPATIBLE 712 static_cast<U8>(
sizeof(U32))
716 static_cast<FwAssertArgType>(_status)
722 static_cast<FwAssertArgType>(_status)
725 #if FW_AMPCS_COMPATIBLE 728 static_cast<U8>(
sizeof(U32))
732 static_cast<FwAssertArgType>(_status)
738 static_cast<FwAssertArgType>(_status)
741 #if FW_AMPCS_COMPATIBLE 744 static_cast<U8>(
sizeof(U32))
748 static_cast<FwAssertArgType>(_status)
754 static_cast<FwAssertArgType>(_status)
767 #if FW_ENABLE_TEXT_LOGGING 768 if (this->isConnected_logTextOut_OutputPort(0)) {
769 #if FW_OBJECT_NAMES == 1 770 const char* _formatString =
771 "(%s) %s: Port %" PRIi16
" schedule at %" PRIu32
" for %" PRIu32
" ticks was long by %" PRIu32
" ticks";
773 const char* _formatString =
774 "%s: Port %" PRIi16
" schedule at %" PRIu32
" for %" PRIu32
" ticks was long by %" PRIu32
" ticks";
781 this->m_objName.toChar(),
790 this->logTextOut_out(
809 this->m_MissedDeadlineThrottle = 0;
821 this->timeCaller_out(0, _time);
836 ComponentIpcSerializableBuffer _msg;
846 static_cast<FwAssertArgType>(_msgStatus)
856 static_cast<FwAssertArgType>(_deserStatus)
859 MsgTypeEnum _msgType =
static_cast<MsgTypeEnum
>(_desMsg);
861 if (_msgType == ACTIVEPHASER_COMPONENT_EXIT) {
866 _deserStatus = _msg.deserializeTo(portNum);
869 static_cast<FwAssertArgType>(_deserStatus)
874 case CYCLEIN_CYCLE: {
877 _deserStatus = _msg.deserializeTo(cycleStart);
880 static_cast<FwAssertArgType>(_deserStatus)
896 _msg.getDeserializeSizeLeft() == 0,
917 void ActivePhaserComponentBase ::
926 compPtr->CycleIn_handlerBase(
932 #if !FW_DIRECT_PORT_CALLS 938 void ActivePhaserComponentBase ::
949 static_cast<FwAssertArgType>(portNum)
953 this->m_logOut_OutputPort[portNum].isConnected(),
954 static_cast<FwAssertArgType>(portNum)
956 this->m_logOut_OutputPort[portNum].
invoke(
964 #if FW_ENABLE_TEXT_LOGGING 966 void ActivePhaserComponentBase ::
976 (0 <= portNum) && (portNum < this->getNum_logTextOut_OutputPorts()),
977 static_cast<FwAssertArgType>(portNum)
981 this->m_logTextOut_OutputPort[portNum].isConnected(),
982 static_cast<FwAssertArgType>(portNum)
984 this->m_logTextOut_OutputPort[portNum].invoke(
994 void ActivePhaserComponentBase ::
1002 static_cast<FwAssertArgType>(portNum)
1006 this->m_timeCaller_OutputPort[portNum].isConnected(),
1007 static_cast<FwAssertArgType>(portNum)
1009 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.
void set_tlmOut_OutputPort(FwIndexType portNum, Fw::InputTlmPort *port)
Connect port to tlmOut[portNum].
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
message to exit active component task
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)
SerializeStatus serializeFrom(U8 val, Endianness mode=Endianness::BIG) override
Serialize an 8-bit unsigned integer value.
bool isConnected_logOut_OutputPort(FwIndexType portNum) const
bool isConnected_tlmOut_OutputPort(FwIndexType portNum) const
Os::Queue m_queue
queue object for active component
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
Throttle reset count for MissedDeadline.
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
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
Warning event that rate group has had a missed deadline.
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)