IMU CompAc Diff

Created Diff never expires
568 removals
882 lines
485 additions
946 lines
// ======================================================================
// ======================================================================
// \title IMU_MPU9250ComponentAc.cpp
// \title IMU_MPU9250ComponentAc.cpp
// \author Auto-generated
// \author Generated by fpp-to-cpp
// \brief cpp file for IMU_MPU9250 component base class
// \brief cpp file for IMU_MPU9250 component base class
//
// NOTE: this file was automatically generated
//
// ======================================================================
// ======================================================================


#include <cstdio>
#include <cstdio>
#include <FpConfig.hpp>

#include <Components/Sensors/IMU_MPU9250/IMU_MPU9250ComponentAc.hpp>
#include "Components/Sensors/IMU_MPU9250/IMU_MPU9250ComponentAc.hpp"
#include <Fw/Types/Assert.hpp>
#include "Fw/Types/Assert.hpp"
#if FW_ENABLE_TEXT_LOGGING
#if FW_ENABLE_TEXT_LOGGING
#include <Fw/Types/String.hpp>
#include "Fw/Types/String.hpp"
#endif
#endif



namespace Sensors {
namespace Sensors {


// ----------------------------------------------------------------------
namespace {
// Getters for numbers of input ports
// Get the max size by doing a union of the input and internal port serialization sizes
// ----------------------------------------------------------------------
union BuffUnion {

BYTE runPortSize[Svc::InputSchedPort::SERIALIZED_SIZE];
Fw::InputCmdPort *IMU_MPU9250ComponentBase ::
BYTE cmdPortSize[Fw::InputCmdPort::SERIALIZED_SIZE];
get_cmdIn_InputPort(NATIVE_INT_TYPE portNum)
};
{
FW_ASSERT(portNum < this->getNum_cmdIn_InputPorts(),static_cast<FwAssertArgType>(portNum));
return &this->m_cmdIn_InputPort[portNum];
}

Svc::InputSchedPort *IMU_MPU9250ComponentBase ::
get_run_InputPort(NATIVE_INT_TYPE portNum)
{
FW_ASSERT(portNum < this->getNum_run_InputPorts(),static_cast<FwAssertArgType>(portNum));
return &this->m_run_InputPort[portNum];
}
Text moved to lines 517-527

// ----------------------------------------------------------------------
// Typed connectors for output ports
// ----------------------------------------------------------------------

void IMU_MPU9250ComponentBase ::
set_cmdRegOut_OutputPort(
NATIVE_INT_TYPE portNum,
Fw::InputCmdRegPort* port
)
{
FW_ASSERT(portNum < this->getNum_cmdRegOut_OutputPorts(),static_cast<FwAssertArgType>(portNum));
Text moved with changes to lines 533-541 (97.1% similarity)
this->m_cmdRegOut_OutputPort[portNum].addCallPort(port);
}

void IMU_MPU9250ComponentBase ::
set_cmdResponseOut_OutputPort(
NATIVE_INT_TYPE portNum,
Fw::InputCmdResponsePort* port
)
{
FW_ASSERT(portNum < this->getNum_cmdResponseOut_OutputPorts(),static_cast<FwAssertArgType>(portNum));
Text moved to lines 393-401
this->m_cmdResponseOut_OutputPort[portNum].addCallPort(port);
}

void IMU_MPU9250ComponentBase ::
set_logOut_OutputPort(
NATIVE_INT_TYPE portNum,
Fw::InputLogPort* port
)
{
FW_ASSERT(portNum < this->getNum_logOut_OutputPorts(),static_cast<FwAssertArgType>(portNum));
Text moved to lines 407-410
this->m_logOut_OutputPort[portNum].addCallPort(port);
}

#if FW_ENABLE_TEXT_LOGGING == 1
Text moved to lines 412-417
void IMU_MPU9250ComponentBase ::
set_logTextOut_OutputPort(
NATIVE_INT_TYPE portNum,
Fw::InputLogTextPort* port
)
{
FW_ASSERT(portNum < this->getNum_logTextOut_OutputPorts(),static_cast<FwAssertArgType>(portNum));
this->m_logTextOut_OutputPort[portNum].addCallPort(port);
}
Text moved to lines 426-433
#endif

void IMU_MPU9250ComponentBase ::
set_prmGetOut_OutputPort(
NATIVE_INT_TYPE portNum,
Fw::InputPrmGetPort* port
)
{
FW_ASSERT(portNum < this->getNum_prmGetOut_OutputPorts(),static_cast<FwAssertArgType>(portNum));
Text moved to lines 439-447
this->m_prmGetOut_OutputPort[portNum].addCallPort(port);
}

void IMU_MPU9250ComponentBase ::
set_prmSetOut_OutputPort(
NATIVE_INT_TYPE portNum,
Fw::InputPrmSetPort* port
)
{
FW_ASSERT(portNum < this->getNum_prmSetOut_OutputPorts(),static_cast<FwAssertArgType>(portNum));
this->m_prmSetOut_OutputPort[portNum].addCallPort(port);
}
Text moved to lines 487-493

void IMU_MPU9250ComponentBase ::
set_read_OutputPort(
NATIVE_INT_TYPE portNum,
Drv::InputI2cPort* port
)
{
FW_ASSERT(portNum < this->getNum_read_OutputPorts(),static_cast<FwAssertArgType>(portNum));
Text moved with changes to lines 453-461 (99.1% similarity)
this->m_read_OutputPort[portNum].addCallPort(port);
}

void IMU_MPU9250ComponentBase ::
set_timeCaller_OutputPort(
NATIVE_INT_TYPE portNum,
Fw::InputTimePort* port
)
{
FW_ASSERT(portNum < this->getNum_timeCaller_OutputPorts(),static_cast<FwAssertArgType>(portNum));
Text moved to lines 467-475
this->m_timeCaller_OutputPort[portNum].addCallPort(port);
}

void IMU_MPU9250ComponentBase ::
set_tlmOut_OutputPort(
NATIVE_INT_TYPE portNum,
Fw::InputTlmPort* port
)
{
FW_ASSERT(portNum < this->getNum_tlmOut_OutputPorts(),static_cast<FwAssertArgType>(portNum));
Text moved with changes to lines 499-507 (99.0% similarity)
this->m_tlmOut_OutputPort[portNum].addCallPort(port);
}

void IMU_MPU9250ComponentBase ::
set_write_OutputPort(
NATIVE_INT_TYPE portNum,
Drv::InputI2cPort* port
)
{
FW_ASSERT(portNum < this->getNum_write_OutputPorts(),static_cast<FwAssertArgType>(portNum));
Text moved with changes to lines 513-516 (93.5% similarity)
this->m_write_OutputPort[portNum].addCallPort(port);
}

// ----------------------------------------------------------------------
// Serialization connectors for output ports
// ----------------------------------------------------------------------

#if FW_PORT_SERIALIZATION

void IMU_MPU9250ComponentBase ::
set_cmdRegOut_OutputPort(
NATIVE_INT_TYPE portNum,
Fw::InputSerializePort *port
)
{
FW_ASSERT(portNum < this->getNum_cmdRegOut_OutputPorts(),static_cast<FwAssertArgType>(portNum));
Text moved with changes to lines 547-555 (97.4% similarity)
return this->m_cmdRegOut_OutputPort[portNum].registerSerialPort(port);
}

void IMU_MPU9250ComponentBase ::
set_cmdResponseOut_OutputPort(
NATIVE_INT_TYPE portNum,
Fw::InputSerializePort *port
)
{
FW_ASSERT(portNum < this->getNum_cmdResponseOut_OutputPorts(),static_cast<FwAssertArgType>(portNum));
return this->m_cmdResponseOut_OutputPort[portNum].registerSerialPort(port);
}


void IMU_MPU9250ComponentBase ::
// Define a message buffer class large enough to handle all the
set_logOut_OutputPort(
// asynchronous inputs to the component
NATIVE_INT_TYPE portNum,
class ComponentIpcSerializableBuffer :
Fw::InputSerializePort *port
public Fw::SerializeBufferBase
)
{
{
FW_ASSERT(portNum < this->getNum_logOut_OutputPorts(),static_cast<FwAssertArgType>(portNum));
return this->m_logOut_OutputPort[portNum].registerSerialPort(port);
}


#if FW_ENABLE_TEXT_LOGGING == 1
public:
Text moved to lines 566-571
void IMU_MPU9250ComponentBase ::
set_logTextOut_OutputPort(
NATIVE_INT_TYPE portNum,
Fw::InputSerializePort *port
)
{
FW_ASSERT(portNum < this->getNum_logTextOut_OutputPorts(),static_cast<FwAssertArgType>(portNum));
return this->m_logTextOut_OutputPort[portNum].registerSerialPort(port);
}
#endif


void IMU_MPU9250ComponentBase ::
enum {
set_prmGetOut_OutputPort(
// Max. message size = size of data + message id + port
NATIVE_INT_TYPE portNum,
SERIALIZATION_SIZE =
Fw::InputSerializePort *port
sizeof(BuffUnion) +
)
sizeof(NATIVE_INT_TYPE) +
{
sizeof(NATIVE_INT_TYPE)
FW_ASSERT(portNum < this->getNum_prmGetOut_OutputPorts(),static_cast<FwAssertArgType>(portNum));
};
return this->m_prmGetOut_OutputPort[portNum].registerSerialPort(port);
}


Text moved to lines 582-587
void IMU_MPU9250ComponentBase ::
NATIVE_UINT_TYPE getBuffCapacity() const {
set_prmSetOut_OutputPort(
return sizeof(m_buff);
NATIVE_INT_TYPE portNum,
}
Fw::InputSerializePort *port
)
{
FW_ASSERT(portNum < this->getNum_prmSetOut_OutputPorts(),static_cast<FwAssertArgType>(portNum));
return this->m_prmSetOut_OutputPort[portNum].registerSerialPort(port);
}


void IMU_MPU9250ComponentBase ::
U8* getBuffAddr() {
set_read_OutputPort(
return m_buff;
NATIVE_INT_TYPE portNum,
}
Fw::InputSerializePort *port
)
{
FW_ASSERT(portNum < this->getNum_read_OutputPorts(),static_cast<FwAssertArgType>(portNum));
return this->m_read_OutputPort[portNum].registerSerialPort(port);
}


Text moved to lines 596-601
void IMU_MPU9250ComponentBase ::
const U8* getBuffAddr() const {
set_timeCaller_OutputPort(
return m_buff;
NATIVE_INT_TYPE portNum,
}
Fw::InputSerializePort *port
)
{
FW_ASSERT(portNum < this->getNum_timeCaller_OutputPorts(),static_cast<FwAssertArgType>(portNum));
return this->m_timeCaller_OutputPort[portNum].registerSerialPort(port);
}


Text moved to lines 610-615
void IMU_MPU9250ComponentBase ::
private:
set_tlmOut_OutputPort(
// Should be the max of all the input ports serialized sizes...
NATIVE_INT_TYPE portNum,
U8 m_buff[SERIALIZATION_SIZE];
Fw::InputSerializePort *port
)
{
FW_ASSERT(portNum < this->getNum_tlmOut_OutputPorts(),static_cast<FwAssertArgType>(portNum));
return this->m_tlmOut_OutputPort[portNum].registerSerialPort(port);
}


void IMU_MPU9250ComponentBase ::
};
set_write_OutputPort(
NATIVE_INT_TYPE portNum,
Fw::InputSerializePort *port
)
{
FW_ASSERT(portNum < this->getNum_write_OutputPorts(),static_cast<FwAssertArgType>(portNum));
return this->m_write_OutputPort[portNum].registerSerialPort(port);
}
}

#endif


// ----------------------------------------------------------------------
// ----------------------------------------------------------------------
// Command registration
// Component initialization
// ----------------------------------------------------------------------
// ----------------------------------------------------------------------


void IMU_MPU9250ComponentBase ::
void IMU_MPU9250ComponentBase ::
Text moved to lines 631-633
regCommands()
{
FW_ASSERT(this->m_cmdRegOut_OutputPort[0].isConnected());
Text moved to lines 635-643
this->m_cmdRegOut_OutputPort[0].invoke(
this->getIdBase() + OPCODE_POWERSWITCH
);
}

// ----------------------------------------------------------------------
// Component construction, initialization, and destruction
// ----------------------------------------------------------------------

IMU_MPU9250ComponentBase :: IMU_MPU9250ComponentBase(const char* compName) :
Fw::PassiveComponentBase(compName) {


Text moved with changes to lines 648-651 (98.0% similarity)

}

void IMU_MPU9250ComponentBase ::
init(NATIVE_INT_TYPE instance)
init(NATIVE_INT_TYPE instance)
{
{

// Initialize base class
// Initialize base class
Fw::PassiveComponentBase::init(instance);
Fw::PassiveComponentBase::init(instance);


// Connect input port cmdIn
// Connect input port cmdIn
for (
for (
PlatformIntType port = 0;
PlatformIntType port = 0;
port < static_cast<PlatformIntType>(this->getNum_cmdIn_InputPorts());
port < static_cast<PlatformIntType>(this->getNum_cmdIn_InputPorts());
port++
port++
) {
) {

this->m_cmdIn_InputPort[port].init();
this->m_cmdIn_InputPort[port].init();
this->m_cmdIn_InputPort[port].addCallComp(
this->m_cmdIn_InputPort[port].addCallComp(
this,
this,
m_p_cmdIn_in
m_p_cmdIn_in
);
);
this->m_cmdIn_InputPort[port].setPortNum(port);
this->m_cmdIn_InputPort[port].setPortNum(port);


#if FW_OBJECT_NAMES == 1
#if FW_OBJECT_NAMES == 1
char portName[120];
char portName[120];
(void) snprintf(
(void) snprintf(
portName,
portName,
sizeof(portName),
sizeof(portName),
"%s_cmdIn_InputPort[%" PRI_PlatformIntType "]",
"%s_cmdIn_InputPort[%" PRI_PlatformIntType "]",
this->m_objName,
this->m_objName,
port
port
);
);
this->m_cmdIn_InputPort[port].setObjName(portName);
this->m_cmdIn_InputPort[port].setObjName(portName);
#endif
#endif

}
}


// Connect input port run
// Connect input port run
for (
for (
PlatformIntType port = 0;
PlatformIntType port = 0;
port < static_cast<PlatformIntType>(this->getNum_run_InputPorts());
port < static_cast<PlatformIntType>(this->getNum_run_InputPorts());
port++
port++
) {
) {

this->m_run_InputPort[port].init();
this->m_run_InputPort[port].init();
this->m_run_InputPort[port].addCallComp(
this->m_run_InputPort[port].addCallComp(
this,
this,
m_p_run_in
m_p_run_in
);
);
this->m_run_InputPort[port].setPortNum(port);
this->m_run_InputPort[port].setPortNum(port);


#if FW_OBJECT_NAMES == 1
#if FW_OBJECT_NAMES == 1
char portName[120];
char portName[120];
(void) snprintf(
(void) snprintf(
portName,
portName,
sizeof(portName),
sizeof(portName),
"%s_run_InputPort[%" PRI_PlatformIntType "]",
"%s_run_InputPort[%" PRI_PlatformIntType "]",
this->m_objName,
this->m_objName,
port
port
);
);
this->m_run_InputPort[port].setObjName(portName);
this->m_run_InputPort[port].setObjName(portName);
#endif
#endif

}
}


// Initialize output port cmdRegOut
// Connect output port cmdRegOut
for (
for (
PlatformIntType port = 0;
PlatformIntType port = 0;
port < static_cast<PlatformIntType>(this->getNum_cmdRegOut_OutputPorts());
port < static_cast<PlatformIntType>(this->getNum_cmdRegOut_OutputPorts());
port++
port++
) {
) {
this->m_cmdRegOut_OutputPort[port].init();
this->m_cmdRegOut_OutputPort[port].init();


#if FW_OBJECT_NAMES == 1
#if FW_OBJECT_NAMES == 1
char portName[120];
char portName[120];
(void) snprintf(
(void) snprintf(
portName,
portName,
sizeof(portName),
sizeof(portName),
"%s_cmdRegOut_OutputPort[%" PRI_PlatformIntType "]",
"%s_cmdRegOut_OutputPort[%" PRI_PlatformIntType "]",
this->m_objName,
this->m_objName,
port
port
);
);
this->m_cmdRegOut_OutputPort[port].setObjName(portName);
this->m_cmdRegOut_OutputPort[port].setObjName(portName);
#endif
#endif

}
}


// Initialize output port cmdResponseOut
// Connect output port cmdResponseOut
for (
for (
PlatformIntType port = 0;
PlatformIntType port = 0;
port < static_cast<PlatformIntType>(this->getNum_cmdResponseOut_OutputPorts());
port < static_cast<PlatformIntType>(this->getNum_cmdResponseOut_OutputPorts());
port++
port++
) {
) {
this->m_cmdResponseOut_OutputPort[port].init();
this->m_cmdResponseOut_OutputPort[port].init();


#if FW_OBJECT_NAMES == 1
#if FW_OBJECT_NAMES == 1
char portName[120];
char portName[120];
(void) snprintf(
(void) snprintf(
portName,
portName,
sizeof(portName),
sizeof(portName),
"%s_cmdResponseOut_OutputPort[%" PRI_PlatformIntType "]",
"%s_cmdResponseOut_OutputPort[%" PRI_PlatformIntType "]",
this->m_objName,
this->m_objName,
port
port
);
);
this->m_cmdResponseOut_OutputPort[port].setObjName(portName);
this->m_cmdResponseOut_OutputPort[port].setObjName(portName);
#endif
#endif

}
}


// Initialize output port logOut
// Connect output port logOut
for (
for (
PlatformIntType port = 0;
PlatformIntType port = 0;
port < static_cast<PlatformIntType>(this->getNum_logOut_OutputPorts());
port < static_cast<PlatformIntType>(this->getNum_logOut_OutputPorts());
port++
port++
) {
) {
this->m_logOut_OutputPort[port].init();
this->m_logOut_OutputPort[port].init();


#if FW_OBJECT_NAMES == 1
#if FW_OBJECT_NAMES == 1
char portName[120];
char portName[120];
(void) snprintf(
(void) snprintf(
portName,
portName,
sizeof(portName),
sizeof(portName),
"%s_logOut_OutputPort[%" PRI_PlatformIntType "]",
"%s_logOut_OutputPort[%" PRI_PlatformIntType "]",
this->m_objName,
this->m_objName,
port
port
);
);
this->m_logOut_OutputPort[port].setObjName(portName);
this->m_logOut_OutputPort[port].setObjName(portName);
#endif
#endif

}
}


// Initialize output port logTextOut
#if FW_ENABLE_TEXT_LOGGING == 1
#if FW_ENABLE_TEXT_LOGGING == 1
// Connect output port logTextOut
for (
for (
PlatformIntType port = 0;
PlatformIntType port = 0;
port < static_cast<PlatformIntType>(this->getNum_logTextOut_OutputPorts());
port < static_cast<PlatformIntType>(this->getNum_logTextOut_OutputPorts());
port++
port++
) {
) {
this->m_logTextOut_OutputPort[port].init();
this->m_logTextOut_OutputPort[port].init();


#if FW_OBJECT_NAMES == 1
#if FW_OBJECT_NAMES == 1
char portName[120];
char portName[120];
(void) snprintf(
(void) snprintf(
portName,
portName,
sizeof(portName),
sizeof(portName),
"%s_logTextOut_OutputPort[%" PRI_PlatformIntType "]",
"%s_logTextOut_OutputPort[%" PRI_PlatformIntType "]",
this->m_objName,
this->m_objName,
port
port
);
);
this->m_logTextOut_OutputPort[port].setObjName(portName);
this->m_logTextOut_OutputPort[port].setObjName(portName);
#endif
#endif

}
}
#endif
#endif


// Initialize output port prmGetOut
// Connect output port prmGetOut
for (
for (
PlatformIntType port = 0;
PlatformIntType port = 0;
port < static_cast<PlatformIntType>(this->getNum_prmGetOut_OutputPorts());
port < static_cast<PlatformIntType>(this->getNum_prmGetOut_OutputPorts());
port++
port++
) {
) {
this->m_prmGetOut_OutputPort[port].init();
this->m_prmGetOut_OutputPort[port].init();


#if FW_OBJECT_NAMES == 1
#if FW_OBJECT_NAMES == 1
char portName[120];
char portName[120];
(void) snprintf(
(void) snprintf(
portName,
portName,
sizeof(portName),
sizeof(portName),
"%s_prmGetOut_OutputPort[%" PRI_PlatformIntType "]",
"%s_prmGetOut_OutputPort[%" PRI_PlatformIntType "]",
this->m_objName,
this->m_objName,
port
port
);
);
this->m_prmGetOut_OutputPort[port].setObjName(portName);
this->m_prmGetOut_OutputPort[port].setObjName(portName);
#endif
#endif

}
}


// Initialize output port prmSetOut
// Connect output port prmSetOut
for (
for (
PlatformIntType port = 0;
PlatformIntType port = 0;
port < static_cast<PlatformIntType>(this->getNum_prmSetOut_OutputPorts());
port < static_cast<PlatformIntType>(this->getNum_prmSetOut_OutputPorts());
port++
port++
) {
) {
this->m_prmSetOut_OutputPort[port].init();
this->m_prmSetOut_OutputPort[port].init();


#if FW_OBJECT_NAMES == 1
#if FW_OBJECT_NAMES == 1
char portName[120];
char portName[120];
(void) snprintf(
(void) snprintf(
portName,
portName,
sizeof(portName),
sizeof(portName),
"%s_prmSetOut_OutputPort[%" PRI_PlatformIntType "]",
"%s_prmSetOut_OutputPort[%" PRI_PlatformIntType "]",
this->m_objName,
this->m_objName,
port
port
);
);
this->m_prmSetOut_OutputPort[port].setObjName(portName);
this->m_prmSetOut_OutputPort[port].setObjName(portName);
#endif
#endif

}
}


// Initialize output port read
// Connect output port timeCaller
for (
for (
PlatformIntType port = 0;
PlatformIntType port = 0;
port < static_cast<PlatformIntType>(this->getNum_read_OutputPorts());
port < static_cast<PlatformIntType>(this->getNum_timeCaller_OutputPorts());
port++
port++
) {
) {
this->m_read_OutputPort[port].init();
this->m_timeCaller_OutputPort[port].init();


#if FW_OBJECT_NAMES == 1
#if FW_OBJECT_NAMES == 1
char portName[120];
char portName[120];
(void) snprintf(
(void) snprintf(
portName,
portName,
sizeof(portName),
sizeof(portName),
"%s_read_OutputPort[%" PRI_PlatformIntType "]",
"%s_timeCaller_OutputPort[%" PRI_PlatformIntType "]",
this->m_objName,
this->m_objName,
port
port
);
);
this->m_read_OutputPort[port].setObjName(portName);
this->m_timeCaller_OutputPort[port].setObjName(portName);
#endif
#endif

}
}


// Initialize output port timeCaller
// Connect output port tlmOut
for (
for (
PlatformIntType port = 0;
PlatformIntType port = 0;
port < static_cast<PlatformIntType>(this->getNum_timeCaller_OutputPorts());
port < static_cast<PlatformIntType>(this->getNum_tlmOut_OutputPorts());
port++
port++
) {
) {
this->m_timeCaller_OutputPort[port].init();
this->m_tlmOut_OutputPort[port].init();


#if FW_OBJECT_NAMES == 1
#if FW_OBJECT_NAMES == 1
char portName[120];
char portName[120];
(void) snprintf(
(void) snprintf(
portName,
portName,
sizeof(portName),
sizeof(portName),
"%s_timeCaller_OutputPort[%" PRI_PlatformIntType "]",
"%s_tlmOut_OutputPort[%" PRI_PlatformIntType "]",
this->m_objName,
this->m_objName,
port
port
);
);
this->m_timeCaller_OutputPort[port].setObjName(portName);
this->m_tlmOut_OutputPort[port].setObjName(portName);
#endif
#endif

}
}


// Initialize output port tlmOut
// Connect output port read
for (
for (
PlatformIntType port = 0;
PlatformIntType port = 0;
port < static_cast<PlatformIntType>(this->getNum_tlmOut_OutputPorts());
port < static_cast<PlatformIntType>(this->getNum_read_OutputPorts());
port++
port++
) {
) {
this->m_tlmOut_OutputPort[port].init();
this->m_read_OutputPort[port].init();


#if FW_OBJECT_NAMES == 1
#if FW_OBJECT_NAMES == 1
char portName[120];
char portName[120];
(void) snprintf(
(void) snprintf(
portName,
portName,
sizeof(portName),
sizeof(portName),
"%s_tlmOut_OutputPort[%" PRI_PlatformIntType "]",
"%s_read_OutputPort[%" PRI_PlatformIntType "]",
this->m_objName,
this->m_objName,
port
port
);
);
this->m_tlmOut_OutputPort[port].setObjName(portName);
this->m_read_OutputPort[port].setObjName(portName);
#endif
#endif

}
}


// Initialize output port write
// Connect output port write
for (
for (
PlatformIntType port = 0;
PlatformIntType port = 0;
port < static_cast<PlatformIntType>(this->getNum_write_OutputPorts());
port < static_cast<PlatformIntType>(this->getNum_write_OutputPorts());
port++
port++
) {
) {
this->m_write_OutputPort[port].init();
this->m_write_OutputPort[port].init();


#if FW_OBJECT_NAMES == 1
#if FW_OBJECT_NAMES == 1
char portName[120];
char portName[120];
(void) snprintf(
(void) snprintf(
portName,
portName,
sizeof(portName),
sizeof(portName),
"%s_write_OutputPort[%" PRI_PlatformIntType "]",
"%s_write_OutputPort[%" PRI_PlatformIntType "]",
this->m_objName,
this->m_objName,
port
port
);
);
this->m_write_OutputPort[port].setObjName(portName);
this->m_write_OutputPort[port].setObjName(portName);
#endif
#endif
}
}


}
// ----------------------------------------------------------------------
// Getters for special input ports
// ----------------------------------------------------------------------


Fw::InputCmdPort* IMU_MPU9250ComponentBase ::
get_cmdIn_InputPort(NATIVE_INT_TYPE portNum)
{
FW_ASSERT(
portNum < this->getNum_cmdIn_InputPorts(),
static_cast<FwAssertArgType>(portNum)
);


return &this->m_cmdIn_InputPort[portNum];
}
}


IMU_MPU9250ComponentBase::
// ----------------------------------------------------------------------
~IMU_MPU9250ComponentBase() {
// Getters for typed input ports
// ----------------------------------------------------------------------

Svc::InputSchedPort* IMU_MPU9250ComponentBase ::
get_run_InputPort(NATIVE_INT_TYPE portNum)
{
FW_ASSERT(
portNum < this->getNum_run_InputPorts(),
static_cast<FwAssertArgType>(portNum)
);


return &this->m_run_InputPort[portNum];
}
}


// ----------------------------------------------------------------------
// ----------------------------------------------------------------------
// Invocation functions for output ports
// Connect special input ports to special output ports
// ----------------------------------------------------------------------
// ----------------------------------------------------------------------


Drv::I2cStatus IMU_MPU9250ComponentBase ::
void IMU_MPU9250ComponentBase ::
read_out(
set_cmdRegOut_OutputPort(
NATIVE_INT_TYPE portNum,
NATIVE_INT_TYPE portNum,
U32 addr, Fw::Buffer &serBuffer
Fw::InputCmdRegPort* port
)
)
{
{
FW_ASSERT(portNum < this->getNum_read_OutputPorts(),static_cast<FwAssertArgType>(portNum));
FW_ASSERT(
return this->m_read_OutputPort[portNum].invoke(addr, serBuffer);
portNum < this->getNum_cmdRegOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);

this->m_cmdRegOut_OutputPort[portNum].addCallPort(port);
}
}


Drv::I2cStatus IMU_MPU9250ComponentBase ::
void IMU_MPU9250ComponentBase ::
write_out(
set_cmdResponseOut_OutputPort(
NATIVE_INT_TYPE portNum,
NATIVE_INT_TYPE portNum,
U32 addr, Fw::Buffer &serBuffer
Fw::InputCmdResponsePort* port
)
)
{
{
FW_ASSERT(portNum < this->getNum_write_OutputPorts(),static_cast<FwAssertArgType>(portNum));
FW_ASSERT(
return this->m_write_OutputPort[portNum].invoke(addr, serBuffer);
portNum < this->getNum_cmdResponseOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);

Text moved from lines 60-68
this->m_cmdResponseOut_OutputPort[portNum].addCallPort(port);
}

void IMU_MPU9250ComponentBase ::
set_logOut_OutputPort(
NATIVE_INT_TYPE portNum,
Fw::InputLogPort* port
)
{
FW_ASSERT(
portNum < this->getNum_logOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);

Text moved from lines 70-73
this->m_logOut_OutputPort[portNum].addCallPort(port);
}

#if FW_ENABLE_TEXT_LOGGING == 1

Text moved from lines 74-79
void IMU_MPU9250ComponentBase ::
set_logTextOut_OutputPort(
NATIVE_INT_TYPE portNum,
Fw::InputLogTextPort* port
)
{
FW_ASSERT(
portNum < this->getNum_logTextOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);

this->m_logTextOut_OutputPort[portNum].addCallPort(port);
}

Text moved from lines 83-90
#endif

void IMU_MPU9250ComponentBase ::
set_prmGetOut_OutputPort(
NATIVE_INT_TYPE portNum,
Fw::InputPrmGetPort* port
)
{
FW_ASSERT(
portNum < this->getNum_prmGetOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);

Text moved from lines 92-100
this->m_prmGetOut_OutputPort[portNum].addCallPort(port);
}

void IMU_MPU9250ComponentBase ::
set_prmSetOut_OutputPort(
NATIVE_INT_TYPE portNum,
Fw::InputPrmSetPort* port
)
{
FW_ASSERT(
portNum < this->getNum_prmSetOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);

Text moved with changes from lines 112-120 (99.1% similarity)
this->m_prmSetOut_OutputPort[portNum].addCallPort(port);
}

void IMU_MPU9250ComponentBase ::
set_timeCaller_OutputPort(
NATIVE_INT_TYPE portNum,
Fw::InputTimePort* port
)
{
FW_ASSERT(
portNum < this->getNum_timeCaller_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);

Text moved from lines 122-130
this->m_timeCaller_OutputPort[portNum].addCallPort(port);
}

void IMU_MPU9250ComponentBase ::
set_tlmOut_OutputPort(
NATIVE_INT_TYPE portNum,
Fw::InputTlmPort* port
)
{
FW_ASSERT(
portNum < this->getNum_tlmOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);

this->m_tlmOut_OutputPort[portNum].addCallPort(port);
}
}


// ----------------------------------------------------------------------
// ----------------------------------------------------------------------
// Getters for numbers of ports
// Connect typed input ports to typed output ports
// ----------------------------------------------------------------------
Text moved from lines 104-110

void IMU_MPU9250ComponentBase ::
set_read_OutputPort(
NATIVE_INT_TYPE portNum,
Drv::InputI2cPort* port
)
{
FW_ASSERT(
portNum < this->getNum_read_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);

Text moved with changes from lines 132-140 (99.0% similarity)
this->m_read_OutputPort[portNum].addCallPort(port);
}

void IMU_MPU9250ComponentBase ::
set_write_OutputPort(
NATIVE_INT_TYPE portNum,
Drv::InputI2cPort* port
)
{
FW_ASSERT(
portNum < this->getNum_write_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);

Text moved with changes from lines 142-145 (93.5% similarity)
this->m_write_OutputPort[portNum].addCallPort(port);
}

#if FW_PORT_SERIALIZATION
Text moved from lines 38-48

// ----------------------------------------------------------------------
// Connect serial input ports to special output ports
// ----------------------------------------------------------------------

void IMU_MPU9250ComponentBase ::
set_cmdRegOut_OutputPort(
NATIVE_INT_TYPE portNum,
Fw::InputSerializePort* port
)
{
FW_ASSERT(
portNum < this->getNum_cmdRegOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);

Text moved with changes from lines 50-58 (97.1% similarity)
this->m_cmdRegOut_OutputPort[portNum].registerSerialPort(port);
}

void IMU_MPU9250ComponentBase ::
set_cmdResponseOut_OutputPort(
NATIVE_INT_TYPE portNum,
Fw::InputSerializePort* port
)
{
FW_ASSERT(
portNum < this->getNum_cmdResponseOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);

Text moved with changes from lines 158-166 (97.4% similarity)
this->m_cmdResponseOut_OutputPort[portNum].registerSerialPort(port);
}

void IMU_MPU9250ComponentBase ::
set_logOut_OutputPort(
NATIVE_INT_TYPE portNum,
Fw::InputSerializePort* port
)
{
FW_ASSERT(
portNum < this->getNum_logOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);

this->m_logOut_OutputPort[portNum].registerSerialPort(port);
}

#if FW_ENABLE_TEXT_LOGGING == 1

Text moved from lines 182-187
void IMU_MPU9250ComponentBase ::
set_logTextOut_OutputPort(
NATIVE_INT_TYPE portNum,
Fw::InputSerializePort* port
)
{
FW_ASSERT(
portNum < this->getNum_logTextOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);

this->m_logTextOut_OutputPort[portNum].registerSerialPort(port);
}

#endif

Text moved from lines 203-208
void IMU_MPU9250ComponentBase ::
set_prmSetOut_OutputPort(
NATIVE_INT_TYPE portNum,
Fw::InputSerializePort* port
)
{
FW_ASSERT(
portNum < this->getNum_prmSetOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);

this->m_prmSetOut_OutputPort[portNum].registerSerialPort(port);
}

Text moved from lines 223-228
void IMU_MPU9250ComponentBase ::
set_timeCaller_OutputPort(
NATIVE_INT_TYPE portNum,
Fw::InputSerializePort* port
)
{
FW_ASSERT(
portNum < this->getNum_timeCaller_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);

this->m_timeCaller_OutputPort[portNum].registerSerialPort(port);
}

Text moved from lines 233-238
void IMU_MPU9250ComponentBase ::
set_tlmOut_OutputPort(
NATIVE_INT_TYPE portNum,
Fw::InputSerializePort* port
)
{
FW_ASSERT(
portNum < this->getNum_tlmOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);

this->m_tlmOut_OutputPort[portNum].registerSerialPort(port);
}

#endif

// ----------------------------------------------------------------------
// Command registration
// ----------------------------------------------------------------------

void IMU_MPU9250ComponentBase ::
Text moved from lines 260-262
regCommands()
{
FW_ASSERT(this->m_cmdRegOut_OutputPort[0].isConnected());

Text moved from lines 263-271
this->m_cmdRegOut_OutputPort[0].invoke(
this->getIdBase() + OPCODE_POWERSWITCH
);
}

// ----------------------------------------------------------------------
// Component construction and destruction
// ----------------------------------------------------------------------

IMU_MPU9250ComponentBase ::
IMU_MPU9250ComponentBase(const char* compName) :
Fw::PassiveComponentBase(compName)
{
Text moved with changes from lines 276-279 (98.0% similarity)

}

IMU_MPU9250ComponentBase ::
~IMU_MPU9250ComponentBase()
{

}

// ----------------------------------------------------------------------
// Getters for numbers of special input ports
// ----------------------------------------------------------------------
// ----------------------------------------------------------------------


NATIVE_INT_TYPE IMU_MPU9250ComponentBase ::
NATIVE_INT_TYPE IMU_MPU9250ComponentBase ::
getNum_cmdIn_InputPorts()
getNum_cmdIn_InputPorts()
{
{
return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_cmdIn_InputPort));
return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_cmdIn_InputPort));
}
}

