fpp/compiler/tools/fpp-to-cpp/test/component/base/ActiveCommandsComponentAc.ref.cpp
2024-04-11 15:11:51 -07:00

4535 lines
106 KiB
C++

// ======================================================================
// \title ActiveCommandsComponentAc.cpp
// \author Generated by fpp-to-cpp
// \brief cpp file for ActiveCommands component base class
// ======================================================================
#include <cstdio>
#include "Fw/Types/Assert.hpp"
#if FW_ENABLE_TEXT_LOGGING
#include "Fw/Types/String.hpp"
#endif
#include "base/ActiveCommandsComponentAc.hpp"
namespace {
enum MsgTypeEnum {
ACTIVECOMMANDS_COMPONENT_EXIT = Fw::ActiveComponentBase::ACTIVE_COMPONENT_EXIT,
NOARGSASYNC_NOARGS,
TYPEDASYNC_TYPED,
TYPEDASYNCASSERT_TYPED,
TYPEDASYNCBLOCKPRIORITY_TYPED,
TYPEDASYNCDROPPRIORITY_TYPED,
CMD_CMD_ASYNC,
CMD_CMD_PRIORITY,
CMD_CMD_PARAMS_PRIORITY,
CMD_CMD_DROP,
CMD_CMD_PARAMS_PRIORITY_DROP,
};
// Get the max size by constructing a union of the async input, command, and
// internal port serialization sizes
union BuffUnion {
BYTE typedAsyncPortSize[Ports::InputTypedPort::SERIALIZED_SIZE];
BYTE typedAsyncAssertPortSize[Ports::InputTypedPort::SERIALIZED_SIZE];
BYTE typedAsyncBlockPriorityPortSize[Ports::InputTypedPort::SERIALIZED_SIZE];
BYTE typedAsyncDropPriorityPortSize[Ports::InputTypedPort::SERIALIZED_SIZE];
BYTE cmdPortSize[Fw::InputCmdPort::SERIALIZED_SIZE];
};
// Define a message buffer class large enough to handle all the
// asynchronous inputs to the component
class ComponentIpcSerializableBuffer :
public Fw::SerializeBufferBase
{
public:
enum {
// Max. message size = size of data + message id + port
SERIALIZATION_SIZE =
sizeof(BuffUnion) +
sizeof(FwEnumStoreType) +
sizeof(FwIndexType)
};
Fw::Serializable::SizeType getBuffCapacity() const {
return sizeof(m_buff);
}
U8* getBuffAddr() {
return m_buff;
}
const U8* getBuffAddr() const {
return m_buff;
}
private:
// Should be the max of all the input ports serialized sizes...
U8 m_buff[SERIALIZATION_SIZE];
};
}
// ----------------------------------------------------------------------
// Component initialization
// ----------------------------------------------------------------------
void ActiveCommandsComponentBase ::
init(
FwQueueSizeType queueDepth,
FwEnumStoreType instance
)
{
// Initialize base class
Fw::ActiveComponentBase::init(instance);
// Connect input port cmdIn
for (
FwIndexType port = 0;
port < static_cast<FwIndexType>(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 noArgsAsync
for (
FwIndexType port = 0;
port < static_cast<FwIndexType>(this->getNum_noArgsAsync_InputPorts());
port++
) {
this->m_noArgsAsync_InputPort[port].init();
this->m_noArgsAsync_InputPort[port].addCallComp(
this,
m_p_noArgsAsync_in
);
this->m_noArgsAsync_InputPort[port].setPortNum(port);
#if FW_OBJECT_NAMES == 1
Fw::ObjectName portName;
portName.format(
"%s_noArgsAsync_InputPort[%" PRI_PlatformIntType "]",
this->m_objName.toChar(),
port
);
this->m_noArgsAsync_InputPort[port].setObjName(portName.toChar());
#endif
}
// Connect input port noArgsGuarded
for (
FwIndexType port = 0;
port < static_cast<FwIndexType>(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<FwIndexType>(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<FwIndexType>(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<FwIndexType>(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 typedAsync
for (
FwIndexType port = 0;
port < static_cast<FwIndexType>(this->getNum_typedAsync_InputPorts());
port++
) {
this->m_typedAsync_InputPort[port].init();
this->m_typedAsync_InputPort[port].addCallComp(
this,
m_p_typedAsync_in
);
this->m_typedAsync_InputPort[port].setPortNum(port);
#if FW_OBJECT_NAMES == 1
Fw::ObjectName portName;
portName.format(
"%s_typedAsync_InputPort[%" PRI_PlatformIntType "]",
this->m_objName.toChar(),
port
);
this->m_typedAsync_InputPort[port].setObjName(portName.toChar());
#endif
}
// Connect input port typedAsyncAssert
for (
FwIndexType port = 0;
port < static_cast<FwIndexType>(this->getNum_typedAsyncAssert_InputPorts());
port++
) {
this->m_typedAsyncAssert_InputPort[port].init();
this->m_typedAsyncAssert_InputPort[port].addCallComp(
this,
m_p_typedAsyncAssert_in
);
this->m_typedAsyncAssert_InputPort[port].setPortNum(port);
#if FW_OBJECT_NAMES == 1
Fw::ObjectName portName;
portName.format(
"%s_typedAsyncAssert_InputPort[%" PRI_PlatformIntType "]",
this->m_objName.toChar(),
port
);
this->m_typedAsyncAssert_InputPort[port].setObjName(portName.toChar());
#endif
}
// Connect input port typedAsyncBlockPriority
for (
FwIndexType port = 0;
port < static_cast<FwIndexType>(this->getNum_typedAsyncBlockPriority_InputPorts());
port++
) {
this->m_typedAsyncBlockPriority_InputPort[port].init();
this->m_typedAsyncBlockPriority_InputPort[port].addCallComp(
this,
m_p_typedAsyncBlockPriority_in
);
this->m_typedAsyncBlockPriority_InputPort[port].setPortNum(port);
#if FW_OBJECT_NAMES == 1
Fw::ObjectName portName;
portName.format(
"%s_typedAsyncBlockPriority_InputPort[%" PRI_PlatformIntType "]",
this->m_objName.toChar(),
port
);
this->m_typedAsyncBlockPriority_InputPort[port].setObjName(portName.toChar());
#endif
}
// Connect input port typedAsyncDropPriority
for (
FwIndexType port = 0;
port < static_cast<FwIndexType>(this->getNum_typedAsyncDropPriority_InputPorts());
port++
) {
this->m_typedAsyncDropPriority_InputPort[port].init();
this->m_typedAsyncDropPriority_InputPort[port].addCallComp(
this,
m_p_typedAsyncDropPriority_in
);
this->m_typedAsyncDropPriority_InputPort[port].setPortNum(port);
#if FW_OBJECT_NAMES == 1
Fw::ObjectName portName;
portName.format(
"%s_typedAsyncDropPriority_InputPort[%" PRI_PlatformIntType "]",
this->m_objName.toChar(),
port
);
this->m_typedAsyncDropPriority_InputPort[port].setObjName(portName.toChar());
#endif
}
// Connect input port typedGuarded
for (
FwIndexType port = 0;
port < static_cast<FwIndexType>(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<FwIndexType>(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<FwIndexType>(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<FwIndexType>(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<FwIndexType>(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<FwIndexType>(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<FwIndexType>(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<FwIndexType>(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<FwIndexType>(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<FwIndexType>(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<FwIndexType>(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<FwIndexType>(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<FwIndexType>(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<FwIndexType>(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<FwIndexType>(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<FwIndexType>(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
}
Os::Queue::QueueStatus qStat = this->createQueue(
queueDepth,
ComponentIpcSerializableBuffer::SERIALIZATION_SIZE
);
FW_ASSERT(
Os::Queue::QUEUE_OK == qStat,
static_cast<FwAssertArgType>(qStat)
);
}
// ----------------------------------------------------------------------
// Getters for special input ports
// ----------------------------------------------------------------------
Fw::InputCmdPort* ActiveCommandsComponentBase ::
get_cmdIn_InputPort(FwIndexType portNum)
{
FW_ASSERT(
portNum < this->getNum_cmdIn_InputPorts(),
static_cast<FwAssertArgType>(portNum)
);
return &this->m_cmdIn_InputPort[portNum];
}
// ----------------------------------------------------------------------
// Getters for typed input ports
// ----------------------------------------------------------------------
Ports::InputNoArgsPort* ActiveCommandsComponentBase ::
get_noArgsAsync_InputPort(FwIndexType portNum)
{
FW_ASSERT(
portNum < this->getNum_noArgsAsync_InputPorts(),
static_cast<FwAssertArgType>(portNum)
);
return &this->m_noArgsAsync_InputPort[portNum];
}
Ports::InputNoArgsPort* ActiveCommandsComponentBase ::
get_noArgsGuarded_InputPort(FwIndexType portNum)
{
FW_ASSERT(
portNum < this->getNum_noArgsGuarded_InputPorts(),
static_cast<FwAssertArgType>(portNum)
);
return &this->m_noArgsGuarded_InputPort[portNum];
}
Ports::InputNoArgsReturnPort* ActiveCommandsComponentBase ::
get_noArgsReturnGuarded_InputPort(FwIndexType portNum)
{
FW_ASSERT(
portNum < this->getNum_noArgsReturnGuarded_InputPorts(),
static_cast<FwAssertArgType>(portNum)
);
return &this->m_noArgsReturnGuarded_InputPort[portNum];
}
Ports::InputNoArgsReturnPort* ActiveCommandsComponentBase ::
get_noArgsReturnSync_InputPort(FwIndexType portNum)
{
FW_ASSERT(
portNum < this->getNum_noArgsReturnSync_InputPorts(),
static_cast<FwAssertArgType>(portNum)
);
return &this->m_noArgsReturnSync_InputPort[portNum];
}
Ports::InputNoArgsPort* ActiveCommandsComponentBase ::
get_noArgsSync_InputPort(FwIndexType portNum)
{
FW_ASSERT(
portNum < this->getNum_noArgsSync_InputPorts(),
static_cast<FwAssertArgType>(portNum)
);
return &this->m_noArgsSync_InputPort[portNum];
}
Ports::InputTypedPort* ActiveCommandsComponentBase ::
get_typedAsync_InputPort(FwIndexType portNum)
{
FW_ASSERT(
portNum < this->getNum_typedAsync_InputPorts(),
static_cast<FwAssertArgType>(portNum)
);
return &this->m_typedAsync_InputPort[portNum];
}
Ports::InputTypedPort* ActiveCommandsComponentBase ::
get_typedAsyncAssert_InputPort(FwIndexType portNum)
{
FW_ASSERT(
portNum < this->getNum_typedAsyncAssert_InputPorts(),
static_cast<FwAssertArgType>(portNum)
);
return &this->m_typedAsyncAssert_InputPort[portNum];
}
Ports::InputTypedPort* ActiveCommandsComponentBase ::
get_typedAsyncBlockPriority_InputPort(FwIndexType portNum)
{
FW_ASSERT(
portNum < this->getNum_typedAsyncBlockPriority_InputPorts(),
static_cast<FwAssertArgType>(portNum)
);
return &this->m_typedAsyncBlockPriority_InputPort[portNum];
}
Ports::InputTypedPort* ActiveCommandsComponentBase ::
get_typedAsyncDropPriority_InputPort(FwIndexType portNum)
{
FW_ASSERT(
portNum < this->getNum_typedAsyncDropPriority_InputPorts(),
static_cast<FwAssertArgType>(portNum)
);
return &this->m_typedAsyncDropPriority_InputPort[portNum];
}
Ports::InputTypedPort* ActiveCommandsComponentBase ::
get_typedGuarded_InputPort(FwIndexType portNum)
{
FW_ASSERT(
portNum < this->getNum_typedGuarded_InputPorts(),
static_cast<FwAssertArgType>(portNum)
);
return &this->m_typedGuarded_InputPort[portNum];
}
Ports::InputTypedReturnPort* ActiveCommandsComponentBase ::
get_typedReturnGuarded_InputPort(FwIndexType portNum)
{
FW_ASSERT(
portNum < this->getNum_typedReturnGuarded_InputPorts(),
static_cast<FwAssertArgType>(portNum)
);
return &this->m_typedReturnGuarded_InputPort[portNum];
}
Ports::InputTypedReturnPort* ActiveCommandsComponentBase ::
get_typedReturnSync_InputPort(FwIndexType portNum)
{
FW_ASSERT(
portNum < this->getNum_typedReturnSync_InputPorts(),
static_cast<FwAssertArgType>(portNum)
);
return &this->m_typedReturnSync_InputPort[portNum];
}
Ports::InputTypedPort* ActiveCommandsComponentBase ::
get_typedSync_InputPort(FwIndexType portNum)
{
FW_ASSERT(
portNum < this->getNum_typedSync_InputPorts(),
static_cast<FwAssertArgType>(portNum)
);
return &this->m_typedSync_InputPort[portNum];
}
// ----------------------------------------------------------------------
// Connect input ports to special output ports
// ----------------------------------------------------------------------
void ActiveCommandsComponentBase ::
set_cmdRegOut_OutputPort(
FwIndexType portNum,
Fw::InputCmdRegPort* port
)
{
FW_ASSERT(
portNum < this->getNum_cmdRegOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
this->m_cmdRegOut_OutputPort[portNum].addCallPort(port);
}
void ActiveCommandsComponentBase ::
set_cmdResponseOut_OutputPort(
FwIndexType portNum,
Fw::InputCmdResponsePort* port
)
{
FW_ASSERT(
portNum < this->getNum_cmdResponseOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
this->m_cmdResponseOut_OutputPort[portNum].addCallPort(port);
}
void ActiveCommandsComponentBase ::
set_eventOut_OutputPort(
FwIndexType portNum,
Fw::InputLogPort* port
)
{
FW_ASSERT(
portNum < this->getNum_eventOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
this->m_eventOut_OutputPort[portNum].addCallPort(port);
}
void ActiveCommandsComponentBase ::
set_prmGetOut_OutputPort(
FwIndexType portNum,
Fw::InputPrmGetPort* port
)
{
FW_ASSERT(
portNum < this->getNum_prmGetOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
this->m_prmGetOut_OutputPort[portNum].addCallPort(port);
}
void ActiveCommandsComponentBase ::
set_prmSetOut_OutputPort(
FwIndexType portNum,
Fw::InputPrmSetPort* port
)
{
FW_ASSERT(
portNum < this->getNum_prmSetOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
this->m_prmSetOut_OutputPort[portNum].addCallPort(port);
}
#if FW_ENABLE_TEXT_LOGGING == 1
void ActiveCommandsComponentBase ::
set_textEventOut_OutputPort(
FwIndexType portNum,
Fw::InputLogTextPort* port
)
{
FW_ASSERT(
portNum < this->getNum_textEventOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
this->m_textEventOut_OutputPort[portNum].addCallPort(port);
}
#endif
void ActiveCommandsComponentBase ::
set_timeGetOut_OutputPort(
FwIndexType portNum,
Fw::InputTimePort* port
)
{
FW_ASSERT(
portNum < this->getNum_timeGetOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
this->m_timeGetOut_OutputPort[portNum].addCallPort(port);
}
void ActiveCommandsComponentBase ::
set_tlmOut_OutputPort(
FwIndexType portNum,
Fw::InputTlmPort* port
)
{
FW_ASSERT(
portNum < this->getNum_tlmOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
this->m_tlmOut_OutputPort[portNum].addCallPort(port);
}
// ----------------------------------------------------------------------
// Connect typed input ports to typed output ports
// ----------------------------------------------------------------------
void ActiveCommandsComponentBase ::
set_noArgsOut_OutputPort(
FwIndexType portNum,
Ports::InputNoArgsPort* port
)
{
FW_ASSERT(
portNum < this->getNum_noArgsOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
this->m_noArgsOut_OutputPort[portNum].addCallPort(port);
}
void ActiveCommandsComponentBase ::
set_noArgsReturnOut_OutputPort(
FwIndexType portNum,
Ports::InputNoArgsReturnPort* port
)
{
FW_ASSERT(
portNum < this->getNum_noArgsReturnOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
this->m_noArgsReturnOut_OutputPort[portNum].addCallPort(port);
}
void ActiveCommandsComponentBase ::
set_typedOut_OutputPort(
FwIndexType portNum,
Ports::InputTypedPort* port
)
{
FW_ASSERT(
portNum < this->getNum_typedOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
this->m_typedOut_OutputPort[portNum].addCallPort(port);
}
void ActiveCommandsComponentBase ::
set_typedReturnOut_OutputPort(
FwIndexType portNum,
Ports::InputTypedReturnPort* port
)
{
FW_ASSERT(
portNum < this->getNum_typedReturnOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
this->m_typedReturnOut_OutputPort[portNum].addCallPort(port);
}
#if FW_PORT_SERIALIZATION
// ----------------------------------------------------------------------
// Connect serial input ports to special output ports
// ----------------------------------------------------------------------
void ActiveCommandsComponentBase ::
set_cmdRegOut_OutputPort(
FwIndexType portNum,
Fw::InputSerializePort* port
)
{
FW_ASSERT(
portNum < this->getNum_cmdRegOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
this->m_cmdRegOut_OutputPort[portNum].registerSerialPort(port);
}
void ActiveCommandsComponentBase ::
set_cmdResponseOut_OutputPort(
FwIndexType portNum,
Fw::InputSerializePort* port
)
{
FW_ASSERT(
portNum < this->getNum_cmdResponseOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
this->m_cmdResponseOut_OutputPort[portNum].registerSerialPort(port);
}
void ActiveCommandsComponentBase ::
set_eventOut_OutputPort(
FwIndexType portNum,
Fw::InputSerializePort* port
)
{
FW_ASSERT(
portNum < this->getNum_eventOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
this->m_eventOut_OutputPort[portNum].registerSerialPort(port);
}
void ActiveCommandsComponentBase ::
set_prmSetOut_OutputPort(
FwIndexType portNum,
Fw::InputSerializePort* port
)
{
FW_ASSERT(
portNum < this->getNum_prmSetOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
this->m_prmSetOut_OutputPort[portNum].registerSerialPort(port);
}
#if FW_ENABLE_TEXT_LOGGING == 1
void ActiveCommandsComponentBase ::
set_textEventOut_OutputPort(
FwIndexType portNum,
Fw::InputSerializePort* port
)
{
FW_ASSERT(
portNum < this->getNum_textEventOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
this->m_textEventOut_OutputPort[portNum].registerSerialPort(port);
}
#endif
void ActiveCommandsComponentBase ::
set_timeGetOut_OutputPort(
FwIndexType portNum,
Fw::InputSerializePort* port
)
{
FW_ASSERT(
portNum < this->getNum_timeGetOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
this->m_timeGetOut_OutputPort[portNum].registerSerialPort(port);
}
void ActiveCommandsComponentBase ::
set_tlmOut_OutputPort(
FwIndexType portNum,
Fw::InputSerializePort* port
)
{
FW_ASSERT(
portNum < this->getNum_tlmOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
this->m_tlmOut_OutputPort[portNum].registerSerialPort(port);
}
#endif
#if FW_PORT_SERIALIZATION
// ----------------------------------------------------------------------
// Connect serial input ports to typed output ports
// ----------------------------------------------------------------------
void ActiveCommandsComponentBase ::
set_noArgsOut_OutputPort(
FwIndexType portNum,
Fw::InputSerializePort* port
)
{
FW_ASSERT(
portNum < this->getNum_noArgsOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
this->m_noArgsOut_OutputPort[portNum].registerSerialPort(port);
}
void ActiveCommandsComponentBase ::
set_typedOut_OutputPort(
FwIndexType portNum,
Fw::InputSerializePort* port
)
{
FW_ASSERT(
portNum < this->getNum_typedOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
this->m_typedOut_OutputPort[portNum].registerSerialPort(port);
}
#endif
// ----------------------------------------------------------------------
// Command registration
// ----------------------------------------------------------------------
void ActiveCommandsComponentBase ::
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
);
this->m_cmdRegOut_OutputPort[0].invoke(
this->getIdBase() + OPCODE_CMD_ASYNC
);
this->m_cmdRegOut_OutputPort[0].invoke(
this->getIdBase() + OPCODE_CMD_PRIORITY
);
this->m_cmdRegOut_OutputPort[0].invoke(
this->getIdBase() + OPCODE_CMD_PARAMS_PRIORITY
);
this->m_cmdRegOut_OutputPort[0].invoke(
this->getIdBase() + OPCODE_CMD_DROP
);
this->m_cmdRegOut_OutputPort[0].invoke(
this->getIdBase() + OPCODE_CMD_PARAMS_PRIORITY_DROP
);
}
// ----------------------------------------------------------------------
// Component construction and destruction
// ----------------------------------------------------------------------
ActiveCommandsComponentBase ::
ActiveCommandsComponentBase(const char* compName) :
Fw::ActiveComponentBase(compName)
{
}
ActiveCommandsComponentBase ::
~ActiveCommandsComponentBase()
{
}
// ----------------------------------------------------------------------
// Getters for numbers of special input ports
// ----------------------------------------------------------------------
FwIndexType ActiveCommandsComponentBase ::
getNum_cmdIn_InputPorts() const
{
return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_cmdIn_InputPort));
}
// ----------------------------------------------------------------------
// Getters for numbers of typed input ports
// ----------------------------------------------------------------------
FwIndexType ActiveCommandsComponentBase ::
getNum_noArgsAsync_InputPorts() const
{
return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_noArgsAsync_InputPort));
}
FwIndexType ActiveCommandsComponentBase ::
getNum_noArgsGuarded_InputPorts() const
{
return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_noArgsGuarded_InputPort));
}
FwIndexType ActiveCommandsComponentBase ::
getNum_noArgsReturnGuarded_InputPorts() const
{
return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_noArgsReturnGuarded_InputPort));
}
FwIndexType ActiveCommandsComponentBase ::
getNum_noArgsReturnSync_InputPorts() const
{
return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_noArgsReturnSync_InputPort));
}
FwIndexType ActiveCommandsComponentBase ::
getNum_noArgsSync_InputPorts() const
{
return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_noArgsSync_InputPort));
}
FwIndexType ActiveCommandsComponentBase ::
getNum_typedAsync_InputPorts() const
{
return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_typedAsync_InputPort));
}
FwIndexType ActiveCommandsComponentBase ::
getNum_typedAsyncAssert_InputPorts() const
{
return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_typedAsyncAssert_InputPort));
}
FwIndexType ActiveCommandsComponentBase ::
getNum_typedAsyncBlockPriority_InputPorts() const
{
return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_typedAsyncBlockPriority_InputPort));
}
FwIndexType ActiveCommandsComponentBase ::
getNum_typedAsyncDropPriority_InputPorts() const
{
return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_typedAsyncDropPriority_InputPort));
}
FwIndexType ActiveCommandsComponentBase ::
getNum_typedGuarded_InputPorts() const
{
return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_typedGuarded_InputPort));
}
FwIndexType ActiveCommandsComponentBase ::
getNum_typedReturnGuarded_InputPorts() const
{
return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_typedReturnGuarded_InputPort));
}
FwIndexType ActiveCommandsComponentBase ::
getNum_typedReturnSync_InputPorts() const
{
return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_typedReturnSync_InputPort));
}
FwIndexType ActiveCommandsComponentBase ::
getNum_typedSync_InputPorts() const
{
return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_typedSync_InputPort));
}
// ----------------------------------------------------------------------
// Getters for numbers of special output ports
// ----------------------------------------------------------------------
FwIndexType ActiveCommandsComponentBase ::
getNum_cmdRegOut_OutputPorts() const
{
return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_cmdRegOut_OutputPort));
}
FwIndexType ActiveCommandsComponentBase ::
getNum_cmdResponseOut_OutputPorts() const
{
return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_cmdResponseOut_OutputPort));
}
FwIndexType ActiveCommandsComponentBase ::
getNum_eventOut_OutputPorts() const
{
return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_eventOut_OutputPort));
}
FwIndexType ActiveCommandsComponentBase ::
getNum_prmGetOut_OutputPorts() const
{
return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_prmGetOut_OutputPort));
}
FwIndexType ActiveCommandsComponentBase ::
getNum_prmSetOut_OutputPorts() const
{
return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_prmSetOut_OutputPort));
}
#if FW_ENABLE_TEXT_LOGGING == 1
FwIndexType ActiveCommandsComponentBase ::
getNum_textEventOut_OutputPorts() const
{
return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_textEventOut_OutputPort));
}
#endif
FwIndexType ActiveCommandsComponentBase ::
getNum_timeGetOut_OutputPorts() const
{
return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_timeGetOut_OutputPort));
}
FwIndexType ActiveCommandsComponentBase ::
getNum_tlmOut_OutputPorts() const
{
return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_tlmOut_OutputPort));
}
// ----------------------------------------------------------------------
// Getters for numbers of typed output ports
// ----------------------------------------------------------------------
FwIndexType ActiveCommandsComponentBase ::
getNum_noArgsOut_OutputPorts() const
{
return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_noArgsOut_OutputPort));
}
FwIndexType ActiveCommandsComponentBase ::
getNum_noArgsReturnOut_OutputPorts() const
{
return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_noArgsReturnOut_OutputPort));
}
FwIndexType ActiveCommandsComponentBase ::
getNum_typedOut_OutputPorts() const
{
return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_typedOut_OutputPort));
}
FwIndexType ActiveCommandsComponentBase ::
getNum_typedReturnOut_OutputPorts() const
{
return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_typedReturnOut_OutputPort));
}
// ----------------------------------------------------------------------
// Connection status queries for special output ports
// ----------------------------------------------------------------------
bool ActiveCommandsComponentBase ::
isConnected_cmdRegOut_OutputPort(FwIndexType portNum)
{
FW_ASSERT(
portNum < this->getNum_cmdRegOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
return this->m_cmdRegOut_OutputPort[portNum].isConnected();
}
bool ActiveCommandsComponentBase ::
isConnected_cmdResponseOut_OutputPort(FwIndexType portNum)
{
FW_ASSERT(
portNum < this->getNum_cmdResponseOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
return this->m_cmdResponseOut_OutputPort[portNum].isConnected();
}
bool ActiveCommandsComponentBase ::
isConnected_eventOut_OutputPort(FwIndexType portNum)
{
FW_ASSERT(
portNum < this->getNum_eventOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
return this->m_eventOut_OutputPort[portNum].isConnected();
}
bool ActiveCommandsComponentBase ::
isConnected_prmGetOut_OutputPort(FwIndexType portNum)
{
FW_ASSERT(
portNum < this->getNum_prmGetOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
return this->m_prmGetOut_OutputPort[portNum].isConnected();
}
bool ActiveCommandsComponentBase ::
isConnected_prmSetOut_OutputPort(FwIndexType portNum)
{
FW_ASSERT(
portNum < this->getNum_prmSetOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
return this->m_prmSetOut_OutputPort[portNum].isConnected();
}
#if FW_ENABLE_TEXT_LOGGING == 1
bool ActiveCommandsComponentBase ::
isConnected_textEventOut_OutputPort(FwIndexType portNum)
{
FW_ASSERT(
portNum < this->getNum_textEventOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
return this->m_textEventOut_OutputPort[portNum].isConnected();
}
#endif
bool ActiveCommandsComponentBase ::
isConnected_timeGetOut_OutputPort(FwIndexType portNum)
{
FW_ASSERT(
portNum < this->getNum_timeGetOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
return this->m_timeGetOut_OutputPort[portNum].isConnected();
}
bool ActiveCommandsComponentBase ::
isConnected_tlmOut_OutputPort(FwIndexType portNum)
{
FW_ASSERT(
portNum < this->getNum_tlmOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
return this->m_tlmOut_OutputPort[portNum].isConnected();
}
// ----------------------------------------------------------------------
// Connection status queries for typed output ports
// ----------------------------------------------------------------------
bool ActiveCommandsComponentBase ::
isConnected_noArgsOut_OutputPort(FwIndexType portNum)
{
FW_ASSERT(
portNum < this->getNum_noArgsOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
return this->m_noArgsOut_OutputPort[portNum].isConnected();
}
bool ActiveCommandsComponentBase ::
isConnected_noArgsReturnOut_OutputPort(FwIndexType portNum)
{
FW_ASSERT(
portNum < this->getNum_noArgsReturnOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
return this->m_noArgsReturnOut_OutputPort[portNum].isConnected();
}
bool ActiveCommandsComponentBase ::
isConnected_typedOut_OutputPort(FwIndexType portNum)
{
FW_ASSERT(
portNum < this->getNum_typedOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
return this->m_typedOut_OutputPort[portNum].isConnected();
}
bool ActiveCommandsComponentBase ::
isConnected_typedReturnOut_OutputPort(FwIndexType portNum)
{
FW_ASSERT(
portNum < this->getNum_typedReturnOut_OutputPorts(),
static_cast<FwAssertArgType>(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 ActiveCommandsComponentBase ::
noArgsAsync_handlerBase(FwIndexType portNum)
{
// Make sure port number is valid
FW_ASSERT(
portNum < this->getNum_noArgsAsync_InputPorts(),
static_cast<FwAssertArgType>(portNum)
);
// Call pre-message hook
noArgsAsync_preMsgHook(portNum);
ComponentIpcSerializableBuffer msg;
Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK;
// Serialize message ID
_status = msg.serialize(
static_cast<FwEnumStoreType>(NOARGSASYNC_NOARGS)
);
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Serialize port number
_status = msg.serialize(portNum);
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Send message
Os::Queue::QueueBlocking _block = Os::Queue::QUEUE_NONBLOCKING;
Os::Queue::QueueStatus qStatus = this->m_queue.send(msg, 0, _block);
FW_ASSERT(
qStatus == Os::Queue::QUEUE_OK,
static_cast<FwAssertArgType>(qStatus)
);
}
void ActiveCommandsComponentBase ::
noArgsGuarded_handlerBase(FwIndexType portNum)
{
// Make sure port number is valid
FW_ASSERT(
portNum < this->getNum_noArgsGuarded_InputPorts(),
static_cast<FwAssertArgType>(portNum)
);
// Lock guard mutex before calling
this->lock();
// Call handler function
this->noArgsGuarded_handler(portNum);
// Unlock guard mutex
this->unLock();
}
U32 ActiveCommandsComponentBase ::
noArgsReturnGuarded_handlerBase(FwIndexType portNum)
{
// Make sure port number is valid
FW_ASSERT(
portNum < this->getNum_noArgsReturnGuarded_InputPorts(),
static_cast<FwAssertArgType>(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 ActiveCommandsComponentBase ::
noArgsReturnSync_handlerBase(FwIndexType portNum)
{
// Make sure port number is valid
FW_ASSERT(
portNum < this->getNum_noArgsReturnSync_InputPorts(),
static_cast<FwAssertArgType>(portNum)
);
U32 retVal;
// Call handler function
retVal = this->noArgsReturnSync_handler(portNum);
return retVal;
}
void ActiveCommandsComponentBase ::
noArgsSync_handlerBase(FwIndexType portNum)
{
// Make sure port number is valid
FW_ASSERT(
portNum < this->getNum_noArgsSync_InputPorts(),
static_cast<FwAssertArgType>(portNum)
);
// Call handler function
this->noArgsSync_handler(portNum);
}
void ActiveCommandsComponentBase ::
typedAsync_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_typedAsync_InputPorts(),
static_cast<FwAssertArgType>(portNum)
);
// Call pre-message hook
typedAsync_preMsgHook(
portNum,
u32,
f32,
b,
str1,
e,
a,
s
);
ComponentIpcSerializableBuffer msg;
Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK;
// Serialize message ID
_status = msg.serialize(
static_cast<FwEnumStoreType>(TYPEDASYNC_TYPED)
);
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Serialize port number
_status = msg.serialize(portNum);
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Serialize argument u32
_status = msg.serialize(u32);
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Serialize argument f32
_status = msg.serialize(f32);
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Serialize argument b
_status = msg.serialize(b);
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Serialize argument str1
_status = msg.serialize(str1);
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Serialize argument e
_status = msg.serialize(e);
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Serialize argument a
_status = msg.serialize(a);
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Serialize argument s
_status = msg.serialize(s);
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Send message
Os::Queue::QueueBlocking _block = Os::Queue::QUEUE_NONBLOCKING;
Os::Queue::QueueStatus qStatus = this->m_queue.send(msg, 0, _block);
FW_ASSERT(
qStatus == Os::Queue::QUEUE_OK,
static_cast<FwAssertArgType>(qStatus)
);
}
void ActiveCommandsComponentBase ::
typedAsyncAssert_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_typedAsyncAssert_InputPorts(),
static_cast<FwAssertArgType>(portNum)
);
// Call pre-message hook
typedAsyncAssert_preMsgHook(
portNum,
u32,
f32,
b,
str1,
e,
a,
s
);
ComponentIpcSerializableBuffer msg;
Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK;
// Serialize message ID
_status = msg.serialize(
static_cast<FwEnumStoreType>(TYPEDASYNCASSERT_TYPED)
);
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Serialize port number
_status = msg.serialize(portNum);
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Serialize argument u32
_status = msg.serialize(u32);
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Serialize argument f32
_status = msg.serialize(f32);
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Serialize argument b
_status = msg.serialize(b);
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Serialize argument str1
_status = msg.serialize(str1);
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Serialize argument e
_status = msg.serialize(e);
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Serialize argument a
_status = msg.serialize(a);
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Serialize argument s
_status = msg.serialize(s);
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Send message
Os::Queue::QueueBlocking _block = Os::Queue::QUEUE_NONBLOCKING;
Os::Queue::QueueStatus qStatus = this->m_queue.send(msg, 0, _block);
FW_ASSERT(
qStatus == Os::Queue::QUEUE_OK,
static_cast<FwAssertArgType>(qStatus)
);
}
void ActiveCommandsComponentBase ::
typedAsyncBlockPriority_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_typedAsyncBlockPriority_InputPorts(),
static_cast<FwAssertArgType>(portNum)
);
// Call pre-message hook
typedAsyncBlockPriority_preMsgHook(
portNum,
u32,
f32,
b,
str1,
e,
a,
s
);
ComponentIpcSerializableBuffer msg;
Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK;
// Serialize message ID
_status = msg.serialize(
static_cast<FwEnumStoreType>(TYPEDASYNCBLOCKPRIORITY_TYPED)
);
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Serialize port number
_status = msg.serialize(portNum);
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Serialize argument u32
_status = msg.serialize(u32);
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Serialize argument f32
_status = msg.serialize(f32);
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Serialize argument b
_status = msg.serialize(b);
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Serialize argument str1
_status = msg.serialize(str1);
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Serialize argument e
_status = msg.serialize(e);
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Serialize argument a
_status = msg.serialize(a);
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Serialize argument s
_status = msg.serialize(s);
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Send message
Os::Queue::QueueBlocking _block = Os::Queue::QUEUE_BLOCKING;
Os::Queue::QueueStatus qStatus = this->m_queue.send(msg, 10, _block);
FW_ASSERT(
qStatus == Os::Queue::QUEUE_OK,
static_cast<FwAssertArgType>(qStatus)
);
}
void ActiveCommandsComponentBase ::
typedAsyncDropPriority_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_typedAsyncDropPriority_InputPorts(),
static_cast<FwAssertArgType>(portNum)
);
// Call pre-message hook
typedAsyncDropPriority_preMsgHook(
portNum,
u32,
f32,
b,
str1,
e,
a,
s
);
ComponentIpcSerializableBuffer msg;
Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK;
// Serialize message ID
_status = msg.serialize(
static_cast<FwEnumStoreType>(TYPEDASYNCDROPPRIORITY_TYPED)
);
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Serialize port number
_status = msg.serialize(portNum);
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Serialize argument u32
_status = msg.serialize(u32);
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Serialize argument f32
_status = msg.serialize(f32);
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Serialize argument b
_status = msg.serialize(b);
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Serialize argument str1
_status = msg.serialize(str1);
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Serialize argument e
_status = msg.serialize(e);
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Serialize argument a
_status = msg.serialize(a);
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Serialize argument s
_status = msg.serialize(s);
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Send message
Os::Queue::QueueBlocking _block = Os::Queue::QUEUE_NONBLOCKING;
Os::Queue::QueueStatus qStatus = this->m_queue.send(msg, 5, _block);
if (qStatus == Os::Queue::QUEUE_FULL) {
this->incNumMsgDropped();
return;
}
FW_ASSERT(
qStatus == Os::Queue::QUEUE_OK,
static_cast<FwAssertArgType>(qStatus)
);
}
void ActiveCommandsComponentBase ::
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<FwAssertArgType>(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 ActiveCommandsComponentBase ::
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<FwAssertArgType>(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 ActiveCommandsComponentBase ::
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<FwAssertArgType>(portNum)
);
F32 retVal;
// Call handler function
retVal = this->typedReturnSync_handler(
portNum,
u32,
f32,
b,
str2,
e,
a,
s
);
return retVal;
}
void ActiveCommandsComponentBase ::
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<FwAssertArgType>(portNum)
);
// Call handler function
this->typedSync_handler(
portNum,
u32,
f32,
b,
str1,
e,
a,
s
);
}
// ----------------------------------------------------------------------
// Pre-message hooks for typed async input ports
//
// Each of these functions is invoked just before processing a message
// on the corresponding port. By default, they do nothing. You can
// override them to provide specific pre-message behavior.
// ----------------------------------------------------------------------
void ActiveCommandsComponentBase ::
noArgsAsync_preMsgHook(FwIndexType portNum)
{
// Default: no-op
}
void ActiveCommandsComponentBase ::
typedAsync_preMsgHook(
FwIndexType portNum,
U32 u32,
F32 f32,
bool b,
const Ports::TypedPortStrings::StringSize80& str1,
const E& e,
const A& a,
const S& s
)
{
// Default: no-op
}
void ActiveCommandsComponentBase ::
typedAsyncAssert_preMsgHook(
FwIndexType portNum,
U32 u32,
F32 f32,
bool b,
const Ports::TypedPortStrings::StringSize80& str1,
const E& e,
const A& a,
const S& s
)
{
// Default: no-op
}
void ActiveCommandsComponentBase ::
typedAsyncBlockPriority_preMsgHook(
FwIndexType portNum,
U32 u32,
F32 f32,
bool b,
const Ports::TypedPortStrings::StringSize80& str1,
const E& e,
const A& a,
const S& s
)
{
// Default: no-op
}
void ActiveCommandsComponentBase ::
typedAsyncDropPriority_preMsgHook(
FwIndexType portNum,
U32 u32,
F32 f32,
bool b,
const Ports::TypedPortStrings::StringSize80& str1,
const E& e,
const A& a,
const S& s
)
{
// Default: no-op
}
// ----------------------------------------------------------------------
// Invocation functions for typed output ports
// ----------------------------------------------------------------------
void ActiveCommandsComponentBase ::
noArgsOut_out(FwIndexType portNum)
{
FW_ASSERT(
portNum < this->getNum_noArgsOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
this->m_noArgsOut_OutputPort[portNum].invoke();
}
U32 ActiveCommandsComponentBase ::
noArgsReturnOut_out(FwIndexType portNum)
{
FW_ASSERT(
portNum < this->getNum_noArgsReturnOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
return this->m_noArgsReturnOut_OutputPort[portNum].invoke();
}
void ActiveCommandsComponentBase ::
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<FwAssertArgType>(portNum)
);
this->m_typedOut_OutputPort[portNum].invoke(
u32,
f32,
b,
str1,
e,
a,
s
);
}
F32 ActiveCommandsComponentBase ::
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<FwAssertArgType>(portNum)
);
return this->m_typedReturnOut_OutputPort[portNum].invoke(
u32,
f32,
b,
str2,
e,
a,
s
);
}
// ----------------------------------------------------------------------
// Command response
// ----------------------------------------------------------------------
void ActiveCommandsComponentBase ::
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 ActiveCommandsComponentBase ::
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 ActiveCommandsComponentBase ::
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 ActiveCommandsComponentBase ::
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 ActiveCommandsComponentBase ::
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 ActiveCommandsComponentBase ::
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 ActiveCommandsComponentBase ::
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 ActiveCommandsComponentBase ::
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 ActiveCommandsComponentBase ::
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 ActiveCommandsComponentBase ::
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 ActiveCommandsComponentBase ::
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 ActiveCommandsComponentBase ::
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 ActiveCommandsComponentBase ::
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();
}
void ActiveCommandsComponentBase ::
CMD_ASYNC_cmdHandlerBase(
FwOpcodeType opCode,
U32 cmdSeq,
Fw::CmdArgBuffer& args
)
{
// Call pre-message hook
this->CMD_ASYNC_preMsgHook(opCode,cmdSeq);
// Defer deserializing arguments to the message dispatcher
// to avoid deserializing and reserializing just for IPC
ComponentIpcSerializableBuffer msg;
Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK;
// Serialize for IPC
_status = msg.serialize(static_cast<FwEnumStoreType>(CMD_CMD_ASYNC));
FW_ASSERT (
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Fake port number to make message dequeue work
FwIndexType port = 0;
_status = msg.serialize(port);
FW_ASSERT (
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
_status = msg.serialize(opCode);
FW_ASSERT (
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
_status = msg.serialize(cmdSeq);
FW_ASSERT (
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
_status = msg.serialize(args);
FW_ASSERT (
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Send message
Os::Queue::QueueBlocking _block = Os::Queue::QUEUE_NONBLOCKING;
Os::Queue::QueueStatus qStatus = this->m_queue.send(msg, 0, _block);
FW_ASSERT(
qStatus == Os::Queue::QUEUE_OK,
static_cast<FwAssertArgType>(qStatus)
);
}
void ActiveCommandsComponentBase ::
CMD_PRIORITY_cmdHandlerBase(
FwOpcodeType opCode,
U32 cmdSeq,
Fw::CmdArgBuffer& args
)
{
// Call pre-message hook
this->CMD_PRIORITY_preMsgHook(opCode,cmdSeq);
// Defer deserializing arguments to the message dispatcher
// to avoid deserializing and reserializing just for IPC
ComponentIpcSerializableBuffer msg;
Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK;
// Serialize for IPC
_status = msg.serialize(static_cast<FwEnumStoreType>(CMD_CMD_PRIORITY));
FW_ASSERT (
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Fake port number to make message dequeue work
FwIndexType port = 0;
_status = msg.serialize(port);
FW_ASSERT (
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
_status = msg.serialize(opCode);
FW_ASSERT (
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
_status = msg.serialize(cmdSeq);
FW_ASSERT (
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
_status = msg.serialize(args);
FW_ASSERT (
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Send message
Os::Queue::QueueBlocking _block = Os::Queue::QUEUE_NONBLOCKING;
Os::Queue::QueueStatus qStatus = this->m_queue.send(msg, 10, _block);
FW_ASSERT(
qStatus == Os::Queue::QUEUE_OK,
static_cast<FwAssertArgType>(qStatus)
);
}
void ActiveCommandsComponentBase ::
CMD_PARAMS_PRIORITY_cmdHandlerBase(
FwOpcodeType opCode,
U32 cmdSeq,
Fw::CmdArgBuffer& args
)
{
// Call pre-message hook
this->CMD_PARAMS_PRIORITY_preMsgHook(opCode,cmdSeq);
// Defer deserializing arguments to the message dispatcher
// to avoid deserializing and reserializing just for IPC
ComponentIpcSerializableBuffer msg;
Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK;
// Serialize for IPC
_status = msg.serialize(static_cast<FwEnumStoreType>(CMD_CMD_PARAMS_PRIORITY));
FW_ASSERT (
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Fake port number to make message dequeue work
FwIndexType port = 0;
_status = msg.serialize(port);
FW_ASSERT (
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
_status = msg.serialize(opCode);
FW_ASSERT (
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
_status = msg.serialize(cmdSeq);
FW_ASSERT (
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
_status = msg.serialize(args);
FW_ASSERT (
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Send message
Os::Queue::QueueBlocking _block = Os::Queue::QUEUE_NONBLOCKING;
Os::Queue::QueueStatus qStatus = this->m_queue.send(msg, 20, _block);
FW_ASSERT(
qStatus == Os::Queue::QUEUE_OK,
static_cast<FwAssertArgType>(qStatus)
);
}
void ActiveCommandsComponentBase ::
CMD_DROP_cmdHandlerBase(
FwOpcodeType opCode,
U32 cmdSeq,
Fw::CmdArgBuffer& args
)
{
// Call pre-message hook
this->CMD_DROP_preMsgHook(opCode,cmdSeq);
// Defer deserializing arguments to the message dispatcher
// to avoid deserializing and reserializing just for IPC
ComponentIpcSerializableBuffer msg;
Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK;
// Serialize for IPC
_status = msg.serialize(static_cast<FwEnumStoreType>(CMD_CMD_DROP));
FW_ASSERT (
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Fake port number to make message dequeue work
FwIndexType port = 0;
_status = msg.serialize(port);
FW_ASSERT (
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
_status = msg.serialize(opCode);
FW_ASSERT (
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
_status = msg.serialize(cmdSeq);
FW_ASSERT (
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
_status = msg.serialize(args);
FW_ASSERT (
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Send message
Os::Queue::QueueBlocking _block = Os::Queue::QUEUE_NONBLOCKING;
Os::Queue::QueueStatus qStatus = this->m_queue.send(msg, 0, _block);
if (qStatus == Os::Queue::QUEUE_FULL) {
this->incNumMsgDropped();
return;
}
FW_ASSERT(
qStatus == Os::Queue::QUEUE_OK,
static_cast<FwAssertArgType>(qStatus)
);
}
void ActiveCommandsComponentBase ::
CMD_PARAMS_PRIORITY_DROP_cmdHandlerBase(
FwOpcodeType opCode,
U32 cmdSeq,
Fw::CmdArgBuffer& args
)
{
// Call pre-message hook
this->CMD_PARAMS_PRIORITY_DROP_preMsgHook(opCode,cmdSeq);
// Defer deserializing arguments to the message dispatcher
// to avoid deserializing and reserializing just for IPC
ComponentIpcSerializableBuffer msg;
Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK;
// Serialize for IPC
_status = msg.serialize(static_cast<FwEnumStoreType>(CMD_CMD_PARAMS_PRIORITY_DROP));
FW_ASSERT (
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Fake port number to make message dequeue work
FwIndexType port = 0;
_status = msg.serialize(port);
FW_ASSERT (
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
_status = msg.serialize(opCode);
FW_ASSERT (
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
_status = msg.serialize(cmdSeq);
FW_ASSERT (
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
_status = msg.serialize(args);
FW_ASSERT (
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Send message
Os::Queue::QueueBlocking _block = Os::Queue::QUEUE_NONBLOCKING;
Os::Queue::QueueStatus qStatus = this->m_queue.send(msg, 30, _block);
if (qStatus == Os::Queue::QUEUE_FULL) {
this->incNumMsgDropped();
return;
}
FW_ASSERT(
qStatus == Os::Queue::QUEUE_OK,
static_cast<FwAssertArgType>(qStatus)
);
}
// ----------------------------------------------------------------------
// Pre-message hooks for async commands
//
// Each of these functions is invoked just before processing the
// corresponding command. By default they do nothing. You can
// override them to provide specific pre-command behavior.
// ----------------------------------------------------------------------
void ActiveCommandsComponentBase ::
CMD_ASYNC_preMsgHook(
FwOpcodeType opCode,
U32 cmdSeq
)
{
// Defaults to no-op; can be overridden
(void) opCode;
(void) cmdSeq;
}
void ActiveCommandsComponentBase ::
CMD_PRIORITY_preMsgHook(
FwOpcodeType opCode,
U32 cmdSeq
)
{
// Defaults to no-op; can be overridden
(void) opCode;
(void) cmdSeq;
}
void ActiveCommandsComponentBase ::
CMD_PARAMS_PRIORITY_preMsgHook(
FwOpcodeType opCode,
U32 cmdSeq
)
{
// Defaults to no-op; can be overridden
(void) opCode;
(void) cmdSeq;
}
void ActiveCommandsComponentBase ::
CMD_DROP_preMsgHook(
FwOpcodeType opCode,
U32 cmdSeq
)
{
// Defaults to no-op; can be overridden
(void) opCode;
(void) cmdSeq;
}
void ActiveCommandsComponentBase ::
CMD_PARAMS_PRIORITY_DROP_preMsgHook(
FwOpcodeType opCode,
U32 cmdSeq
)
{
// Defaults to no-op; can be overridden
(void) opCode;
(void) cmdSeq;
}
// ----------------------------------------------------------------------
// Time
// ----------------------------------------------------------------------
Fw::Time ActiveCommandsComponentBase ::
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 ActiveCommandsComponentBase ::
lock()
{
this->m_guardedPortMutex.lock();
}
void ActiveCommandsComponentBase ::
unLock()
{
this->m_guardedPortMutex.unLock();
}
// ----------------------------------------------------------------------
// Message dispatch functions
// ----------------------------------------------------------------------
Fw::QueuedComponentBase::MsgDispatchStatus ActiveCommandsComponentBase ::
doDispatch()
{
ComponentIpcSerializableBuffer msg;
FwQueuePriorityType priority = 0;
Os::Queue::QueueStatus msgStatus = this->m_queue.receive(
msg,
priority,
Os::Queue::QUEUE_BLOCKING
);
FW_ASSERT(
msgStatus == Os::Queue::QUEUE_OK,
static_cast<FwAssertArgType>(msgStatus)
);
// Reset to beginning of buffer
msg.resetDeser();
FwEnumStoreType desMsg = 0;
Fw::SerializeStatus deserStatus = msg.deserialize(desMsg);
FW_ASSERT(
deserStatus == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(deserStatus)
);
MsgTypeEnum msgType = static_cast<MsgTypeEnum>(desMsg);
if (msgType == ACTIVECOMMANDS_COMPONENT_EXIT) {
return MSG_DISPATCH_EXIT;
}
FwIndexType portNum = 0;
deserStatus = msg.deserialize(portNum);
FW_ASSERT(
deserStatus == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(deserStatus)
);
switch (msgType) {
// Handle async input port noArgsAsync
case NOARGSASYNC_NOARGS: {
// Call handler function
this->noArgsAsync_handler(portNum);
break;
}
// Handle async input port typedAsync
case TYPEDASYNC_TYPED: {
// Deserialize argument u32
U32 u32;
deserStatus = msg.deserialize(u32);
FW_ASSERT(
deserStatus == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(deserStatus)
);
// Deserialize argument f32
F32 f32;
deserStatus = msg.deserialize(f32);
FW_ASSERT(
deserStatus == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(deserStatus)
);
// Deserialize argument b
bool b;
deserStatus = msg.deserialize(b);
FW_ASSERT(
deserStatus == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(deserStatus)
);
// Deserialize argument str1
Ports::TypedPortStrings::StringSize80 str1;
deserStatus = msg.deserialize(str1);
FW_ASSERT(
deserStatus == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(deserStatus)
);
// Deserialize argument e
E e;
deserStatus = msg.deserialize(e);
FW_ASSERT(
deserStatus == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(deserStatus)
);
// Deserialize argument a
A a;
deserStatus = msg.deserialize(a);
FW_ASSERT(
deserStatus == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(deserStatus)
);
// Deserialize argument s
S s;
deserStatus = msg.deserialize(s);
FW_ASSERT(
deserStatus == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(deserStatus)
);
// Call handler function
this->typedAsync_handler(
portNum,
u32,
f32,
b,
str1,
e,
a,
s
);
break;
}
// Handle async input port typedAsyncAssert
case TYPEDASYNCASSERT_TYPED: {
// Deserialize argument u32
U32 u32;
deserStatus = msg.deserialize(u32);
FW_ASSERT(
deserStatus == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(deserStatus)
);
// Deserialize argument f32
F32 f32;
deserStatus = msg.deserialize(f32);
FW_ASSERT(
deserStatus == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(deserStatus)
);
// Deserialize argument b
bool b;
deserStatus = msg.deserialize(b);
FW_ASSERT(
deserStatus == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(deserStatus)
);
// Deserialize argument str1
Ports::TypedPortStrings::StringSize80 str1;
deserStatus = msg.deserialize(str1);
FW_ASSERT(
deserStatus == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(deserStatus)
);
// Deserialize argument e
E e;
deserStatus = msg.deserialize(e);
FW_ASSERT(
deserStatus == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(deserStatus)
);
// Deserialize argument a
A a;
deserStatus = msg.deserialize(a);
FW_ASSERT(
deserStatus == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(deserStatus)
);
// Deserialize argument s
S s;
deserStatus = msg.deserialize(s);
FW_ASSERT(
deserStatus == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(deserStatus)
);
// Call handler function
this->typedAsyncAssert_handler(
portNum,
u32,
f32,
b,
str1,
e,
a,
s
);
break;
}
// Handle async input port typedAsyncBlockPriority
case TYPEDASYNCBLOCKPRIORITY_TYPED: {
// Deserialize argument u32
U32 u32;
deserStatus = msg.deserialize(u32);
FW_ASSERT(
deserStatus == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(deserStatus)
);
// Deserialize argument f32
F32 f32;
deserStatus = msg.deserialize(f32);
FW_ASSERT(
deserStatus == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(deserStatus)
);
// Deserialize argument b
bool b;
deserStatus = msg.deserialize(b);
FW_ASSERT(
deserStatus == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(deserStatus)
);
// Deserialize argument str1
Ports::TypedPortStrings::StringSize80 str1;
deserStatus = msg.deserialize(str1);
FW_ASSERT(
deserStatus == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(deserStatus)
);
// Deserialize argument e
E e;
deserStatus = msg.deserialize(e);
FW_ASSERT(
deserStatus == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(deserStatus)
);
// Deserialize argument a
A a;
deserStatus = msg.deserialize(a);
FW_ASSERT(
deserStatus == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(deserStatus)
);
// Deserialize argument s
S s;
deserStatus = msg.deserialize(s);
FW_ASSERT(
deserStatus == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(deserStatus)
);
// Call handler function
this->typedAsyncBlockPriority_handler(
portNum,
u32,
f32,
b,
str1,
e,
a,
s
);
break;
}
// Handle async input port typedAsyncDropPriority
case TYPEDASYNCDROPPRIORITY_TYPED: {
// Deserialize argument u32
U32 u32;
deserStatus = msg.deserialize(u32);
FW_ASSERT(
deserStatus == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(deserStatus)
);
// Deserialize argument f32
F32 f32;
deserStatus = msg.deserialize(f32);
FW_ASSERT(
deserStatus == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(deserStatus)
);
// Deserialize argument b
bool b;
deserStatus = msg.deserialize(b);
FW_ASSERT(
deserStatus == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(deserStatus)
);
// Deserialize argument str1
Ports::TypedPortStrings::StringSize80 str1;
deserStatus = msg.deserialize(str1);
FW_ASSERT(
deserStatus == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(deserStatus)
);
// Deserialize argument e
E e;
deserStatus = msg.deserialize(e);
FW_ASSERT(
deserStatus == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(deserStatus)
);
// Deserialize argument a
A a;
deserStatus = msg.deserialize(a);
FW_ASSERT(
deserStatus == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(deserStatus)
);
// Deserialize argument s
S s;
deserStatus = msg.deserialize(s);
FW_ASSERT(
deserStatus == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(deserStatus)
);
// Call handler function
this->typedAsyncDropPriority_handler(
portNum,
u32,
f32,
b,
str1,
e,
a,
s
);
break;
}
// Handle command CMD_ASYNC
case CMD_CMD_ASYNC: {
// Deserialize opcode
FwOpcodeType opCode = 0;
deserStatus = msg.deserialize(opCode);
FW_ASSERT (
deserStatus == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(deserStatus)
);
// Deserialize command sequence
U32 cmdSeq = 0;
deserStatus = msg.deserialize(cmdSeq);
FW_ASSERT (
deserStatus == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(deserStatus)
);
// Deserialize command argument buffer
Fw::CmdArgBuffer args;
deserStatus = msg.deserialize(args);
FW_ASSERT (
deserStatus == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(deserStatus)
);
// Reset buffer
args.resetDeser();
// Make sure there was no data left over.
// That means the argument buffer size was incorrect.
#if FW_CMD_CHECK_RESIDUAL
if (args.getBuffLeft() != 0) {
if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
}
// Don't crash the task if bad arguments were passed from the ground
break;
}
#endif
// Call handler function
this->CMD_ASYNC_cmdHandler(opCode, cmdSeq);
break;
}
// Handle command CMD_PRIORITY
case CMD_CMD_PRIORITY: {
// Deserialize opcode
FwOpcodeType opCode = 0;
deserStatus = msg.deserialize(opCode);
FW_ASSERT (
deserStatus == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(deserStatus)
);
// Deserialize command sequence
U32 cmdSeq = 0;
deserStatus = msg.deserialize(cmdSeq);
FW_ASSERT (
deserStatus == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(deserStatus)
);
// Deserialize command argument buffer
Fw::CmdArgBuffer args;
deserStatus = msg.deserialize(args);
FW_ASSERT (
deserStatus == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(deserStatus)
);
// Reset buffer
args.resetDeser();
// Make sure there was no data left over.
// That means the argument buffer size was incorrect.
#if FW_CMD_CHECK_RESIDUAL
if (args.getBuffLeft() != 0) {
if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
}
// Don't crash the task if bad arguments were passed from the ground
break;
}
#endif
// Call handler function
this->CMD_PRIORITY_cmdHandler(opCode, cmdSeq);
break;
}
// Handle command CMD_PARAMS_PRIORITY
case CMD_CMD_PARAMS_PRIORITY: {
// Deserialize opcode
FwOpcodeType opCode = 0;
deserStatus = msg.deserialize(opCode);
FW_ASSERT (
deserStatus == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(deserStatus)
);
// Deserialize command sequence
U32 cmdSeq = 0;
deserStatus = msg.deserialize(cmdSeq);
FW_ASSERT (
deserStatus == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(deserStatus)
);
// Deserialize command argument buffer
Fw::CmdArgBuffer args;
deserStatus = msg.deserialize(args);
FW_ASSERT (
deserStatus == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(deserStatus)
);
// Reset buffer
args.resetDeser();
// Deserialize argument u32
U32 u32;
deserStatus = args.deserialize(u32);
if (deserStatus != Fw::FW_SERIALIZE_OK) {
if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
this->cmdResponse_out(
opCode,
cmdSeq,
Fw::CmdResponse::FORMAT_ERROR
);
}
// Don't crash the task if bad arguments were passed from the ground
break;
}
// Make sure there was no data left over.
// That means the argument buffer size was incorrect.
#if FW_CMD_CHECK_RESIDUAL
if (args.getBuffLeft() != 0) {
if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
}
// Don't crash the task if bad arguments were passed from the ground
break;
}
#endif
// Call handler function
this->CMD_PARAMS_PRIORITY_cmdHandler(
opCode, cmdSeq,
u32
);
break;
}
// Handle command CMD_DROP
case CMD_CMD_DROP: {
// Deserialize opcode
FwOpcodeType opCode = 0;
deserStatus = msg.deserialize(opCode);
FW_ASSERT (
deserStatus == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(deserStatus)
);
// Deserialize command sequence
U32 cmdSeq = 0;
deserStatus = msg.deserialize(cmdSeq);
FW_ASSERT (
deserStatus == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(deserStatus)
);
// Deserialize command argument buffer
Fw::CmdArgBuffer args;
deserStatus = msg.deserialize(args);
FW_ASSERT (
deserStatus == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(deserStatus)
);
// Reset buffer
args.resetDeser();
// Make sure there was no data left over.
// That means the argument buffer size was incorrect.
#if FW_CMD_CHECK_RESIDUAL
if (args.getBuffLeft() != 0) {
if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
}
// Don't crash the task if bad arguments were passed from the ground
break;
}
#endif
// Call handler function
this->CMD_DROP_cmdHandler(opCode, cmdSeq);
break;
}
// Handle command CMD_PARAMS_PRIORITY_DROP
case CMD_CMD_PARAMS_PRIORITY_DROP: {
// Deserialize opcode
FwOpcodeType opCode = 0;
deserStatus = msg.deserialize(opCode);
FW_ASSERT (
deserStatus == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(deserStatus)
);
// Deserialize command sequence
U32 cmdSeq = 0;
deserStatus = msg.deserialize(cmdSeq);
FW_ASSERT (
deserStatus == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(deserStatus)
);
// Deserialize command argument buffer
Fw::CmdArgBuffer args;
deserStatus = msg.deserialize(args);
FW_ASSERT (
deserStatus == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(deserStatus)
);
// Reset buffer
args.resetDeser();
// Deserialize argument u32
U32 u32;
deserStatus = args.deserialize(u32);
if (deserStatus != Fw::FW_SERIALIZE_OK) {
if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
this->cmdResponse_out(
opCode,
cmdSeq,
Fw::CmdResponse::FORMAT_ERROR
);
}
// Don't crash the task if bad arguments were passed from the ground
break;
}
// Make sure there was no data left over.
// That means the argument buffer size was incorrect.
#if FW_CMD_CHECK_RESIDUAL
if (args.getBuffLeft() != 0) {
if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
}
// Don't crash the task if bad arguments were passed from the ground
break;
}
#endif
// Call handler function
this->CMD_PARAMS_PRIORITY_DROP_cmdHandler(
opCode, cmdSeq,
u32
);
break;
}
default:
return MSG_DISPATCH_ERROR;
}
return MSG_DISPATCH_OK;
}
// ----------------------------------------------------------------------
// Calls for messages received on special input ports
// ----------------------------------------------------------------------
void ActiveCommandsComponentBase ::
m_p_cmdIn_in(
Fw::PassiveComponentBase* callComp,
FwIndexType portNum,
FwOpcodeType opCode,
U32 cmdSeq,
Fw::CmdArgBuffer& args
)
{
FW_ASSERT(callComp);
ActiveCommandsComponentBase* compPtr = static_cast<ActiveCommandsComponentBase*>(callComp);
const U32 idBase = callComp->getIdBase();
FW_ASSERT(opCode >= idBase, static_cast<FwAssertArgType>(opCode), static_cast<FwAssertArgType>(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;
}
case OPCODE_CMD_ASYNC: {
compPtr->CMD_ASYNC_cmdHandlerBase(
opCode,
cmdSeq,
args
);
break;
}
case OPCODE_CMD_PRIORITY: {
compPtr->CMD_PRIORITY_cmdHandlerBase(
opCode,
cmdSeq,
args
);
break;
}
case OPCODE_CMD_PARAMS_PRIORITY: {
compPtr->CMD_PARAMS_PRIORITY_cmdHandlerBase(
opCode,
cmdSeq,
args
);
break;
}
case OPCODE_CMD_DROP: {
compPtr->CMD_DROP_cmdHandlerBase(
opCode,
cmdSeq,
args
);
break;
}
case OPCODE_CMD_PARAMS_PRIORITY_DROP: {
compPtr->CMD_PARAMS_PRIORITY_DROP_cmdHandlerBase(
opCode,
cmdSeq,
args
);
break;
}
}
}
// ----------------------------------------------------------------------
// Calls for messages received on typed input ports
// ----------------------------------------------------------------------
void ActiveCommandsComponentBase ::
m_p_noArgsAsync_in(
Fw::PassiveComponentBase* callComp,
FwIndexType portNum
)
{
FW_ASSERT(callComp);
ActiveCommandsComponentBase* compPtr = static_cast<ActiveCommandsComponentBase*>(callComp);
compPtr->noArgsAsync_handlerBase(portNum);
}
void ActiveCommandsComponentBase ::
m_p_noArgsGuarded_in(
Fw::PassiveComponentBase* callComp,
FwIndexType portNum
)
{
FW_ASSERT(callComp);
ActiveCommandsComponentBase* compPtr = static_cast<ActiveCommandsComponentBase*>(callComp);
compPtr->noArgsGuarded_handlerBase(portNum);
}
U32 ActiveCommandsComponentBase ::
m_p_noArgsReturnGuarded_in(
Fw::PassiveComponentBase* callComp,
FwIndexType portNum
)
{
FW_ASSERT(callComp);
ActiveCommandsComponentBase* compPtr = static_cast<ActiveCommandsComponentBase*>(callComp);
return compPtr->noArgsReturnGuarded_handlerBase(portNum);
}
U32 ActiveCommandsComponentBase ::
m_p_noArgsReturnSync_in(
Fw::PassiveComponentBase* callComp,
FwIndexType portNum
)
{
FW_ASSERT(callComp);
ActiveCommandsComponentBase* compPtr = static_cast<ActiveCommandsComponentBase*>(callComp);
return compPtr->noArgsReturnSync_handlerBase(portNum);
}
void ActiveCommandsComponentBase ::
m_p_noArgsSync_in(
Fw::PassiveComponentBase* callComp,
FwIndexType portNum
)
{
FW_ASSERT(callComp);
ActiveCommandsComponentBase* compPtr = static_cast<ActiveCommandsComponentBase*>(callComp);
compPtr->noArgsSync_handlerBase(portNum);
}
void ActiveCommandsComponentBase ::
m_p_typedAsync_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);
ActiveCommandsComponentBase* compPtr = static_cast<ActiveCommandsComponentBase*>(callComp);
compPtr->typedAsync_handlerBase(
portNum,
u32,
f32,
b,
str1,
e,
a,
s
);
}
void ActiveCommandsComponentBase ::
m_p_typedAsyncAssert_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);
ActiveCommandsComponentBase* compPtr = static_cast<ActiveCommandsComponentBase*>(callComp);
compPtr->typedAsyncAssert_handlerBase(
portNum,
u32,
f32,
b,
str1,
e,
a,
s
);
}
void ActiveCommandsComponentBase ::
m_p_typedAsyncBlockPriority_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);
ActiveCommandsComponentBase* compPtr = static_cast<ActiveCommandsComponentBase*>(callComp);
compPtr->typedAsyncBlockPriority_handlerBase(
portNum,
u32,
f32,
b,
str1,
e,
a,
s
);
}
void ActiveCommandsComponentBase ::
m_p_typedAsyncDropPriority_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);
ActiveCommandsComponentBase* compPtr = static_cast<ActiveCommandsComponentBase*>(callComp);
compPtr->typedAsyncDropPriority_handlerBase(
portNum,
u32,
f32,
b,
str1,
e,
a,
s
);
}
void ActiveCommandsComponentBase ::
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);
ActiveCommandsComponentBase* compPtr = static_cast<ActiveCommandsComponentBase*>(callComp);
compPtr->typedGuarded_handlerBase(
portNum,
u32,
f32,
b,
str1,
e,
a,
s
);
}
F32 ActiveCommandsComponentBase ::
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);
ActiveCommandsComponentBase* compPtr = static_cast<ActiveCommandsComponentBase*>(callComp);
return compPtr->typedReturnGuarded_handlerBase(
portNum,
u32,
f32,
b,
str2,
e,
a,
s
);
}
F32 ActiveCommandsComponentBase ::
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);
ActiveCommandsComponentBase* compPtr = static_cast<ActiveCommandsComponentBase*>(callComp);
return compPtr->typedReturnSync_handlerBase(
portNum,
u32,
f32,
b,
str2,
e,
a,
s
);
}
void ActiveCommandsComponentBase ::
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);
ActiveCommandsComponentBase* compPtr = static_cast<ActiveCommandsComponentBase*>(callComp);
compPtr->typedSync_handlerBase(
portNum,
u32,
f32,
b,
str1,
e,
a,
s
);
}