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 ::
158 return this->m_component.Svc_AggregationMachine_guard_willFill(this->getId(), signal, value);
161 bool ComAggregatorComponentBase::Svc_AggregationMachine ::
162 guard_isNotEmpty(
Signal signal)
const 164 return this->m_component.Svc_AggregationMachine_guard_isNotEmpty(this->getId(), signal);
167 bool ComAggregatorComponentBase::Svc_AggregationMachine ::
173 return this->m_component.Svc_AggregationMachine_guard_isGood(this->getId(), signal, value);
192 #if !FW_DIRECT_PORT_CALLS 199 this->m_comStatusIn_InputPort[port].
init();
204 this->m_comStatusIn_InputPort[port].
setPortNum(port);
206 #if FW_OBJECT_NAMES == 1 210 this->m_objName.toChar(),
213 this->m_comStatusIn_InputPort[port].setObjName(portName.
toChar());
218 #if !FW_DIRECT_PORT_CALLS 225 this->m_dataIn_InputPort[port].
init();
230 this->m_dataIn_InputPort[port].
setPortNum(port);
232 #if FW_OBJECT_NAMES == 1 236 this->m_objName.toChar(),
239 this->m_dataIn_InputPort[port].setObjName(portName.
toChar());
244 #if !FW_DIRECT_PORT_CALLS 251 this->m_dataReturnIn_InputPort[port].
init();
256 this->m_dataReturnIn_InputPort[port].
setPortNum(port);
258 #if FW_OBJECT_NAMES == 1 262 this->m_objName.toChar(),
265 this->m_dataReturnIn_InputPort[port].setObjName(portName.
toChar());
270 #if !FW_DIRECT_PORT_CALLS 277 this->m_timeout_InputPort[port].
init();
282 this->m_timeout_InputPort[port].
setPortNum(port);
284 #if FW_OBJECT_NAMES == 1 288 this->m_objName.toChar(),
291 this->m_timeout_InputPort[port].setObjName(portName.
toChar());
296 #if !FW_DIRECT_PORT_CALLS 303 this->m_comStatusOut_OutputPort[port].
init();
305 #if FW_OBJECT_NAMES == 1 309 this->m_objName.toChar(),
312 this->m_comStatusOut_OutputPort[port].setObjName(portName.
toChar());
317 #if !FW_DIRECT_PORT_CALLS 324 this->m_dataOut_OutputPort[port].
init();
326 #if FW_OBJECT_NAMES == 1 330 this->m_objName.toChar(),
333 this->m_dataOut_OutputPort[port].setObjName(portName.
toChar());
338 #if !FW_DIRECT_PORT_CALLS 345 this->m_dataReturnOut_OutputPort[port].
init();
347 #if FW_OBJECT_NAMES == 1 351 this->m_objName.toChar(),
354 this->m_dataReturnOut_OutputPort[port].setObjName(portName.
toChar());
362 static_cast<FwSizeType>(ComponentIpcSerializableBuffer::SERIALIZATION_SIZE)
366 static_cast<FwAssertArgType>(qStat)
370 #if !FW_DIRECT_PORT_CALLS 381 static_cast<FwAssertArgType>(portNum)
384 return &this->m_comStatusIn_InputPort[portNum];
392 static_cast<FwAssertArgType>(portNum)
395 return &this->m_dataIn_InputPort[portNum];
403 static_cast<FwAssertArgType>(portNum)
406 return &this->m_dataReturnIn_InputPort[portNum];
414 static_cast<FwAssertArgType>(portNum)
417 return &this->m_timeout_InputPort[portNum];
422 #if !FW_DIRECT_PORT_CALLS 436 static_cast<FwAssertArgType>(portNum)
439 this->m_comStatusOut_OutputPort[portNum].
addCallPort(port);
450 static_cast<FwAssertArgType>(portNum)
453 this->m_dataOut_OutputPort[portNum].
addCallPort(port);
464 static_cast<FwAssertArgType>(portNum)
467 this->m_dataReturnOut_OutputPort[portNum].
addCallPort(port);
472 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION 481 Fw::InputSerializePort* port
486 static_cast<FwAssertArgType>(portNum)
489 this->m_comStatusOut_OutputPort[portNum].registerSerialPort(port);
495 Fw::InputSerializePort* port
500 static_cast<FwAssertArgType>(portNum)
503 this->m_dataOut_OutputPort[portNum].registerSerialPort(port);
509 Fw::InputSerializePort* port
514 static_cast<FwAssertArgType>(portNum)
517 this->m_dataReturnOut_OutputPort[portNum].registerSerialPort(port);
529 m_stateMachine_aggregationMachine(*this)
540 #if !FW_DIRECT_PORT_CALLS 551 static_cast<FwAssertArgType>(portNum)
554 return this->m_comStatusOut_OutputPort[portNum].
isConnected();
562 static_cast<FwAssertArgType>(portNum)
565 return this->m_dataOut_OutputPort[portNum].
isConnected();
573 static_cast<FwAssertArgType>(portNum)
576 return this->m_dataReturnOut_OutputPort[portNum].
isConnected();
596 static_cast<FwAssertArgType>(portNum)
616 static_cast<FwAssertArgType>(portNum)
637 static_cast<FwAssertArgType>(portNum)
657 static_cast<FwAssertArgType>(portNum)
667 #if !FW_DIRECT_PORT_CALLS 681 static_cast<FwAssertArgType>(portNum)
685 this->m_comStatusOut_OutputPort[portNum].isConnected(),
686 static_cast<FwAssertArgType>(portNum)
688 this->m_comStatusOut_OutputPort[portNum].
invoke(
702 static_cast<FwAssertArgType>(portNum)
706 this->m_dataOut_OutputPort[portNum].isConnected(),
707 static_cast<FwAssertArgType>(portNum)
709 this->m_dataOut_OutputPort[portNum].
invoke(
724 static_cast<FwAssertArgType>(portNum)
728 this->m_dataReturnOut_OutputPort[portNum].isConnected(),
729 static_cast<FwAssertArgType>(portNum)
731 this->m_dataReturnOut_OutputPort[portNum].
invoke(
746 return this->m_stateMachine_aggregationMachine.
getState();
756 ComponentIpcSerializableBuffer buffer;
760 this->aggregationMachine_sendSignalFinish(buffer);
766 ComponentIpcSerializableBuffer buffer;
773 this->aggregationMachine_sendSignalFinish(buffer);
779 ComponentIpcSerializableBuffer buffer;
786 this->aggregationMachine_sendSignalFinish(buffer);
796 ComponentIpcSerializableBuffer _msg;
806 static_cast<FwAssertArgType>(_msgStatus)
816 static_cast<FwAssertArgType>(_deserStatus)
819 MsgTypeEnum _msgType =
static_cast<MsgTypeEnum
>(_desMsg);
821 if (_msgType == COMAGGREGATOR_COMPONENT_EXIT) {
826 _deserStatus = _msg.deserializeTo(portNum);
829 static_cast<FwAssertArgType>(_deserStatus)
835 case INTERNAL_STATE_MACHINE_SIGNAL:
836 this->smDispatch(_msg);
850 void ComAggregatorComponentBase ::
859 compPtr->comStatusIn_handlerBase(
865 void ComAggregatorComponentBase ::
875 compPtr->dataIn_handlerBase(
882 void ComAggregatorComponentBase ::
892 compPtr->dataReturnIn_handlerBase(
899 void ComAggregatorComponentBase ::
908 compPtr->timeout_handlerBase(
918 void ComAggregatorComponentBase ::
928 status = buffer.
serializeFrom(static_cast<FwEnumStoreType>(INTERNAL_STATE_MACHINE_SIGNAL));
936 status = buffer.
serializeFrom(static_cast<FwEnumStoreType>(smId));
940 status = buffer.
serializeFrom(static_cast<FwEnumStoreType>(signal));
944 void ComAggregatorComponentBase ::
953 static_cast<FwAssertArgType>(qStatus)
961 void ComAggregatorComponentBase ::
967 ComAggregatorComponentBase::deserializeSmIdAndSignal(buffer, storedSmId, storedSignal);
970 const SmId smId =
static_cast<SmId>(storedSmId);
974 this->Svc_AggregationMachine_smDispatch(buffer, this->m_stateMachine_aggregationMachine, signal);
978 FW_ASSERT(0, static_cast<FwAssertArgType>(smId));
983 void ComAggregatorComponentBase ::
984 deserializeSmIdAndSignal(
1004 void ComAggregatorComponentBase ::
1005 Svc_AggregationMachine_smDispatch(
1007 Svc_AggregationMachine& sm,
1016 sm.sendSignal_timeout();
1027 sm.sendSignal_fill(value);
1038 sm.sendSignal_status(value);
1042 FW_ASSERT(0, static_cast<FwAssertArgType>(signal));
Serialization/Deserialization operation was successful.
static constexpr FwIndexType getNum_comStatusOut_OutputPorts()
The size of the serial representation.
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.
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.
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 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.
FormatStatus format(const CHAR *formatString,...)
write formatted string to buffer
The size of the serial representation.
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
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.
message to exit active component task