// ----------------------------------------------------------------------
// Getters for numbers of typed input ports
// ----------------------------------------------------------------------

NATIVE_INT_TYPE IMU_MPU9250ComponentBase ::
getNum_run_InputPorts()
{
return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_run_InputPort));
}

// ----------------------------------------------------------------------
// Getters for numbers of special output ports
// ----------------------------------------------------------------------


NATIVE_INT_TYPE IMU_MPU9250ComponentBase ::
NATIVE_INT_TYPE IMU_MPU9250ComponentBase ::
getNum_cmdRegOut_OutputPorts()
getNum_cmdRegOut_OutputPorts()
{
{
return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_cmdRegOut_OutputPort));
return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_cmdRegOut_OutputPort));
}
}


NATIVE_INT_TYPE IMU_MPU9250ComponentBase ::
NATIVE_INT_TYPE IMU_MPU9250ComponentBase ::
getNum_cmdResponseOut_OutputPorts()
getNum_cmdResponseOut_OutputPorts()
{
{
return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_cmdResponseOut_OutputPort));
return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_cmdResponseOut_OutputPort));
}
}


NATIVE_INT_TYPE IMU_MPU9250ComponentBase ::
NATIVE_INT_TYPE IMU_MPU9250ComponentBase ::
getNum_logOut_OutputPorts()
getNum_logOut_OutputPorts()
{
{
return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_logOut_OutputPort));
return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_logOut_OutputPort));
}
}


