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 ::
135 this->m_component.Svc_AggregationMachine_action_doSplitHold(this->getId(), signal, value);
138 void ComAggregatorComponentBase::Svc_AggregationMachine ::
139 action_doNoteFailure(
Signal signal)
141 this->m_component.Svc_AggregationMachine_action_doNoteFailure(this->getId(), signal);
144 void ComAggregatorComponentBase::Svc_AggregationMachine ::
145 action_assertNoStatus(
Signal signal)
147 this->m_component.Svc_AggregationMachine_action_assertNoStatus(this->getId(), signal);
150 bool ComAggregatorComponentBase::Svc_AggregationMachine ::
156 return this->m_component.Svc_AggregationMachine_guard_isFull(this->getId(), signal, value);
159 bool ComAggregatorComponentBase::Svc_AggregationMachine ::
165 return this->m_component.Svc_AggregationMachine_guard_willFill(this->getId(), signal, value);
168 bool ComAggregatorComponentBase::Svc_AggregationMachine ::
169 guard_isNotEmpty(
Signal signal)
const 171 return this->m_component.Svc_AggregationMachine_guard_isNotEmpty(this->getId(), signal);
174 bool ComAggregatorComponentBase::Svc_AggregationMachine ::
180 return this->m_component.Svc_AggregationMachine_guard_isGood(this->getId(), signal, value);
183 bool ComAggregatorComponentBase::Svc_AggregationMachine ::
184 guard_isSpanFull(
Signal signal)
const 186 return this->m_component.Svc_AggregationMachine_guard_isSpanFull(this->getId(), signal);
205 #if !FW_DIRECT_PORT_CALLS 212 this->m_comStatusIn_InputPort[port].
init();
217 this->m_comStatusIn_InputPort[port].
setPortNum(port);
219 #if FW_OBJECT_NAMES == 1 223 this->m_objName.toChar(),
226 this->m_comStatusIn_InputPort[port].setObjName(portName.
toChar());
231 #if !FW_DIRECT_PORT_CALLS 238 this->m_dataIn_InputPort[port].
init();
243 this->m_dataIn_InputPort[port].
setPortNum(port);
245 #if FW_OBJECT_NAMES == 1 249 this->m_objName.toChar(),
252 this->m_dataIn_InputPort[port].setObjName(portName.
toChar());
257 #if !FW_DIRECT_PORT_CALLS 264 this->m_dataReturnIn_InputPort[port].
init();
269 this->m_dataReturnIn_InputPort[port].
setPortNum(port);
271 #if FW_OBJECT_NAMES == 1 275 this->m_objName.toChar(),
278 this->m_dataReturnIn_InputPort[port].setObjName(portName.
toChar());
283 #if !FW_DIRECT_PORT_CALLS 290 this->m_timeout_InputPort[port].
init();
295 this->m_timeout_InputPort[port].
setPortNum(port);
297 #if FW_OBJECT_NAMES == 1 301 this->m_objName.toChar(),
304 this->m_timeout_InputPort[port].setObjName(portName.
toChar());
309 #if !FW_DIRECT_PORT_CALLS 316 this->m_comStatusOut_OutputPort[port].
init();
318 #if FW_OBJECT_NAMES == 1 322 this->m_objName.toChar(),
325 this->m_comStatusOut_OutputPort[port].setObjName(portName.
toChar());
330 #if !FW_DIRECT_PORT_CALLS 337 this->m_dataOut_OutputPort[port].
init();
339 #if FW_OBJECT_NAMES == 1 343 this->m_objName.toChar(),
346 this->m_dataOut_OutputPort[port].setObjName(portName.
toChar());
351 #if !FW_DIRECT_PORT_CALLS 358 this->m_dataReturnOut_OutputPort[port].
init();
360 #if FW_OBJECT_NAMES == 1 364 this->m_objName.toChar(),
367 this->m_dataReturnOut_OutputPort[port].setObjName(portName.
toChar());
375 static_cast<FwSizeType>(ComponentIpcSerializableBuffer::SERIALIZATION_SIZE)
379 static_cast<FwAssertArgType>(qStat)
383 #if !FW_DIRECT_PORT_CALLS 394 static_cast<FwAssertArgType>(portNum)
397 return &this->m_comStatusIn_InputPort[portNum];
405 static_cast<FwAssertArgType>(portNum)
408 return &this->m_dataIn_InputPort[portNum];
416 static_cast<FwAssertArgType>(portNum)
419 return &this->m_dataReturnIn_InputPort[portNum];
427 static_cast<FwAssertArgType>(portNum)
430 return &this->m_timeout_InputPort[portNum];
435 #if !FW_DIRECT_PORT_CALLS 449 static_cast<FwAssertArgType>(portNum)
452 this->m_comStatusOut_OutputPort[portNum].
addCallPort(port);
463 static_cast<FwAssertArgType>(portNum)
466 this->m_dataOut_OutputPort[portNum].
addCallPort(port);
477 static_cast<FwAssertArgType>(portNum)
480 this->m_dataReturnOut_OutputPort[portNum].
addCallPort(port);
485 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION 494 Fw::InputSerializePort* port
499 static_cast<FwAssertArgType>(portNum)
502 this->m_comStatusOut_OutputPort[portNum].registerSerialPort(port);
508 Fw::InputSerializePort* port
513 static_cast<FwAssertArgType>(portNum)
516 this->m_dataOut_OutputPort[portNum].registerSerialPort(port);
522 Fw::InputSerializePort* port
527 static_cast<FwAssertArgType>(portNum)
530 this->m_dataReturnOut_OutputPort[portNum].registerSerialPort(port);
542 m_stateMachine_aggregationMachine(*this)
553 #if !FW_DIRECT_PORT_CALLS 564 static_cast<FwAssertArgType>(portNum)
567 return this->m_comStatusOut_OutputPort[portNum].
isConnected();
575 static_cast<FwAssertArgType>(portNum)
578 return this->m_dataOut_OutputPort[portNum].
isConnected();
586 static_cast<FwAssertArgType>(portNum)
589 return this->m_dataReturnOut_OutputPort[portNum].
isConnected();
609 static_cast<FwAssertArgType>(portNum)
629 static_cast<FwAssertArgType>(portNum)
650 static_cast<FwAssertArgType>(portNum)
670 static_cast<FwAssertArgType>(portNum)
680 #if !FW_DIRECT_PORT_CALLS 694 static_cast<FwAssertArgType>(portNum)
698 this->m_comStatusOut_OutputPort[portNum].isConnected(),
699 static_cast<FwAssertArgType>(portNum)
701 this->m_comStatusOut_OutputPort[portNum].
invoke(
715 static_cast<FwAssertArgType>(portNum)
719 this->m_dataOut_OutputPort[portNum].isConnected(),
720 static_cast<FwAssertArgType>(portNum)
722 this->m_dataOut_OutputPort[portNum].
invoke(
737 static_cast<FwAssertArgType>(portNum)
741 this->m_dataReturnOut_OutputPort[portNum].isConnected(),
742 static_cast<FwAssertArgType>(portNum)
744 this->m_dataReturnOut_OutputPort[portNum].
invoke(
759 return this->m_stateMachine_aggregationMachine.
getState();
769 ComponentIpcSerializableBuffer buffer;
773 this->aggregationMachine_sendSignalFinish(buffer);
779 ComponentIpcSerializableBuffer buffer;
786 this->aggregationMachine_sendSignalFinish(buffer);
792 ComponentIpcSerializableBuffer buffer;
799 this->aggregationMachine_sendSignalFinish(buffer);
809 ComponentIpcSerializableBuffer _msg;
819 static_cast<FwAssertArgType>(_msgStatus)
829 static_cast<FwAssertArgType>(_deserStatus)
832 MsgTypeEnum _msgType =
static_cast<MsgTypeEnum
>(_desMsg);
834 if (_msgType == COMAGGREGATOR_COMPONENT_EXIT) {
839 _deserStatus = _msg.deserializeTo(portNum);
842 static_cast<FwAssertArgType>(_deserStatus)
848 case INTERNAL_STATE_MACHINE_SIGNAL:
849 this->smDispatch(_msg);
863 void ComAggregatorComponentBase ::
872 compPtr->comStatusIn_handlerBase(
878 void ComAggregatorComponentBase ::
888 compPtr->dataIn_handlerBase(
895 void ComAggregatorComponentBase ::
905 compPtr->dataReturnIn_handlerBase(
912 void ComAggregatorComponentBase ::
921 compPtr->timeout_handlerBase(
931 void ComAggregatorComponentBase ::
941 status = buffer.
serializeFrom(static_cast<FwEnumStoreType>(INTERNAL_STATE_MACHINE_SIGNAL));
949 status = buffer.
serializeFrom(static_cast<FwEnumStoreType>(smId));
953 status = buffer.
serializeFrom(static_cast<FwEnumStoreType>(signal));
957 void ComAggregatorComponentBase ::
966 static_cast<FwAssertArgType>(qStatus)
974 void ComAggregatorComponentBase ::
980 ComAggregatorComponentBase::deserializeSmIdAndSignal(buffer, storedSmId, storedSignal);
983 const SmId smId =
static_cast<SmId>(storedSmId);
987 this->Svc_AggregationMachine_smDispatch(buffer, this->m_stateMachine_aggregationMachine, signal);
991 FW_ASSERT(
false, static_cast<FwAssertArgType>(smId));
996 void ComAggregatorComponentBase ::
997 deserializeSmIdAndSignal(
1017 void ComAggregatorComponentBase ::
1018 Svc_AggregationMachine_smDispatch(
1020 Svc_AggregationMachine& sm,
1029 sm.sendSignal_timeout();
1040 sm.sendSignal_fill(value);
1051 sm.sendSignal_status(value);
1055 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].
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.
The size of the serial representation.
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.
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.
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.
message to exit active component task
The size of the serial representation.
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.