9 #if FW_ENABLE_TEXT_LOGGING 19 namespace SmSignalBuffer {
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
66 return sizeof(m_buff);
73 const U8* getBuffAddr()
const {
79 U8 m_buff[SERIALIZATION_SIZE];
90 m_component(component)
98 this->initBase(static_cast<FwEnumStoreType>(smId));
107 void ComAggregatorComponentBase::Svc_AggregationMachine ::
108 action_doClear(
Signal signal)
110 this->m_component.Svc_AggregationMachine_action_doClear(this->getId(), signal);
113 void ComAggregatorComponentBase::Svc_AggregationMachine ::
119 this->m_component.Svc_AggregationMachine_action_doFill(this->getId(), signal, value);
122 void ComAggregatorComponentBase::Svc_AggregationMachine ::
123 action_doSend(
Signal signal)
125 this->m_component.Svc_AggregationMachine_action_doSend(this->getId(), signal);
128 void ComAggregatorComponentBase::Svc_AggregationMachine ::
134 this->m_component.Svc_AggregationMachine_action_doHold(this->getId(), signal, value);
137 void ComAggregatorComponentBase::Svc_AggregationMachine ::
138 action_assertNoStatus(
Signal signal)
140 this->m_component.Svc_AggregationMachine_action_assertNoStatus(this->getId(), signal);
143 bool ComAggregatorComponentBase::Svc_AggregationMachine ::
149 return this->m_component.Svc_AggregationMachine_guard_isFull(this->getId(), signal, value);
152 bool ComAggregatorComponentBase::Svc_AggregationMachine ::
153 guard_isNotEmpty(
Signal signal)
const 155 return this->m_component.Svc_AggregationMachine_guard_isNotEmpty(this->getId(), signal);
158 bool ComAggregatorComponentBase::Svc_AggregationMachine ::
164 return this->m_component.Svc_AggregationMachine_guard_isGood(this->getId(), signal, value);
189 this->m_comStatusIn_InputPort[port].
init();
194 this->m_comStatusIn_InputPort[port].
setPortNum(port);
196 #if FW_OBJECT_NAMES == 1 200 this->m_objName.toChar(),
203 this->m_comStatusIn_InputPort[port].setObjName(portName.
toChar());
213 this->m_dataIn_InputPort[port].
init();
218 this->m_dataIn_InputPort[port].
setPortNum(port);
220 #if FW_OBJECT_NAMES == 1 224 this->m_objName.toChar(),
227 this->m_dataIn_InputPort[port].setObjName(portName.
toChar());
237 this->m_dataReturnIn_InputPort[port].
init();
242 this->m_dataReturnIn_InputPort[port].
setPortNum(port);
244 #if FW_OBJECT_NAMES == 1 248 this->m_objName.toChar(),
251 this->m_dataReturnIn_InputPort[port].setObjName(portName.
toChar());
261 this->m_timeout_InputPort[port].
init();
266 this->m_timeout_InputPort[port].
setPortNum(port);
268 #if FW_OBJECT_NAMES == 1 272 this->m_objName.toChar(),
275 this->m_timeout_InputPort[port].setObjName(portName.
toChar());
285 this->m_comStatusOut_OutputPort[port].
init();
287 #if FW_OBJECT_NAMES == 1 291 this->m_objName.toChar(),
294 this->m_comStatusOut_OutputPort[port].setObjName(portName.
toChar());
304 this->m_dataOut_OutputPort[port].
init();
306 #if FW_OBJECT_NAMES == 1 310 this->m_objName.toChar(),
313 this->m_dataOut_OutputPort[port].setObjName(portName.
toChar());
323 this->m_dataReturnOut_OutputPort[port].
init();
325 #if FW_OBJECT_NAMES == 1 329 this->m_objName.toChar(),
332 this->m_dataReturnOut_OutputPort[port].setObjName(portName.
toChar());
339 static_cast<FwSizeType>(ComponentIpcSerializableBuffer::SERIALIZATION_SIZE)
343 static_cast<FwAssertArgType>(qStat)
356 static_cast<FwAssertArgType>(portNum)
359 return &this->m_comStatusIn_InputPort[portNum];
367 static_cast<FwAssertArgType>(portNum)
370 return &this->m_dataIn_InputPort[portNum];
378 static_cast<FwAssertArgType>(portNum)
381 return &this->m_dataReturnIn_InputPort[portNum];
389 static_cast<FwAssertArgType>(portNum)
392 return &this->m_timeout_InputPort[portNum];
407 static_cast<FwAssertArgType>(portNum)
410 this->m_comStatusOut_OutputPort[portNum].
addCallPort(port);
421 static_cast<FwAssertArgType>(portNum)
424 this->m_dataOut_OutputPort[portNum].
addCallPort(port);
435 static_cast<FwAssertArgType>(portNum)
438 this->m_dataReturnOut_OutputPort[portNum].
addCallPort(port);
441 #if FW_PORT_SERIALIZATION 450 Fw::InputSerializePort* port
455 static_cast<FwAssertArgType>(portNum)
458 this->m_comStatusOut_OutputPort[portNum].registerSerialPort(port);
464 Fw::InputSerializePort* port
469 static_cast<FwAssertArgType>(portNum)
472 this->m_dataOut_OutputPort[portNum].registerSerialPort(port);
478 Fw::InputSerializePort* port
483 static_cast<FwAssertArgType>(portNum)
486 this->m_dataReturnOut_OutputPort[portNum].registerSerialPort(port);
498 m_stateMachine_aggregationMachine(*this)
518 static_cast<FwAssertArgType>(portNum)
521 return this->m_comStatusOut_OutputPort[portNum].
isConnected();
529 static_cast<FwAssertArgType>(portNum)
532 return this->m_dataOut_OutputPort[portNum].
isConnected();
540 static_cast<FwAssertArgType>(portNum)
543 return this->m_dataReturnOut_OutputPort[portNum].
isConnected();
561 static_cast<FwAssertArgType>(portNum)
581 static_cast<FwAssertArgType>(portNum)
602 static_cast<FwAssertArgType>(portNum)
622 static_cast<FwAssertArgType>(portNum)
644 static_cast<FwAssertArgType>(portNum)
648 this->m_comStatusOut_OutputPort[portNum].isConnected(),
649 static_cast<FwAssertArgType>(portNum)
651 this->m_comStatusOut_OutputPort[portNum].
invoke(
665 static_cast<FwAssertArgType>(portNum)
669 this->m_dataOut_OutputPort[portNum].isConnected(),
670 static_cast<FwAssertArgType>(portNum)
672 this->m_dataOut_OutputPort[portNum].
invoke(
687 static_cast<FwAssertArgType>(portNum)
691 this->m_dataReturnOut_OutputPort[portNum].isConnected(),
692 static_cast<FwAssertArgType>(portNum)
694 this->m_dataReturnOut_OutputPort[portNum].
invoke(
707 return this->m_stateMachine_aggregationMachine.
getState();
717 ComponentIpcSerializableBuffer buffer;
721 this->aggregationMachine_sendSignalFinish(buffer);
727 ComponentIpcSerializableBuffer buffer;
734 this->aggregationMachine_sendSignalFinish(buffer);
740 ComponentIpcSerializableBuffer buffer;
747 this->aggregationMachine_sendSignalFinish(buffer);
757 ComponentIpcSerializableBuffer _msg;
767 static_cast<FwAssertArgType>(_msgStatus)
777 static_cast<FwAssertArgType>(_deserStatus)
780 MsgTypeEnum _msgType =
static_cast<MsgTypeEnum
>(_desMsg);
782 if (_msgType == COMAGGREGATOR_COMPONENT_EXIT) {
787 _deserStatus = _msg.deserializeTo(portNum);
790 static_cast<FwAssertArgType>(_deserStatus)
796 case INTERNAL_STATE_MACHINE_SIGNAL:
797 this->smDispatch(_msg);
811 void ComAggregatorComponentBase ::
820 compPtr->comStatusIn_handlerBase(
826 void ComAggregatorComponentBase ::
836 compPtr->dataIn_handlerBase(
843 void ComAggregatorComponentBase ::
853 compPtr->dataReturnIn_handlerBase(
860 void ComAggregatorComponentBase ::
869 compPtr->timeout_handlerBase(
879 void ComAggregatorComponentBase ::
889 status = buffer.
serializeFrom(static_cast<FwEnumStoreType>(INTERNAL_STATE_MACHINE_SIGNAL));
897 status = buffer.
serializeFrom(static_cast<FwEnumStoreType>(smId));
901 status = buffer.
serializeFrom(static_cast<FwEnumStoreType>(signal));
905 void ComAggregatorComponentBase ::
914 static_cast<FwAssertArgType>(qStatus)
922 void ComAggregatorComponentBase ::
928 ComAggregatorComponentBase::deserializeSmIdAndSignal(buffer, storedSmId, storedSignal);
931 const SmId smId =
static_cast<SmId>(storedSmId);
935 this->Svc_AggregationMachine_smDispatch(buffer, this->m_stateMachine_aggregationMachine, signal);
939 FW_ASSERT(0, static_cast<FwAssertArgType>(smId));
944 void ComAggregatorComponentBase ::
945 deserializeSmIdAndSignal(
965 void ComAggregatorComponentBase ::
966 Svc_AggregationMachine_smDispatch(
968 Svc_AggregationMachine& sm,
977 sm.sendSignal_timeout();
988 sm.sendSignal_fill(value);
999 sm.sendSignal_status(value);
1003 FW_ASSERT(0, static_cast<FwAssertArgType>(signal));
Serialization/Deserialization operation was successful.
bool isConnected_dataOut_OutputPort(FwIndexType portNum)
void comStatusOut_out(FwIndexType portNum, Fw::Success &condition)
Invoke output port comStatusOut.
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
Status
status returned from the queue send function
The size of the serial representation.
void set_dataReturnOut_OutputPort(FwIndexType portNum, Svc::InputComDataWithContextPort *port)
Connect port to dataReturnOut[portNum].
void dataReturnOut_out(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Invoke output port dataReturnOut.
SmId
State machine identifiers.
void init(ComAggregatorComponentBase::SmId smId)
Initialize the state machine.
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.
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.
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.
const char * toChar() const
Convert to a C-style char*.
Svc::InputComDataWithContextPort * get_dataReturnIn_InputPort(FwIndexType portNum)
void invoke(Fw::Success &condition) const
Invoke a port interface.
void invoke(Fw::Buffer &data, const ComCfg::FrameContext &context) const
Invoke a port interface.
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.
ComAggregatorComponentBase(const char *compName="")
Construct ComAggregatorComponentBase object.
Errors dispatching messages.
bool isConnected_comStatusOut_OutputPort(FwIndexType portNum)
void init()
Initialization function.
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()
message to exit active component task
PlatformIndexType FwIndexType
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.
bool isConnected_dataReturnOut_OutputPort(FwIndexType portNum)
message sent/received okay
The size of the serial representation.
Message will return with status when space is unavailable.
Implementation of malloc based allocator.
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].
void dataOut_out(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Invoke output port dataOut.
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.