#if FW_ENABLE_TEXT_LOGGING == 1
#if FW_ENABLE_TEXT_LOGGING == 1

NATIVE_INT_TYPE IMU_MPU9250ComponentBase ::
NATIVE_INT_TYPE IMU_MPU9250ComponentBase ::
getNum_logTextOut_OutputPorts()
getNum_logTextOut_OutputPorts()
{
{
return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_logTextOut_OutputPort));
return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_logTextOut_OutputPort));
}
}

#endif
#endif


NATIVE_INT_TYPE IMU_MPU9250ComponentBase ::
NATIVE_INT_TYPE IMU_MPU9250ComponentBase ::
getNum_prmGetOut_OutputPorts()
getNum_prmGetOut_OutputPorts()
{
{
return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_prmGetOut_OutputPort));
return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_prmGetOut_OutputPort));
}
}


NATIVE_INT_TYPE IMU_MPU9250ComponentBase ::
NATIVE_INT_TYPE IMU_MPU9250ComponentBase ::
getNum_prmSetOut_OutputPorts()
getNum_prmSetOut_OutputPorts()
{
{
return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_prmSetOut_OutputPort));
return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_prmSetOut_OutputPort));
}
}


NATIVE_INT_TYPE IMU_MPU9250ComponentBase ::
NATIVE_INT_TYPE IMU_MPU9250ComponentBase ::
getNum_read_OutputPorts()
getNum_timeCaller_OutputPorts()
{
{
return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_read_OutputPort));
return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_timeCaller_OutputPort));
}
}


