9 #if FW_ENABLE_TEXT_LOGGING 19 FILEANNOUNCERECV_FILEANNOUNCE,
34 class ComponentIpcSerializableBuffer :
44 MAX_DATA_SIZE =
sizeof(BuffUnion),
46 SERIALIZATION_SIZE = DATA_OFFSET + MAX_DATA_SIZE
50 return sizeof(m_buff);
57 const U8* getBuffAddr()
const {
63 U8 m_buff[SERIALIZATION_SIZE];
87 this->m_cmdIn_InputPort[port].
init();
92 this->m_cmdIn_InputPort[port].
setPortNum(port);
94 #if FW_OBJECT_NAMES == 1 98 this->m_objName.toChar(),
101 this->m_cmdIn_InputPort[port].setObjName(portName.
toChar());
111 this->m_fileAnnounceRecv_InputPort[port].
init();
112 this->m_fileAnnounceRecv_InputPort[port].
addCallComp(
114 m_p_fileAnnounceRecv_in
116 this->m_fileAnnounceRecv_InputPort[port].
setPortNum(port);
118 #if FW_OBJECT_NAMES == 1 122 this->m_objName.toChar(),
125 this->m_fileAnnounceRecv_InputPort[port].setObjName(portName.
toChar());
135 this->m_pingIn_InputPort[port].
init();
140 this->m_pingIn_InputPort[port].
setPortNum(port);
142 #if FW_OBJECT_NAMES == 1 146 this->m_objName.toChar(),
149 this->m_pingIn_InputPort[port].setObjName(portName.
toChar());
159 this->m_cmdRegOut_OutputPort[port].
init();
161 #if FW_OBJECT_NAMES == 1 165 this->m_objName.toChar(),
168 this->m_cmdRegOut_OutputPort[port].setObjName(portName.
toChar());
178 this->m_cmdResponseOut_OutputPort[port].
init();
180 #if FW_OBJECT_NAMES == 1 184 this->m_objName.toChar(),
187 this->m_cmdResponseOut_OutputPort[port].setObjName(portName.
toChar());
197 this->m_logOut_OutputPort[port].
init();
199 #if FW_OBJECT_NAMES == 1 203 this->m_objName.toChar(),
206 this->m_logOut_OutputPort[port].setObjName(portName.
toChar());
210 #if FW_ENABLE_TEXT_LOGGING == 1 214 port < static_cast<FwIndexType>(this->getNum_logTextOut_OutputPorts());
217 this->m_logTextOut_OutputPort[port].
init();
219 #if FW_OBJECT_NAMES == 1 223 this->m_objName.toChar(),
226 this->m_logTextOut_OutputPort[port].setObjName(portName.
toChar());
237 this->m_timeCaller_OutputPort[port].
init();
239 #if FW_OBJECT_NAMES == 1 243 this->m_objName.toChar(),
246 this->m_timeCaller_OutputPort[port].setObjName(portName.
toChar());
256 this->m_fileDispatch_OutputPort[port].
init();
258 #if FW_OBJECT_NAMES == 1 262 this->m_objName.toChar(),
265 this->m_fileDispatch_OutputPort[port].setObjName(portName.
toChar());
275 this->m_pingOut_OutputPort[port].
init();
277 #if FW_OBJECT_NAMES == 1 281 this->m_objName.toChar(),
284 this->m_pingOut_OutputPort[port].setObjName(portName.
toChar());
291 static_cast<FwSizeType>(ComponentIpcSerializableBuffer::SERIALIZATION_SIZE)
295 static_cast<FwAssertArgType>(qStat)
308 static_cast<FwAssertArgType>(portNum)
311 return &this->m_cmdIn_InputPort[portNum];
323 static_cast<FwAssertArgType>(portNum)
326 return &this->m_fileAnnounceRecv_InputPort[portNum];
334 static_cast<FwAssertArgType>(portNum)
337 return &this->m_pingIn_InputPort[portNum];
352 static_cast<FwAssertArgType>(portNum)
355 this->m_cmdRegOut_OutputPort[portNum].
addCallPort(port);
366 static_cast<FwAssertArgType>(portNum)
369 this->m_cmdResponseOut_OutputPort[portNum].
addCallPort(port);
380 static_cast<FwAssertArgType>(portNum)
383 this->m_logOut_OutputPort[portNum].
addCallPort(port);
386 #if FW_ENABLE_TEXT_LOGGING == 1 388 void FileDispatcherComponentBase ::
389 set_logTextOut_OutputPort(
395 (0 <= portNum) && (portNum < this->getNum_logTextOut_OutputPorts()),
396 static_cast<FwAssertArgType>(portNum)
399 this->m_logTextOut_OutputPort[portNum].addCallPort(port);
412 static_cast<FwAssertArgType>(portNum)
415 this->m_timeCaller_OutputPort[portNum].
addCallPort(port);
430 static_cast<FwAssertArgType>(portNum)
433 this->m_fileDispatch_OutputPort[portNum].
addCallPort(port);
444 static_cast<FwAssertArgType>(portNum)
447 this->m_pingOut_OutputPort[portNum].
addCallPort(port);
450 #if FW_PORT_SERIALIZATION 459 Fw::InputSerializePort* port
464 static_cast<FwAssertArgType>(portNum)
467 this->m_cmdRegOut_OutputPort[portNum].registerSerialPort(port);
473 Fw::InputSerializePort* port
478 static_cast<FwAssertArgType>(portNum)
481 this->m_cmdResponseOut_OutputPort[portNum].registerSerialPort(port);
487 Fw::InputSerializePort* port
492 static_cast<FwAssertArgType>(portNum)
495 this->m_logOut_OutputPort[portNum].registerSerialPort(port);
498 #if FW_ENABLE_TEXT_LOGGING == 1 500 void FileDispatcherComponentBase ::
501 set_logTextOut_OutputPort(
503 Fw::InputSerializePort* port
507 (0 <= portNum) && (portNum < this->getNum_logTextOut_OutputPorts()),
508 static_cast<FwAssertArgType>(portNum)
511 this->m_logTextOut_OutputPort[portNum].registerSerialPort(port);
519 Fw::InputSerializePort* port
524 static_cast<FwAssertArgType>(portNum)
527 this->m_timeCaller_OutputPort[portNum].registerSerialPort(port);
532 #if FW_PORT_SERIALIZATION 541 Fw::InputSerializePort* port
546 static_cast<FwAssertArgType>(portNum)
549 this->m_fileDispatch_OutputPort[portNum].registerSerialPort(port);
555 Fw::InputSerializePort* port
560 static_cast<FwAssertArgType>(portNum)
563 this->m_pingOut_OutputPort[portNum].registerSerialPort(port);
575 FW_ASSERT(this->m_cmdRegOut_OutputPort[0].isConnected());
577 this->m_cmdRegOut_OutputPort[0].
invoke(
588 Fw::ActiveComponentBase(compName)
608 static_cast<FwAssertArgType>(portNum)
611 return this->m_cmdRegOut_OutputPort[portNum].
isConnected();
619 static_cast<FwAssertArgType>(portNum)
622 return this->m_cmdResponseOut_OutputPort[portNum].
isConnected();
630 static_cast<FwAssertArgType>(portNum)
633 return this->m_logOut_OutputPort[portNum].
isConnected();
636 #if FW_ENABLE_TEXT_LOGGING == 1 638 bool FileDispatcherComponentBase ::
639 isConnected_logTextOut_OutputPort(
FwIndexType portNum)
642 (0 <= portNum) && (portNum < this->getNum_logTextOut_OutputPorts()),
643 static_cast<FwAssertArgType>(portNum)
646 return this->m_logTextOut_OutputPort[portNum].isConnected();
656 static_cast<FwAssertArgType>(portNum)
659 return this->m_timeCaller_OutputPort[portNum].
isConnected();
671 static_cast<FwAssertArgType>(portNum)
674 return this->m_fileDispatch_OutputPort[portNum].
isConnected();
682 static_cast<FwAssertArgType>(portNum)
685 return this->m_pingOut_OutputPort[portNum].
isConnected();
703 static_cast<FwAssertArgType>(portNum)
711 ComponentIpcSerializableBuffer msg;
715 _status = msg.serializeFrom(
716 static_cast<FwEnumStoreType>(FILEANNOUNCERECV_FILEANNOUNCE)
720 static_cast<FwAssertArgType>(_status)
724 _status = msg.serializeFrom(portNum);
727 static_cast<FwAssertArgType>(_status)
734 static_cast<FwAssertArgType>(_status)
743 static_cast<FwAssertArgType>(qStatus)
756 static_cast<FwAssertArgType>(portNum)
764 ComponentIpcSerializableBuffer msg;
768 _status = msg.serializeFrom(
769 static_cast<FwEnumStoreType>(PINGIN_PING)
773 static_cast<FwAssertArgType>(_status)
777 _status = msg.serializeFrom(portNum);
780 static_cast<FwAssertArgType>(_status)
784 _status = msg.serializeFrom(key);
787 static_cast<FwAssertArgType>(_status)
796 static_cast<FwAssertArgType>(qStatus)
838 static_cast<FwAssertArgType>(portNum)
842 this->m_fileDispatch_OutputPort[portNum].isConnected(),
843 static_cast<FwAssertArgType>(portNum)
845 this->m_fileDispatch_OutputPort[portNum].
invoke(
858 static_cast<FwAssertArgType>(portNum)
862 this->m_pingOut_OutputPort[portNum].isConnected(),
863 static_cast<FwAssertArgType>(portNum)
865 this->m_pingOut_OutputPort[portNum].
invoke(
881 FW_ASSERT(this->m_cmdResponseOut_OutputPort[0].isConnected());
882 this->m_cmdResponseOut_OutputPort[0].
invoke(opCode, cmdSeq, response);
903 ComponentIpcSerializableBuffer msg;
907 _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_ENABLE_DISPATCH));
910 static_cast<FwAssertArgType>(_status)
916 _status = msg.serializeFrom(port);
919 static_cast<FwAssertArgType>(_status)
922 _status = msg.serializeFrom(opCode);
925 static_cast<FwAssertArgType>(_status)
928 _status = msg.serializeFrom(cmdSeq);
931 static_cast<FwAssertArgType>(_status)
934 _status = msg.serializeFrom(args);
937 static_cast<FwAssertArgType>(_status)
946 static_cast<FwAssertArgType>(qStatus)
981 if (this->m_timeCaller_OutputPort[0].isConnected()) {
982 this->m_timeCaller_OutputPort[0].
invoke(_logTime);
990 if (this->m_logOut_OutputPort[0].isConnected()) {
994 #if FW_AMPCS_COMPATIBLE 999 static_cast<FwAssertArgType>(_status)
1003 #if FW_AMPCS_COMPATIBLE 1010 static_cast<FwAssertArgType>(_status)
1016 static_cast<FwAssertArgType>(_status)
1019 #if FW_AMPCS_COMPATIBLE 1026 static_cast<FwAssertArgType>(_status)
1032 static_cast<FwAssertArgType>(_status)
1035 this->m_logOut_OutputPort[0].
invoke(
1044 #if FW_ENABLE_TEXT_LOGGING 1045 if (this->m_logTextOut_OutputPort[0].isConnected()) {
1046 #if FW_OBJECT_NAMES == 1 1047 const char* _formatString =
1048 "(%s) %s: File dispatch %s state changed: to %s";
1050 const char* _formatString =
1051 "%s: File dispatch %s state changed: to %s";
1055 file_type.toString(file_typeStr);
1057 enabled.toString(enabledStr);
1063 this->m_objName.toChar(),
1065 "FileDispatchState ",
1070 this->m_logTextOut_OutputPort[0].invoke(
1088 if (this->m_timeCaller_OutputPort[0].isConnected()) {
1089 this->m_timeCaller_OutputPort[0].
invoke(_logTime);
1097 if (this->m_logOut_OutputPort[0].isConnected()) {
1101 #if FW_AMPCS_COMPATIBLE 1106 static_cast<FwAssertArgType>(_status)
1113 static_cast<FwAssertArgType>(_status)
1116 #if FW_AMPCS_COMPATIBLE 1123 static_cast<FwAssertArgType>(_status)
1129 static_cast<FwAssertArgType>(_status)
1132 this->m_logOut_OutputPort[0].
invoke(
1141 #if FW_ENABLE_TEXT_LOGGING 1142 if (this->m_logTextOut_OutputPort[0].isConnected()) {
1143 #if FW_OBJECT_NAMES == 1 1144 const char* _formatString =
1145 "(%s) %s: File %s dispatched to %s";
1147 const char* _formatString =
1148 "%s: File %s dispatched to %s";
1152 file_type.toString(file_typeStr);
1158 this->m_objName.toChar(),
1165 this->m_logTextOut_OutputPort[0].invoke(
1182 if (this->m_timeCaller_OutputPort[0].isConnected()) {
1184 this->m_timeCaller_OutputPort[0].
invoke(_time);
1199 ComponentIpcSerializableBuffer _msg;
1209 static_cast<FwAssertArgType>(_msgStatus)
1219 static_cast<FwAssertArgType>(_deserStatus)
1222 MsgTypeEnum _msgType =
static_cast<MsgTypeEnum
>(_desMsg);
1224 if (_msgType == FILEDISPATCHER_COMPONENT_EXIT) {
1229 _deserStatus = _msg.deserializeTo(portNum);
1232 static_cast<FwAssertArgType>(_deserStatus)
1237 case FILEANNOUNCERECV_FILEANNOUNCE: {
1240 Fw::ExternalString file_name(__fprime_ac_file_name_buffer,
sizeof __fprime_ac_file_name_buffer);
1241 _deserStatus = _msg.deserializeTo(file_name);
1244 static_cast<FwAssertArgType>(_deserStatus)
1259 _deserStatus = _msg.deserializeTo(key);
1262 static_cast<FwAssertArgType>(_deserStatus)
1274 case CMD_ENABLE_DISPATCH: {
1277 _deserStatus = _msg.deserializeTo(_opCode);
1280 static_cast<FwAssertArgType>(_deserStatus)
1285 _deserStatus = _msg.deserializeTo(_cmdSeq);
1288 static_cast<FwAssertArgType>(_deserStatus)
1293 _deserStatus = _msg.deserializeTo(args);
1296 static_cast<FwAssertArgType>(_deserStatus)
1306 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
1321 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
1334 #if FW_CMD_CHECK_RESIDUAL 1336 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
1365 void FileDispatcherComponentBase ::
1377 const U32 idBase = callComp->
getIdBase();
1378 FW_ASSERT(opCode >= idBase, static_cast<FwAssertArgType>(opCode), static_cast<FwAssertArgType>(idBase));
1381 switch (opCode - idBase) {
1383 compPtr->ENABLE_DISPATCH_cmdHandlerBase(
1397 void FileDispatcherComponentBase ::
1398 m_p_fileAnnounceRecv_in(
1406 compPtr->fileAnnounceRecv_handlerBase(
1412 void FileDispatcherComponentBase ::
1421 compPtr->pingIn_handlerBase(
Serialization/Deserialization operation was successful.
void set_pingOut_OutputPort(FwIndexType portNum, Svc::InputPingPort *port)
Connect port to pingOut[portNum].
void addCallPort(InputTimePort *callPort)
Register an input port.
static constexpr FwIndexType getNum_cmdResponseOut_OutputPorts()
virtual void pingIn_handler(FwIndexType portNum, U32 key)=0
Handler for input port pingIn.
FwIdType FwOpcodeType
The type of a command opcode.
SerializeStatus serializeFrom(U8 val, Endianness mode=Endianness::BIG) override
Serialize an 8-bit unsigned integer value.
static constexpr FwIndexType getNum_cmdRegOut_OutputPorts()
FwIdType getIdBase() const
PlatformSizeType FwSizeType
void set_logOut_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to logOut[portNum].
Status receive(U8 *destination, FwSizeType capacity, BlockingType blockType, FwSizeType &actualSize, FwQueuePriorityType &priority) override
receive a message from the queue through delegate
static constexpr FwIndexType getNum_timeCaller_OutputPorts()
Status
status returned from the queue send function
const char * toChar() const
Convert to a C-style char*.
void fileAnnounceRecv_handlerBase(FwIndexType portNum, Fw::StringBase &file_name)
Handler base-class function for input port fileAnnounceRecv.
void invoke(U32 key) const
Invoke a port interface.
virtual const CHAR * toChar() const =0
Convert to a C-style char*.
FileDispatcherComponentBase(const char *compName="")
Construct FileDispatcherComponentBase object.
Enum representing a command response.
void pingIn_handlerBase(FwIndexType portNum, U32 key)
Handler base-class function for input port pingIn.
No time base has been established (Required)
void addCallPort(InputCmdRegPort *callPort)
Register an input port.
Fw::InputCmdPort * get_cmdIn_InputPort(FwIndexType portNum)
virtual void fileAnnounceRecv_handler(FwIndexType portNum, Fw::StringBase &file_name)=0
Handler for input port fileAnnounceRecv.
void log_ACTIVITY_HI_FileDispatchState(Svc::FileDispatcherCfg::FileDispatchPort file_type, Fw::Enabled enabled) const
Log event FileDispatchState.
void init()
Initialization function.
Os::Queue m_queue
queue object for active component
void set_cmdResponseOut_OutputPort(FwIndexType portNum, Fw::InputCmdResponsePort *port)
Connect port to cmdResponseOut[portNum].
bool isConnected_fileDispatch_OutputPort(FwIndexType portNum)
virtual void ENABLE_DISPATCH_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command ENABLE_DISPATCH.
void init()
Object initializer.
void regCommands()
Register commands with the Command Dispatcher.
SerializeStatus
forward declaration for string
Message will block until space is available.
static constexpr FwIndexType getNum_fileDispatch_OutputPorts()
FwIdType FwEventIdType
The type of an event identifier.
void fileDispatch_out(FwIndexType portNum, Fw::StringBase &file_name)
Invoke output port fileDispatch.
void invoke(FwOpcodeType opCode) const
Invoke a port interface.
bool isConnected_pingOut_OutputPort(FwIndexType portNum)
#define FW_OBJECT_NAMES
Indicates whether or not object names are stored (more memory, can be used for tracking objects) ...
virtual void pingIn_preMsgHook(FwIndexType portNum, U32 key)
Pre-message hook for async input port pingIn.
void init()
Initialization function.
bool isConnected_logOut_OutputPort(FwIndexType portNum)
Os::Queue::Status createQueue(FwSizeType depth, FwSizeType msgSize)
#define FW_MIN(a, b)
MIN macro.
static constexpr FwIndexType getNum_logOut_OutputPorts()
void init()
Initialization function.
void invoke(Fw::Time &time) const
Invoke a port interface.
Serializable::SizeType getDeserializeSizeLeft() const override
Get remaining deserialization buffer size.
static constexpr FwIndexType getNum_pingIn_InputPorts()
const char * toChar() const
Convert to a C-style char*.
virtual void ENABLE_DISPATCH_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, Svc::FileDispatcherCfg::FileDispatchPort file_type, Fw::Enabled enable)=0
Handler for command ENABLE_DISPATCH.
void invoke(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response) const
Invoke a port interface.
void addCallPort(InputPingPort *callPort)
Register an input port.
Status send(const U8 *buffer, FwSizeType size, FwQueuePriorityType priority, BlockingType blockType) override
send a message into the queue through delegate
static constexpr FwIndexType getNum_cmdIn_InputPorts()
void resetDeser() override
Reset deserialization pointer to beginning of buffer.
A string backed by an external buffer.
Errors dispatching messages.
void ENABLE_DISPATCH_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
Base-class handler function for command ENABLE_DISPATCH.
bool isConnected_timeCaller_OutputPort(FwIndexType portNum)
virtual void fileAnnounceRecv_preMsgHook(FwIndexType portNum, Fw::StringBase &file_name)
Pre-message hook for async input port fileAnnounceRecv.
Enabled and disabled states.
FormatStatus format(const CHAR *formatString,...)
write formatted string to buffer
void init()
Initialization function.
void pingOut_out(FwIndexType portNum, U32 key)
Invoke output port pingOut.
uint8_t U8
8-bit unsigned integer
Command failed to deserialize.
PlatformQueuePriorityType FwQueuePriorityType
The type of queue priorities used.
Important informational events.
void invoke(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args) const
Invoke a port interface.
The size of the serial representation.
void set_fileDispatch_OutputPort(FwIndexType portNum, Svc::InputFileDispatchPort *port)
Connect port to fileDispatch[portNum].
A message was sent requesting an exit of the loop.
message to exit active component task
void cmdResponse_out(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdResponse response)
Emit command response.
Svc::InputFileAnnouncePort * get_fileAnnounceRecv_InputPort(FwIndexType portNum)
virtual ~FileDispatcherComponentBase()
Destroy FileDispatcherComponentBase object.
PlatformIndexType FwIndexType
The size of the serial representation.
void addCallPort(InputLogPort *callPort)
Register an input port.
bool isConnected_cmdRegOut_OutputPort(FwIndexType portNum)
void init()
Initialization function.
bool isConnected_cmdResponseOut_OutputPort(FwIndexType portNum)
void addCallPort(InputFileDispatchPort *callPort)
Register an input port.
RateGroupDivider component implementation.
message sent/received okay
SerializeStatus deserializeTo(U8 &val, Endianness mode=Endianness::BIG) override
Deserialize an 8-bit unsigned integer value.
void set_timeCaller_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to timeCaller[portNum].
Message will return with status when space is unavailable.
Implementation of malloc based allocator.
void set_cmdRegOut_OutputPort(FwIndexType portNum, Fw::InputCmdRegPort *port)
Connect port to cmdRegOut[portNum].
static constexpr SizeType BUFFER_SIZE(SizeType maxLength)
Get the size of a null-terminated string buffer.
static constexpr FwIndexType getNum_pingOut_OutputPorts()
void init()
Initialization function.
void log_ACTIVITY_HI_FileDispatched(const Fw::StringBase &file_name, Svc::FileDispatcherCfg::FileDispatchPort file_type) const
Log event FileDispatched.
void invoke(Fw::StringBase &file_name) const
Invoke a port interface.
static constexpr FwIndexType getNum_fileAnnounceRecv_InputPorts()
Svc::InputPingPort * get_pingIn_InputPort(FwIndexType portNum)
void addCallPort(InputCmdResponsePort *callPort)
Register an input port.
SerializeStatus serializeTo(SerialBufferBase &buffer, Endianness mode=Endianness::BIG) const override
Serialize the contents of this object to a buffer.