9 #if FW_ENABLE_TEXT_LOGGING 22 union SignalTypeUnion {
30 sizeof(SignalTypeUnion);
36 INTERNAL_STATE_MACHINE_SIGNAL,
45 BYTE internalSmBufferSize[SmSignalBuffer::SERIALIZED_SIZE];
50 class ComponentIpcSerializableBuffer :
60 MAX_DATA_SIZE =
sizeof(BuffUnion),
62 SERIALIZATION_SIZE = DATA_OFFSET + MAX_DATA_SIZE
65 ComponentIpcSerializableBuffer() :
Fw::LinearBufferBase(m_buff, sizeof(m_buff)) {
71 U8 m_buff[SERIALIZATION_SIZE];
82 m_component(component)
90 this->initBase(static_cast<FwEnumStoreType>(smId));
99 void ComAggregatorComponentBase::Svc_AggregationMachine ::
100 action_doClear(
Signal signal)
102 this->m_component.Svc_AggregationMachine_action_doClear(this->getId(), signal);
105 void ComAggregatorComponentBase::Svc_AggregationMachine ::
111 this->m_component.Svc_AggregationMachine_action_doFill(this->getId(), signal, value);
114 void ComAggregatorComponentBase::Svc_AggregationMachine ::
115 action_doSend(
Signal signal)
117 this->m_component.Svc_AggregationMachine_action_doSend(this->getId(), signal);
120 void ComAggregatorComponentBase::Svc_AggregationMachine ::
126 this->m_component.Svc_AggregationMachine_action_doHold(this->getId(), signal, value);
129 void ComAggregatorComponentBase::Svc_AggregationMachine ::
130 action_assertNoStatus(
Signal signal)
132 this->m_component.Svc_AggregationMachine_action_assertNoStatus(this->getId(), signal);
135 bool ComAggregatorComponentBase::Svc_AggregationMachine ::
141 return this->m_component.Svc_AggregationMachine_guard_isFull(this->getId(), signal, value);
144 bool ComAggregatorComponentBase::Svc_AggregationMachine ::
150 return this->m_component.Svc_AggregationMachine_guard_willFill(this->getId(), signal, value);
153 bool ComAggregatorComponentBase::Svc_AggregationMachine ::
154 guard_isNotEmpty(
Signal signal)
const 156 return this->m_component.Svc_AggregationMachine_guard_isNotEmpty(this->getId(), signal);
159 bool ComAggregatorComponentBase::Svc_AggregationMachine ::
165 return this->m_component.Svc_AggregationMachine_guard_isGood(this->getId(), signal, value);
184 #if !FW_DIRECT_PORT_CALLS 191 this->m_comStatusIn_InputPort[port].
init();
196 this->m_comStatusIn_InputPort[port].
setPortNum(port);
198 #if FW_OBJECT_NAMES == 1 202 this->m_objName.toChar(),
205 this->m_comStatusIn_InputPort[port].setObjName(portName.
toChar());
210 #if !FW_DIRECT_PORT_CALLS 217 this->m_dataIn_InputPort[port].
init();
222 this->m_dataIn_InputPort[port].
setPortNum(port);
224 #if FW_OBJECT_NAMES == 1 228 this->m_objName.toChar(),
231 this->m_dataIn_InputPort[port].setObjName(portName.
toChar());
236 #if !FW_DIRECT_PORT_CALLS 243 this->m_dataReturnIn_InputPort[port].
init();
248 this->m_dataReturnIn_InputPort[port].
setPortNum(port);
250 #if FW_OBJECT_NAMES == 1 254 this->m_objName.toChar(),
257 this->m_dataReturnIn_InputPort[port].setObjName(portName.
toChar());
262 #if !FW_DIRECT_PORT_CALLS 269 this->m_timeout_InputPort[port].
init();
274 this->m_timeout_InputPort[port].
setPortNum(port);
276 #if FW_OBJECT_NAMES == 1 280 this->m_objName.toChar(),
283 this->m_timeout_InputPort[port].setObjName(portName.
toChar());
288 #if !FW_DIRECT_PORT_CALLS 295 this->m_comStatusOut_OutputPort[port].
init();
297 #if FW_OBJECT_NAMES == 1 301 this->m_objName.toChar(),
304 this->m_comStatusOut_OutputPort[port].setObjName(portName.
toChar());
309 #if !FW_DIRECT_PORT_CALLS 316 this->m_dataOut_OutputPort[port].
init();
318 #if FW_OBJECT_NAMES == 1 322 this->m_objName.toChar(),
325 this->m_dataOut_OutputPort[port].setObjName(portName.
toChar());
330 #if !FW_DIRECT_PORT_CALLS 337 this->m_dataReturnOut_OutputPort[port].
init();
339 #if FW_OBJECT_NAMES == 1 343 this->m_objName.toChar(),
346 this->m_dataReturnOut_OutputPort[port].setObjName(portName.
toChar());
354 static_cast<FwSizeType>(ComponentIpcSerializableBuffer::SERIALIZATION_SIZE)
358 static_cast<FwAssertArgType>(qStat)
362 #if !FW_DIRECT_PORT_CALLS 373 static_cast<FwAssertArgType>(portNum)
376 return &this->m_comStatusIn_InputPort[portNum];
384 static_cast<FwAssertArgType>(portNum)
387 return &this->m_dataIn_InputPort[portNum];
395 static_cast<FwAssertArgType>(portNum)
398 return &this->m_dataReturnIn_InputPort[portNum];
406 static_cast<FwAssertArgType>(portNum)
409 return &this->m_timeout_InputPort[portNum];
414 #if !FW_DIRECT_PORT_CALLS 428 static_cast<FwAssertArgType>(portNum)
431 this->m_comStatusOut_OutputPort[portNum].
addCallPort(port);
442 static_cast<FwAssertArgType>(portNum)
445 this->m_dataOut_OutputPort[portNum].
addCallPort(port);
456 static_cast<FwAssertArgType>(portNum)
459 this->m_dataReturnOut_OutputPort[portNum].
addCallPort(port);
464 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION 473 Fw::InputSerializePort* port
478 static_cast<FwAssertArgType>(portNum)
481 this->m_comStatusOut_OutputPort[portNum].registerSerialPort(port);
487 Fw::InputSerializePort* port
492 static_cast<FwAssertArgType>(portNum)
495 this->m_dataOut_OutputPort[portNum].registerSerialPort(port);
501 Fw::InputSerializePort* port
506 static_cast<FwAssertArgType>(portNum)
509 this->m_dataReturnOut_OutputPort[portNum].registerSerialPort(port);
521 m_stateMachine_aggregationMachine(*this)
532 #if !FW_DIRECT_PORT_CALLS 543 static_cast<FwAssertArgType>(portNum)
546 return this->m_comStatusOut_OutputPort[portNum].
isConnected();
554 static_cast<FwAssertArgType>(portNum)
557 return this->m_dataOut_OutputPort[portNum].
isConnected();
565 static_cast<FwAssertArgType>(portNum)
568 return this->m_dataReturnOut_OutputPort[portNum].
isConnected();
588 static_cast<FwAssertArgType>(portNum)
608 static_cast<FwAssertArgType>(portNum)
629 static_cast<FwAssertArgType>(portNum)
649 static_cast<FwAssertArgType>(portNum)
659 #if !FW_DIRECT_PORT_CALLS 673 static_cast<FwAssertArgType>(portNum)
677 this->m_comStatusOut_OutputPort[portNum].isConnected(),
678 static_cast<FwAssertArgType>(portNum)
680 this->m_comStatusOut_OutputPort[portNum].
invoke(
694 static_cast<FwAssertArgType>(portNum)
698 this->m_dataOut_OutputPort[portNum].isConnected(),
699 static_cast<FwAssertArgType>(portNum)
701 this->m_dataOut_OutputPort[portNum].
invoke(
716 static_cast<FwAssertArgType>(portNum)
720 this->m_dataReturnOut_OutputPort[portNum].isConnected(),
721 static_cast<FwAssertArgType>(portNum)
723 this->m_dataReturnOut_OutputPort[portNum].
invoke(
738 return this->m_stateMachine_aggregationMachine.
getState();
748 ComponentIpcSerializableBuffer buffer;
752 this->aggregationMachine_sendSignalFinish(buffer);
758 ComponentIpcSerializableBuffer buffer;
765 this->aggregationMachine_sendSignalFinish(buffer);
771 ComponentIpcSerializableBuffer buffer;
778 this->aggregationMachine_sendSignalFinish(buffer);
788 ComponentIpcSerializableBuffer _msg;
798 static_cast<FwAssertArgType>(_msgStatus)
808 static_cast<FwAssertArgType>(_deserStatus)
811 MsgTypeEnum _msgType =
static_cast<MsgTypeEnum
>(_desMsg);
813 if (_msgType == COMAGGREGATOR_COMPONENT_EXIT) {
818 _deserStatus = _msg.deserializeTo(portNum);
821 static_cast<FwAssertArgType>(_deserStatus)
827 case INTERNAL_STATE_MACHINE_SIGNAL:
828 this->smDispatch(_msg);
842 void ComAggregatorComponentBase ::
851 compPtr->comStatusIn_handlerBase(
857 void ComAggregatorComponentBase ::
867 compPtr->dataIn_handlerBase(
874 void ComAggregatorComponentBase ::
884 compPtr->dataReturnIn_handlerBase(
891 void ComAggregatorComponentBase ::
900 compPtr->timeout_handlerBase(
910 void ComAggregatorComponentBase ::
920 status = buffer.
serializeFrom(static_cast<FwEnumStoreType>(INTERNAL_STATE_MACHINE_SIGNAL));
928 status = buffer.
serializeFrom(static_cast<FwEnumStoreType>(smId));
932 status = buffer.
serializeFrom(static_cast<FwEnumStoreType>(signal));
936 void ComAggregatorComponentBase ::
945 static_cast<FwAssertArgType>(qStatus)
953 void ComAggregatorComponentBase ::
959 ComAggregatorComponentBase::deserializeSmIdAndSignal(buffer, storedSmId, storedSignal);
962 const SmId smId =
static_cast<SmId>(storedSmId);
966 this->Svc_AggregationMachine_smDispatch(buffer, this->m_stateMachine_aggregationMachine, signal);
970 FW_ASSERT(
false, static_cast<FwAssertArgType>(smId));
975 void ComAggregatorComponentBase ::
976 deserializeSmIdAndSignal(
996 void ComAggregatorComponentBase ::
997 Svc_AggregationMachine_smDispatch(
999 Svc_AggregationMachine& sm,
1008 sm.sendSignal_timeout();
1019 sm.sendSignal_fill(value);
1030 sm.sendSignal_status(value);
1034 FW_ASSERT(
false, static_cast<FwAssertArgType>(signal));
Serialization/Deserialization operation was successful.
static constexpr FwIndexType getNum_comStatusOut_OutputPorts()
static constexpr FwIndexType getNum_dataOut_OutputPorts()
PlatformSizeType FwSizeType
static constexpr FwIndexType getNum_dataIn_InputPorts()
Status receive(U8 *destination, FwSizeType capacity, BlockingType blockType, FwSizeType &actualSize, FwQueuePriorityType &priority) override
receive a message from the queue through delegate
bool isConnected_comStatusOut_OutputPort(FwIndexType portNum) const
Status
status returned from the queue send function
void set_dataReturnOut_OutputPort(FwIndexType portNum, Svc::InputComDataWithContextPort *port)
Connect port to dataReturnOut[portNum].
message to exit active component task
SmId
State machine identifiers.
void init(ComAggregatorComponentBase::SmId smId)
Initialize the state machine.
void dataReturnOut_out(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context) const
Invoke output port dataReturnOut.
void aggregationMachine_sendSignal_status(const Fw::Success &value)
Send signal status to state machine aggregationMachine.
static constexpr FwIndexType getNum_timeout_InputPorts()
void timeout_handlerBase(FwIndexType portNum, U32 context)
Handler base-class function for input port timeout.
static constexpr FwIndexType getNum_comStatusIn_InputPorts()
AggregationMachineStateMachineBase::State getState() const
Get the state.
Fw::InputSuccessConditionPort * get_comStatusIn_InputPort(FwIndexType portNum)
virtual ~ComAggregatorComponentBase()
Destroy ComAggregatorComponentBase object.
Svc_AggregationMachine::State aggregationMachine_getState() const
Get the state of state machine instance aggregationMachine.
void addCallPort(InputSuccessConditionPort *callPort)
Register an input port.
virtual SerializeStatus serializeFrom(U8 val, Endianness mode=Endianness::BIG)=0
Serialize an 8-bit unsigned integer value.
The size of the serial representation.
Os::Queue m_queue
queue object for active component
static constexpr FwIndexType getNum_dataReturnIn_InputPorts()
void addCallPort(InputComDataWithContextPort *callPort)
Register an input port.
void dataIn_handlerBase(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Handler base-class function for input port dataIn.
void set_comStatusOut_OutputPort(FwIndexType portNum, Fw::InputSuccessConditionPort *port)
Connect port to comStatusOut[portNum].
void init()
Object initializer.
SerializeStatus
forward declaration for string
virtual SerializeStatus deserializeTo(U8 &val, Endianness mode=Endianness::BIG)=0
Deserialize an 8-bit unsigned integer value.
Message will block until space is available.
void dataReturnIn_handlerBase(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Handler base-class function for input port dataReturnIn.
bool isConnected_dataOut_OutputPort(FwIndexType portNum) const
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Os::Queue::Status createQueue(FwSizeType depth, FwSizeType msgSize)
Svc_AggregationMachine(ComAggregatorComponentBase &component)
Constructor.
The size of the serial representation.
virtual void dataIn_handler(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)=0
Handler for input port dataIn.
ActiveComponentBase(const char *name)
Constructor.
void comStatusIn_handlerBase(FwIndexType portNum, Fw::Success &condition)
Handler base-class function for input port comStatusIn.
Svc::InputComDataWithContextPort * get_dataReturnIn_InputPort(FwIndexType portNum)
void invoke(Fw::Success &condition) const
Invoke a port connection.
void invoke(Fw::Buffer &data, const ComCfg::FrameContext &context) const
Invoke a port connection.
Status send(const U8 *buffer, FwSizeType size, FwQueuePriorityType priority, BlockingType blockType) override
send a message into the queue through delegate
ComAggregatorComponentBase::SmId getId() const
Get the state machine id.
virtual void timeout_handler(FwIndexType portNum, U32 context)=0
Handler for input port timeout.
bool isConnected_dataReturnOut_OutputPort(FwIndexType portNum) const
ComAggregatorComponentBase(const char *compName="")
Construct ComAggregatorComponentBase object.
Errors dispatching messages.
void init()
Initialization function.
const char * toChar() const
Convert to a C-style char*.
FormatStatus format(const CHAR *formatString,...)
write formatted string to buffer
virtual Serializable::SizeType getDeserializeSizeLeft() const =0
Get remaining deserialization buffer size.
uint8_t U8
8-bit unsigned integer
Auto-generated base for ComAggregator component.
void aggregationMachine_sendSignal_timeout()
Send signal timeout to state machine aggregationMachine.
void init()
Initialization function.
PlatformQueuePriorityType FwQueuePriorityType
The type of queue priorities used.
A message was sent requesting an exit of the loop.
static constexpr FwIndexType getNum_dataReturnOut_OutputPorts()
PlatformIndexType FwIndexType
void comStatusOut_out(FwIndexType portNum, Fw::Success &condition) const
Invoke output port comStatusOut.
virtual void comStatusIn_handler(FwIndexType portNum, Fw::Success &condition)=0
Handler for input port comStatusIn.
Svc::InputComDataWithContextPort * get_dataIn_InputPort(FwIndexType portNum)
Type used to pass context info between components during framing/deframing.
Svc::InputSchedPort * get_timeout_InputPort(FwIndexType portNum)
RateGroupDivider component implementation.
message sent/received okay
LinearBufferTemplate< FW_SM_SIGNAL_BUFFER_MAX_SIZE > SmSignalBuffer
Message will return with status when space is unavailable.
Implementation of malloc based allocator.
void dataOut_out(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context) const
Invoke output port dataOut.
void init()
Initialization function.
virtual SerializeStatus moveDeserToOffset(FwSizeType offset)=0
Move deserialization pointer to specified offset.
FpySequencer_SequencerStateMachineStateMachineBase::Signal Signal
void aggregationMachine_sendSignal_fill(const Svc::ComDataContextPair &value)
Send signal fill to state machine aggregationMachine.
void set_dataOut_OutputPort(FwIndexType portNum, Svc::InputComDataWithContextPort *port)
Connect port to dataOut[portNum].
PlatformAssertArgType FwAssertArgType
The type of arguments to assert functions.
Rate-group driven timeout signal.
virtual void dataReturnIn_handler(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)=0
Handler for input port dataReturnIn.