NATIVE_INT_TYPE IMU_MPU9250ComponentBase ::
NATIVE_INT_TYPE IMU_MPU9250ComponentBase ::
getNum_run_InputPorts()
getNum_tlmOut_OutputPorts()
{
{
return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_run_InputPort));
return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_tlmOut_OutputPort));
}
}


NATIVE_INT_TYPE IMU_MPU9250ComponentBase ::
// ----------------------------------------------------------------------
getNum_timeCaller_OutputPorts()
// Getters for numbers of typed output ports
{
// ----------------------------------------------------------------------
return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_timeCaller_OutputPort));
}


NATIVE_INT_TYPE IMU_MPU9250ComponentBase ::
NATIVE_INT_TYPE IMU_MPU9250ComponentBase ::
getNum_tlmOut_OutputPorts()
getNum_read_OutputPorts()
{
{
return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_tlmOut_OutputPort));
return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_read_OutputPort));
}
}


NATIVE_INT_TYPE IMU_MPU9250ComponentBase ::
NATIVE_INT_TYPE IMU_MPU9250ComponentBase ::
getNum_write_OutputPorts()
getNum_write_OutputPorts()
{
{
return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_write_OutputPort));
return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_write_OutputPort));
}
}


// ----------------------------------------------------------------------
// ----------------------------------------------------------------------
// Port connection status queries
// Connection status queries for special output ports
// ----------------------------------------------------------------------
// ----------------------------------------------------------------------


