// ====================================================================== // \title PassiveCommandsComponentAc.cpp // \author Generated by fpp-to-cpp // \brief cpp file for PassiveCommands component base class // ====================================================================== #include #include "Fw/Types/Assert.hpp" #if FW_ENABLE_TEXT_LOGGING #include "Fw/Types/String.hpp" #endif #include "base/PassiveCommandsComponentAc.hpp" // ---------------------------------------------------------------------- // Component initialization // ---------------------------------------------------------------------- void PassiveCommandsComponentBase :: init(FwEnumStoreType instance) { // Initialize base class Fw::PassiveComponentBase::init(instance); // Connect input port cmdIn for ( FwIndexType port = 0; port < static_cast(this->getNum_cmdIn_InputPorts()); port++ ) { this->m_cmdIn_InputPort[port].init(); this->m_cmdIn_InputPort[port].addCallComp( this, m_p_cmdIn_in ); this->m_cmdIn_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 Fw::ObjectName portName; portName.format( "%s_cmdIn_InputPort[%" PRI_PlatformIntType "]", this->m_objName.toChar(), port ); this->m_cmdIn_InputPort[port].setObjName(portName.toChar()); #endif } // Connect input port noArgsGuarded for ( FwIndexType port = 0; port < static_cast(this->getNum_noArgsGuarded_InputPorts()); port++ ) { this->m_noArgsGuarded_InputPort[port].init(); this->m_noArgsGuarded_InputPort[port].addCallComp( this, m_p_noArgsGuarded_in ); this->m_noArgsGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 Fw::ObjectName portName; portName.format( "%s_noArgsGuarded_InputPort[%" PRI_PlatformIntType "]", this->m_objName.toChar(), port ); this->m_noArgsGuarded_InputPort[port].setObjName(portName.toChar()); #endif } // Connect input port noArgsReturnGuarded for ( FwIndexType port = 0; port < static_cast(this->getNum_noArgsReturnGuarded_InputPorts()); port++ ) { this->m_noArgsReturnGuarded_InputPort[port].init(); this->m_noArgsReturnGuarded_InputPort[port].addCallComp( this, m_p_noArgsReturnGuarded_in ); this->m_noArgsReturnGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 Fw::ObjectName portName; portName.format( "%s_noArgsReturnGuarded_InputPort[%" PRI_PlatformIntType "]", this->m_objName.toChar(), port ); this->m_noArgsReturnGuarded_InputPort[port].setObjName(portName.toChar()); #endif } // Connect input port noArgsReturnSync for ( FwIndexType port = 0; port < static_cast(this->getNum_noArgsReturnSync_InputPorts()); port++ ) { this->m_noArgsReturnSync_InputPort[port].init(); this->m_noArgsReturnSync_InputPort[port].addCallComp( this, m_p_noArgsReturnSync_in ); this->m_noArgsReturnSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 Fw::ObjectName portName; portName.format( "%s_noArgsReturnSync_InputPort[%" PRI_PlatformIntType "]", this->m_objName.toChar(), port ); this->m_noArgsReturnSync_InputPort[port].setObjName(portName.toChar()); #endif } // Connect input port noArgsSync for ( FwIndexType port = 0; port < static_cast(this->getNum_noArgsSync_InputPorts()); port++ ) { this->m_noArgsSync_InputPort[port].init(); this->m_noArgsSync_InputPort[port].addCallComp( this, m_p_noArgsSync_in ); this->m_noArgsSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 Fw::ObjectName portName; portName.format( "%s_noArgsSync_InputPort[%" PRI_PlatformIntType "]", this->m_objName.toChar(), port ); this->m_noArgsSync_InputPort[port].setObjName(portName.toChar()); #endif } // Connect input port typedGuarded for ( FwIndexType port = 0; port < static_cast(this->getNum_typedGuarded_InputPorts()); port++ ) { this->m_typedGuarded_InputPort[port].init(); this->m_typedGuarded_InputPort[port].addCallComp( this, m_p_typedGuarded_in ); this->m_typedGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 Fw::ObjectName portName; portName.format( "%s_typedGuarded_InputPort[%" PRI_PlatformIntType "]", this->m_objName.toChar(), port ); this->m_typedGuarded_InputPort[port].setObjName(portName.toChar()); #endif } // Connect input port typedReturnGuarded for ( FwIndexType port = 0; port < static_cast(this->getNum_typedReturnGuarded_InputPorts()); port++ ) { this->m_typedReturnGuarded_InputPort[port].init(); this->m_typedReturnGuarded_InputPort[port].addCallComp( this, m_p_typedReturnGuarded_in ); this->m_typedReturnGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 Fw::ObjectName portName; portName.format( "%s_typedReturnGuarded_InputPort[%" PRI_PlatformIntType "]", this->m_objName.toChar(), port ); this->m_typedReturnGuarded_InputPort[port].setObjName(portName.toChar()); #endif } // Connect input port typedReturnSync for ( FwIndexType port = 0; port < static_cast(this->getNum_typedReturnSync_InputPorts()); port++ ) { this->m_typedReturnSync_InputPort[port].init(); this->m_typedReturnSync_InputPort[port].addCallComp( this, m_p_typedReturnSync_in ); this->m_typedReturnSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 Fw::ObjectName portName; portName.format( "%s_typedReturnSync_InputPort[%" PRI_PlatformIntType "]", this->m_objName.toChar(), port ); this->m_typedReturnSync_InputPort[port].setObjName(portName.toChar()); #endif } // Connect input port typedSync for ( FwIndexType port = 0; port < static_cast(this->getNum_typedSync_InputPorts()); port++ ) { this->m_typedSync_InputPort[port].init(); this->m_typedSync_InputPort[port].addCallComp( this, m_p_typedSync_in ); this->m_typedSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 Fw::ObjectName portName; portName.format( "%s_typedSync_InputPort[%" PRI_PlatformIntType "]", this->m_objName.toChar(), port ); this->m_typedSync_InputPort[port].setObjName(portName.toChar()); #endif } // Connect output port cmdRegOut for ( FwIndexType port = 0; port < static_cast(this->getNum_cmdRegOut_OutputPorts()); port++ ) { this->m_cmdRegOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 Fw::ObjectName portName; portName.format( "%s_cmdRegOut_OutputPort[%" PRI_PlatformIntType "]", this->m_objName.toChar(), port ); this->m_cmdRegOut_OutputPort[port].setObjName(portName.toChar()); #endif } // Connect output port cmdResponseOut for ( FwIndexType port = 0; port < static_cast(this->getNum_cmdResponseOut_OutputPorts()); port++ ) { this->m_cmdResponseOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 Fw::ObjectName portName; portName.format( "%s_cmdResponseOut_OutputPort[%" PRI_PlatformIntType "]", this->m_objName.toChar(), port ); this->m_cmdResponseOut_OutputPort[port].setObjName(portName.toChar()); #endif } // Connect output port eventOut for ( FwIndexType port = 0; port < static_cast(this->getNum_eventOut_OutputPorts()); port++ ) { this->m_eventOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 Fw::ObjectName portName; portName.format( "%s_eventOut_OutputPort[%" PRI_PlatformIntType "]", this->m_objName.toChar(), port ); this->m_eventOut_OutputPort[port].setObjName(portName.toChar()); #endif } // Connect output port prmGetOut for ( FwIndexType port = 0; port < static_cast(this->getNum_prmGetOut_OutputPorts()); port++ ) { this->m_prmGetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 Fw::ObjectName portName; portName.format( "%s_prmGetOut_OutputPort[%" PRI_PlatformIntType "]", this->m_objName.toChar(), port ); this->m_prmGetOut_OutputPort[port].setObjName(portName.toChar()); #endif } // Connect output port prmSetOut for ( FwIndexType port = 0; port < static_cast(this->getNum_prmSetOut_OutputPorts()); port++ ) { this->m_prmSetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 Fw::ObjectName portName; portName.format( "%s_prmSetOut_OutputPort[%" PRI_PlatformIntType "]", this->m_objName.toChar(), port ); this->m_prmSetOut_OutputPort[port].setObjName(portName.toChar()); #endif } #if FW_ENABLE_TEXT_LOGGING == 1 // Connect output port textEventOut for ( FwIndexType port = 0; port < static_cast(this->getNum_textEventOut_OutputPorts()); port++ ) { this->m_textEventOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 Fw::ObjectName portName; portName.format( "%s_textEventOut_OutputPort[%" PRI_PlatformIntType "]", this->m_objName.toChar(), port ); this->m_textEventOut_OutputPort[port].setObjName(portName.toChar()); #endif } #endif // Connect output port timeGetOut for ( FwIndexType port = 0; port < static_cast(this->getNum_timeGetOut_OutputPorts()); port++ ) { this->m_timeGetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 Fw::ObjectName portName; portName.format( "%s_timeGetOut_OutputPort[%" PRI_PlatformIntType "]", this->m_objName.toChar(), port ); this->m_timeGetOut_OutputPort[port].setObjName(portName.toChar()); #endif } // Connect output port tlmOut for ( FwIndexType port = 0; port < static_cast(this->getNum_tlmOut_OutputPorts()); port++ ) { this->m_tlmOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 Fw::ObjectName portName; portName.format( "%s_tlmOut_OutputPort[%" PRI_PlatformIntType "]", this->m_objName.toChar(), port ); this->m_tlmOut_OutputPort[port].setObjName(portName.toChar()); #endif } // Connect output port noArgsOut for ( FwIndexType port = 0; port < static_cast(this->getNum_noArgsOut_OutputPorts()); port++ ) { this->m_noArgsOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 Fw::ObjectName portName; portName.format( "%s_noArgsOut_OutputPort[%" PRI_PlatformIntType "]", this->m_objName.toChar(), port ); this->m_noArgsOut_OutputPort[port].setObjName(portName.toChar()); #endif } // Connect output port noArgsReturnOut for ( FwIndexType port = 0; port < static_cast(this->getNum_noArgsReturnOut_OutputPorts()); port++ ) { this->m_noArgsReturnOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 Fw::ObjectName portName; portName.format( "%s_noArgsReturnOut_OutputPort[%" PRI_PlatformIntType "]", this->m_objName.toChar(), port ); this->m_noArgsReturnOut_OutputPort[port].setObjName(portName.toChar()); #endif } // Connect output port typedOut for ( FwIndexType port = 0; port < static_cast(this->getNum_typedOut_OutputPorts()); port++ ) { this->m_typedOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 Fw::ObjectName portName; portName.format( "%s_typedOut_OutputPort[%" PRI_PlatformIntType "]", this->m_objName.toChar(), port ); this->m_typedOut_OutputPort[port].setObjName(portName.toChar()); #endif } // Connect output port typedReturnOut for ( FwIndexType port = 0; port < static_cast(this->getNum_typedReturnOut_OutputPorts()); port++ ) { this->m_typedReturnOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 Fw::ObjectName portName; portName.format( "%s_typedReturnOut_OutputPort[%" PRI_PlatformIntType "]", this->m_objName.toChar(), port ); this->m_typedReturnOut_OutputPort[port].setObjName(portName.toChar()); #endif } } // ---------------------------------------------------------------------- // Getters for special input ports // ---------------------------------------------------------------------- Fw::InputCmdPort* PassiveCommandsComponentBase :: get_cmdIn_InputPort(FwIndexType portNum) { FW_ASSERT( portNum < this->getNum_cmdIn_InputPorts(), static_cast(portNum) ); return &this->m_cmdIn_InputPort[portNum]; } // ---------------------------------------------------------------------- // Getters for typed input ports // ---------------------------------------------------------------------- Ports::InputNoArgsPort* PassiveCommandsComponentBase :: get_noArgsGuarded_InputPort(FwIndexType portNum) { FW_ASSERT( portNum < this->getNum_noArgsGuarded_InputPorts(), static_cast(portNum) ); return &this->m_noArgsGuarded_InputPort[portNum]; } Ports::InputNoArgsReturnPort* PassiveCommandsComponentBase :: get_noArgsReturnGuarded_InputPort(FwIndexType portNum) { FW_ASSERT( portNum < this->getNum_noArgsReturnGuarded_InputPorts(), static_cast(portNum) ); return &this->m_noArgsReturnGuarded_InputPort[portNum]; } Ports::InputNoArgsReturnPort* PassiveCommandsComponentBase :: get_noArgsReturnSync_InputPort(FwIndexType portNum) { FW_ASSERT( portNum < this->getNum_noArgsReturnSync_InputPorts(), static_cast(portNum) ); return &this->m_noArgsReturnSync_InputPort[portNum]; } Ports::InputNoArgsPort* PassiveCommandsComponentBase :: get_noArgsSync_InputPort(FwIndexType portNum) { FW_ASSERT( portNum < this->getNum_noArgsSync_InputPorts(), static_cast(portNum) ); return &this->m_noArgsSync_InputPort[portNum]; } Ports::InputTypedPort* PassiveCommandsComponentBase :: get_typedGuarded_InputPort(FwIndexType portNum) { FW_ASSERT( portNum < this->getNum_typedGuarded_InputPorts(), static_cast(portNum) ); return &this->m_typedGuarded_InputPort[portNum]; } Ports::InputTypedReturnPort* PassiveCommandsComponentBase :: get_typedReturnGuarded_InputPort(FwIndexType portNum) { FW_ASSERT( portNum < this->getNum_typedReturnGuarded_InputPorts(), static_cast(portNum) ); return &this->m_typedReturnGuarded_InputPort[portNum]; } Ports::InputTypedReturnPort* PassiveCommandsComponentBase :: get_typedReturnSync_InputPort(FwIndexType portNum) { FW_ASSERT( portNum < this->getNum_typedReturnSync_InputPorts(), static_cast(portNum) ); return &this->m_typedReturnSync_InputPort[portNum]; } Ports::InputTypedPort* PassiveCommandsComponentBase :: get_typedSync_InputPort(FwIndexType portNum) { FW_ASSERT( portNum < this->getNum_typedSync_InputPorts(), static_cast(portNum) ); return &this->m_typedSync_InputPort[portNum]; } // ---------------------------------------------------------------------- // Connect input ports to special output ports // ---------------------------------------------------------------------- void PassiveCommandsComponentBase :: set_cmdRegOut_OutputPort( FwIndexType portNum, Fw::InputCmdRegPort* port ) { FW_ASSERT( portNum < this->getNum_cmdRegOut_OutputPorts(), static_cast(portNum) ); this->m_cmdRegOut_OutputPort[portNum].addCallPort(port); } void PassiveCommandsComponentBase :: set_cmdResponseOut_OutputPort( FwIndexType portNum, Fw::InputCmdResponsePort* port ) { FW_ASSERT( portNum < this->getNum_cmdResponseOut_OutputPorts(), static_cast(portNum) ); this->m_cmdResponseOut_OutputPort[portNum].addCallPort(port); } void PassiveCommandsComponentBase :: set_eventOut_OutputPort( FwIndexType portNum, Fw::InputLogPort* port ) { FW_ASSERT( portNum < this->getNum_eventOut_OutputPorts(), static_cast(portNum) ); this->m_eventOut_OutputPort[portNum].addCallPort(port); } void PassiveCommandsComponentBase :: set_prmGetOut_OutputPort( FwIndexType portNum, Fw::InputPrmGetPort* port ) { FW_ASSERT( portNum < this->getNum_prmGetOut_OutputPorts(), static_cast(portNum) ); this->m_prmGetOut_OutputPort[portNum].addCallPort(port); } void PassiveCommandsComponentBase :: set_prmSetOut_OutputPort( FwIndexType portNum, Fw::InputPrmSetPort* port ) { FW_ASSERT( portNum < this->getNum_prmSetOut_OutputPorts(), static_cast(portNum) ); this->m_prmSetOut_OutputPort[portNum].addCallPort(port); } #if FW_ENABLE_TEXT_LOGGING == 1 void PassiveCommandsComponentBase :: set_textEventOut_OutputPort( FwIndexType portNum, Fw::InputLogTextPort* port ) { FW_ASSERT( portNum < this->getNum_textEventOut_OutputPorts(), static_cast(portNum) ); this->m_textEventOut_OutputPort[portNum].addCallPort(port); } #endif void PassiveCommandsComponentBase :: set_timeGetOut_OutputPort( FwIndexType portNum, Fw::InputTimePort* port ) { FW_ASSERT( portNum < this->getNum_timeGetOut_OutputPorts(), static_cast(portNum) ); this->m_timeGetOut_OutputPort[portNum].addCallPort(port); } void PassiveCommandsComponentBase :: set_tlmOut_OutputPort( FwIndexType portNum, Fw::InputTlmPort* port ) { FW_ASSERT( portNum < this->getNum_tlmOut_OutputPorts(), static_cast(portNum) ); this->m_tlmOut_OutputPort[portNum].addCallPort(port); } // ---------------------------------------------------------------------- // Connect typed input ports to typed output ports // ---------------------------------------------------------------------- void PassiveCommandsComponentBase :: set_noArgsOut_OutputPort( FwIndexType portNum, Ports::InputNoArgsPort* port ) { FW_ASSERT( portNum < this->getNum_noArgsOut_OutputPorts(), static_cast(portNum) ); this->m_noArgsOut_OutputPort[portNum].addCallPort(port); } void PassiveCommandsComponentBase :: set_noArgsReturnOut_OutputPort( FwIndexType portNum, Ports::InputNoArgsReturnPort* port ) { FW_ASSERT( portNum < this->getNum_noArgsReturnOut_OutputPorts(), static_cast(portNum) ); this->m_noArgsReturnOut_OutputPort[portNum].addCallPort(port); } void PassiveCommandsComponentBase :: set_typedOut_OutputPort( FwIndexType portNum, Ports::InputTypedPort* port ) { FW_ASSERT( portNum < this->getNum_typedOut_OutputPorts(), static_cast(portNum) ); this->m_typedOut_OutputPort[portNum].addCallPort(port); } void PassiveCommandsComponentBase :: set_typedReturnOut_OutputPort( FwIndexType portNum, Ports::InputTypedReturnPort* port ) { FW_ASSERT( portNum < this->getNum_typedReturnOut_OutputPorts(), static_cast(portNum) ); this->m_typedReturnOut_OutputPort[portNum].addCallPort(port); } #if FW_PORT_SERIALIZATION // ---------------------------------------------------------------------- // Connect serial input ports to special output ports // ---------------------------------------------------------------------- void PassiveCommandsComponentBase :: set_cmdRegOut_OutputPort( FwIndexType portNum, Fw::InputSerializePort* port ) { FW_ASSERT( portNum < this->getNum_cmdRegOut_OutputPorts(), static_cast(portNum) ); this->m_cmdRegOut_OutputPort[portNum].registerSerialPort(port); } void PassiveCommandsComponentBase :: set_cmdResponseOut_OutputPort( FwIndexType portNum, Fw::InputSerializePort* port ) { FW_ASSERT( portNum < this->getNum_cmdResponseOut_OutputPorts(), static_cast(portNum) ); this->m_cmdResponseOut_OutputPort[portNum].registerSerialPort(port); } void PassiveCommandsComponentBase :: set_eventOut_OutputPort( FwIndexType portNum, Fw::InputSerializePort* port ) { FW_ASSERT( portNum < this->getNum_eventOut_OutputPorts(), static_cast(portNum) ); this->m_eventOut_OutputPort[portNum].registerSerialPort(port); } void PassiveCommandsComponentBase :: set_prmSetOut_OutputPort( FwIndexType portNum, Fw::InputSerializePort* port ) { FW_ASSERT( portNum < this->getNum_prmSetOut_OutputPorts(), static_cast(portNum) ); this->m_prmSetOut_OutputPort[portNum].registerSerialPort(port); } #if FW_ENABLE_TEXT_LOGGING == 1 void PassiveCommandsComponentBase :: set_textEventOut_OutputPort( FwIndexType portNum, Fw::InputSerializePort* port ) { FW_ASSERT( portNum < this->getNum_textEventOut_OutputPorts(), static_cast(portNum) ); this->m_textEventOut_OutputPort[portNum].registerSerialPort(port); } #endif void PassiveCommandsComponentBase :: set_timeGetOut_OutputPort( FwIndexType portNum, Fw::InputSerializePort* port ) { FW_ASSERT( portNum < this->getNum_timeGetOut_OutputPorts(), static_cast(portNum) ); this->m_timeGetOut_OutputPort[portNum].registerSerialPort(port); } void PassiveCommandsComponentBase :: set_tlmOut_OutputPort( FwIndexType portNum, Fw::InputSerializePort* port ) { FW_ASSERT( portNum < this->getNum_tlmOut_OutputPorts(), static_cast(portNum) ); this->m_tlmOut_OutputPort[portNum].registerSerialPort(port); } #endif #if FW_PORT_SERIALIZATION // ---------------------------------------------------------------------- // Connect serial input ports to typed output ports // ---------------------------------------------------------------------- void PassiveCommandsComponentBase :: set_noArgsOut_OutputPort( FwIndexType portNum, Fw::InputSerializePort* port ) { FW_ASSERT( portNum < this->getNum_noArgsOut_OutputPorts(), static_cast(portNum) ); this->m_noArgsOut_OutputPort[portNum].registerSerialPort(port); } void PassiveCommandsComponentBase :: set_typedOut_OutputPort( FwIndexType portNum, Fw::InputSerializePort* port ) { FW_ASSERT( portNum < this->getNum_typedOut_OutputPorts(), static_cast(portNum) ); this->m_typedOut_OutputPort[portNum].registerSerialPort(port); } #endif // ---------------------------------------------------------------------- // Command registration // ---------------------------------------------------------------------- void PassiveCommandsComponentBase :: regCommands() { FW_ASSERT(this->m_cmdRegOut_OutputPort[0].isConnected()); this->m_cmdRegOut_OutputPort[0].invoke( this->getIdBase() + OPCODE_CMD_SYNC ); this->m_cmdRegOut_OutputPort[0].invoke( this->getIdBase() + OPCODE_CMD_SYNC_PRIMITIVE ); this->m_cmdRegOut_OutputPort[0].invoke( this->getIdBase() + OPCODE_CMD_SYNC_STRING ); this->m_cmdRegOut_OutputPort[0].invoke( this->getIdBase() + OPCODE_CMD_SYNC_ENUM ); this->m_cmdRegOut_OutputPort[0].invoke( this->getIdBase() + OPCODE_CMD_SYNC_ARRAY ); this->m_cmdRegOut_OutputPort[0].invoke( this->getIdBase() + OPCODE_CMD_SYNC_STRUCT ); this->m_cmdRegOut_OutputPort[0].invoke( this->getIdBase() + OPCODE_CMD_GUARDED ); this->m_cmdRegOut_OutputPort[0].invoke( this->getIdBase() + OPCODE_CMD_GUARDED_PRIMITIVE ); this->m_cmdRegOut_OutputPort[0].invoke( this->getIdBase() + OPCODE_CMD_GUARDED_STRING ); this->m_cmdRegOut_OutputPort[0].invoke( this->getIdBase() + OPCODE_CMD_GUARDED_ENUM ); this->m_cmdRegOut_OutputPort[0].invoke( this->getIdBase() + OPCODE_CMD_GUARDED_ARRAY ); this->m_cmdRegOut_OutputPort[0].invoke( this->getIdBase() + OPCODE_CMD_GUARDED_STRUCT ); } // ---------------------------------------------------------------------- // Component construction and destruction // ---------------------------------------------------------------------- PassiveCommandsComponentBase :: PassiveCommandsComponentBase(const char* compName) : Fw::PassiveComponentBase(compName) { } PassiveCommandsComponentBase :: ~PassiveCommandsComponentBase() { } // ---------------------------------------------------------------------- // Getters for numbers of special input ports // ---------------------------------------------------------------------- FwIndexType PassiveCommandsComponentBase :: getNum_cmdIn_InputPorts() const { return static_cast(FW_NUM_ARRAY_ELEMENTS(this->m_cmdIn_InputPort)); } // ---------------------------------------------------------------------- // Getters for numbers of typed input ports // ---------------------------------------------------------------------- FwIndexType PassiveCommandsComponentBase :: getNum_noArgsGuarded_InputPorts() const { return static_cast(FW_NUM_ARRAY_ELEMENTS(this->m_noArgsGuarded_InputPort)); } FwIndexType PassiveCommandsComponentBase :: getNum_noArgsReturnGuarded_InputPorts() const { return static_cast(FW_NUM_ARRAY_ELEMENTS(this->m_noArgsReturnGuarded_InputPort)); } FwIndexType PassiveCommandsComponentBase :: getNum_noArgsReturnSync_InputPorts() const { return static_cast(FW_NUM_ARRAY_ELEMENTS(this->m_noArgsReturnSync_InputPort)); } FwIndexType PassiveCommandsComponentBase :: getNum_noArgsSync_InputPorts() const { return static_cast(FW_NUM_ARRAY_ELEMENTS(this->m_noArgsSync_InputPort)); } FwIndexType PassiveCommandsComponentBase :: getNum_typedGuarded_InputPorts() const { return static_cast(FW_NUM_ARRAY_ELEMENTS(this->m_typedGuarded_InputPort)); } FwIndexType PassiveCommandsComponentBase :: getNum_typedReturnGuarded_InputPorts() const { return static_cast(FW_NUM_ARRAY_ELEMENTS(this->m_typedReturnGuarded_InputPort)); } FwIndexType PassiveCommandsComponentBase :: getNum_typedReturnSync_InputPorts() const { return static_cast(FW_NUM_ARRAY_ELEMENTS(this->m_typedReturnSync_InputPort)); } FwIndexType PassiveCommandsComponentBase :: getNum_typedSync_InputPorts() const { return static_cast(FW_NUM_ARRAY_ELEMENTS(this->m_typedSync_InputPort)); } // ---------------------------------------------------------------------- // Getters for numbers of special output ports // ---------------------------------------------------------------------- FwIndexType PassiveCommandsComponentBase :: getNum_cmdRegOut_OutputPorts() const { return static_cast(FW_NUM_ARRAY_ELEMENTS(this->m_cmdRegOut_OutputPort)); } FwIndexType PassiveCommandsComponentBase :: getNum_cmdResponseOut_OutputPorts() const { return static_cast(FW_NUM_ARRAY_ELEMENTS(this->m_cmdResponseOut_OutputPort)); } FwIndexType PassiveCommandsComponentBase :: getNum_eventOut_OutputPorts() const { return static_cast(FW_NUM_ARRAY_ELEMENTS(this->m_eventOut_OutputPort)); } FwIndexType PassiveCommandsComponentBase :: getNum_prmGetOut_OutputPorts() const { return static_cast(FW_NUM_ARRAY_ELEMENTS(this->m_prmGetOut_OutputPort)); } FwIndexType PassiveCommandsComponentBase :: getNum_prmSetOut_OutputPorts() const { return static_cast(FW_NUM_ARRAY_ELEMENTS(this->m_prmSetOut_OutputPort)); } #if FW_ENABLE_TEXT_LOGGING == 1 FwIndexType PassiveCommandsComponentBase :: getNum_textEventOut_OutputPorts() const { return static_cast(FW_NUM_ARRAY_ELEMENTS(this->m_textEventOut_OutputPort)); } #endif FwIndexType PassiveCommandsComponentBase :: getNum_timeGetOut_OutputPorts() const { return static_cast(FW_NUM_ARRAY_ELEMENTS(this->m_timeGetOut_OutputPort)); } FwIndexType PassiveCommandsComponentBase :: getNum_tlmOut_OutputPorts() const { return static_cast(FW_NUM_ARRAY_ELEMENTS(this->m_tlmOut_OutputPort)); } // ---------------------------------------------------------------------- // Getters for numbers of typed output ports // ---------------------------------------------------------------------- FwIndexType PassiveCommandsComponentBase :: getNum_noArgsOut_OutputPorts() const { return static_cast(FW_NUM_ARRAY_ELEMENTS(this->m_noArgsOut_OutputPort)); } FwIndexType PassiveCommandsComponentBase :: getNum_noArgsReturnOut_OutputPorts() const { return static_cast(FW_NUM_ARRAY_ELEMENTS(this->m_noArgsReturnOut_OutputPort)); } FwIndexType PassiveCommandsComponentBase :: getNum_typedOut_OutputPorts() const { return static_cast(FW_NUM_ARRAY_ELEMENTS(this->m_typedOut_OutputPort)); } FwIndexType PassiveCommandsComponentBase :: getNum_typedReturnOut_OutputPorts() const { return static_cast(FW_NUM_ARRAY_ELEMENTS(this->m_typedReturnOut_OutputPort)); } // ---------------------------------------------------------------------- // Connection status queries for special output ports // ---------------------------------------------------------------------- bool PassiveCommandsComponentBase :: isConnected_cmdRegOut_OutputPort(FwIndexType portNum) { FW_ASSERT( portNum < this->getNum_cmdRegOut_OutputPorts(), static_cast(portNum) ); return this->m_cmdRegOut_OutputPort[portNum].isConnected(); } bool PassiveCommandsComponentBase :: isConnected_cmdResponseOut_OutputPort(FwIndexType portNum) { FW_ASSERT( portNum < this->getNum_cmdResponseOut_OutputPorts(), static_cast(portNum) ); return this->m_cmdResponseOut_OutputPort[portNum].isConnected(); } bool PassiveCommandsComponentBase :: isConnected_eventOut_OutputPort(FwIndexType portNum) { FW_ASSERT( portNum < this->getNum_eventOut_OutputPorts(), static_cast(portNum) ); return this->m_eventOut_OutputPort[portNum].isConnected(); } bool PassiveCommandsComponentBase :: isConnected_prmGetOut_OutputPort(FwIndexType portNum) { FW_ASSERT( portNum < this->getNum_prmGetOut_OutputPorts(), static_cast(portNum) ); return this->m_prmGetOut_OutputPort[portNum].isConnected(); } bool PassiveCommandsComponentBase :: isConnected_prmSetOut_OutputPort(FwIndexType portNum) { FW_ASSERT( portNum < this->getNum_prmSetOut_OutputPorts(), static_cast(portNum) ); return this->m_prmSetOut_OutputPort[portNum].isConnected(); } #if FW_ENABLE_TEXT_LOGGING == 1 bool PassiveCommandsComponentBase :: isConnected_textEventOut_OutputPort(FwIndexType portNum) { FW_ASSERT( portNum < this->getNum_textEventOut_OutputPorts(), static_cast(portNum) ); return this->m_textEventOut_OutputPort[portNum].isConnected(); } #endif bool PassiveCommandsComponentBase :: isConnected_timeGetOut_OutputPort(FwIndexType portNum) { FW_ASSERT( portNum < this->getNum_timeGetOut_OutputPorts(), static_cast(portNum) ); return this->m_timeGetOut_OutputPort[portNum].isConnected(); } bool PassiveCommandsComponentBase :: isConnected_tlmOut_OutputPort(FwIndexType portNum) { FW_ASSERT( portNum < this->getNum_tlmOut_OutputPorts(), static_cast(portNum) ); return this->m_tlmOut_OutputPort[portNum].isConnected(); } // ---------------------------------------------------------------------- // Connection status queries for typed output ports // ---------------------------------------------------------------------- bool PassiveCommandsComponentBase :: isConnected_noArgsOut_OutputPort(FwIndexType portNum) { FW_ASSERT( portNum < this->getNum_noArgsOut_OutputPorts(), static_cast(portNum) ); return this->m_noArgsOut_OutputPort[portNum].isConnected(); } bool PassiveCommandsComponentBase :: isConnected_noArgsReturnOut_OutputPort(FwIndexType portNum) { FW_ASSERT( portNum < this->getNum_noArgsReturnOut_OutputPorts(), static_cast(portNum) ); return this->m_noArgsReturnOut_OutputPort[portNum].isConnected(); } bool PassiveCommandsComponentBase :: isConnected_typedOut_OutputPort(FwIndexType portNum) { FW_ASSERT( portNum < this->getNum_typedOut_OutputPorts(), static_cast(portNum) ); return this->m_typedOut_OutputPort[portNum].isConnected(); } bool PassiveCommandsComponentBase :: isConnected_typedReturnOut_OutputPort(FwIndexType portNum) { FW_ASSERT( portNum < this->getNum_typedReturnOut_OutputPorts(), static_cast(portNum) ); return this->m_typedReturnOut_OutputPort[portNum].isConnected(); } // ---------------------------------------------------------------------- // Port handler base-class functions for typed input ports // // Call these functions directly to bypass the corresponding ports // ---------------------------------------------------------------------- void PassiveCommandsComponentBase :: noArgsGuarded_handlerBase(FwIndexType portNum) { // Make sure port number is valid FW_ASSERT( portNum < this->getNum_noArgsGuarded_InputPorts(), static_cast(portNum) ); // Lock guard mutex before calling this->lock(); // Call handler function this->noArgsGuarded_handler(portNum); // Unlock guard mutex this->unLock(); } U32 PassiveCommandsComponentBase :: noArgsReturnGuarded_handlerBase(FwIndexType portNum) { // Make sure port number is valid FW_ASSERT( portNum < this->getNum_noArgsReturnGuarded_InputPorts(), static_cast(portNum) ); U32 retVal; // Lock guard mutex before calling this->lock(); // Call handler function retVal = this->noArgsReturnGuarded_handler(portNum); // Unlock guard mutex this->unLock(); return retVal; } U32 PassiveCommandsComponentBase :: noArgsReturnSync_handlerBase(FwIndexType portNum) { // Make sure port number is valid FW_ASSERT( portNum < this->getNum_noArgsReturnSync_InputPorts(), static_cast(portNum) ); U32 retVal; // Call handler function retVal = this->noArgsReturnSync_handler(portNum); return retVal; } void PassiveCommandsComponentBase :: noArgsSync_handlerBase(FwIndexType portNum) { // Make sure port number is valid FW_ASSERT( portNum < this->getNum_noArgsSync_InputPorts(), static_cast(portNum) ); // Call handler function this->noArgsSync_handler(portNum); } void PassiveCommandsComponentBase :: typedGuarded_handlerBase( FwIndexType portNum, U32 u32, F32 f32, bool b, const Ports::TypedPortStrings::StringSize80& str1, const E& e, const A& a, const S& s ) { // Make sure port number is valid FW_ASSERT( portNum < this->getNum_typedGuarded_InputPorts(), static_cast(portNum) ); // Lock guard mutex before calling this->lock(); // Call handler function this->typedGuarded_handler( portNum, u32, f32, b, str1, e, a, s ); // Unlock guard mutex this->unLock(); } F32 PassiveCommandsComponentBase :: typedReturnGuarded_handlerBase( FwIndexType portNum, U32 u32, F32 f32, bool b, const Ports::TypedReturnPortStrings::StringSize80& str2, const E& e, const A& a, const S& s ) { // Make sure port number is valid FW_ASSERT( portNum < this->getNum_typedReturnGuarded_InputPorts(), static_cast(portNum) ); F32 retVal; // Lock guard mutex before calling this->lock(); // Call handler function retVal = this->typedReturnGuarded_handler( portNum, u32, f32, b, str2, e, a, s ); // Unlock guard mutex this->unLock(); return retVal; } F32 PassiveCommandsComponentBase :: typedReturnSync_handlerBase( FwIndexType portNum, U32 u32, F32 f32, bool b, const Ports::TypedReturnPortStrings::StringSize80& str2, const E& e, const A& a, const S& s ) { // Make sure port number is valid FW_ASSERT( portNum < this->getNum_typedReturnSync_InputPorts(), static_cast(portNum) ); F32 retVal; // Call handler function retVal = this->typedReturnSync_handler( portNum, u32, f32, b, str2, e, a, s ); return retVal; } void PassiveCommandsComponentBase :: typedSync_handlerBase( FwIndexType portNum, U32 u32, F32 f32, bool b, const Ports::TypedPortStrings::StringSize80& str1, const E& e, const A& a, const S& s ) { // Make sure port number is valid FW_ASSERT( portNum < this->getNum_typedSync_InputPorts(), static_cast(portNum) ); // Call handler function this->typedSync_handler( portNum, u32, f32, b, str1, e, a, s ); } // ---------------------------------------------------------------------- // Invocation functions for typed output ports // ---------------------------------------------------------------------- void PassiveCommandsComponentBase :: noArgsOut_out(FwIndexType portNum) { FW_ASSERT( portNum < this->getNum_noArgsOut_OutputPorts(), static_cast(portNum) ); this->m_noArgsOut_OutputPort[portNum].invoke(); } U32 PassiveCommandsComponentBase :: noArgsReturnOut_out(FwIndexType portNum) { FW_ASSERT( portNum < this->getNum_noArgsReturnOut_OutputPorts(), static_cast(portNum) ); return this->m_noArgsReturnOut_OutputPort[portNum].invoke(); } void PassiveCommandsComponentBase :: typedOut_out( FwIndexType portNum, U32 u32, F32 f32, bool b, const Ports::TypedPortStrings::StringSize80& str1, const E& e, const A& a, const S& s ) { FW_ASSERT( portNum < this->getNum_typedOut_OutputPorts(), static_cast(portNum) ); this->m_typedOut_OutputPort[portNum].invoke( u32, f32, b, str1, e, a, s ); } F32 PassiveCommandsComponentBase :: typedReturnOut_out( FwIndexType portNum, U32 u32, F32 f32, bool b, const Ports::TypedReturnPortStrings::StringSize80& str2, const E& e, const A& a, const S& s ) { FW_ASSERT( portNum < this->getNum_typedReturnOut_OutputPorts(), static_cast(portNum) ); return this->m_typedReturnOut_OutputPort[portNum].invoke( u32, f32, b, str2, e, a, s ); } // ---------------------------------------------------------------------- // Command response // ---------------------------------------------------------------------- void PassiveCommandsComponentBase :: cmdResponse_out( FwOpcodeType opCode, U32 cmdSeq, Fw::CmdResponse response ) { FW_ASSERT(this->m_cmdResponseOut_OutputPort[0].isConnected()); this->m_cmdResponseOut_OutputPort[0].invoke(opCode, cmdSeq, response); } // ---------------------------------------------------------------------- // Command handler base-class functions // // Call these functions directly to bypass the command input port // ---------------------------------------------------------------------- void PassiveCommandsComponentBase :: CMD_SYNC_cmdHandlerBase( FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer& args ) { #if FW_CMD_CHECK_RESIDUAL // Make sure there was no data left over. // That means the argument buffer size was incorrect. if (args.getBuffLeft() != 0) { if (this->m_cmdResponseOut_OutputPort[0].isConnected()) { this->m_cmdResponseOut_OutputPort[0].invoke( opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR ); } return; } #endif this->CMD_SYNC_cmdHandler(opCode, cmdSeq); } void PassiveCommandsComponentBase :: CMD_SYNC_PRIMITIVE_cmdHandlerBase( FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer& args ) { // Deserialize the arguments Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK; // Reset the buffer args.resetDeser(); U32 u32; _status = args.deserialize(u32); if (_status != Fw::FW_SERIALIZE_OK) { if (this->m_cmdResponseOut_OutputPort[0].isConnected()) { this->m_cmdResponseOut_OutputPort[0].invoke( opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR ); } return; } F32 f32; _status = args.deserialize(f32); if (_status != Fw::FW_SERIALIZE_OK) { if (this->m_cmdResponseOut_OutputPort[0].isConnected()) { this->m_cmdResponseOut_OutputPort[0].invoke( opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR ); } return; } bool b; _status = args.deserialize(b); if (_status != Fw::FW_SERIALIZE_OK) { if (this->m_cmdResponseOut_OutputPort[0].isConnected()) { this->m_cmdResponseOut_OutputPort[0].invoke( opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR ); } return; } #if FW_CMD_CHECK_RESIDUAL // Make sure there was no data left over. // That means the argument buffer size was incorrect. if (args.getBuffLeft() != 0) { if (this->m_cmdResponseOut_OutputPort[0].isConnected()) { this->m_cmdResponseOut_OutputPort[0].invoke( opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR ); } return; } #endif this->CMD_SYNC_PRIMITIVE_cmdHandler( opCode, cmdSeq, u32, f32, b ); } void PassiveCommandsComponentBase :: CMD_SYNC_STRING_cmdHandlerBase( FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer& args ) { // Deserialize the arguments Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK; // Reset the buffer args.resetDeser(); Fw::CmdStringArg str1; _status = args.deserialize(str1); if (_status != Fw::FW_SERIALIZE_OK) { if (this->m_cmdResponseOut_OutputPort[0].isConnected()) { this->m_cmdResponseOut_OutputPort[0].invoke( opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR ); } return; } Fw::CmdStringArg str2; _status = args.deserialize(str2); if (_status != Fw::FW_SERIALIZE_OK) { if (this->m_cmdResponseOut_OutputPort[0].isConnected()) { this->m_cmdResponseOut_OutputPort[0].invoke( opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR ); } return; } #if FW_CMD_CHECK_RESIDUAL // Make sure there was no data left over. // That means the argument buffer size was incorrect. if (args.getBuffLeft() != 0) { if (this->m_cmdResponseOut_OutputPort[0].isConnected()) { this->m_cmdResponseOut_OutputPort[0].invoke( opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR ); } return; } #endif this->CMD_SYNC_STRING_cmdHandler( opCode, cmdSeq, str1, str2 ); } void PassiveCommandsComponentBase :: CMD_SYNC_ENUM_cmdHandlerBase( FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer& args ) { // Deserialize the arguments Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK; // Reset the buffer args.resetDeser(); E e; _status = args.deserialize(e); if (_status != Fw::FW_SERIALIZE_OK) { if (this->m_cmdResponseOut_OutputPort[0].isConnected()) { this->m_cmdResponseOut_OutputPort[0].invoke( opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR ); } return; } #if FW_CMD_CHECK_RESIDUAL // Make sure there was no data left over. // That means the argument buffer size was incorrect. if (args.getBuffLeft() != 0) { if (this->m_cmdResponseOut_OutputPort[0].isConnected()) { this->m_cmdResponseOut_OutputPort[0].invoke( opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR ); } return; } #endif this->CMD_SYNC_ENUM_cmdHandler( opCode, cmdSeq, e ); } void PassiveCommandsComponentBase :: CMD_SYNC_ARRAY_cmdHandlerBase( FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer& args ) { // Deserialize the arguments Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK; // Reset the buffer args.resetDeser(); A a; _status = args.deserialize(a); if (_status != Fw::FW_SERIALIZE_OK) { if (this->m_cmdResponseOut_OutputPort[0].isConnected()) { this->m_cmdResponseOut_OutputPort[0].invoke( opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR ); } return; } #if FW_CMD_CHECK_RESIDUAL // Make sure there was no data left over. // That means the argument buffer size was incorrect. if (args.getBuffLeft() != 0) { if (this->m_cmdResponseOut_OutputPort[0].isConnected()) { this->m_cmdResponseOut_OutputPort[0].invoke( opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR ); } return; } #endif this->CMD_SYNC_ARRAY_cmdHandler( opCode, cmdSeq, a ); } void PassiveCommandsComponentBase :: CMD_SYNC_STRUCT_cmdHandlerBase( FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer& args ) { // Deserialize the arguments Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK; // Reset the buffer args.resetDeser(); S s; _status = args.deserialize(s); if (_status != Fw::FW_SERIALIZE_OK) { if (this->m_cmdResponseOut_OutputPort[0].isConnected()) { this->m_cmdResponseOut_OutputPort[0].invoke( opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR ); } return; } #if FW_CMD_CHECK_RESIDUAL // Make sure there was no data left over. // That means the argument buffer size was incorrect. if (args.getBuffLeft() != 0) { if (this->m_cmdResponseOut_OutputPort[0].isConnected()) { this->m_cmdResponseOut_OutputPort[0].invoke( opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR ); } return; } #endif this->CMD_SYNC_STRUCT_cmdHandler( opCode, cmdSeq, s ); } void PassiveCommandsComponentBase :: CMD_GUARDED_cmdHandlerBase( FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer& args ) { #if FW_CMD_CHECK_RESIDUAL // Make sure there was no data left over. // That means the argument buffer size was incorrect. if (args.getBuffLeft() != 0) { if (this->m_cmdResponseOut_OutputPort[0].isConnected()) { this->m_cmdResponseOut_OutputPort[0].invoke( opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR ); } return; } #endif this->lock(); this->CMD_GUARDED_cmdHandler(opCode, cmdSeq); this->unLock(); } void PassiveCommandsComponentBase :: CMD_GUARDED_PRIMITIVE_cmdHandlerBase( FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer& args ) { // Deserialize the arguments Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK; // Reset the buffer args.resetDeser(); U32 u32; _status = args.deserialize(u32); if (_status != Fw::FW_SERIALIZE_OK) { if (this->m_cmdResponseOut_OutputPort[0].isConnected()) { this->m_cmdResponseOut_OutputPort[0].invoke( opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR ); } return; } F32 f32; _status = args.deserialize(f32); if (_status != Fw::FW_SERIALIZE_OK) { if (this->m_cmdResponseOut_OutputPort[0].isConnected()) { this->m_cmdResponseOut_OutputPort[0].invoke( opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR ); } return; } bool b; _status = args.deserialize(b); if (_status != Fw::FW_SERIALIZE_OK) { if (this->m_cmdResponseOut_OutputPort[0].isConnected()) { this->m_cmdResponseOut_OutputPort[0].invoke( opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR ); } return; } #if FW_CMD_CHECK_RESIDUAL // Make sure there was no data left over. // That means the argument buffer size was incorrect. if (args.getBuffLeft() != 0) { if (this->m_cmdResponseOut_OutputPort[0].isConnected()) { this->m_cmdResponseOut_OutputPort[0].invoke( opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR ); } return; } #endif this->lock(); this->CMD_GUARDED_PRIMITIVE_cmdHandler( opCode, cmdSeq, u32, f32, b ); this->unLock(); } void PassiveCommandsComponentBase :: CMD_GUARDED_STRING_cmdHandlerBase( FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer& args ) { // Deserialize the arguments Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK; // Reset the buffer args.resetDeser(); Fw::CmdStringArg str1; _status = args.deserialize(str1); if (_status != Fw::FW_SERIALIZE_OK) { if (this->m_cmdResponseOut_OutputPort[0].isConnected()) { this->m_cmdResponseOut_OutputPort[0].invoke( opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR ); } return; } Fw::CmdStringArg str2; _status = args.deserialize(str2); if (_status != Fw::FW_SERIALIZE_OK) { if (this->m_cmdResponseOut_OutputPort[0].isConnected()) { this->m_cmdResponseOut_OutputPort[0].invoke( opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR ); } return; } #if FW_CMD_CHECK_RESIDUAL // Make sure there was no data left over. // That means the argument buffer size was incorrect. if (args.getBuffLeft() != 0) { if (this->m_cmdResponseOut_OutputPort[0].isConnected()) { this->m_cmdResponseOut_OutputPort[0].invoke( opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR ); } return; } #endif this->lock(); this->CMD_GUARDED_STRING_cmdHandler( opCode, cmdSeq, str1, str2 ); this->unLock(); } void PassiveCommandsComponentBase :: CMD_GUARDED_ENUM_cmdHandlerBase( FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer& args ) { // Deserialize the arguments Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK; // Reset the buffer args.resetDeser(); E e; _status = args.deserialize(e); if (_status != Fw::FW_SERIALIZE_OK) { if (this->m_cmdResponseOut_OutputPort[0].isConnected()) { this->m_cmdResponseOut_OutputPort[0].invoke( opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR ); } return; } #if FW_CMD_CHECK_RESIDUAL // Make sure there was no data left over. // That means the argument buffer size was incorrect. if (args.getBuffLeft() != 0) { if (this->m_cmdResponseOut_OutputPort[0].isConnected()) { this->m_cmdResponseOut_OutputPort[0].invoke( opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR ); } return; } #endif this->lock(); this->CMD_GUARDED_ENUM_cmdHandler( opCode, cmdSeq, e ); this->unLock(); } void PassiveCommandsComponentBase :: CMD_GUARDED_ARRAY_cmdHandlerBase( FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer& args ) { // Deserialize the arguments Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK; // Reset the buffer args.resetDeser(); A a; _status = args.deserialize(a); if (_status != Fw::FW_SERIALIZE_OK) { if (this->m_cmdResponseOut_OutputPort[0].isConnected()) { this->m_cmdResponseOut_OutputPort[0].invoke( opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR ); } return; } #if FW_CMD_CHECK_RESIDUAL // Make sure there was no data left over. // That means the argument buffer size was incorrect. if (args.getBuffLeft() != 0) { if (this->m_cmdResponseOut_OutputPort[0].isConnected()) { this->m_cmdResponseOut_OutputPort[0].invoke( opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR ); } return; } #endif this->lock(); this->CMD_GUARDED_ARRAY_cmdHandler( opCode, cmdSeq, a ); this->unLock(); } void PassiveCommandsComponentBase :: CMD_GUARDED_STRUCT_cmdHandlerBase( FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer& args ) { // Deserialize the arguments Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK; // Reset the buffer args.resetDeser(); S s; _status = args.deserialize(s); if (_status != Fw::FW_SERIALIZE_OK) { if (this->m_cmdResponseOut_OutputPort[0].isConnected()) { this->m_cmdResponseOut_OutputPort[0].invoke( opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR ); } return; } #if FW_CMD_CHECK_RESIDUAL // Make sure there was no data left over. // That means the argument buffer size was incorrect. if (args.getBuffLeft() != 0) { if (this->m_cmdResponseOut_OutputPort[0].isConnected()) { this->m_cmdResponseOut_OutputPort[0].invoke( opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR ); } return; } #endif this->lock(); this->CMD_GUARDED_STRUCT_cmdHandler( opCode, cmdSeq, s ); this->unLock(); } // ---------------------------------------------------------------------- // Time // ---------------------------------------------------------------------- Fw::Time PassiveCommandsComponentBase :: getTime() { if (this->m_timeGetOut_OutputPort[0].isConnected()) { Fw::Time _time; this->m_timeGetOut_OutputPort[0].invoke(_time); return _time; } else { return Fw::Time(TB_NONE, 0, 0); } } // ---------------------------------------------------------------------- // Mutex operations for guarded ports // // You can override these operations to provide more sophisticated // synchronization // ---------------------------------------------------------------------- void PassiveCommandsComponentBase :: lock() { this->m_guardedPortMutex.lock(); } void PassiveCommandsComponentBase :: unLock() { this->m_guardedPortMutex.unLock(); } // ---------------------------------------------------------------------- // Calls for messages received on special input ports // ---------------------------------------------------------------------- void PassiveCommandsComponentBase :: m_p_cmdIn_in( Fw::PassiveComponentBase* callComp, FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer& args ) { FW_ASSERT(callComp); PassiveCommandsComponentBase* compPtr = static_cast(callComp); const U32 idBase = callComp->getIdBase(); FW_ASSERT(opCode >= idBase, static_cast(opCode), static_cast(idBase)); // Select base class function based on opcode switch (opCode - idBase) { case OPCODE_CMD_SYNC: { compPtr->CMD_SYNC_cmdHandlerBase( opCode, cmdSeq, args ); break; } case OPCODE_CMD_SYNC_PRIMITIVE: { compPtr->CMD_SYNC_PRIMITIVE_cmdHandlerBase( opCode, cmdSeq, args ); break; } case OPCODE_CMD_SYNC_STRING: { compPtr->CMD_SYNC_STRING_cmdHandlerBase( opCode, cmdSeq, args ); break; } case OPCODE_CMD_SYNC_ENUM: { compPtr->CMD_SYNC_ENUM_cmdHandlerBase( opCode, cmdSeq, args ); break; } case OPCODE_CMD_SYNC_ARRAY: { compPtr->CMD_SYNC_ARRAY_cmdHandlerBase( opCode, cmdSeq, args ); break; } case OPCODE_CMD_SYNC_STRUCT: { compPtr->CMD_SYNC_STRUCT_cmdHandlerBase( opCode, cmdSeq, args ); break; } case OPCODE_CMD_GUARDED: { compPtr->CMD_GUARDED_cmdHandlerBase( opCode, cmdSeq, args ); break; } case OPCODE_CMD_GUARDED_PRIMITIVE: { compPtr->CMD_GUARDED_PRIMITIVE_cmdHandlerBase( opCode, cmdSeq, args ); break; } case OPCODE_CMD_GUARDED_STRING: { compPtr->CMD_GUARDED_STRING_cmdHandlerBase( opCode, cmdSeq, args ); break; } case OPCODE_CMD_GUARDED_ENUM: { compPtr->CMD_GUARDED_ENUM_cmdHandlerBase( opCode, cmdSeq, args ); break; } case OPCODE_CMD_GUARDED_ARRAY: { compPtr->CMD_GUARDED_ARRAY_cmdHandlerBase( opCode, cmdSeq, args ); break; } case OPCODE_CMD_GUARDED_STRUCT: { compPtr->CMD_GUARDED_STRUCT_cmdHandlerBase( opCode, cmdSeq, args ); break; } } } // ---------------------------------------------------------------------- // Calls for messages received on typed input ports // ---------------------------------------------------------------------- void PassiveCommandsComponentBase :: m_p_noArgsGuarded_in( Fw::PassiveComponentBase* callComp, FwIndexType portNum ) { FW_ASSERT(callComp); PassiveCommandsComponentBase* compPtr = static_cast(callComp); compPtr->noArgsGuarded_handlerBase(portNum); } U32 PassiveCommandsComponentBase :: m_p_noArgsReturnGuarded_in( Fw::PassiveComponentBase* callComp, FwIndexType portNum ) { FW_ASSERT(callComp); PassiveCommandsComponentBase* compPtr = static_cast(callComp); return compPtr->noArgsReturnGuarded_handlerBase(portNum); } U32 PassiveCommandsComponentBase :: m_p_noArgsReturnSync_in( Fw::PassiveComponentBase* callComp, FwIndexType portNum ) { FW_ASSERT(callComp); PassiveCommandsComponentBase* compPtr = static_cast(callComp); return compPtr->noArgsReturnSync_handlerBase(portNum); } void PassiveCommandsComponentBase :: m_p_noArgsSync_in( Fw::PassiveComponentBase* callComp, FwIndexType portNum ) { FW_ASSERT(callComp); PassiveCommandsComponentBase* compPtr = static_cast(callComp); compPtr->noArgsSync_handlerBase(portNum); } void PassiveCommandsComponentBase :: m_p_typedGuarded_in( Fw::PassiveComponentBase* callComp, FwIndexType portNum, U32 u32, F32 f32, bool b, const Ports::TypedPortStrings::StringSize80& str1, const E& e, const A& a, const S& s ) { FW_ASSERT(callComp); PassiveCommandsComponentBase* compPtr = static_cast(callComp); compPtr->typedGuarded_handlerBase( portNum, u32, f32, b, str1, e, a, s ); } F32 PassiveCommandsComponentBase :: m_p_typedReturnGuarded_in( Fw::PassiveComponentBase* callComp, FwIndexType portNum, U32 u32, F32 f32, bool b, const Ports::TypedReturnPortStrings::StringSize80& str2, const E& e, const A& a, const S& s ) { FW_ASSERT(callComp); PassiveCommandsComponentBase* compPtr = static_cast(callComp); return compPtr->typedReturnGuarded_handlerBase( portNum, u32, f32, b, str2, e, a, s ); } F32 PassiveCommandsComponentBase :: m_p_typedReturnSync_in( Fw::PassiveComponentBase* callComp, FwIndexType portNum, U32 u32, F32 f32, bool b, const Ports::TypedReturnPortStrings::StringSize80& str2, const E& e, const A& a, const S& s ) { FW_ASSERT(callComp); PassiveCommandsComponentBase* compPtr = static_cast(callComp); return compPtr->typedReturnSync_handlerBase( portNum, u32, f32, b, str2, e, a, s ); } void PassiveCommandsComponentBase :: m_p_typedSync_in( Fw::PassiveComponentBase* callComp, FwIndexType portNum, U32 u32, F32 f32, bool b, const Ports::TypedPortStrings::StringSize80& str1, const E& e, const A& a, const S& s ) { FW_ASSERT(callComp); PassiveCommandsComponentBase* compPtr = static_cast(callComp); compPtr->typedSync_handlerBase( portNum, u32, f32, b, str1, e, a, s ); }