bool IMU_MPU9250ComponentBase ::
bool IMU_MPU9250ComponentBase ::
isConnected_cmdRegOut_OutputPort(NATIVE_INT_TYPE portNum)
isConnected_cmdRegOut_OutputPort(NATIVE_INT_TYPE portNum)
{
{
FW_ASSERT(
FW_ASSERT(
portNum < this->getNum_cmdRegOut_OutputPorts(),
portNum < this->getNum_cmdRegOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
static_cast<FwAssertArgType>(portNum)
);
);
return this->m_cmdRegOut_OutputPort[portNum].isConnected();

return this->m_cmdRegOut_OutputPort[portNum].isConnected();
}
}


bool IMU_MPU9250ComponentBase ::
bool IMU_MPU9250ComponentBase ::
isConnected_cmdResponseOut_OutputPort(NATIVE_INT_TYPE portNum)
isConnected_cmdResponseOut_OutputPort(NATIVE_INT_TYPE portNum)
{
{
FW_ASSERT(
FW_ASSERT(
portNum < this->getNum_cmdResponseOut_OutputPorts(),
portNum < this->getNum_cmdResponseOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
static_cast<FwAssertArgType>(portNum)
);
);
return this->m_cmdResponseOut_OutputPort[portNum].isConnected();

return this->m_cmdResponseOut_OutputPort[portNum].isConnected();
}
}


bool IMU_MPU9250ComponentBase ::
bool IMU_MPU9250ComponentBase ::
isConnected_logOut_OutputPort(NATIVE_INT_TYPE portNum)
isConnected_logOut_OutputPort(NATIVE_INT_TYPE portNum)
{
{
FW_ASSERT(
FW_ASSERT(
portNum < this->getNum_logOut_OutputPorts(),
portNum < this->getNum_logOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
static_cast<FwAssertArgType>(portNum)
);
);
return this->m_logOut_OutputPort[portNum].isConnected();

return this->m_logOut_OutputPort[portNum].isConnected();
}
}


#if FW_ENABLE_TEXT_LOGGING == 1
#if FW_ENABLE_TEXT_LOGGING == 1

bool IMU_MPU9250ComponentBase ::
bool IMU_MPU9250ComponentBase ::
isConnected_logTextOut_OutputPort(NATIVE_INT_TYPE portNum)
isConnected_logTextOut_OutputPort(NATIVE_INT_TYPE portNum)
{
{
FW_ASSERT(
FW_ASSERT(
portNum < this->getNum_logTextOut_OutputPorts(),
portNum < this->getNum_logTextOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
static_cast<FwAssertArgType>(portNum)
);
);
return this->m_logTextOut_OutputPort[portNum].isConnected();

return this->m_logTextOut_OutputPort[portNum].isConnected();
}
}

#endif
#endif


bool IMU_MPU9250ComponentBase ::
bool IMU_MPU9250ComponentBase ::
isConnected_prmGetOut_OutputPort(NATIVE_INT_TYPE portNum)
isConnected_prmGetOut_OutputPort(NATIVE_INT_TYPE portNum)
{
{
FW_ASSERT(
FW_ASSERT(
portNum < this->getNum_prmGetOut_OutputPorts(),
portNum < this->getNum_prmGetOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
static_cast<FwAssertArgType>(portNum)
);
);
return this->m_prmGetOut_OutputPort[portNum].isConnected();

return this->m_prmGetOut_OutputPort[portNum].isConnected();
}
}


bool IMU_MPU9250ComponentBase ::
bool IMU_MPU9250ComponentBase ::
isConnected_prmSetOut_OutputPort(NATIVE_INT_TYPE portNum)
isConnected_prmSetOut_OutputPort(NATIVE_INT_TYPE portNum)
{
{
FW_ASSERT(
FW_ASSERT(
portNum < this->getNum_prmSetOut_OutputPorts(),
portNum < this->getNum_prmSetOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
static_cast<FwAssertArgType>(portNum)
);
);
return this->m_prmSetOut_OutputPort[portNum].isConnected();

return this->m_prmSetOut_OutputPort[portNum].isConnected();
}
}


bool IMU_MPU9250ComponentBase ::
bool IMU_MPU9250ComponentBase ::
isConnected_read_OutputPort(NATIVE_INT_TYPE portNum)
isConnected_timeCaller_OutputPort(NATIVE_INT_TYPE portNum)
{
{
FW_ASSERT(
FW_ASSERT(
portNum < this->getNum_read_OutputPorts(),
portNum < this->getNum_timeCaller_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
static_cast<FwAssertArgType>(portNum)
);
);
return this->m_read_OutputPort[portNum].isConnected();

return this->m_timeCaller_OutputPort[portNum].isConnected();
}
}


bool IMU_MPU9250ComponentBase ::
bool IMU_MPU9250ComponentBase ::
isConnected_timeCaller_OutputPort(NATIVE_INT_TYPE portNum)
isConnected_tlmOut_OutputPort(NATIVE_INT_TYPE portNum)
{
{
FW_ASSERT(
FW_ASSERT(
portNum < this->getNum_timeCaller_OutputPorts(),
portNum < this->getNum_tlmOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
static_cast<FwAssertArgType>(portNum)
);
);
return this->m_timeCaller_OutputPort[portNum].isConnected();

return this->m_tlmOut_OutputPort[portNum].isConnected();
}
}


// ----------------------------------------------------------------------
// Connection status queries for typed output ports
// ----------------------------------------------------------------------

bool IMU_MPU9250ComponentBase ::
bool IMU_MPU9250ComponentBase ::
isConnected_tlmOut_OutputPort(NATIVE_INT_TYPE portNum)
isConnected_read_OutputPort(NATIVE_INT_TYPE portNum)
{
{
FW_ASSERT(
FW_ASSERT(
portNum < this->getNum_tlmOut_OutputPorts(),
portNum < this->getNum_read_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
static_cast<FwAssertArgType>(portNum)
);
);
return this->m_tlmOut_OutputPort[portNum].isConnected();

return this->m_read_OutputPort[portNum].isConnected();
}
}


bool IMU_MPU9250ComponentBase ::
bool IMU_MPU9250ComponentBase ::
isConnected_write_OutputPort(NATIVE_INT_TYPE portNum)
isConnected_write_OutputPort(NATIVE_INT_TYPE portNum)
{
{
FW_ASSERT(
FW_ASSERT(
portNum < this->getNum_write_OutputPorts(),
portNum < this->getNum_write_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
static_cast<FwAssertArgType>(portNum)
);
);
return this->m_write_OutputPort[portNum].isConnected();

return this->m_write_OutputPort[portNum].isConnected();
}
}


// ----------------------------------------------------------------------
// ----------------------------------------------------------------------
// Calls for messages received on command input ports
// Port handler base-class functions for typed input ports
//
// Call these functions directly to bypass the corresponding ports
// ----------------------------------------------------------------------
// ----------------------------------------------------------------------


void IMU_MPU9250ComponentBase ::
void IMU_MPU9250ComponentBase ::
m_p_cmdIn_in(
run_handlerBase(
Fw::PassiveComponentBase* callComp,
NATIVE_INT_TYPE portNum,
NATIVE_INT_TYPE portNum,
FwOpcodeType opCode,
NATIVE_UINT_TYPE context
U32 cmdSeq,
Fw::CmdArgBuffer &args
)
)
{
{

// Make sure port number is valid
// Select base class function based on opcode
FW_ASSERT(
FW_ASSERT(callComp);
portNum < this->getNum_run_InputPorts(),
IMU_MPU9250ComponentBase* compPtr = static_cast<IMU_MPU9250ComponentBase*>(callComp);
static_cast<FwAssertArgType>(portNum)
);


const U32 idBase = callComp->getIdBase();
// Down call to pure virtual handler method implemented in Impl class
FW_ASSERT(opCode >= idBase, opCode, idBase);
this->run_handler(
switch (opCode - idBase) {
portNum,
context
);
}


case OPCODE_POWERSWITCH: /*!< Command to turn on the device */
// ----------------------------------------------------------------------
compPtr->PowerSwitch_cmdHandlerBase(
// Invocation functions for typed output ports
opCode,
// ----------------------------------------------------------------------
cmdSeq,
args
);
break;


default: {
Drv::I2cStatus IMU_MPU9250ComponentBase ::
compPtr->cmdResponse_out(
read_out(
opCode,cmdSeq,
NATIVE_INT_TYPE portNum,
Fw::CmdResponse::INVALID_OPCODE
U32 addr,
);
Fw::Buffer& serBuffer
break;
)
}
{

FW_ASSERT(
}
portNum < this->getNum_read_OutputPorts(),

static_cast<FwAssertArgType>(portNum)
);
return this->m_read_OutputPort[portNum].invoke(
addr,
serBuffer
);
}
}


void IMU_MPU9250ComponentBase ::
Drv::I2cStatus IMU_MPU9250ComponentBase ::
cmdResponse_out(
write_out(
FwOpcodeType opCode,
NATIVE_INT_TYPE portNum,
U32 cmdSeq,
U32 addr,
Fw::CmdResponse response
Fw::Buffer& serBuffer
)
)
{
{
FW_ASSERT(this->m_cmdResponseOut_OutputPort[0].isConnected());
FW_ASSERT(
this->m_cmdResponseOut_OutputPort[0].invoke(opCode,cmdSeq,response);
portNum < this->getNum_write_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
return this->m_write_OutputPort[portNum].invoke(
addr,
serBuffer
);
}
}


// ----------------------------------------------------------------------
// ----------------------------------------------------------------------
// Base class command functions
// Command response
// ----------------------------------------------------------------------
// ----------------------------------------------------------------------


void IMU_MPU9250ComponentBase ::
void IMU_MPU9250ComponentBase ::
PowerSwitch_cmdHandlerBase(
cmdResponse_out(
FwOpcodeType opCode,
FwOpcodeType opCode,
U32 cmdSeq,
U32 cmdSeq,
Fw::CmdArgBuffer &args
Fw::CmdResponse response
)
)
{
{

FW_ASSERT(this->m_cmdResponseOut_OutputPort[0].isConnected());
// Deserialize the arguments
Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK;

// Reset the buffer
args.resetDeser();

Fw::On powerState;
_status = args.deserialize(powerState);
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->PowerSwitch_cmdHandler(
opCode,
cmdSeq,
powerState
);
this