fpp/compiler/tools/fpp-to-cpp/test/component/base/ActiveSerialComponentAc.ref.cpp
Robert L. Bocchino Jr b83a9fd7a7 Revise port name array
This change fixes a warning that can occur with -Wpedantic enabled
2024-01-18 01:19:02 -08:00

7892 lines
196 KiB
C++

// ======================================================================
// \title ActiveSerialComponentAc.cpp
// \author Generated by fpp-to-cpp
// \brief cpp file for ActiveSerial component base class
// ======================================================================
#include <cstdio>
#include "Fw/Types/Assert.hpp"
#if FW_ENABLE_TEXT_LOGGING
#include "Fw/Types/String.hpp"
#endif
#include "base/ActiveSerialComponentAc.hpp"
namespace {
enum MsgTypeEnum {
ACTIVESERIAL_COMPONENT_EXIT = Fw::ActiveComponentBase::ACTIVE_COMPONENT_EXIT,
NOARGSASYNC_NOARGS,
TYPEDASYNC_TYPED,
TYPEDASYNCASSERT_TYPED,
TYPEDASYNCBLOCKPRIORITY_TYPED,
TYPEDASYNCDROPPRIORITY_TYPED,
SERIALASYNC_SERIAL,
SERIALASYNCASSERT_SERIAL,
SERIALASYNCBLOCKPRIORITY_SERIAL,
SERIALASYNCDROPPRIORITY_SERIAL,
CMD_CMD_ASYNC,
CMD_CMD_PRIORITY,
CMD_CMD_PARAMS_PRIORITY,
CMD_CMD_DROP,
CMD_CMD_PARAMS_PRIORITY_DROP,
INT_IF_INTERNALARRAY,
INT_IF_INTERNALENUM,
INT_IF_INTERNALPRIMITIVE,
INT_IF_INTERNALPRIORITYDROP,
INT_IF_INTERNALSTRING,
INT_IF_INTERNALSTRUCT,
};
// Get the max size by constructing a union of the async input, command, and
// internal port serialization sizes
union BuffUnion {
BYTE noArgsAsyncPortSize[Ports::InputNoArgsPort::SERIALIZED_SIZE];
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];
// Size of internalArray argument list
BYTE internalArrayIntIfSize[
A::SERIALIZED_SIZE
];
// Size of internalEnum argument list
BYTE internalEnumIntIfSize[
E::SERIALIZED_SIZE
];
// Size of internalPrimitive argument list
BYTE internalPrimitiveIntIfSize[
sizeof(U32) +
sizeof(F32) +
sizeof(U8)
];
// Size of internalPriorityDrop argument list
// [ no port arguments ]
// Size of internalString argument list
BYTE internalStringIntIfSize[
Fw::InternalInterfaceString::SERIALIZED_SIZE +
Fw::InternalInterfaceString::SERIALIZED_SIZE
];
// Size of internalStruct argument list
BYTE internalStructIntIfSize[
S::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(NATIVE_INT_TYPE) +
sizeof(NATIVE_INT_TYPE)
};
NATIVE_UINT_TYPE 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 ActiveSerialComponentBase ::
init(
NATIVE_INT_TYPE queueDepth,
NATIVE_INT_TYPE msgSize,
NATIVE_INT_TYPE instance
)
{
// Initialize base class
Fw::ActiveComponentBase::init(instance);
// Connect input port cmdIn
for (
PlatformIntType port = 0;
port < static_cast<PlatformIntType>(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
// The port name consists of this->m_objName and some extra info.
// We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes.
// However, the compiler may assume that this->m_objName fills
// the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to
// avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE
// bytes to cover the extra info.
char portName[2*FW_OBJ_NAME_MAX_SIZE];
(void) snprintf(
portName,
sizeof(portName),
"%s_cmdIn_InputPort[%" PRI_PlatformIntType "]",
this->m_objName,
port
);
this->m_cmdIn_InputPort[port].setObjName(portName);
#endif
}
// Connect input port noArgsAsync
for (
PlatformIntType port = 0;
port < static_cast<PlatformIntType>(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
// The port name consists of this->m_objName and some extra info.
// We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes.
// However, the compiler may assume that this->m_objName fills
// the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to
// avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE
// bytes to cover the extra info.
char portName[2*FW_OBJ_NAME_MAX_SIZE];
(void) snprintf(
portName,
sizeof(portName),
"%s_noArgsAsync_InputPort[%" PRI_PlatformIntType "]",
this->m_objName,
port
);
this->m_noArgsAsync_InputPort[port].setObjName(portName);
#endif
}
// Connect input port noArgsGuarded
for (
PlatformIntType port = 0;
port < static_cast<PlatformIntType>(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
// The port name consists of this->m_objName and some extra info.
// We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes.
// However, the compiler may assume that this->m_objName fills
// the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to
// avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE
// bytes to cover the extra info.
char portName[2*FW_OBJ_NAME_MAX_SIZE];
(void) snprintf(
portName,
sizeof(portName),
"%s_noArgsGuarded_InputPort[%" PRI_PlatformIntType "]",
this->m_objName,
port
);
this->m_noArgsGuarded_InputPort[port].setObjName(portName);
#endif
}
// Connect input port noArgsReturnGuarded
for (
PlatformIntType port = 0;
port < static_cast<PlatformIntType>(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
// The port name consists of this->m_objName and some extra info.
// We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes.
// However, the compiler may assume that this->m_objName fills
// the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to
// avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE
// bytes to cover the extra info.
char portName[2*FW_OBJ_NAME_MAX_SIZE];
(void) snprintf(
portName,
sizeof(portName),
"%s_noArgsReturnGuarded_InputPort[%" PRI_PlatformIntType "]",
this->m_objName,
port
);
this->m_noArgsReturnGuarded_InputPort[port].setObjName(portName);
#endif
}
// Connect input port noArgsReturnSync
for (
PlatformIntType port = 0;
port < static_cast<PlatformIntType>(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
// The port name consists of this->m_objName and some extra info.
// We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes.
// However, the compiler may assume that this->m_objName fills
// the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to
// avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE
// bytes to cover the extra info.
char portName[2*FW_OBJ_NAME_MAX_SIZE];
(void) snprintf(
portName,
sizeof(portName),
"%s_noArgsReturnSync_InputPort[%" PRI_PlatformIntType "]",
this->m_objName,
port
);
this->m_noArgsReturnSync_InputPort[port].setObjName(portName);
#endif
}
// Connect input port noArgsSync
for (
PlatformIntType port = 0;
port < static_cast<PlatformIntType>(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
// The port name consists of this->m_objName and some extra info.
// We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes.
// However, the compiler may assume that this->m_objName fills
// the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to
// avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE
// bytes to cover the extra info.
char portName[2*FW_OBJ_NAME_MAX_SIZE];
(void) snprintf(
portName,
sizeof(portName),
"%s_noArgsSync_InputPort[%" PRI_PlatformIntType "]",
this->m_objName,
port
);
this->m_noArgsSync_InputPort[port].setObjName(portName);
#endif
}
// Connect input port typedAsync
for (
PlatformIntType port = 0;
port < static_cast<PlatformIntType>(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
// The port name consists of this->m_objName and some extra info.
// We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes.
// However, the compiler may assume that this->m_objName fills
// the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to
// avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE
// bytes to cover the extra info.
char portName[2*FW_OBJ_NAME_MAX_SIZE];
(void) snprintf(
portName,
sizeof(portName),
"%s_typedAsync_InputPort[%" PRI_PlatformIntType "]",
this->m_objName,
port
);
this->m_typedAsync_InputPort[port].setObjName(portName);
#endif
}
// Connect input port typedAsyncAssert
for (
PlatformIntType port = 0;
port < static_cast<PlatformIntType>(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
// The port name consists of this->m_objName and some extra info.
// We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes.
// However, the compiler may assume that this->m_objName fills
// the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to
// avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE
// bytes to cover the extra info.
char portName[2*FW_OBJ_NAME_MAX_SIZE];
(void) snprintf(
portName,
sizeof(portName),
"%s_typedAsyncAssert_InputPort[%" PRI_PlatformIntType "]",
this->m_objName,
port
);
this->m_typedAsyncAssert_InputPort[port].setObjName(portName);
#endif
}
// Connect input port typedAsyncBlockPriority
for (
PlatformIntType port = 0;
port < static_cast<PlatformIntType>(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
// The port name consists of this->m_objName and some extra info.
// We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes.
// However, the compiler may assume that this->m_objName fills
// the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to
// avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE
// bytes to cover the extra info.
char portName[2*FW_OBJ_NAME_MAX_SIZE];
(void) snprintf(
portName,
sizeof(portName),
"%s_typedAsyncBlockPriority_InputPort[%" PRI_PlatformIntType "]",
this->m_objName,
port
);
this->m_typedAsyncBlockPriority_InputPort[port].setObjName(portName);
#endif
}
// Connect input port typedAsyncDropPriority
for (
PlatformIntType port = 0;
port < static_cast<PlatformIntType>(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
// The port name consists of this->m_objName and some extra info.
// We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes.
// However, the compiler may assume that this->m_objName fills
// the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to
// avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE
// bytes to cover the extra info.
char portName[2*FW_OBJ_NAME_MAX_SIZE];
(void) snprintf(
portName,
sizeof(portName),
"%s_typedAsyncDropPriority_InputPort[%" PRI_PlatformIntType "]",
this->m_objName,
port
);
this->m_typedAsyncDropPriority_InputPort[port].setObjName(portName);
#endif
}
// Connect input port typedGuarded
for (
PlatformIntType port = 0;
port < static_cast<PlatformIntType>(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
// The port name consists of this->m_objName and some extra info.
// We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes.
// However, the compiler may assume that this->m_objName fills
// the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to
// avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE
// bytes to cover the extra info.
char portName[2*FW_OBJ_NAME_MAX_SIZE];
(void) snprintf(
portName,
sizeof(portName),
"%s_typedGuarded_InputPort[%" PRI_PlatformIntType "]",
this->m_objName,
port
);
this->m_typedGuarded_InputPort[port].setObjName(portName);
#endif
}
// Connect input port typedReturnGuarded
for (
PlatformIntType port = 0;
port < static_cast<PlatformIntType>(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
// The port name consists of this->m_objName and some extra info.
// We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes.
// However, the compiler may assume that this->m_objName fills
// the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to
// avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE
// bytes to cover the extra info.
char portName[2*FW_OBJ_NAME_MAX_SIZE];
(void) snprintf(
portName,
sizeof(portName),
"%s_typedReturnGuarded_InputPort[%" PRI_PlatformIntType "]",
this->m_objName,
port
);
this->m_typedReturnGuarded_InputPort[port].setObjName(portName);
#endif
}
// Connect input port typedReturnSync
for (
PlatformIntType port = 0;
port < static_cast<PlatformIntType>(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
// The port name consists of this->m_objName and some extra info.
// We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes.
// However, the compiler may assume that this->m_objName fills
// the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to
// avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE
// bytes to cover the extra info.
char portName[2*FW_OBJ_NAME_MAX_SIZE];
(void) snprintf(
portName,
sizeof(portName),
"%s_typedReturnSync_InputPort[%" PRI_PlatformIntType "]",
this->m_objName,
port
);
this->m_typedReturnSync_InputPort[port].setObjName(portName);
#endif
}
// Connect input port typedSync
for (
PlatformIntType port = 0;
port < static_cast<PlatformIntType>(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
// The port name consists of this->m_objName and some extra info.
// We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes.
// However, the compiler may assume that this->m_objName fills
// the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to
// avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE
// bytes to cover the extra info.
char portName[2*FW_OBJ_NAME_MAX_SIZE];
(void) snprintf(
portName,
sizeof(portName),
"%s_typedSync_InputPort[%" PRI_PlatformIntType "]",
this->m_objName,
port
);
this->m_typedSync_InputPort[port].setObjName(portName);
#endif
}
// Connect input port serialAsync
for (
PlatformIntType port = 0;
port < static_cast<PlatformIntType>(this->getNum_serialAsync_InputPorts());
port++
) {
this->m_serialAsync_InputPort[port].init();
this->m_serialAsync_InputPort[port].addCallComp(
this,
m_p_serialAsync_in
);
this->m_serialAsync_InputPort[port].setPortNum(port);
#if FW_OBJECT_NAMES == 1
// The port name consists of this->m_objName and some extra info.
// We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes.
// However, the compiler may assume that this->m_objName fills
// the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to
// avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE
// bytes to cover the extra info.
char portName[2*FW_OBJ_NAME_MAX_SIZE];
(void) snprintf(
portName,
sizeof(portName),
"%s_serialAsync_InputPort[%" PRI_PlatformIntType "]",
this->m_objName,
port
);
this->m_serialAsync_InputPort[port].setObjName(portName);
#endif
}
// Connect input port serialAsyncAssert
for (
PlatformIntType port = 0;
port < static_cast<PlatformIntType>(this->getNum_serialAsyncAssert_InputPorts());
port++
) {
this->m_serialAsyncAssert_InputPort[port].init();
this->m_serialAsyncAssert_InputPort[port].addCallComp(
this,
m_p_serialAsyncAssert_in
);
this->m_serialAsyncAssert_InputPort[port].setPortNum(port);
#if FW_OBJECT_NAMES == 1
// The port name consists of this->m_objName and some extra info.
// We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes.
// However, the compiler may assume that this->m_objName fills
// the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to
// avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE
// bytes to cover the extra info.
char portName[2*FW_OBJ_NAME_MAX_SIZE];
(void) snprintf(
portName,
sizeof(portName),
"%s_serialAsyncAssert_InputPort[%" PRI_PlatformIntType "]",
this->m_objName,
port
);
this->m_serialAsyncAssert_InputPort[port].setObjName(portName);
#endif
}
// Connect input port serialAsyncBlockPriority
for (
PlatformIntType port = 0;
port < static_cast<PlatformIntType>(this->getNum_serialAsyncBlockPriority_InputPorts());
port++
) {
this->m_serialAsyncBlockPriority_InputPort[port].init();
this->m_serialAsyncBlockPriority_InputPort[port].addCallComp(
this,
m_p_serialAsyncBlockPriority_in
);
this->m_serialAsyncBlockPriority_InputPort[port].setPortNum(port);
#if FW_OBJECT_NAMES == 1
// The port name consists of this->m_objName and some extra info.
// We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes.
// However, the compiler may assume that this->m_objName fills
// the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to
// avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE
// bytes to cover the extra info.
char portName[2*FW_OBJ_NAME_MAX_SIZE];
(void) snprintf(
portName,
sizeof(portName),
"%s_serialAsyncBlockPriority_InputPort[%" PRI_PlatformIntType "]",
this->m_objName,
port
);
this->m_serialAsyncBlockPriority_InputPort[port].setObjName(portName);
#endif
}
// Connect input port serialAsyncDropPriority
for (
PlatformIntType port = 0;
port < static_cast<PlatformIntType>(this->getNum_serialAsyncDropPriority_InputPorts());
port++
) {
this->m_serialAsyncDropPriority_InputPort[port].init();
this->m_serialAsyncDropPriority_InputPort[port].addCallComp(
this,
m_p_serialAsyncDropPriority_in
);
this->m_serialAsyncDropPriority_InputPort[port].setPortNum(port);
#if FW_OBJECT_NAMES == 1
// The port name consists of this->m_objName and some extra info.
// We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes.
// However, the compiler may assume that this->m_objName fills
// the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to
// avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE
// bytes to cover the extra info.
char portName[2*FW_OBJ_NAME_MAX_SIZE];
(void) snprintf(
portName,
sizeof(portName),
"%s_serialAsyncDropPriority_InputPort[%" PRI_PlatformIntType "]",
this->m_objName,
port
);
this->m_serialAsyncDropPriority_InputPort[port].setObjName(portName);
#endif
}
// Connect input port serialGuarded
for (
PlatformIntType port = 0;
port < static_cast<PlatformIntType>(this->getNum_serialGuarded_InputPorts());
port++
) {
this->m_serialGuarded_InputPort[port].init();
this->m_serialGuarded_InputPort[port].addCallComp(
this,
m_p_serialGuarded_in
);
this->m_serialGuarded_InputPort[port].setPortNum(port);
#if FW_OBJECT_NAMES == 1
// The port name consists of this->m_objName and some extra info.
// We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes.
// However, the compiler may assume that this->m_objName fills
// the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to
// avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE
// bytes to cover the extra info.
char portName[2*FW_OBJ_NAME_MAX_SIZE];
(void) snprintf(
portName,
sizeof(portName),
"%s_serialGuarded_InputPort[%" PRI_PlatformIntType "]",
this->m_objName,
port
);
this->m_serialGuarded_InputPort[port].setObjName(portName);
#endif
}
// Connect input port serialSync
for (
PlatformIntType port = 0;
port < static_cast<PlatformIntType>(this->getNum_serialSync_InputPorts());
port++
) {
this->m_serialSync_InputPort[port].init();
this->m_serialSync_InputPort[port].addCallComp(
this,
m_p_serialSync_in
);
this->m_serialSync_InputPort[port].setPortNum(port);
#if FW_OBJECT_NAMES == 1
// The port name consists of this->m_objName and some extra info.
// We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes.
// However, the compiler may assume that this->m_objName fills
// the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to
// avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE
// bytes to cover the extra info.
char portName[2*FW_OBJ_NAME_MAX_SIZE];
(void) snprintf(
portName,
sizeof(portName),
"%s_serialSync_InputPort[%" PRI_PlatformIntType "]",
this->m_objName,
port
);
this->m_serialSync_InputPort[port].setObjName(portName);
#endif
}
// Connect output port cmdRegOut
for (
PlatformIntType port = 0;
port < static_cast<PlatformIntType>(this->getNum_cmdRegOut_OutputPorts());
port++
) {
this->m_cmdRegOut_OutputPort[port].init();
#if FW_OBJECT_NAMES == 1
// The port name consists of this->m_objName and some extra info.
// We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes.
// However, the compiler may assume that this->m_objName fills
// the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to
// avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE
// bytes to cover the extra info.
char portName[2*FW_OBJ_NAME_MAX_SIZE];
(void) snprintf(
portName,
sizeof(portName),
"%s_cmdRegOut_OutputPort[%" PRI_PlatformIntType "]",
this->m_objName,
port
);
this->m_cmdRegOut_OutputPort[port].setObjName(portName);
#endif
}
// Connect output port cmdResponseOut
for (
PlatformIntType port = 0;
port < static_cast<PlatformIntType>(this->getNum_cmdResponseOut_OutputPorts());
port++
) {
this->m_cmdResponseOut_OutputPort[port].init();
#if FW_OBJECT_NAMES == 1
// The port name consists of this->m_objName and some extra info.
// We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes.
// However, the compiler may assume that this->m_objName fills
// the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to
// avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE
// bytes to cover the extra info.
char portName[2*FW_OBJ_NAME_MAX_SIZE];
(void) snprintf(
portName,
sizeof(portName),
"%s_cmdResponseOut_OutputPort[%" PRI_PlatformIntType "]",
this->m_objName,
port
);
this->m_cmdResponseOut_OutputPort[port].setObjName(portName);
#endif
}
// Connect output port eventOut
for (
PlatformIntType port = 0;
port < static_cast<PlatformIntType>(this->getNum_eventOut_OutputPorts());
port++
) {
this->m_eventOut_OutputPort[port].init();
#if FW_OBJECT_NAMES == 1
// The port name consists of this->m_objName and some extra info.
// We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes.
// However, the compiler may assume that this->m_objName fills
// the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to
// avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE
// bytes to cover the extra info.
char portName[2*FW_OBJ_NAME_MAX_SIZE];
(void) snprintf(
portName,
sizeof(portName),
"%s_eventOut_OutputPort[%" PRI_PlatformIntType "]",
this->m_objName,
port
);
this->m_eventOut_OutputPort[port].setObjName(portName);
#endif
}
// Connect output port prmGetOut
for (
PlatformIntType port = 0;
port < static_cast<PlatformIntType>(this->getNum_prmGetOut_OutputPorts());
port++
) {
this->m_prmGetOut_OutputPort[port].init();
#if FW_OBJECT_NAMES == 1
// The port name consists of this->m_objName and some extra info.
// We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes.
// However, the compiler may assume that this->m_objName fills
// the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to
// avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE
// bytes to cover the extra info.
char portName[2*FW_OBJ_NAME_MAX_SIZE];
(void) snprintf(
portName,
sizeof(portName),
"%s_prmGetOut_OutputPort[%" PRI_PlatformIntType "]",
this->m_objName,
port
);
this->m_prmGetOut_OutputPort[port].setObjName(portName);
#endif
}
// Connect output port prmSetOut
for (
PlatformIntType port = 0;
port < static_cast<PlatformIntType>(this->getNum_prmSetOut_OutputPorts());
port++
) {
this->m_prmSetOut_OutputPort[port].init();
#if FW_OBJECT_NAMES == 1
// The port name consists of this->m_objName and some extra info.
// We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes.
// However, the compiler may assume that this->m_objName fills
// the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to
// avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE
// bytes to cover the extra info.
char portName[2*FW_OBJ_NAME_MAX_SIZE];
(void) snprintf(
portName,
sizeof(portName),
"%s_prmSetOut_OutputPort[%" PRI_PlatformIntType "]",
this->m_objName,
port
);
this->m_prmSetOut_OutputPort[port].setObjName(portName);
#endif
}
#if FW_ENABLE_TEXT_LOGGING == 1
// Connect output port textEventOut
for (
PlatformIntType port = 0;
port < static_cast<PlatformIntType>(this->getNum_textEventOut_OutputPorts());
port++
) {
this->m_textEventOut_OutputPort[port].init();
#if FW_OBJECT_NAMES == 1
// The port name consists of this->m_objName and some extra info.
// We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes.
// However, the compiler may assume that this->m_objName fills
// the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to
// avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE
// bytes to cover the extra info.
char portName[2*FW_OBJ_NAME_MAX_SIZE];
(void) snprintf(
portName,
sizeof(portName),
"%s_textEventOut_OutputPort[%" PRI_PlatformIntType "]",
this->m_objName,
port
);
this->m_textEventOut_OutputPort[port].setObjName(portName);
#endif
}
#endif
// Connect output port timeGetOut
for (
PlatformIntType port = 0;
port < static_cast<PlatformIntType>(this->getNum_timeGetOut_OutputPorts());
port++
) {
this->m_timeGetOut_OutputPort[port].init();
#if FW_OBJECT_NAMES == 1
// The port name consists of this->m_objName and some extra info.
// We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes.
// However, the compiler may assume that this->m_objName fills
// the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to
// avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE
// bytes to cover the extra info.
char portName[2*FW_OBJ_NAME_MAX_SIZE];
(void) snprintf(
portName,
sizeof(portName),
"%s_timeGetOut_OutputPort[%" PRI_PlatformIntType "]",
this->m_objName,
port
);
this->m_timeGetOut_OutputPort[port].setObjName(portName);
#endif
}
// Connect output port tlmOut
for (
PlatformIntType port = 0;
port < static_cast<PlatformIntType>(this->getNum_tlmOut_OutputPorts());
port++
) {
this->m_tlmOut_OutputPort[port].init();
#if FW_OBJECT_NAMES == 1
// The port name consists of this->m_objName and some extra info.
// We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes.
// However, the compiler may assume that this->m_objName fills
// the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to
// avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE
// bytes to cover the extra info.
char portName[2*FW_OBJ_NAME_MAX_SIZE];
(void) snprintf(
portName,
sizeof(portName),
"%s_tlmOut_OutputPort[%" PRI_PlatformIntType "]",
this->m_objName,
port
);
this->m_tlmOut_OutputPort[port].setObjName(portName);
#endif
}
// Connect output port noArgsOut
for (
PlatformIntType port = 0;
port < static_cast<PlatformIntType>(this->getNum_noArgsOut_OutputPorts());
port++
) {
this->m_noArgsOut_OutputPort[port].init();
#if FW_OBJECT_NAMES == 1
// The port name consists of this->m_objName and some extra info.
// We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes.
// However, the compiler may assume that this->m_objName fills
// the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to
// avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE
// bytes to cover the extra info.
char portName[2*FW_OBJ_NAME_MAX_SIZE];
(void) snprintf(
portName,
sizeof(portName),
"%s_noArgsOut_OutputPort[%" PRI_PlatformIntType "]",
this->m_objName,
port
);
this->m_noArgsOut_OutputPort[port].setObjName(portName);
#endif
}
// Connect output port noArgsReturnOut
for (
PlatformIntType port = 0;
port < static_cast<PlatformIntType>(this->getNum_noArgsReturnOut_OutputPorts());
port++
) {
this->m_noArgsReturnOut_OutputPort[port].init();
#if FW_OBJECT_NAMES == 1
// The port name consists of this->m_objName and some extra info.
// We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes.
// However, the compiler may assume that this->m_objName fills
// the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to
// avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE
// bytes to cover the extra info.
char portName[2*FW_OBJ_NAME_MAX_SIZE];
(void) snprintf(
portName,
sizeof(portName),
"%s_noArgsReturnOut_OutputPort[%" PRI_PlatformIntType "]",
this->m_objName,
port
);
this->m_noArgsReturnOut_OutputPort[port].setObjName(portName);
#endif
}
// Connect output port typedOut
for (
PlatformIntType port = 0;
port < static_cast<PlatformIntType>(this->getNum_typedOut_OutputPorts());
port++
) {
this->m_typedOut_OutputPort[port].init();
#if FW_OBJECT_NAMES == 1
// The port name consists of this->m_objName and some extra info.
// We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes.
// However, the compiler may assume that this->m_objName fills
// the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to
// avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE
// bytes to cover the extra info.
char portName[2*FW_OBJ_NAME_MAX_SIZE];
(void) snprintf(
portName,
sizeof(portName),
"%s_typedOut_OutputPort[%" PRI_PlatformIntType "]",
this->m_objName,
port
);
this->m_typedOut_OutputPort[port].setObjName(portName);
#endif
}
// Connect output port typedReturnOut
for (
PlatformIntType port = 0;
port < static_cast<PlatformIntType>(this->getNum_typedReturnOut_OutputPorts());
port++
) {
this->m_typedReturnOut_OutputPort[port].init();
#if FW_OBJECT_NAMES == 1
// The port name consists of this->m_objName and some extra info.
// We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes.
// However, the compiler may assume that this->m_objName fills
// the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to
// avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE
// bytes to cover the extra info.
char portName[2*FW_OBJ_NAME_MAX_SIZE];
(void) snprintf(
portName,
sizeof(portName),
"%s_typedReturnOut_OutputPort[%" PRI_PlatformIntType "]",
this->m_objName,
port
);
this->m_typedReturnOut_OutputPort[port].setObjName(portName);
#endif
}
// Connect output port serialOut
for (
PlatformIntType port = 0;
port < static_cast<PlatformIntType>(this->getNum_serialOut_OutputPorts());
port++
) {
this->m_serialOut_OutputPort[port].init();
#if FW_OBJECT_NAMES == 1
// The port name consists of this->m_objName and some extra info.
// We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes.
// However, the compiler may assume that this->m_objName fills
// the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to
// avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE
// bytes to cover the extra info.
char portName[2*FW_OBJ_NAME_MAX_SIZE];
(void) snprintf(
portName,
sizeof(portName),
"%s_serialOut_OutputPort[%" PRI_PlatformIntType "]",
this->m_objName,
port
);
this->m_serialOut_OutputPort[port].setObjName(portName);
#endif
}
// Passed-in size added to port number and message type enumeration sizes.
// NATIVE_INT_TYPE cast because of compiler warning.
this->m_msgSize = FW_MAX(
msgSize +
static_cast<NATIVE_INT_TYPE>(sizeof(NATIVE_INT_TYPE)) +
static_cast<NATIVE_INT_TYPE>(sizeof(I32)),
static_cast<NATIVE_INT_TYPE>(ComponentIpcSerializableBuffer::SERIALIZATION_SIZE)
);
Os::Queue::QueueStatus qStat = this->createQueue(queueDepth, this->m_msgSize);
FW_ASSERT(
Os::Queue::QUEUE_OK == qStat,
static_cast<FwAssertArgType>(qStat)
);
}
// ----------------------------------------------------------------------
// Getters for special input ports
// ----------------------------------------------------------------------
Fw::InputCmdPort* ActiveSerialComponentBase ::
get_cmdIn_InputPort(NATIVE_INT_TYPE 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* ActiveSerialComponentBase ::
get_noArgsAsync_InputPort(NATIVE_INT_TYPE portNum)
{
FW_ASSERT(
portNum < this->getNum_noArgsAsync_InputPorts(),
static_cast<FwAssertArgType>(portNum)
);
return &this->m_noArgsAsync_InputPort[portNum];
}
Ports::InputNoArgsPort* ActiveSerialComponentBase ::
get_noArgsGuarded_InputPort(NATIVE_INT_TYPE portNum)
{
FW_ASSERT(
portNum < this->getNum_noArgsGuarded_InputPorts(),
static_cast<FwAssertArgType>(portNum)
);
return &this->m_noArgsGuarded_InputPort[portNum];
}
Ports::InputNoArgsReturnPort* ActiveSerialComponentBase ::
get_noArgsReturnGuarded_InputPort(NATIVE_INT_TYPE portNum)
{
FW_ASSERT(
portNum < this->getNum_noArgsReturnGuarded_InputPorts(),
static_cast<FwAssertArgType>(portNum)
);
return &this->m_noArgsReturnGuarded_InputPort[portNum];
}
Ports::InputNoArgsReturnPort* ActiveSerialComponentBase ::
get_noArgsReturnSync_InputPort(NATIVE_INT_TYPE portNum)
{
FW_ASSERT(
portNum < this->getNum_noArgsReturnSync_InputPorts(),
static_cast<FwAssertArgType>(portNum)
);
return &this->m_noArgsReturnSync_InputPort[portNum];
}
Ports::InputNoArgsPort* ActiveSerialComponentBase ::
get_noArgsSync_InputPort(NATIVE_INT_TYPE portNum)
{
FW_ASSERT(
portNum < this->getNum_noArgsSync_InputPorts(),
static_cast<FwAssertArgType>(portNum)
);
return &this->m_noArgsSync_InputPort[portNum];
}
Ports::InputTypedPort* ActiveSerialComponentBase ::
get_typedAsync_InputPort(NATIVE_INT_TYPE portNum)
{
FW_ASSERT(
portNum < this->getNum_typedAsync_InputPorts(),
static_cast<FwAssertArgType>(portNum)
);
return &this->m_typedAsync_InputPort[portNum];
}
Ports::InputTypedPort* ActiveSerialComponentBase ::
get_typedAsyncAssert_InputPort(NATIVE_INT_TYPE portNum)
{
FW_ASSERT(
portNum < this->getNum_typedAsyncAssert_InputPorts(),
static_cast<FwAssertArgType>(portNum)
);
return &this->m_typedAsyncAssert_InputPort[portNum];
}
Ports::InputTypedPort* ActiveSerialComponentBase ::
get_typedAsyncBlockPriority_InputPort(NATIVE_INT_TYPE portNum)
{
FW_ASSERT(
portNum < this->getNum_typedAsyncBlockPriority_InputPorts(),
static_cast<FwAssertArgType>(portNum)
);
return &this->m_typedAsyncBlockPriority_InputPort[portNum];
}
Ports::InputTypedPort* ActiveSerialComponentBase ::
get_typedAsyncDropPriority_InputPort(NATIVE_INT_TYPE portNum)
{
FW_ASSERT(
portNum < this->getNum_typedAsyncDropPriority_InputPorts(),
static_cast<FwAssertArgType>(portNum)
);
return &this->m_typedAsyncDropPriority_InputPort[portNum];
}
Ports::InputTypedPort* ActiveSerialComponentBase ::
get_typedGuarded_InputPort(NATIVE_INT_TYPE portNum)
{
FW_ASSERT(
portNum < this->getNum_typedGuarded_InputPorts(),
static_cast<FwAssertArgType>(portNum)
);
return &this->m_typedGuarded_InputPort[portNum];
}
Ports::InputTypedReturnPort* ActiveSerialComponentBase ::
get_typedReturnGuarded_InputPort(NATIVE_INT_TYPE portNum)
{
FW_ASSERT(
portNum < this->getNum_typedReturnGuarded_InputPorts(),
static_cast<FwAssertArgType>(portNum)
);
return &this->m_typedReturnGuarded_InputPort[portNum];
}
Ports::InputTypedReturnPort* ActiveSerialComponentBase ::
get_typedReturnSync_InputPort(NATIVE_INT_TYPE portNum)
{
FW_ASSERT(
portNum < this->getNum_typedReturnSync_InputPorts(),
static_cast<FwAssertArgType>(portNum)
);
return &this->m_typedReturnSync_InputPort[portNum];
}
Ports::InputTypedPort* ActiveSerialComponentBase ::
get_typedSync_InputPort(NATIVE_INT_TYPE portNum)
{
FW_ASSERT(
portNum < this->getNum_typedSync_InputPorts(),
static_cast<FwAssertArgType>(portNum)
);
return &this->m_typedSync_InputPort[portNum];
}
// ----------------------------------------------------------------------
// Getters for serial input ports
// ----------------------------------------------------------------------
Fw::InputSerializePort* ActiveSerialComponentBase ::
get_serialAsync_InputPort(NATIVE_INT_TYPE portNum)
{
FW_ASSERT(
portNum < this->getNum_serialAsync_InputPorts(),
static_cast<FwAssertArgType>(portNum)
);
return &this->m_serialAsync_InputPort[portNum];
}
Fw::InputSerializePort* ActiveSerialComponentBase ::
get_serialAsyncAssert_InputPort(NATIVE_INT_TYPE portNum)
{
FW_ASSERT(
portNum < this->getNum_serialAsyncAssert_InputPorts(),
static_cast<FwAssertArgType>(portNum)
);
return &this->m_serialAsyncAssert_InputPort[portNum];
}
Fw::InputSerializePort* ActiveSerialComponentBase ::
get_serialAsyncBlockPriority_InputPort(NATIVE_INT_TYPE portNum)
{
FW_ASSERT(
portNum < this->getNum_serialAsyncBlockPriority_InputPorts(),
static_cast<FwAssertArgType>(portNum)
);
return &this->m_serialAsyncBlockPriority_InputPort[portNum];
}
Fw::InputSerializePort* ActiveSerialComponentBase ::
get_serialAsyncDropPriority_InputPort(NATIVE_INT_TYPE portNum)
{
FW_ASSERT(
portNum < this->getNum_serialAsyncDropPriority_InputPorts(),
static_cast<FwAssertArgType>(portNum)
);
return &this->m_serialAsyncDropPriority_InputPort[portNum];
}
Fw::InputSerializePort* ActiveSerialComponentBase ::
get_serialGuarded_InputPort(NATIVE_INT_TYPE portNum)
{
FW_ASSERT(
portNum < this->getNum_serialGuarded_InputPorts(),
static_cast<FwAssertArgType>(portNum)
);
return &this->m_serialGuarded_InputPort[portNum];
}
Fw::InputSerializePort* ActiveSerialComponentBase ::
get_serialSync_InputPort(NATIVE_INT_TYPE portNum)
{
FW_ASSERT(
portNum < this->getNum_serialSync_InputPorts(),
static_cast<FwAssertArgType>(portNum)
);
return &this->m_serialSync_InputPort[portNum];
}
// ----------------------------------------------------------------------
// Connect input ports to special output ports
// ----------------------------------------------------------------------
void ActiveSerialComponentBase ::
set_cmdRegOut_OutputPort(
NATIVE_INT_TYPE portNum,
Fw::InputCmdRegPort* port
)
{
FW_ASSERT(
portNum < this->getNum_cmdRegOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
this->m_cmdRegOut_OutputPort[portNum].addCallPort(port);
}
void ActiveSerialComponentBase ::
set_cmdResponseOut_OutputPort(
NATIVE_INT_TYPE portNum,
Fw::InputCmdResponsePort* port
)
{
FW_ASSERT(
portNum < this->getNum_cmdResponseOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
this->m_cmdResponseOut_OutputPort[portNum].addCallPort(port);
}
void ActiveSerialComponentBase ::
set_eventOut_OutputPort(
NATIVE_INT_TYPE portNum,
Fw::InputLogPort* port
)
{
FW_ASSERT(
portNum < this->getNum_eventOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
this->m_eventOut_OutputPort[portNum].addCallPort(port);
}
void ActiveSerialComponentBase ::
set_prmGetOut_OutputPort(
NATIVE_INT_TYPE portNum,
Fw::InputPrmGetPort* port
)
{
FW_ASSERT(
portNum < this->getNum_prmGetOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
this->m_prmGetOut_OutputPort[portNum].addCallPort(port);
}
void ActiveSerialComponentBase ::
set_prmSetOut_OutputPort(
NATIVE_INT_TYPE portNum,
Fw::InputPrmSetPort* port
)
{
FW_ASSERT(
portNum < this->getNum_prmSetOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
this->m_prmSetOut_OutputPort[portNum].addCallPort(port);
}
#if FW_ENABLE_TEXT_LOGGING == 1
void ActiveSerialComponentBase ::
set_textEventOut_OutputPort(
NATIVE_INT_TYPE portNum,
Fw::InputLogTextPort* port
)
{
FW_ASSERT(
portNum < this->getNum_textEventOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
this->m_textEventOut_OutputPort[portNum].addCallPort(port);
}
#endif
void ActiveSerialComponentBase ::
set_timeGetOut_OutputPort(
NATIVE_INT_TYPE portNum,
Fw::InputTimePort* port
)
{
FW_ASSERT(
portNum < this->getNum_timeGetOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
this->m_timeGetOut_OutputPort[portNum].addCallPort(port);
}
void ActiveSerialComponentBase ::
set_tlmOut_OutputPort(
NATIVE_INT_TYPE portNum,
Fw::InputTlmPort* port
)
{
FW_ASSERT(
portNum < this->getNum_tlmOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
this->m_tlmOut_OutputPort[portNum].addCallPort(port);
}
// ----------------------------------------------------------------------
// Connect typed input ports to typed output ports
// ----------------------------------------------------------------------
void ActiveSerialComponentBase ::
set_noArgsOut_OutputPort(
NATIVE_INT_TYPE portNum,
Ports::InputNoArgsPort* port
)
{
FW_ASSERT(
portNum < this->getNum_noArgsOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
this->m_noArgsOut_OutputPort[portNum].addCallPort(port);
}
void ActiveSerialComponentBase ::
set_noArgsReturnOut_OutputPort(
NATIVE_INT_TYPE portNum,
Ports::InputNoArgsReturnPort* port
)
{
FW_ASSERT(
portNum < this->getNum_noArgsReturnOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
this->m_noArgsReturnOut_OutputPort[portNum].addCallPort(port);
}
void ActiveSerialComponentBase ::
set_typedOut_OutputPort(
NATIVE_INT_TYPE portNum,
Ports::InputTypedPort* port
)
{
FW_ASSERT(
portNum < this->getNum_typedOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
this->m_typedOut_OutputPort[portNum].addCallPort(port);
}
void ActiveSerialComponentBase ::
set_typedReturnOut_OutputPort(
NATIVE_INT_TYPE 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 ActiveSerialComponentBase ::
set_cmdRegOut_OutputPort(
NATIVE_INT_TYPE portNum,
Fw::InputSerializePort* port
)
{
FW_ASSERT(
portNum < this->getNum_cmdRegOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
this->m_cmdRegOut_OutputPort[portNum].registerSerialPort(port);
}
void ActiveSerialComponentBase ::
set_cmdResponseOut_OutputPort(
NATIVE_INT_TYPE portNum,
Fw::InputSerializePort* port
)
{
FW_ASSERT(
portNum < this->getNum_cmdResponseOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
this->m_cmdResponseOut_OutputPort[portNum].registerSerialPort(port);
}
void ActiveSerialComponentBase ::
set_eventOut_OutputPort(
NATIVE_INT_TYPE portNum,
Fw::InputSerializePort* port
)
{
FW_ASSERT(
portNum < this->getNum_eventOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
this->m_eventOut_OutputPort[portNum].registerSerialPort(port);
}
void ActiveSerialComponentBase ::
set_prmSetOut_OutputPort(
NATIVE_INT_TYPE portNum,
Fw::InputSerializePort* port
)
{
FW_ASSERT(
portNum < this->getNum_prmSetOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
this->m_prmSetOut_OutputPort[portNum].registerSerialPort(port);
}
#if FW_ENABLE_TEXT_LOGGING == 1
void ActiveSerialComponentBase ::
set_textEventOut_OutputPort(
NATIVE_INT_TYPE portNum,
Fw::InputSerializePort* port
)
{
FW_ASSERT(
portNum < this->getNum_textEventOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
this->m_textEventOut_OutputPort[portNum].registerSerialPort(port);
}
#endif
void ActiveSerialComponentBase ::
set_timeGetOut_OutputPort(
NATIVE_INT_TYPE portNum,
Fw::InputSerializePort* port
)
{
FW_ASSERT(
portNum < this->getNum_timeGetOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
this->m_timeGetOut_OutputPort[portNum].registerSerialPort(port);
}
void ActiveSerialComponentBase ::
set_tlmOut_OutputPort(
NATIVE_INT_TYPE portNum,
Fw::InputSerializePort* port
)
{
FW_ASSERT(
portNum < this->getNum_tlmOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
this->m_tlmOut_OutputPort[portNum].registerSerialPort(port);
}
#endif
#if FW_PORT_SERIALIZATION
// ----------------------------------------------------------------------
// Connect serial input ports to typed output ports
// ----------------------------------------------------------------------
void ActiveSerialComponentBase ::
set_noArgsOut_OutputPort(
NATIVE_INT_TYPE portNum,
Fw::InputSerializePort* port
)
{
FW_ASSERT(
portNum < this->getNum_noArgsOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
this->m_noArgsOut_OutputPort[portNum].registerSerialPort(port);
}
void ActiveSerialComponentBase ::
set_typedOut_OutputPort(
NATIVE_INT_TYPE portNum,
Fw::InputSerializePort* port
)
{
FW_ASSERT(
portNum < this->getNum_typedOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
this->m_typedOut_OutputPort[portNum].registerSerialPort(port);
}
#endif
#if FW_PORT_SERIALIZATION
// ----------------------------------------------------------------------
// Connect serial input ports to serial output ports
// ----------------------------------------------------------------------
void ActiveSerialComponentBase ::
set_serialOut_OutputPort(
NATIVE_INT_TYPE portNum,
Fw::InputPortBase* port
)
{
FW_ASSERT(
portNum < this->getNum_serialOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
this->m_serialOut_OutputPort[portNum].registerSerialPort(port);
}
#endif
// ----------------------------------------------------------------------
// Command registration
// ----------------------------------------------------------------------
void ActiveSerialComponentBase ::
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
);
this->m_cmdRegOut_OutputPort[0].invoke(
this->getIdBase() + OPCODE_PARAMU32_SET
);
this->m_cmdRegOut_OutputPort[0].invoke(
this->getIdBase() + OPCODE_PARAMU32_SAVE
);
this->m_cmdRegOut_OutputPort[0].invoke(
this->getIdBase() + OPCODE_PARAMF64_SET
);
this->m_cmdRegOut_OutputPort[0].invoke(
this->getIdBase() + OPCODE_PARAMF64_SAVE
);
this->m_cmdRegOut_OutputPort[0].invoke(
this->getIdBase() + OPCODE_PARAMSTRING_SET
);
this->m_cmdRegOut_OutputPort[0].invoke(
this->getIdBase() + OPCODE_PARAMSTRING_SAVE
);
this->m_cmdRegOut_OutputPort[0].invoke(
this->getIdBase() + OPCODE_PARAMENUM_SET
);
this->m_cmdRegOut_OutputPort[0].invoke(
this->getIdBase() + OPCODE_PARAMENUM_SAVE
);
this->m_cmdRegOut_OutputPort[0].invoke(
this->getIdBase() + OPCODE_PARAMARRAY_SET
);
this->m_cmdRegOut_OutputPort[0].invoke(
this->getIdBase() + OPCODE_PARAMARRAY_SAVE
);
this->m_cmdRegOut_OutputPort[0].invoke(
this->getIdBase() + OPCODE_PARAMSTRUCT_SET
);
this->m_cmdRegOut_OutputPort[0].invoke(
this->getIdBase() + OPCODE_PARAMSTRUCT_SAVE
);
}
// ----------------------------------------------------------------------
// Parameter loading
// ----------------------------------------------------------------------
void ActiveSerialComponentBase ::
loadParameters()
{
Fw::ParamBuffer buff;
Fw::SerializeStatus stat = Fw::FW_SERIALIZE_OK;
FW_ASSERT(this->m_prmGetOut_OutputPort[0].isConnected());
FwPrmIdType _id;
_id = this->getIdBase() + PARAMID_PARAMU32;
// Get parameter ParamU32
this->m_param_ParamU32_valid =
this->m_prmGetOut_OutputPort[0].invoke(
_id,
buff
);
// Deserialize value
this->m_paramLock.lock();
// If there was a deserialization issue, mark it invalid
if (this->m_param_ParamU32_valid == Fw::ParamValid::VALID) {
stat = buff.deserialize(this->m_ParamU32);
if (stat != Fw::FW_SERIALIZE_OK) {
this->m_param_ParamU32_valid = Fw::ParamValid::INVALID;
}
}
else {
// No default
}
this->m_paramLock.unLock();
_id = this->getIdBase() + PARAMID_PARAMF64;
// Get parameter ParamF64
this->m_param_ParamF64_valid =
this->m_prmGetOut_OutputPort[0].invoke(
_id,
buff
);
// Deserialize value
this->m_paramLock.lock();
// If there was a deserialization issue, mark it invalid
if (this->m_param_ParamF64_valid == Fw::ParamValid::VALID) {
stat = buff.deserialize(this->m_ParamF64);
if (stat != Fw::FW_SERIALIZE_OK) {
this->m_param_ParamF64_valid = Fw::ParamValid::INVALID;
}
}
else {
// No default
}
this->m_paramLock.unLock();
_id = this->getIdBase() + PARAMID_PARAMSTRING;
// Get parameter ParamString
this->m_param_ParamString_valid =
this->m_prmGetOut_OutputPort[0].invoke(
_id,
buff
);
// Deserialize value
this->m_paramLock.lock();
// If there was a deserialization issue, mark it invalid
if (this->m_param_ParamString_valid == Fw::ParamValid::VALID) {
stat = buff.deserialize(this->m_ParamString);
if (stat != Fw::FW_SERIALIZE_OK) {
this->m_param_ParamString_valid = Fw::ParamValid::DEFAULT;
// Set default value
this->m_ParamString = "default";
}
}
else {
// Set default value
this->m_param_ParamString_valid = Fw::ParamValid::DEFAULT;
this->m_ParamString = "default";
}
this->m_paramLock.unLock();
_id = this->getIdBase() + PARAMID_PARAMENUM;
// Get parameter ParamEnum
this->m_param_ParamEnum_valid =
this->m_prmGetOut_OutputPort[0].invoke(
_id,
buff
);
// Deserialize value
this->m_paramLock.lock();
// If there was a deserialization issue, mark it invalid
if (this->m_param_ParamEnum_valid == Fw::ParamValid::VALID) {
stat = buff.deserialize(this->m_ParamEnum);
if (stat != Fw::FW_SERIALIZE_OK) {
this->m_param_ParamEnum_valid = Fw::ParamValid::INVALID;
}
}
else {
// No default
}
this->m_paramLock.unLock();
_id = this->getIdBase() + PARAMID_PARAMARRAY;
// Get parameter ParamArray
this->m_param_ParamArray_valid =
this->m_prmGetOut_OutputPort[0].invoke(
_id,
buff
);
// Deserialize value
this->m_paramLock.lock();
// If there was a deserialization issue, mark it invalid
if (this->m_param_ParamArray_valid == Fw::ParamValid::VALID) {
stat = buff.deserialize(this->m_ParamArray);
if (stat != Fw::FW_SERIALIZE_OK) {
this->m_param_ParamArray_valid = Fw::ParamValid::DEFAULT;
// Set default value
this->m_ParamArray = A(1, 2, 3);
}
}
else {
// Set default value
this->m_param_ParamArray_valid = Fw::ParamValid::DEFAULT;
this->m_ParamArray = A(1, 2, 3);
}
this->m_paramLock.unLock();
_id = this->getIdBase() + PARAMID_PARAMSTRUCT;
// Get parameter ParamStruct
this->m_param_ParamStruct_valid =
this->m_prmGetOut_OutputPort[0].invoke(
_id,
buff
);
// Deserialize value
this->m_paramLock.lock();
// If there was a deserialization issue, mark it invalid
if (this->m_param_ParamStruct_valid == Fw::ParamValid::VALID) {
stat = buff.deserialize(this->m_ParamStruct);
if (stat != Fw::FW_SERIALIZE_OK) {
this->m_param_ParamStruct_valid = Fw::ParamValid::INVALID;
}
}
else {
// No default
}
this->m_paramLock.unLock();
// Call notifier
this->parametersLoaded();
}
// ----------------------------------------------------------------------
// Component construction and destruction
// ----------------------------------------------------------------------
ActiveSerialComponentBase ::
ActiveSerialComponentBase(const char* compName) :
Fw::ActiveComponentBase(compName)
{
// Write telemetry channel ChannelU32OnChange
this->m_first_update_ChannelU32OnChange = true;
this->m_last_ChannelU32OnChange = 0;
// Write telemetry channel ChannelEnumOnChange
this->m_first_update_ChannelEnumOnChange = true;
this->m_EventActivityLowThrottledThrottle = 0;
this->m_EventFatalThrottledThrottle = 0;
this->m_EventWarningLowThrottledThrottle = 0;
this->m_param_ParamU32_valid = Fw::ParamValid::UNINIT;
this->m_param_ParamF64_valid = Fw::ParamValid::UNINIT;
this->m_param_ParamString_valid = Fw::ParamValid::UNINIT;
this->m_param_ParamEnum_valid = Fw::ParamValid::UNINIT;
this->m_param_ParamArray_valid = Fw::ParamValid::UNINIT;
this->m_param_ParamStruct_valid = Fw::ParamValid::UNINIT;
}
ActiveSerialComponentBase ::
~ActiveSerialComponentBase()
{
}
// ----------------------------------------------------------------------
// Getters for numbers of special input ports
// ----------------------------------------------------------------------
NATIVE_INT_TYPE ActiveSerialComponentBase ::
getNum_cmdIn_InputPorts() const
{
return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_cmdIn_InputPort));
}
// ----------------------------------------------------------------------
// Getters for numbers of typed input ports
// ----------------------------------------------------------------------
NATIVE_INT_TYPE ActiveSerialComponentBase ::
getNum_noArgsAsync_InputPorts() const
{
return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_noArgsAsync_InputPort));
}
NATIVE_INT_TYPE ActiveSerialComponentBase ::
getNum_noArgsGuarded_InputPorts() const
{
return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_noArgsGuarded_InputPort));
}
NATIVE_INT_TYPE ActiveSerialComponentBase ::
getNum_noArgsReturnGuarded_InputPorts() const
{
return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_noArgsReturnGuarded_InputPort));
}
NATIVE_INT_TYPE ActiveSerialComponentBase ::
getNum_noArgsReturnSync_InputPorts() const
{
return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_noArgsReturnSync_InputPort));
}
NATIVE_INT_TYPE ActiveSerialComponentBase ::
getNum_noArgsSync_InputPorts() const
{
return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_noArgsSync_InputPort));
}
NATIVE_INT_TYPE ActiveSerialComponentBase ::
getNum_typedAsync_InputPorts() const
{
return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_typedAsync_InputPort));
}
NATIVE_INT_TYPE ActiveSerialComponentBase ::
getNum_typedAsyncAssert_InputPorts() const
{
return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_typedAsyncAssert_InputPort));
}
NATIVE_INT_TYPE ActiveSerialComponentBase ::
getNum_typedAsyncBlockPriority_InputPorts() const
{
return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_typedAsyncBlockPriority_InputPort));
}
NATIVE_INT_TYPE ActiveSerialComponentBase ::
getNum_typedAsyncDropPriority_InputPorts() const
{
return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_typedAsyncDropPriority_InputPort));
}
NATIVE_INT_TYPE ActiveSerialComponentBase ::
getNum_typedGuarded_InputPorts() const
{
return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_typedGuarded_InputPort));
}
NATIVE_INT_TYPE ActiveSerialComponentBase ::
getNum_typedReturnGuarded_InputPorts() const
{
return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_typedReturnGuarded_InputPort));
}
NATIVE_INT_TYPE ActiveSerialComponentBase ::
getNum_typedReturnSync_InputPorts() const
{
return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_typedReturnSync_InputPort));
}
NATIVE_INT_TYPE ActiveSerialComponentBase ::
getNum_typedSync_InputPorts() const
{
return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_typedSync_InputPort));
}
// ----------------------------------------------------------------------
// Getters for numbers of serial input ports
// ----------------------------------------------------------------------
NATIVE_INT_TYPE ActiveSerialComponentBase ::
getNum_serialAsync_InputPorts() const
{
return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_serialAsync_InputPort));
}
NATIVE_INT_TYPE ActiveSerialComponentBase ::
getNum_serialAsyncAssert_InputPorts() const
{
return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_serialAsyncAssert_InputPort));
}
NATIVE_INT_TYPE ActiveSerialComponentBase ::
getNum_serialAsyncBlockPriority_InputPorts() const
{
return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_serialAsyncBlockPriority_InputPort));
}
NATIVE_INT_TYPE ActiveSerialComponentBase ::
getNum_serialAsyncDropPriority_InputPorts() const
{
return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_serialAsyncDropPriority_InputPort));
}
NATIVE_INT_TYPE ActiveSerialComponentBase ::
getNum_serialGuarded_InputPorts() const
{
return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_serialGuarded_InputPort));
}
NATIVE_INT_TYPE ActiveSerialComponentBase ::
getNum_serialSync_InputPorts() const
{
return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_serialSync_InputPort));
}
// ----------------------------------------------------------------------
// Getters for numbers of special output ports
// ----------------------------------------------------------------------
NATIVE_INT_TYPE ActiveSerialComponentBase ::
getNum_cmdRegOut_OutputPorts() const
{
return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_cmdRegOut_OutputPort));
}
NATIVE_INT_TYPE ActiveSerialComponentBase ::
getNum_cmdResponseOut_OutputPorts() const
{
return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_cmdResponseOut_OutputPort));
}
NATIVE_INT_TYPE ActiveSerialComponentBase ::
getNum_eventOut_OutputPorts() const
{
return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_eventOut_OutputPort));
}
NATIVE_INT_TYPE ActiveSerialComponentBase ::
getNum_prmGetOut_OutputPorts() const
{
return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_prmGetOut_OutputPort));
}
NATIVE_INT_TYPE ActiveSerialComponentBase ::
getNum_prmSetOut_OutputPorts() const
{
return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_prmSetOut_OutputPort));
}
#if FW_ENABLE_TEXT_LOGGING == 1
NATIVE_INT_TYPE ActiveSerialComponentBase ::
getNum_textEventOut_OutputPorts() const
{
return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_textEventOut_OutputPort));
}
#endif
NATIVE_INT_TYPE ActiveSerialComponentBase ::
getNum_timeGetOut_OutputPorts() const
{
return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_timeGetOut_OutputPort));
}
NATIVE_INT_TYPE ActiveSerialComponentBase ::
getNum_tlmOut_OutputPorts() const
{
return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_tlmOut_OutputPort));
}
// ----------------------------------------------------------------------
// Getters for numbers of typed output ports
// ----------------------------------------------------------------------
NATIVE_INT_TYPE ActiveSerialComponentBase ::
getNum_noArgsOut_OutputPorts() const
{
return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_noArgsOut_OutputPort));
}
NATIVE_INT_TYPE ActiveSerialComponentBase ::
getNum_noArgsReturnOut_OutputPorts() const
{
return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_noArgsReturnOut_OutputPort));
}
NATIVE_INT_TYPE ActiveSerialComponentBase ::
getNum_typedOut_OutputPorts() const
{
return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_typedOut_OutputPort));
}
NATIVE_INT_TYPE ActiveSerialComponentBase ::
getNum_typedReturnOut_OutputPorts() const
{
return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_typedReturnOut_OutputPort));
}
// ----------------------------------------------------------------------
// Getters for numbers of serial output ports
// ----------------------------------------------------------------------
NATIVE_INT_TYPE ActiveSerialComponentBase ::
getNum_serialOut_OutputPorts() const
{
return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_serialOut_OutputPort));
}
// ----------------------------------------------------------------------
// Connection status queries for special output ports
// ----------------------------------------------------------------------
bool ActiveSerialComponentBase ::
isConnected_cmdRegOut_OutputPort(NATIVE_INT_TYPE portNum)
{
FW_ASSERT(
portNum < this->getNum_cmdRegOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
return this->m_cmdRegOut_OutputPort[portNum].isConnected();
}
bool ActiveSerialComponentBase ::
isConnected_cmdResponseOut_OutputPort(NATIVE_INT_TYPE portNum)
{
FW_ASSERT(
portNum < this->getNum_cmdResponseOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
return this->m_cmdResponseOut_OutputPort[portNum].isConnected();
}
bool ActiveSerialComponentBase ::
isConnected_eventOut_OutputPort(NATIVE_INT_TYPE portNum)
{
FW_ASSERT(
portNum < this->getNum_eventOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
return this->m_eventOut_OutputPort[portNum].isConnected();
}
bool ActiveSerialComponentBase ::
isConnected_prmGetOut_OutputPort(NATIVE_INT_TYPE portNum)
{
FW_ASSERT(
portNum < this->getNum_prmGetOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
return this->m_prmGetOut_OutputPort[portNum].isConnected();
}
bool ActiveSerialComponentBase ::
isConnected_prmSetOut_OutputPort(NATIVE_INT_TYPE 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 ActiveSerialComponentBase ::
isConnected_textEventOut_OutputPort(NATIVE_INT_TYPE portNum)
{
FW_ASSERT(
portNum < this->getNum_textEventOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
return this->m_textEventOut_OutputPort[portNum].isConnected();
}
#endif
bool ActiveSerialComponentBase ::
isConnected_timeGetOut_OutputPort(NATIVE_INT_TYPE portNum)
{
FW_ASSERT(
portNum < this->getNum_timeGetOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
return this->m_timeGetOut_OutputPort[portNum].isConnected();
}
bool ActiveSerialComponentBase ::
isConnected_tlmOut_OutputPort(NATIVE_INT_TYPE 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 ActiveSerialComponentBase ::
isConnected_noArgsOut_OutputPort(NATIVE_INT_TYPE portNum)
{
FW_ASSERT(
portNum < this->getNum_noArgsOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
return this->m_noArgsOut_OutputPort[portNum].isConnected();
}
bool ActiveSerialComponentBase ::
isConnected_noArgsReturnOut_OutputPort(NATIVE_INT_TYPE portNum)
{
FW_ASSERT(
portNum < this->getNum_noArgsReturnOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
return this->m_noArgsReturnOut_OutputPort[portNum].isConnected();
}
bool ActiveSerialComponentBase ::
isConnected_typedOut_OutputPort(NATIVE_INT_TYPE portNum)
{
FW_ASSERT(
portNum < this->getNum_typedOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
return this->m_typedOut_OutputPort[portNum].isConnected();
}
bool ActiveSerialComponentBase ::
isConnected_typedReturnOut_OutputPort(NATIVE_INT_TYPE portNum)
{
FW_ASSERT(
portNum < this->getNum_typedReturnOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
return this->m_typedReturnOut_OutputPort[portNum].isConnected();
}
// ----------------------------------------------------------------------
// Connection status queries for serial output ports
// ----------------------------------------------------------------------
bool ActiveSerialComponentBase ::
isConnected_serialOut_OutputPort(NATIVE_INT_TYPE portNum)
{
FW_ASSERT(
portNum < this->getNum_serialOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
return this->m_serialOut_OutputPort[portNum].isConnected();
}
// ----------------------------------------------------------------------
// Port handler base-class functions for typed input ports
//
// Call these functions directly to bypass the corresponding ports
// ----------------------------------------------------------------------
void ActiveSerialComponentBase ::
noArgsAsync_handlerBase(NATIVE_INT_TYPE 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<NATIVE_INT_TYPE>(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 ActiveSerialComponentBase ::
noArgsGuarded_handlerBase(NATIVE_INT_TYPE 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 ActiveSerialComponentBase ::
noArgsReturnGuarded_handlerBase(NATIVE_INT_TYPE 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 ActiveSerialComponentBase ::
noArgsReturnSync_handlerBase(NATIVE_INT_TYPE 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 ActiveSerialComponentBase ::
noArgsSync_handlerBase(NATIVE_INT_TYPE 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 ActiveSerialComponentBase ::
typedAsync_handlerBase(
NATIVE_INT_TYPE 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<NATIVE_INT_TYPE>(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 ActiveSerialComponentBase ::
typedAsyncAssert_handlerBase(
NATIVE_INT_TYPE 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<NATIVE_INT_TYPE>(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 ActiveSerialComponentBase ::
typedAsyncBlockPriority_handlerBase(
NATIVE_INT_TYPE 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<NATIVE_INT_TYPE>(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 ActiveSerialComponentBase ::
typedAsyncDropPriority_handlerBase(
NATIVE_INT_TYPE 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<NATIVE_INT_TYPE>(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 ActiveSerialComponentBase ::
typedGuarded_handlerBase(
NATIVE_INT_TYPE 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 ActiveSerialComponentBase ::
typedReturnGuarded_handlerBase(
NATIVE_INT_TYPE 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 ActiveSerialComponentBase ::
typedReturnSync_handlerBase(
NATIVE_INT_TYPE 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 ActiveSerialComponentBase ::
typedSync_handlerBase(
NATIVE_INT_TYPE 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
);
}
// ----------------------------------------------------------------------
// Port handler base-class functions for serial input ports
//
// Call these functions directly to bypass the corresponding ports
// ----------------------------------------------------------------------
void ActiveSerialComponentBase ::
serialAsync_handlerBase(
NATIVE_INT_TYPE portNum,
Fw::SerializeBufferBase& buffer
)
{
// Make sure port number is valid
FW_ASSERT(
portNum < this->getNum_serialAsync_InputPorts(),
static_cast<FwAssertArgType>(portNum)
);
// Declare buffer for serialAsync
U8 msgBuff[this->m_msgSize];
Fw::ExternalSerializeBuffer msgSerBuff(msgBuff, this->m_msgSize);
Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK;
// Serialize message ID
_status = msgSerBuff.serialize(
static_cast<NATIVE_INT_TYPE>(SERIALASYNC_SERIAL)
);
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Serialize port number
_status = msgSerBuff.serialize(portNum);
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Serialize argument buffer
_status = msgSerBuff.serialize(buffer);
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(msgSerBuff, 0, _block);
FW_ASSERT(
qStatus == Os::Queue::QUEUE_OK,
static_cast<FwAssertArgType>(qStatus)
);
}
void ActiveSerialComponentBase ::
serialAsyncAssert_handlerBase(
NATIVE_INT_TYPE portNum,
Fw::SerializeBufferBase& buffer
)
{
// Make sure port number is valid
FW_ASSERT(
portNum < this->getNum_serialAsyncAssert_InputPorts(),
static_cast<FwAssertArgType>(portNum)
);
// Declare buffer for serialAsyncAssert
U8 msgBuff[this->m_msgSize];
Fw::ExternalSerializeBuffer msgSerBuff(msgBuff, this->m_msgSize);
Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK;
// Serialize message ID
_status = msgSerBuff.serialize(
static_cast<NATIVE_INT_TYPE>(SERIALASYNCASSERT_SERIAL)
);
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Serialize port number
_status = msgSerBuff.serialize(portNum);
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Serialize argument buffer
_status = msgSerBuff.serialize(buffer);
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(msgSerBuff, 0, _block);
FW_ASSERT(
qStatus == Os::Queue::QUEUE_OK,
static_cast<FwAssertArgType>(qStatus)
);
}
void ActiveSerialComponentBase ::
serialAsyncBlockPriority_handlerBase(
NATIVE_INT_TYPE portNum,
Fw::SerializeBufferBase& buffer
)
{
// Make sure port number is valid
FW_ASSERT(
portNum < this->getNum_serialAsyncBlockPriority_InputPorts(),
static_cast<FwAssertArgType>(portNum)
);
// Declare buffer for serialAsyncBlockPriority
U8 msgBuff[this->m_msgSize];
Fw::ExternalSerializeBuffer msgSerBuff(msgBuff, this->m_msgSize);
Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK;
// Serialize message ID
_status = msgSerBuff.serialize(
static_cast<NATIVE_INT_TYPE>(SERIALASYNCBLOCKPRIORITY_SERIAL)
);
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Serialize port number
_status = msgSerBuff.serialize(portNum);
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Serialize argument buffer
_status = msgSerBuff.serialize(buffer);
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(msgSerBuff, 10, _block);
FW_ASSERT(
qStatus == Os::Queue::QUEUE_OK,
static_cast<FwAssertArgType>(qStatus)
);
}
void ActiveSerialComponentBase ::
serialAsyncDropPriority_handlerBase(
NATIVE_INT_TYPE portNum,
Fw::SerializeBufferBase& buffer
)
{
// Make sure port number is valid
FW_ASSERT(
portNum < this->getNum_serialAsyncDropPriority_InputPorts(),
static_cast<FwAssertArgType>(portNum)
);
// Declare buffer for serialAsyncDropPriority
U8 msgBuff[this->m_msgSize];
Fw::ExternalSerializeBuffer msgSerBuff(msgBuff, this->m_msgSize);
Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK;
// Serialize message ID
_status = msgSerBuff.serialize(
static_cast<NATIVE_INT_TYPE>(SERIALASYNCDROPPRIORITY_SERIAL)
);
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Serialize port number
_status = msgSerBuff.serialize(portNum);
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Serialize argument buffer
_status = msgSerBuff.serialize(buffer);
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(msgSerBuff, 5, _block);
if (qStatus == Os::Queue::QUEUE_FULL) {
this->incNumMsgDropped();
return;
}
FW_ASSERT(
qStatus == Os::Queue::QUEUE_OK,
static_cast<FwAssertArgType>(qStatus)
);
}
void ActiveSerialComponentBase ::
serialGuarded_handlerBase(
NATIVE_INT_TYPE portNum,
Fw::SerializeBufferBase& buffer
)
{
// Make sure port number is valid
FW_ASSERT(
portNum < this->getNum_serialGuarded_InputPorts(),
static_cast<FwAssertArgType>(portNum)
);
// Lock guard mutex before calling
this->lock();
// Call handler function
this->serialGuarded_handler(
portNum,
buffer
);
// Unlock guard mutex
this->unLock();
}
void ActiveSerialComponentBase ::
serialSync_handlerBase(
NATIVE_INT_TYPE portNum,
Fw::SerializeBufferBase& buffer
)
{
// Make sure port number is valid
FW_ASSERT(
portNum < this->getNum_serialSync_InputPorts(),
static_cast<FwAssertArgType>(portNum)
);
// Call handler function
this->serialSync_handler(
portNum,
buffer
);
}
// ----------------------------------------------------------------------
// 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 ActiveSerialComponentBase ::
noArgsAsync_preMsgHook(NATIVE_INT_TYPE portNum)
{
// Default: no-op
}
void ActiveSerialComponentBase ::
typedAsync_preMsgHook(
NATIVE_INT_TYPE 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 ActiveSerialComponentBase ::
typedAsyncAssert_preMsgHook(
NATIVE_INT_TYPE 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 ActiveSerialComponentBase ::
typedAsyncBlockPriority_preMsgHook(
NATIVE_INT_TYPE 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 ActiveSerialComponentBase ::
typedAsyncDropPriority_preMsgHook(
NATIVE_INT_TYPE portNum,
U32 u32,
F32 f32,
bool b,
const Ports::TypedPortStrings::StringSize80& str1,
const E& e,
const A& a,
const S& s
)
{
// Default: no-op
}
// ----------------------------------------------------------------------
// Pre-message hooks for serial 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 ActiveSerialComponentBase ::
serialAsync_preMsgHook(
NATIVE_INT_TYPE portNum,
Fw::SerializeBufferBase& buffer
)
{
// Default: no-op
}
void ActiveSerialComponentBase ::
serialAsyncAssert_preMsgHook(
NATIVE_INT_TYPE portNum,
Fw::SerializeBufferBase& buffer
)
{
// Default: no-op
}
void ActiveSerialComponentBase ::
serialAsyncBlockPriority_preMsgHook(
NATIVE_INT_TYPE portNum,
Fw::SerializeBufferBase& buffer
)
{
// Default: no-op
}
void ActiveSerialComponentBase ::
serialAsyncDropPriority_preMsgHook(
NATIVE_INT_TYPE portNum,
Fw::SerializeBufferBase& buffer
)
{
// Default: no-op
}
// ----------------------------------------------------------------------
// Invocation functions for typed output ports
// ----------------------------------------------------------------------
void ActiveSerialComponentBase ::
noArgsOut_out(NATIVE_INT_TYPE portNum)
{
FW_ASSERT(
portNum < this->getNum_noArgsOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
this->m_noArgsOut_OutputPort[portNum].invoke();
}
U32 ActiveSerialComponentBase ::
noArgsReturnOut_out(NATIVE_INT_TYPE portNum)
{
FW_ASSERT(
portNum < this->getNum_noArgsReturnOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
return this->m_noArgsReturnOut_OutputPort[portNum].invoke();
}
void ActiveSerialComponentBase ::
typedOut_out(
NATIVE_INT_TYPE 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 ActiveSerialComponentBase ::
typedReturnOut_out(
NATIVE_INT_TYPE 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
);
}
// ----------------------------------------------------------------------
// Invocation functions for serial output ports
// ----------------------------------------------------------------------
Fw::SerializeStatus ActiveSerialComponentBase ::
serialOut_out(
NATIVE_INT_TYPE portNum,
Fw::SerializeBufferBase& buffer
)
{
FW_ASSERT(
portNum < this->getNum_serialOut_OutputPorts(),
static_cast<FwAssertArgType>(portNum)
);
return this->m_serialOut_OutputPort[portNum].invokeSerial(
buffer
);
}
// ----------------------------------------------------------------------
// Internal interface base-class functions
// ----------------------------------------------------------------------
void ActiveSerialComponentBase ::
internalArray_internalInterfaceInvoke(const A& a)
{
ComponentIpcSerializableBuffer msg;
Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK;
// Serialize the message ID
_status = msg.serialize(static_cast<NATIVE_INT_TYPE>(INT_IF_INTERNALARRAY));
FW_ASSERT (
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Fake port number to make message dequeue work
_status = msg.serialize(static_cast<NATIVE_INT_TYPE>(0));
FW_ASSERT (
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
_status = msg.serialize(a);
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 ActiveSerialComponentBase ::
internalEnum_internalInterfaceInvoke(const E& e)
{
ComponentIpcSerializableBuffer msg;
Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK;
// Serialize the message ID
_status = msg.serialize(static_cast<NATIVE_INT_TYPE>(INT_IF_INTERNALENUM));
FW_ASSERT (
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Fake port number to make message dequeue work
_status = msg.serialize(static_cast<NATIVE_INT_TYPE>(0));
FW_ASSERT (
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
_status = msg.serialize(e);
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 ActiveSerialComponentBase ::
internalPrimitive_internalInterfaceInvoke(
U32 u32,
F32 f32,
bool b
)
{
ComponentIpcSerializableBuffer msg;
Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK;
// Serialize the message ID
_status = msg.serialize(static_cast<NATIVE_INT_TYPE>(INT_IF_INTERNALPRIMITIVE));
FW_ASSERT (
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Fake port number to make message dequeue work
_status = msg.serialize(static_cast<NATIVE_INT_TYPE>(0));
FW_ASSERT (
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
_status = msg.serialize(u32);
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
_status = msg.serialize(f32);
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
_status = msg.serialize(b);
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);
FW_ASSERT(
qStatus == Os::Queue::QUEUE_OK,
static_cast<FwAssertArgType>(qStatus)
);
}
void ActiveSerialComponentBase ::
internalPriorityDrop_internalInterfaceInvoke()
{
ComponentIpcSerializableBuffer msg;
Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK;
// Serialize the message ID
_status = msg.serialize(static_cast<NATIVE_INT_TYPE>(INT_IF_INTERNALPRIORITYDROP));
FW_ASSERT (
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Fake port number to make message dequeue work
_status = msg.serialize(static_cast<NATIVE_INT_TYPE>(0));
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);
if (qStatus == Os::Queue::QUEUE_FULL) {
this->incNumMsgDropped();
return;
}
FW_ASSERT(
qStatus == Os::Queue::QUEUE_OK,
static_cast<FwAssertArgType>(qStatus)
);
}
void ActiveSerialComponentBase ::
internalString_internalInterfaceInvoke(
const Fw::InternalInterfaceString& str1,
const Fw::InternalInterfaceString& str2
)
{
ComponentIpcSerializableBuffer msg;
Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK;
// Serialize the message ID
_status = msg.serialize(static_cast<NATIVE_INT_TYPE>(INT_IF_INTERNALSTRING));
FW_ASSERT (
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Fake port number to make message dequeue work
_status = msg.serialize(static_cast<NATIVE_INT_TYPE>(0));
FW_ASSERT (
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
_status = msg.serialize(str1);
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
_status = msg.serialize(str2);
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 ActiveSerialComponentBase ::
internalStruct_internalInterfaceInvoke(const S& s)
{
ComponentIpcSerializableBuffer msg;
Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK;
// Serialize the message ID
_status = msg.serialize(static_cast<NATIVE_INT_TYPE>(INT_IF_INTERNALSTRUCT));
FW_ASSERT (
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Fake port number to make message dequeue work
_status = msg.serialize(static_cast<NATIVE_INT_TYPE>(0));
FW_ASSERT (
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
_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, 20, _block);
if (qStatus == Os::Queue::QUEUE_FULL) {
this->incNumMsgDropped();
return;
}
FW_ASSERT(
qStatus == Os::Queue::QUEUE_OK,
static_cast<FwAssertArgType>(qStatus)
);
}
// ----------------------------------------------------------------------
// Command response
// ----------------------------------------------------------------------
void ActiveSerialComponentBase ::
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 ActiveSerialComponentBase ::
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 ActiveSerialComponentBase ::
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 ActiveSerialComponentBase ::
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 ActiveSerialComponentBase ::
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 ActiveSerialComponentBase ::
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 ActiveSerialComponentBase ::
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 ActiveSerialComponentBase ::
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 ActiveSerialComponentBase ::
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 ActiveSerialComponentBase ::
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 ActiveSerialComponentBase ::
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 ActiveSerialComponentBase ::
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 ActiveSerialComponentBase ::
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 ActiveSerialComponentBase ::
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<NATIVE_INT_TYPE>(CMD_CMD_ASYNC));
FW_ASSERT (
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Fake port number to make message dequeue work
NATIVE_INT_TYPE 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 ActiveSerialComponentBase ::
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<NATIVE_INT_TYPE>(CMD_CMD_PRIORITY));
FW_ASSERT (
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Fake port number to make message dequeue work
NATIVE_INT_TYPE 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 ActiveSerialComponentBase ::
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<NATIVE_INT_TYPE>(CMD_CMD_PARAMS_PRIORITY));
FW_ASSERT (
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Fake port number to make message dequeue work
NATIVE_INT_TYPE 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 ActiveSerialComponentBase ::
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<NATIVE_INT_TYPE>(CMD_CMD_DROP));
FW_ASSERT (
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Fake port number to make message dequeue work
NATIVE_INT_TYPE 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 ActiveSerialComponentBase ::
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<NATIVE_INT_TYPE>(CMD_CMD_PARAMS_PRIORITY_DROP));
FW_ASSERT (
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// Fake port number to make message dequeue work
NATIVE_INT_TYPE 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 ActiveSerialComponentBase ::
CMD_ASYNC_preMsgHook(
FwOpcodeType opCode,
U32 cmdSeq
)
{
// Defaults to no-op; can be overridden
}
void ActiveSerialComponentBase ::
CMD_PRIORITY_preMsgHook(
FwOpcodeType opCode,
U32 cmdSeq
)
{
// Defaults to no-op; can be overridden
}
void ActiveSerialComponentBase ::
CMD_PARAMS_PRIORITY_preMsgHook(
FwOpcodeType opCode,
U32 cmdSeq
)
{
// Defaults to no-op; can be overridden
}
void ActiveSerialComponentBase ::
CMD_DROP_preMsgHook(
FwOpcodeType opCode,
U32 cmdSeq
)
{
// Defaults to no-op; can be overridden
}
void ActiveSerialComponentBase ::
CMD_PARAMS_PRIORITY_DROP_preMsgHook(
FwOpcodeType opCode,
U32 cmdSeq
)
{
// Defaults to no-op; can be overridden
}
// ----------------------------------------------------------------------
// Event logging functions
// ----------------------------------------------------------------------
void ActiveSerialComponentBase ::
log_ACTIVITY_HI_EventActivityHigh()
{
// Get the time
Fw::Time _logTime;
if (this->m_timeGetOut_OutputPort[0].isConnected()) {
this->m_timeGetOut_OutputPort[0].invoke(_logTime);
}
FwEventIdType _id = static_cast<FwEventIdType>(0);
_id = this->getIdBase() + EVENTID_EVENTACTIVITYHIGH;
// Emit the event on the log port
if (this->m_eventOut_OutputPort[0].isConnected()) {
Fw::LogBuffer _logBuff;
#if FW_AMPCS_COMPATIBLE
Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK;
// Serialize the number of arguments
_status = _logBuff.serialize(static_cast<U8>(0));
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
#endif
this->m_eventOut_OutputPort[0].invoke(
_id,
_logTime,
Fw::LogSeverity::ACTIVITY_HI,
_logBuff
);
}
// Emit the event on the text log port
#if FW_ENABLE_TEXT_LOGGING
if (this->m_textEventOut_OutputPort[0].isConnected()) {
#if FW_OBJECT_NAMES == 1
const char* _formatString =
"(%s) %s: Event Activity High occurred";
#else
const char* _formatString =
"%s: Event Activity High occurred";
#endif
char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
(void) snprintf(
_textBuffer,
FW_LOG_TEXT_BUFFER_SIZE,
_formatString,
#if FW_OBJECT_NAMES == 1
this->m_objName,
#endif
"EventActivityHigh "
);
// Null terminate
_textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
Fw::TextLogString _logString = _textBuffer;
this->m_textEventOut_OutputPort[0].invoke(
_id,
_logTime,
Fw::LogSeverity::ACTIVITY_HI,
_logString
);
}
#endif
}
void ActiveSerialComponentBase ::
log_ACTIVITY_LO_EventActivityLowThrottled(
U32 u32,
F32 f32,
bool b
)
{
// Check throttle value
if (this->m_EventActivityLowThrottledThrottle >= EVENTID_EVENTACTIVITYLOWTHROTTLED_THROTTLE) {
return;
}
else {
this->m_EventActivityLowThrottledThrottle++;
}
// Get the time
Fw::Time _logTime;
if (this->m_timeGetOut_OutputPort[0].isConnected()) {
this->m_timeGetOut_OutputPort[0].invoke(_logTime);
}
FwEventIdType _id = static_cast<FwEventIdType>(0);
_id = this->getIdBase() + EVENTID_EVENTACTIVITYLOWTHROTTLED;
// Emit the event on the log port
if (this->m_eventOut_OutputPort[0].isConnected()) {
Fw::LogBuffer _logBuff;
Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK;
#if FW_AMPCS_COMPATIBLE
// Serialize the number of arguments
_status = _logBuff.serialize(static_cast<U8>(3));
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
#endif
#if FW_AMPCS_COMPATIBLE
// Serialize the argument size
_status = _logBuff.serialize(
static_cast<U8>(sizeof(U32))
);
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
#endif
_status = _logBuff.serialize(u32);
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
#if FW_AMPCS_COMPATIBLE
// Serialize the argument size
_status = _logBuff.serialize(
static_cast<U8>(sizeof(F32))
);
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
#endif
_status = _logBuff.serialize(f32);
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
#if FW_AMPCS_COMPATIBLE
// Serialize the argument size
_status = _logBuff.serialize(
static_cast<U8>(sizeof(U8))
);
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
#endif
_status = _logBuff.serialize(b);
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
this->m_eventOut_OutputPort[0].invoke(
_id,
_logTime,
Fw::LogSeverity::ACTIVITY_LO,
_logBuff
);
}
// Emit the event on the text log port
#if FW_ENABLE_TEXT_LOGGING
if (this->m_textEventOut_OutputPort[0].isConnected()) {
#if FW_OBJECT_NAMES == 1
const char* _formatString =
"(%s) %s: Event Activity Low occurred with arguments: %" PRIu32 ", %f, %d";
#else
const char* _formatString =
"%s: Event Activity Low occurred with arguments: %" PRIu32 ", %f, %d";
#endif
char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
(void) snprintf(
_textBuffer,
FW_LOG_TEXT_BUFFER_SIZE,
_formatString,
#if FW_OBJECT_NAMES == 1
this->m_objName,
#endif
"EventActivityLowThrottled ",
u32,
f32,
b
);
// Null terminate
_textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
Fw::TextLogString _logString = _textBuffer;
this->m_textEventOut_OutputPort[0].invoke(
_id,
_logTime,
Fw::LogSeverity::ACTIVITY_LO,
_logString
);
}
#endif
}
void ActiveSerialComponentBase ::
log_COMMAND_EventCommand(
const Fw::LogStringArg& str1,
const Fw::LogStringArg& str2
)
{
// Get the time
Fw::Time _logTime;
if (this->m_timeGetOut_OutputPort[0].isConnected()) {
this->m_timeGetOut_OutputPort[0].invoke(_logTime);
}
FwEventIdType _id = static_cast<FwEventIdType>(0);
_id = this->getIdBase() + EVENTID_EVENTCOMMAND;
// Emit the event on the log port
if (this->m_eventOut_OutputPort[0].isConnected()) {
Fw::LogBuffer _logBuff;
Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK;
#if FW_AMPCS_COMPATIBLE
// Serialize the number of arguments
_status = _logBuff.serialize(static_cast<U8>(2));
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
#endif
_status = str1.serialize(_logBuff, 80);
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
_status = str2.serialize(_logBuff, 100);
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
this->m_eventOut_OutputPort[0].invoke(
_id,
_logTime,
Fw::LogSeverity::COMMAND,
_logBuff
);
}
// Emit the event on the text log port
#if FW_ENABLE_TEXT_LOGGING
if (this->m_textEventOut_OutputPort[0].isConnected()) {
#if FW_OBJECT_NAMES == 1
const char* _formatString =
"(%s) %s: Event Command occurred with arguments: %s, %s";
#else
const char* _formatString =
"%s: Event Command occurred with arguments: %s, %s";
#endif
char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
(void) snprintf(
_textBuffer,
FW_LOG_TEXT_BUFFER_SIZE,
_formatString,
#if FW_OBJECT_NAMES == 1
this->m_objName,
#endif
"EventCommand ",
str1.toChar(),
str2.toChar()
);
// Null terminate
_textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
Fw::TextLogString _logString = _textBuffer;
this->m_textEventOut_OutputPort[0].invoke(
_id,
_logTime,
Fw::LogSeverity::COMMAND,
_logString
);
}
#endif
}
void ActiveSerialComponentBase ::
log_DIAGNOSTIC_EventDiagnostic(E e)
{
// Get the time
Fw::Time _logTime;
if (this->m_timeGetOut_OutputPort[0].isConnected()) {
this->m_timeGetOut_OutputPort[0].invoke(_logTime);
}
FwEventIdType _id = static_cast<FwEventIdType>(0);
_id = this->getIdBase() + EVENTID_EVENTDIAGNOSTIC;
// Emit the event on the log port
if (this->m_eventOut_OutputPort[0].isConnected()) {
Fw::LogBuffer _logBuff;
Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK;
#if FW_AMPCS_COMPATIBLE
// Serialize the number of arguments
_status = _logBuff.serialize(static_cast<U8>(1));
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
#endif
#if FW_AMPCS_COMPATIBLE
// Serialize the argument size
_status = _logBuff.serialize(
static_cast<U8>(E::SERIALIZED_SIZE)
);
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
#endif
_status = _logBuff.serialize(e);
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
this->m_eventOut_OutputPort[0].invoke(
_id,
_logTime,
Fw::LogSeverity::DIAGNOSTIC,
_logBuff
);
}
// Emit the event on the text log port
#if FW_ENABLE_TEXT_LOGGING
if (this->m_textEventOut_OutputPort[0].isConnected()) {
#if FW_OBJECT_NAMES == 1
const char* _formatString =
"(%s) %s: Event Diagnostic occurred with argument: %s";
#else
const char* _formatString =
"%s: Event Diagnostic occurred with argument: %s";
#endif
char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
Fw::String eStr;
e.toString(eStr);
(void) snprintf(
_textBuffer,
FW_LOG_TEXT_BUFFER_SIZE,
_formatString,
#if FW_OBJECT_NAMES == 1
this->m_objName,
#endif
"EventDiagnostic ",
eStr.toChar()
);
// Null terminate
_textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
Fw::TextLogString _logString = _textBuffer;
this->m_textEventOut_OutputPort[0].invoke(
_id,
_logTime,
Fw::LogSeverity::DIAGNOSTIC,
_logString
);
}
#endif
}
void ActiveSerialComponentBase ::
log_FATAL_EventFatalThrottled(A a)
{
// Check throttle value
if (this->m_EventFatalThrottledThrottle >= EVENTID_EVENTFATALTHROTTLED_THROTTLE) {
return;
}
else {
this->m_EventFatalThrottledThrottle++;
}
// Get the time
Fw::Time _logTime;
if (this->m_timeGetOut_OutputPort[0].isConnected()) {
this->m_timeGetOut_OutputPort[0].invoke(_logTime);
}
FwEventIdType _id = static_cast<FwEventIdType>(0);
_id = this->getIdBase() + EVENTID_EVENTFATALTHROTTLED;
// Emit the event on the log port
if (this->m_eventOut_OutputPort[0].isConnected()) {
Fw::LogBuffer _logBuff;
Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK;
#if FW_AMPCS_COMPATIBLE
// Serialize the number of arguments
_status = _logBuff.serialize(static_cast<U8>(1 + 1));
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
// For FATAL, add stack size of 4 and a dummy entry. No support for stacks yet.
_status = _logBuff.serialize(static_cast<U8>(4));
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
_status = _logBuff.serialize(static_cast<U32>(0));
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
#endif
#if FW_AMPCS_COMPATIBLE
// Serialize the argument size
_status = _logBuff.serialize(
static_cast<U8>(A::SERIALIZED_SIZE)
);
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
#endif
_status = _logBuff.serialize(a);
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
this->m_eventOut_OutputPort[0].invoke(
_id,
_logTime,
Fw::LogSeverity::FATAL,
_logBuff
);
}
// Emit the event on the text log port
#if FW_ENABLE_TEXT_LOGGING
if (this->m_textEventOut_OutputPort[0].isConnected()) {
#if FW_OBJECT_NAMES == 1
const char* _formatString =
"(%s) %s: Event Fatal occurred with argument: %s";
#else
const char* _formatString =
"%s: Event Fatal occurred with argument: %s";
#endif
char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
Fw::String aStr;
a.toString(aStr);
(void) snprintf(
_textBuffer,
FW_LOG_TEXT_BUFFER_SIZE,
_formatString,
#if FW_OBJECT_NAMES == 1
this->m_objName,
#endif
"EventFatalThrottled ",
aStr.toChar()
);
// Null terminate
_textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
Fw::TextLogString _logString = _textBuffer;
this->m_textEventOut_OutputPort[0].invoke(
_id,
_logTime,
Fw::LogSeverity::FATAL,
_logString
);
}
#endif
}
void ActiveSerialComponentBase ::
log_WARNING_HI_EventWarningHigh(S s)
{
// Get the time
Fw::Time _logTime;
if (this->m_timeGetOut_OutputPort[0].isConnected()) {
this->m_timeGetOut_OutputPort[0].invoke(_logTime);
}
FwEventIdType _id = static_cast<FwEventIdType>(0);
_id = this->getIdBase() + EVENTID_EVENTWARNINGHIGH;
// Emit the event on the log port
if (this->m_eventOut_OutputPort[0].isConnected()) {
Fw::LogBuffer _logBuff;
Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK;
#if FW_AMPCS_COMPATIBLE
// Serialize the number of arguments
_status = _logBuff.serialize(static_cast<U8>(1));
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
#endif
#if FW_AMPCS_COMPATIBLE
// Serialize the argument size
_status = _logBuff.serialize(
static_cast<U8>(S::SERIALIZED_SIZE)
);
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
#endif
_status = _logBuff.serialize(s);
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
this->m_eventOut_OutputPort[0].invoke(
_id,
_logTime,
Fw::LogSeverity::WARNING_HI,
_logBuff
);
}
// Emit the event on the text log port
#if FW_ENABLE_TEXT_LOGGING
if (this->m_textEventOut_OutputPort[0].isConnected()) {
#if FW_OBJECT_NAMES == 1
const char* _formatString =
"(%s) %s: Event Warning High occurred with argument: %s";
#else
const char* _formatString =
"%s: Event Warning High occurred with argument: %s";
#endif
char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
Fw::String sStr;
s.toString(sStr);
(void) snprintf(
_textBuffer,
FW_LOG_TEXT_BUFFER_SIZE,
_formatString,
#if FW_OBJECT_NAMES == 1
this->m_objName,
#endif
"EventWarningHigh ",
sStr.toChar()
);
// Null terminate
_textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
Fw::TextLogString _logString = _textBuffer;
this->m_textEventOut_OutputPort[0].invoke(
_id,
_logTime,
Fw::LogSeverity::WARNING_HI,
_logString
);
}
#endif
}
void ActiveSerialComponentBase ::
log_WARNING_LO_EventWarningLowThrottled()
{
// Check throttle value
if (this->m_EventWarningLowThrottledThrottle >= EVENTID_EVENTWARNINGLOWTHROTTLED_THROTTLE) {
return;
}
else {
this->m_EventWarningLowThrottledThrottle++;
}
// Get the time
Fw::Time _logTime;
if (this->m_timeGetOut_OutputPort[0].isConnected()) {
this->m_timeGetOut_OutputPort[0].invoke(_logTime);
}
FwEventIdType _id = static_cast<FwEventIdType>(0);
_id = this->getIdBase() + EVENTID_EVENTWARNINGLOWTHROTTLED;
// Emit the event on the log port
if (this->m_eventOut_OutputPort[0].isConnected()) {
Fw::LogBuffer _logBuff;
#if FW_AMPCS_COMPATIBLE
Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK;
// Serialize the number of arguments
_status = _logBuff.serialize(static_cast<U8>(0));
FW_ASSERT(
_status == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_status)
);
#endif
this->m_eventOut_OutputPort[0].invoke(
_id,
_logTime,
Fw::LogSeverity::WARNING_LO,
_logBuff
);
}
// Emit the event on the text log port
#if FW_ENABLE_TEXT_LOGGING
if (this->m_textEventOut_OutputPort[0].isConnected()) {
#if FW_OBJECT_NAMES == 1
const char* _formatString =
"(%s) %s: Event Warning Low occurred";
#else
const char* _formatString =
"%s: Event Warning Low occurred";
#endif
char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
(void) snprintf(
_textBuffer,
FW_LOG_TEXT_BUFFER_SIZE,
_formatString,
#if FW_OBJECT_NAMES == 1
this->m_objName,
#endif
"EventWarningLowThrottled "
);
// Null terminate
_textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
Fw::TextLogString _logString = _textBuffer;
this->m_textEventOut_OutputPort[0].invoke(
_id,
_logTime,
Fw::LogSeverity::WARNING_LO,
_logString
);
}
#endif
}
// ----------------------------------------------------------------------
// Event throttle reset functions
// ----------------------------------------------------------------------
void ActiveSerialComponentBase ::
log_ACTIVITY_LO_EventActivityLowThrottled_ThrottleClear()
{
// Reset throttle counter
this->m_EventActivityLowThrottledThrottle = 0;
}
void ActiveSerialComponentBase ::
log_FATAL_EventFatalThrottled_ThrottleClear()
{
// Reset throttle counter
this->m_EventFatalThrottledThrottle = 0;
}
void ActiveSerialComponentBase ::
log_WARNING_LO_EventWarningLowThrottled_ThrottleClear()
{
// Reset throttle counter
this->m_EventWarningLowThrottledThrottle = 0;
}
// ----------------------------------------------------------------------
// Telemetry write functions
// ----------------------------------------------------------------------
void ActiveSerialComponentBase ::
tlmWrite_ChannelU32Format(
U32 arg,
Fw::Time _tlmTime
)
{
if (this->m_tlmOut_OutputPort[0].isConnected()) {
if (
this->m_timeGetOut_OutputPort[0].isConnected() &&
(_tlmTime == Fw::ZERO_TIME)
) {
this->m_timeGetOut_OutputPort[0].invoke(_tlmTime);
}
Fw::TlmBuffer _tlmBuff;
Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
FW_ASSERT(
_stat == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_stat)
);
FwChanIdType _id;
_id = this->getIdBase() + CHANNELID_CHANNELU32FORMAT;
this->m_tlmOut_OutputPort[0].invoke(
_id,
_tlmTime,
_tlmBuff
);
}
}
void ActiveSerialComponentBase ::
tlmWrite_ChannelF32Format(
F32 arg,
Fw::Time _tlmTime
)
{
if (this->m_tlmOut_OutputPort[0].isConnected()) {
if (
this->m_timeGetOut_OutputPort[0].isConnected() &&
(_tlmTime == Fw::ZERO_TIME)
) {
this->m_timeGetOut_OutputPort[0].invoke(_tlmTime);
}
Fw::TlmBuffer _tlmBuff;
Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
FW_ASSERT(
_stat == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_stat)
);
FwChanIdType _id;
_id = this->getIdBase() + CHANNELID_CHANNELF32FORMAT;
this->m_tlmOut_OutputPort[0].invoke(
_id,
_tlmTime,
_tlmBuff
);
}
}
void ActiveSerialComponentBase ::
tlmWrite_ChannelStringFormat(
const Fw::TlmString& arg,
Fw::Time _tlmTime
)
{
if (this->m_tlmOut_OutputPort[0].isConnected()) {
if (
this->m_timeGetOut_OutputPort[0].isConnected() &&
(_tlmTime == Fw::ZERO_TIME)
) {
this->m_timeGetOut_OutputPort[0].invoke(_tlmTime);
}
Fw::TlmBuffer _tlmBuff;
Fw::SerializeStatus _stat = arg.serialize(_tlmBuff, 80);
FW_ASSERT(
_stat == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_stat)
);
FwChanIdType _id;
_id = this->getIdBase() + CHANNELID_CHANNELSTRINGFORMAT;
this->m_tlmOut_OutputPort[0].invoke(
_id,
_tlmTime,
_tlmBuff
);
}
}
void ActiveSerialComponentBase ::
tlmWrite_ChannelEnum(
const E& arg,
Fw::Time _tlmTime
)
{
if (this->m_tlmOut_OutputPort[0].isConnected()) {
if (
this->m_timeGetOut_OutputPort[0].isConnected() &&
(_tlmTime == Fw::ZERO_TIME)
) {
this->m_timeGetOut_OutputPort[0].invoke(_tlmTime);
}
Fw::TlmBuffer _tlmBuff;
Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
FW_ASSERT(
_stat == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_stat)
);
FwChanIdType _id;
_id = this->getIdBase() + CHANNELID_CHANNELENUM;
this->m_tlmOut_OutputPort[0].invoke(
_id,
_tlmTime,
_tlmBuff
);
}
}
void ActiveSerialComponentBase ::
tlmWrite_ChannelArrayFreq(
const A& arg,
Fw::Time _tlmTime
)
{
if (this->m_tlmOut_OutputPort[0].isConnected()) {
if (
this->m_timeGetOut_OutputPort[0].isConnected() &&
(_tlmTime == Fw::ZERO_TIME)
) {
this->m_timeGetOut_OutputPort[0].invoke(_tlmTime);
}
Fw::TlmBuffer _tlmBuff;
Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
FW_ASSERT(
_stat == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_stat)
);
FwChanIdType _id;
_id = this->getIdBase() + CHANNELID_CHANNELARRAYFREQ;
this->m_tlmOut_OutputPort[0].invoke(
_id,
_tlmTime,
_tlmBuff
);
}
}
void ActiveSerialComponentBase ::
tlmWrite_ChannelStructFreq(
const S& arg,
Fw::Time _tlmTime
)
{
if (this->m_tlmOut_OutputPort[0].isConnected()) {
if (
this->m_timeGetOut_OutputPort[0].isConnected() &&
(_tlmTime == Fw::ZERO_TIME)
) {
this->m_timeGetOut_OutputPort[0].invoke(_tlmTime);
}
Fw::TlmBuffer _tlmBuff;
Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
FW_ASSERT(
_stat == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_stat)
);
FwChanIdType _id;
_id = this->getIdBase() + CHANNELID_CHANNELSTRUCTFREQ;
this->m_tlmOut_OutputPort[0].invoke(
_id,
_tlmTime,
_tlmBuff
);
}
}
void ActiveSerialComponentBase ::
tlmWrite_ChannelU32Limits(
U32 arg,
Fw::Time _tlmTime
)
{
if (this->m_tlmOut_OutputPort[0].isConnected()) {
if (
this->m_timeGetOut_OutputPort[0].isConnected() &&
(_tlmTime == Fw::ZERO_TIME)
) {
this->m_timeGetOut_OutputPort[0].invoke(_tlmTime);
}
Fw::TlmBuffer _tlmBuff;
Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
FW_ASSERT(
_stat == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_stat)
);
FwChanIdType _id;
_id = this->getIdBase() + CHANNELID_CHANNELU32LIMITS;
this->m_tlmOut_OutputPort[0].invoke(
_id,
_tlmTime,
_tlmBuff
);
}
}
void ActiveSerialComponentBase ::
tlmWrite_ChannelF32Limits(
F32 arg,
Fw::Time _tlmTime
)
{
if (this->m_tlmOut_OutputPort[0].isConnected()) {
if (
this->m_timeGetOut_OutputPort[0].isConnected() &&
(_tlmTime == Fw::ZERO_TIME)
) {
this->m_timeGetOut_OutputPort[0].invoke(_tlmTime);
}
Fw::TlmBuffer _tlmBuff;
Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
FW_ASSERT(
_stat == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_stat)
);
FwChanIdType _id;
_id = this->getIdBase() + CHANNELID_CHANNELF32LIMITS;
this->m_tlmOut_OutputPort[0].invoke(
_id,
_tlmTime,
_tlmBuff
);
}
}
void ActiveSerialComponentBase ::
tlmWrite_ChannelF64(
F64 arg,
Fw::Time _tlmTime
)
{
if (this->m_tlmOut_OutputPort[0].isConnected()) {
if (
this->m_timeGetOut_OutputPort[0].isConnected() &&
(_tlmTime == Fw::ZERO_TIME)
) {
this->m_timeGetOut_OutputPort[0].invoke(_tlmTime);
}
Fw::TlmBuffer _tlmBuff;
Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
FW_ASSERT(
_stat == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_stat)
);
FwChanIdType _id;
_id = this->getIdBase() + CHANNELID_CHANNELF64;
this->m_tlmOut_OutputPort[0].invoke(
_id,
_tlmTime,
_tlmBuff
);
}
}
void ActiveSerialComponentBase ::
tlmWrite_ChannelU32OnChange(
U32 arg,
Fw::Time _tlmTime
)
{
// Check to see if it is the first time
if (not this->m_first_update_ChannelU32OnChange) {
// Check to see if value has changed. If not, don't write it.
if (arg == this->m_last_ChannelU32OnChange) {
return;
}
else {
this->m_last_ChannelU32OnChange = arg;
}
}
else {
this->m_first_update_ChannelU32OnChange = false;
this->m_last_ChannelU32OnChange = arg;
}
if (this->m_tlmOut_OutputPort[0].isConnected()) {
if (
this->m_timeGetOut_OutputPort[0].isConnected() &&
(_tlmTime == Fw::ZERO_TIME)
) {
this->m_timeGetOut_OutputPort[0].invoke(_tlmTime);
}
Fw::TlmBuffer _tlmBuff;
Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
FW_ASSERT(
_stat == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_stat)
);
FwChanIdType _id;
_id = this->getIdBase() + CHANNELID_CHANNELU32ONCHANGE;
this->m_tlmOut_OutputPort[0].invoke(
_id,
_tlmTime,
_tlmBuff
);
}
}
void ActiveSerialComponentBase ::
tlmWrite_ChannelEnumOnChange(
const E& arg,
Fw::Time _tlmTime
)
{
// Check to see if it is the first time
if (not this->m_first_update_ChannelEnumOnChange) {
// Check to see if value has changed. If not, don't write it.
if (arg == this->m_last_ChannelEnumOnChange) {
return;
}
else {
this->m_last_ChannelEnumOnChange = arg;
}
}
else {
this->m_first_update_ChannelEnumOnChange = false;
this->m_last_ChannelEnumOnChange = arg;
}
if (this->m_tlmOut_OutputPort[0].isConnected()) {
if (
this->m_timeGetOut_OutputPort[0].isConnected() &&
(_tlmTime == Fw::ZERO_TIME)
) {
this->m_timeGetOut_OutputPort[0].invoke(_tlmTime);
}
Fw::TlmBuffer _tlmBuff;
Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
FW_ASSERT(
_stat == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(_stat)
);
FwChanIdType _id;
_id = this->getIdBase() + CHANNELID_CHANNELENUMONCHANGE;
this->m_tlmOut_OutputPort[0].invoke(
_id,
_tlmTime,
_tlmBuff
);
}
}
// ----------------------------------------------------------------------
// Parameter update hook
// ----------------------------------------------------------------------
void ActiveSerialComponentBase ::
parameterUpdated(FwPrmIdType id)
{
// Do nothing by default
}
void ActiveSerialComponentBase ::
parametersLoaded()
{
// Do nothing by default
}
// ----------------------------------------------------------------------
// Parameter get functions
// ----------------------------------------------------------------------
U32 ActiveSerialComponentBase ::
paramGet_ParamU32(Fw::ParamValid& valid)
{
U32 _local;
this->m_paramLock.lock();
valid = this->m_param_ParamU32_valid;
_local = this->m_ParamU32;
this->m_paramLock.unLock();
return _local;
}
F64 ActiveSerialComponentBase ::
paramGet_ParamF64(Fw::ParamValid& valid)
{
F64 _local;
this->m_paramLock.lock();
valid = this->m_param_ParamF64_valid;
_local = this->m_ParamF64;
this->m_paramLock.unLock();
return _local;
}
Fw::ParamString ActiveSerialComponentBase ::
paramGet_ParamString(Fw::ParamValid& valid)
{
Fw::ParamString _local;
this->m_paramLock.lock();
valid = this->m_param_ParamString_valid;
_local = this->m_ParamString;
this->m_paramLock.unLock();
return _local;
}
E ActiveSerialComponentBase ::
paramGet_ParamEnum(Fw::ParamValid& valid)
{
E _local;
this->m_paramLock.lock();
valid = this->m_param_ParamEnum_valid;
_local = this->m_ParamEnum;
this->m_paramLock.unLock();
return _local;
}
A ActiveSerialComponentBase ::
paramGet_ParamArray(Fw::ParamValid& valid)
{
A _local;
this->m_paramLock.lock();
valid = this->m_param_ParamArray_valid;
_local = this->m_ParamArray;
this->m_paramLock.unLock();
return _local;
}
S ActiveSerialComponentBase ::
paramGet_ParamStruct(Fw::ParamValid& valid)
{
S _local;
this->m_paramLock.lock();
valid = this->m_param_ParamStruct_valid;
_local = this->m_ParamStruct;
this->m_paramLock.unLock();
return _local;
}
// ----------------------------------------------------------------------
// Time
// ----------------------------------------------------------------------
Fw::Time ActiveSerialComponentBase ::
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 ActiveSerialComponentBase ::
lock()
{
this->m_guardedPortMutex.lock();
}
void ActiveSerialComponentBase ::
unLock()
{
this->m_guardedPortMutex.unLock();
}
// ----------------------------------------------------------------------
// Message dispatch functions
// ----------------------------------------------------------------------
Fw::QueuedComponentBase::MsgDispatchStatus ActiveSerialComponentBase ::
doDispatch()
{
U8 msgBuff[this->m_msgSize];
Fw::ExternalSerializeBuffer msg(msgBuff,this->m_msgSize);
NATIVE_INT_TYPE 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();
NATIVE_INT_TYPE 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 == ACTIVESERIAL_COMPONENT_EXIT) {
return MSG_DISPATCH_EXIT;
}
NATIVE_INT_TYPE 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 async input port serialAsync
case SERIALASYNC_SERIAL: {
// Deserialize serialized buffer into new buffer
U8 handBuff[this->m_msgSize];
Fw::ExternalSerializeBuffer serHandBuff(handBuff,this->m_msgSize);
deserStatus = msg.deserialize(serHandBuff);
FW_ASSERT(
deserStatus == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(deserStatus)
);
this->serialAsync_handler(portNum, serHandBuff);
break;
}
// Handle async input port serialAsyncAssert
case SERIALASYNCASSERT_SERIAL: {
// Deserialize serialized buffer into new buffer
U8 handBuff[this->m_msgSize];
Fw::ExternalSerializeBuffer serHandBuff(handBuff,this->m_msgSize);
deserStatus = msg.deserialize(serHandBuff);
FW_ASSERT(
deserStatus == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(deserStatus)
);
this->serialAsyncAssert_handler(portNum, serHandBuff);
break;
}
// Handle async input port serialAsyncBlockPriority
case SERIALASYNCBLOCKPRIORITY_SERIAL: {
// Deserialize serialized buffer into new buffer
U8 handBuff[this->m_msgSize];
Fw::ExternalSerializeBuffer serHandBuff(handBuff,this->m_msgSize);
deserStatus = msg.deserialize(serHandBuff);
FW_ASSERT(
deserStatus == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(deserStatus)
);
this->serialAsyncBlockPriority_handler(portNum, serHandBuff);
break;
}
// Handle async input port serialAsyncDropPriority
case SERIALASYNCDROPPRIORITY_SERIAL: {
// Deserialize serialized buffer into new buffer
U8 handBuff[this->m_msgSize];
Fw::ExternalSerializeBuffer serHandBuff(handBuff,this->m_msgSize);
deserStatus = msg.deserialize(serHandBuff);
FW_ASSERT(
deserStatus == Fw::FW_SERIALIZE_OK,
static_cast<FwAssertArgType>(deserStatus)
);
this->serialAsyncDropPriority_handler(portNum, serHandBuff);
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;
}
// Handle internal interface internalArray
case INT_IF_INTERNALARRAY: {
A a;
deserStatus = msg.deserialize(a);
// Internal interface should always deserialize
FW_ASSERT(
Fw::FW_SERIALIZE_OK == deserStatus,
static_cast<FwAssertArgType>(deserStatus)
);
// Make sure there was no data left over.
// That means the buffer size was incorrect.
FW_ASSERT(
msg.getBuffLeft() == 0,
static_cast<FwAssertArgType>(msg.getBuffLeft())
);
// Call handler function
this->internalArray_internalInterfaceHandler(
a
);
break;
}
// Handle internal interface internalEnum
case INT_IF_INTERNALENUM: {
E e;
deserStatus = msg.deserialize(e);
// Internal interface should always deserialize
FW_ASSERT(
Fw::FW_SERIALIZE_OK == deserStatus,
static_cast<FwAssertArgType>(deserStatus)
);
// Make sure there was no data left over.
// That means the buffer size was incorrect.
FW_ASSERT(
msg.getBuffLeft() == 0,
static_cast<FwAssertArgType>(msg.getBuffLeft())
);
// Call handler function
this->internalEnum_internalInterfaceHandler(
e
);
break;
}
// Handle internal interface internalPrimitive
case INT_IF_INTERNALPRIMITIVE: {
U32 u32;
deserStatus = msg.deserialize(u32);
// Internal interface should always deserialize
FW_ASSERT(
Fw::FW_SERIALIZE_OK == deserStatus,
static_cast<FwAssertArgType>(deserStatus)
);
F32 f32;
deserStatus = msg.deserialize(f32);
// Internal interface should always deserialize
FW_ASSERT(
Fw::FW_SERIALIZE_OK == deserStatus,
static_cast<FwAssertArgType>(deserStatus)
);
bool b;
deserStatus = msg.deserialize(b);
// Internal interface should always deserialize
FW_ASSERT(
Fw::FW_SERIALIZE_OK == deserStatus,
static_cast<FwAssertArgType>(deserStatus)
);
// Make sure there was no data left over.
// That means the buffer size was incorrect.
FW_ASSERT(
msg.getBuffLeft() == 0,
static_cast<FwAssertArgType>(msg.getBuffLeft())
);
// Call handler function
this->internalPrimitive_internalInterfaceHandler(
u32,
f32,
b
);
break;
}
// Handle internal interface internalPriorityDrop
case INT_IF_INTERNALPRIORITYDROP: {
// Make sure there was no data left over.
// That means the buffer size was incorrect.
FW_ASSERT(
msg.getBuffLeft() == 0,
static_cast<FwAssertArgType>(msg.getBuffLeft())
);
// Call handler function
this->internalPriorityDrop_internalInterfaceHandler();
break;
}
// Handle internal interface internalString
case INT_IF_INTERNALSTRING: {
Fw::InternalInterfaceString str1;
deserStatus = msg.deserialize(str1);
// Internal interface should always deserialize
FW_ASSERT(
Fw::FW_SERIALIZE_OK == deserStatus,
static_cast<FwAssertArgType>(deserStatus)
);
Fw::InternalInterfaceString str2;
deserStatus = msg.deserialize(str2);
// Internal interface should always deserialize
FW_ASSERT(
Fw::FW_SERIALIZE_OK == deserStatus,
static_cast<FwAssertArgType>(deserStatus)
);
// Make sure there was no data left over.
// That means the buffer size was incorrect.
FW_ASSERT(
msg.getBuffLeft() == 0,
static_cast<FwAssertArgType>(msg.getBuffLeft())
);
// Call handler function
this->internalString_internalInterfaceHandler(
str1,
str2
);
break;
}
// Handle internal interface internalStruct
case INT_IF_INTERNALSTRUCT: {
S s;
deserStatus = msg.deserialize(s);
// Internal interface should always deserialize
FW_ASSERT(
Fw::FW_SERIALIZE_OK == deserStatus,
static_cast<FwAssertArgType>(deserStatus)
);
// Make sure there was no data left over.
// That means the buffer size was incorrect.
FW_ASSERT(
msg.getBuffLeft() == 0,
static_cast<FwAssertArgType>(msg.getBuffLeft())
);
// Call handler function
this->internalStruct_internalInterfaceHandler(
s
);
break;
}
default:
return MSG_DISPATCH_ERROR;
}
return MSG_DISPATCH_OK;
}
// ----------------------------------------------------------------------
// Calls for messages received on special input ports
// ----------------------------------------------------------------------
void ActiveSerialComponentBase ::
m_p_cmdIn_in(
Fw::PassiveComponentBase* callComp,
NATIVE_INT_TYPE portNum,
FwOpcodeType opCode,
U32 cmdSeq,
Fw::CmdArgBuffer& args
)
{
FW_ASSERT(callComp);
ActiveSerialComponentBase* compPtr = static_cast<ActiveSerialComponentBase*>(callComp);
const U32 idBase = callComp->getIdBase();
FW_ASSERT(opCode >= idBase, opCode, 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;
}
case OPCODE_PARAMU32_SET: {
Fw::CmdResponse _cstat = compPtr->paramSet_ParamU32(args);
compPtr->cmdResponse_out(
opCode,
cmdSeq,
_cstat
);
break;
}
case OPCODE_PARAMU32_SAVE: {
Fw::CmdResponse _cstat = compPtr->paramSave_ParamU32();
compPtr->cmdResponse_out(
opCode,
cmdSeq,
_cstat
);
break;
}
case OPCODE_PARAMF64_SET: {
Fw::CmdResponse _cstat = compPtr->paramSet_ParamF64(args);
compPtr->cmdResponse_out(
opCode,
cmdSeq,
_cstat
);
break;
}
case OPCODE_PARAMF64_SAVE: {
Fw::CmdResponse _cstat = compPtr->paramSave_ParamF64();
compPtr->cmdResponse_out(
opCode,
cmdSeq,
_cstat
);
break;
}
case OPCODE_PARAMSTRING_SET: {
Fw::CmdResponse _cstat = compPtr->paramSet_ParamString(args);
compPtr->cmdResponse_out(
opCode,
cmdSeq,
_cstat
);
break;
}
case OPCODE_PARAMSTRING_SAVE: {
Fw::CmdResponse _cstat = compPtr->paramSave_ParamString();
compPtr->cmdResponse_out(
opCode,
cmdSeq,
_cstat
);
break;
}
case OPCODE_PARAMENUM_SET: {
Fw::CmdResponse _cstat = compPtr->paramSet_ParamEnum(args);
compPtr->cmdResponse_out(
opCode,
cmdSeq,
_cstat
);
break;
}
case OPCODE_PARAMENUM_SAVE: {
Fw::CmdResponse _cstat = compPtr->paramSave_ParamEnum();
compPtr->cmdResponse_out(
opCode,
cmdSeq,
_cstat
);
break;
}
case OPCODE_PARAMARRAY_SET: {
Fw::CmdResponse _cstat = compPtr->paramSet_ParamArray(args);
compPtr->cmdResponse_out(
opCode,
cmdSeq,
_cstat
);
break;
}
case OPCODE_PARAMARRAY_SAVE: {
Fw::CmdResponse _cstat = compPtr->paramSave_ParamArray();
compPtr->cmdResponse_out(
opCode,
cmdSeq,
_cstat
);
break;
}
case OPCODE_PARAMSTRUCT_SET: {
Fw::CmdResponse _cstat = compPtr->paramSet_ParamStruct(args);
compPtr->cmdResponse_out(
opCode,
cmdSeq,
_cstat
);
break;
}
case OPCODE_PARAMSTRUCT_SAVE: {
Fw::CmdResponse _cstat = compPtr->paramSave_ParamStruct();
compPtr->cmdResponse_out(
opCode,
cmdSeq,
_cstat
);
break;
}
}
}
// ----------------------------------------------------------------------
// Calls for messages received on typed input ports
// ----------------------------------------------------------------------
void ActiveSerialComponentBase ::
m_p_noArgsAsync_in(
Fw::PassiveComponentBase* callComp,
NATIVE_INT_TYPE portNum
)
{
FW_ASSERT(callComp);
ActiveSerialComponentBase* compPtr = static_cast<ActiveSerialComponentBase*>(callComp);
compPtr->noArgsAsync_handlerBase(portNum);
}
void ActiveSerialComponentBase ::
m_p_noArgsGuarded_in(
Fw::PassiveComponentBase* callComp,
NATIVE_INT_TYPE portNum
)
{
FW_ASSERT(callComp);
ActiveSerialComponentBase* compPtr = static_cast<ActiveSerialComponentBase*>(callComp);
compPtr->noArgsGuarded_handlerBase(portNum);
}
U32 ActiveSerialComponentBase ::
m_p_noArgsReturnGuarded_in(
Fw::PassiveComponentBase* callComp,
NATIVE_INT_TYPE portNum
)
{
FW_ASSERT(callComp);
ActiveSerialComponentBase* compPtr = static_cast<ActiveSerialComponentBase*>(callComp);
return compPtr->noArgsReturnGuarded_handlerBase(portNum);
}
U32 ActiveSerialComponentBase ::
m_p_noArgsReturnSync_in(
Fw::PassiveComponentBase* callComp,
NATIVE_INT_TYPE portNum
)
{
FW_ASSERT(callComp);
ActiveSerialComponentBase* compPtr = static_cast<ActiveSerialComponentBase*>(callComp);
return compPtr->noArgsReturnSync_handlerBase(portNum);
}
void ActiveSerialComponentBase ::
m_p_noArgsSync_in(
Fw::PassiveComponentBase* callComp,
NATIVE_INT_TYPE portNum
)
{
FW_ASSERT(callComp);
ActiveSerialComponentBase* compPtr = static_cast<ActiveSerialComponentBase*>(callComp);
compPtr->noArgsSync_handlerBase(portNum);
}
void ActiveSerialComponentBase ::
m_p_typedAsync_in(
Fw::PassiveComponentBase* callComp,
NATIVE_INT_TYPE portNum,
U32 u32,
F32 f32,
bool b,
const Ports::TypedPortStrings::StringSize80& str1,
const E& e,
const A& a,
const S& s
)
{
FW_ASSERT(callComp);
ActiveSerialComponentBase* compPtr = static_cast<ActiveSerialComponentBase*>(callComp);
compPtr->typedAsync_handlerBase(
portNum,
u32,
f32,
b,
str1,
e,
a,
s
);
}
void ActiveSerialComponentBase ::
m_p_typedAsyncAssert_in(
Fw::PassiveComponentBase* callComp,
NATIVE_INT_TYPE portNum,
U32 u32,
F32 f32,
bool b,
const Ports::TypedPortStrings::StringSize80& str1,
const E& e,
const A& a,
const S& s
)
{
FW_ASSERT(callComp);
ActiveSerialComponentBase* compPtr = static_cast<ActiveSerialComponentBase*>(callComp);
compPtr->typedAsyncAssert_handlerBase(
portNum,
u32,
f32,
b,
str1,
e,
a,
s
);
}
void ActiveSerialComponentBase ::
m_p_typedAsyncBlockPriority_in(
Fw::PassiveComponentBase* callComp,
NATIVE_INT_TYPE portNum,
U32 u32,
F32 f32,
bool b,
const Ports::TypedPortStrings::StringSize80& str1,
const E& e,
const A& a,
const S& s
)
{
FW_ASSERT(callComp);
ActiveSerialComponentBase* compPtr = static_cast<ActiveSerialComponentBase*>(callComp);
compPtr->typedAsyncBlockPriority_handlerBase(
portNum,
u32,
f32,
b,
str1,
e,
a,
s
);
}
void ActiveSerialComponentBase ::
m_p_typedAsyncDropPriority_in(
Fw::PassiveComponentBase* callComp,
NATIVE_INT_TYPE portNum,
U32 u32,
F32 f32,
bool b,
const Ports::TypedPortStrings::StringSize80& str1,
const E& e,
const A& a,
const S& s
)
{
FW_ASSERT(callComp);
ActiveSerialComponentBase* compPtr = static_cast<ActiveSerialComponentBase*>(callComp);
compPtr->typedAsyncDropPriority_handlerBase(
portNum,
u32,
f32,
b,
str1,
e,
a,
s
);
}
void ActiveSerialComponentBase ::
m_p_typedGuarded_in(
Fw::PassiveComponentBase* callComp,
NATIVE_INT_TYPE portNum,
U32 u32,
F32 f32,
bool b,
const Ports::TypedPortStrings::StringSize80& str1,
const E& e,
const A& a,
const S& s
)
{
FW_ASSERT(callComp);
ActiveSerialComponentBase* compPtr = static_cast<ActiveSerialComponentBase*>(callComp);
compPtr->typedGuarded_handlerBase(
portNum,
u32,
f32,
b,
str1,
e,
a,
s
);
}
F32 ActiveSerialComponentBase ::
m_p_typedReturnGuarded_in(
Fw::PassiveComponentBase* callComp,
NATIVE_INT_TYPE portNum,
U32 u32,
F32 f32,
bool b,
const Ports::TypedReturnPortStrings::StringSize80& str2,
const E& e,
const A& a,
const S& s
)
{
FW_ASSERT(callComp);
ActiveSerialComponentBase* compPtr = static_cast<ActiveSerialComponentBase*>(callComp);
return compPtr->typedReturnGuarded_handlerBase(
portNum,
u32,
f32,
b,
str2,
e,
a,
s
);
}
F32 ActiveSerialComponentBase ::
m_p_typedReturnSync_in(
Fw::PassiveComponentBase* callComp,
NATIVE_INT_TYPE portNum,
U32 u32,
F32 f32,
bool b,
const Ports::TypedReturnPortStrings::StringSize80& str2,
const E& e,
const A& a,
const S& s
)
{
FW_ASSERT(callComp);
ActiveSerialComponentBase* compPtr = static_cast<ActiveSerialComponentBase*>(callComp);
return compPtr->typedReturnSync_handlerBase(
portNum,
u32,
f32,
b,
str2,
e,
a,
s
);
}
void ActiveSerialComponentBase ::
m_p_typedSync_in(
Fw::PassiveComponentBase* callComp,
NATIVE_INT_TYPE portNum,
U32 u32,
F32 f32,
bool b,
const Ports::TypedPortStrings::StringSize80& str1,
const E& e,
const A& a,
const S& s
)
{
FW_ASSERT(callComp);
ActiveSerialComponentBase* compPtr = static_cast<ActiveSerialComponentBase*>(callComp);
compPtr->typedSync_handlerBase(
portNum,
u32,
f32,
b,
str1,
e,
a,
s
);
}
// ----------------------------------------------------------------------
// Calls for messages received on serial input ports
// ----------------------------------------------------------------------
#if FW_PORT_SERIALIZATION
void ActiveSerialComponentBase ::
m_p_serialAsync_in(
Fw::PassiveComponentBase* callComp,
NATIVE_INT_TYPE portNum,
Fw::SerializeBufferBase& buffer
)
{
FW_ASSERT(callComp);
ActiveSerialComponentBase* compPtr = static_cast<ActiveSerialComponentBase*>(callComp);
compPtr->serialAsync_handlerBase(
portNum,
buffer
);
}
void ActiveSerialComponentBase ::
m_p_serialAsyncAssert_in(
Fw::PassiveComponentBase* callComp,
NATIVE_INT_TYPE portNum,
Fw::SerializeBufferBase& buffer
)
{
FW_ASSERT(callComp);
ActiveSerialComponentBase* compPtr = static_cast<ActiveSerialComponentBase*>(callComp);
compPtr->serialAsyncAssert_handlerBase(
portNum,
buffer
);
}
void ActiveSerialComponentBase ::
m_p_serialAsyncBlockPriority_in(
Fw::PassiveComponentBase* callComp,
NATIVE_INT_TYPE portNum,
Fw::SerializeBufferBase& buffer
)
{
FW_ASSERT(callComp);
ActiveSerialComponentBase* compPtr = static_cast<ActiveSerialComponentBase*>(callComp);
compPtr->serialAsyncBlockPriority_handlerBase(
portNum,
buffer
);
}
void ActiveSerialComponentBase ::
m_p_serialAsyncDropPriority_in(
Fw::PassiveComponentBase* callComp,
NATIVE_INT_TYPE portNum,
Fw::SerializeBufferBase& buffer
)
{
FW_ASSERT(callComp);
ActiveSerialComponentBase* compPtr = static_cast<ActiveSerialComponentBase*>(callComp);
compPtr->serialAsyncDropPriority_handlerBase(
portNum,
buffer
);
}
void ActiveSerialComponentBase ::
m_p_serialGuarded_in(
Fw::PassiveComponentBase* callComp,
NATIVE_INT_TYPE portNum,
Fw::SerializeBufferBase& buffer
)
{
FW_ASSERT(callComp);
ActiveSerialComponentBase* compPtr = static_cast<ActiveSerialComponentBase*>(callComp);
compPtr->serialGuarded_handlerBase(
portNum,
buffer
);
}
void ActiveSerialComponentBase ::
m_p_serialSync_in(
Fw::PassiveComponentBase* callComp,
NATIVE_INT_TYPE portNum,
Fw::SerializeBufferBase& buffer
)
{
FW_ASSERT(callComp);
ActiveSerialComponentBase* compPtr = static_cast<ActiveSerialComponentBase*>(callComp);
compPtr->serialSync_handlerBase(
portNum,
buffer
);
}
#endif
// ----------------------------------------------------------------------
// Parameter set functions
// ----------------------------------------------------------------------
Fw::CmdResponse ActiveSerialComponentBase ::
paramSet_ParamU32(Fw::SerializeBufferBase& val)
{
U32 _local_val;
Fw::SerializeStatus _stat = val.deserialize(_local_val);
if (_stat != Fw::FW_SERIALIZE_OK) {
return Fw::CmdResponse::VALIDATION_ERROR;
}
// Assign value only if successfully deserialized
this->m_paramLock.lock();
this->m_ParamU32 = _local_val;
this->m_param_ParamU32_valid = Fw::ParamValid::VALID;
this->m_paramLock.unLock();
// Call notifier
this->parameterUpdated(PARAMID_PARAMU32);
return Fw::CmdResponse::OK;
}
Fw::CmdResponse ActiveSerialComponentBase ::
paramSet_ParamF64(Fw::SerializeBufferBase& val)
{
F64 _local_val;
Fw::SerializeStatus _stat = val.deserialize(_local_val);
if (_stat != Fw::FW_SERIALIZE_OK) {
return Fw::CmdResponse::VALIDATION_ERROR;
}
// Assign value only if successfully deserialized
this->m_paramLock.lock();
this->m_ParamF64 = _local_val;
this->m_param_ParamF64_valid = Fw::ParamValid::VALID;
this->m_paramLock.unLock();
// Call notifier
this->parameterUpdated(PARAMID_PARAMF64);
return Fw::CmdResponse::OK;
}
Fw::CmdResponse ActiveSerialComponentBase ::
paramSet_ParamString(Fw::SerializeBufferBase& val)
{
Fw::ParamString _local_val;
Fw::SerializeStatus _stat = val.deserialize(_local_val);
if (_stat != Fw::FW_SERIALIZE_OK) {
return Fw::CmdResponse::VALIDATION_ERROR;
}
// Assign value only if successfully deserialized
this->m_paramLock.lock();
this->m_ParamString = _local_val;
this->m_param_ParamString_valid = Fw::ParamValid::VALID;
this->m_paramLock.unLock();
// Call notifier
this->parameterUpdated(PARAMID_PARAMSTRING);
return Fw::CmdResponse::OK;
}
Fw::CmdResponse ActiveSerialComponentBase ::
paramSet_ParamEnum(Fw::SerializeBufferBase& val)
{
E _local_val;
Fw::SerializeStatus _stat = val.deserialize(_local_val);
if (_stat != Fw::FW_SERIALIZE_OK) {
return Fw::CmdResponse::VALIDATION_ERROR;
}
// Assign value only if successfully deserialized
this->m_paramLock.lock();
this->m_ParamEnum = _local_val;
this->m_param_ParamEnum_valid = Fw::ParamValid::VALID;
this->m_paramLock.unLock();
// Call notifier
this->parameterUpdated(PARAMID_PARAMENUM);
return Fw::CmdResponse::OK;
}
Fw::CmdResponse ActiveSerialComponentBase ::
paramSet_ParamArray(Fw::SerializeBufferBase& val)
{
A _local_val;
Fw::SerializeStatus _stat = val.deserialize(_local_val);
if (_stat != Fw::FW_SERIALIZE_OK) {
return Fw::CmdResponse::VALIDATION_ERROR;
}
// Assign value only if successfully deserialized
this->m_paramLock.lock();
this->m_ParamArray = _local_val;
this->m_param_ParamArray_valid = Fw::ParamValid::VALID;
this->m_paramLock.unLock();
// Call notifier
this->parameterUpdated(PARAMID_PARAMARRAY);
return Fw::CmdResponse::OK;
}
Fw::CmdResponse ActiveSerialComponentBase ::
paramSet_ParamStruct(Fw::SerializeBufferBase& val)
{
S _local_val;
Fw::SerializeStatus _stat = val.deserialize(_local_val);
if (_stat != Fw::FW_SERIALIZE_OK) {
return Fw::CmdResponse::VALIDATION_ERROR;
}
// Assign value only if successfully deserialized
this->m_paramLock.lock();
this->m_ParamStruct = _local_val;
this->m_param_ParamStruct_valid = Fw::ParamValid::VALID;
this->m_paramLock.unLock();
// Call notifier
this->parameterUpdated(PARAMID_PARAMSTRUCT);
return Fw::CmdResponse::OK;
}
// ----------------------------------------------------------------------
// Parameter save functions
// ----------------------------------------------------------------------
Fw::CmdResponse ActiveSerialComponentBase ::
paramSave_ParamU32()
{
if (this->m_prmSetOut_OutputPort[0].isConnected()) {
Fw::ParamBuffer saveBuff;
this->m_paramLock.lock();
Fw::SerializeStatus stat = saveBuff.serialize(m_ParamU32);
this->m_paramLock.unLock();
if (stat != Fw::FW_SERIALIZE_OK) {
return Fw::CmdResponse::VALIDATION_ERROR;
}
FwPrmIdType id = 0;
id = this->getIdBase() + PARAMID_PARAMU32;
// Save the parameter
this->m_prmSetOut_OutputPort[0].invoke(
id,
saveBuff
);
return Fw::CmdResponse::OK;
}
return Fw::CmdResponse::EXECUTION_ERROR;
}
Fw::CmdResponse ActiveSerialComponentBase ::
paramSave_ParamF64()
{
if (this->m_prmSetOut_OutputPort[0].isConnected()) {
Fw::ParamBuffer saveBuff;
this->m_paramLock.lock();
Fw::SerializeStatus stat = saveBuff.serialize(m_ParamF64);
this->m_paramLock.unLock();
if (stat != Fw::FW_SERIALIZE_OK) {
return Fw::CmdResponse::VALIDATION_ERROR;
}
FwPrmIdType id = 0;
id = this->getIdBase() + PARAMID_PARAMF64;
// Save the parameter
this->m_prmSetOut_OutputPort[0].invoke(
id,
saveBuff
);
return Fw::CmdResponse::OK;
}
return Fw::CmdResponse::EXECUTION_ERROR;
}
Fw::CmdResponse ActiveSerialComponentBase ::
paramSave_ParamString()
{
if (this->m_prmSetOut_OutputPort[0].isConnected()) {
Fw::ParamBuffer saveBuff;
this->m_paramLock.lock();
Fw::SerializeStatus stat = saveBuff.serialize(m_ParamString);
this->m_paramLock.unLock();
if (stat != Fw::FW_SERIALIZE_OK) {
return Fw::CmdResponse::VALIDATION_ERROR;
}
FwPrmIdType id = 0;
id = this->getIdBase() + PARAMID_PARAMSTRING;
// Save the parameter
this->m_prmSetOut_OutputPort[0].invoke(
id,
saveBuff
);
return Fw::CmdResponse::OK;
}
return Fw::CmdResponse::EXECUTION_ERROR;
}
Fw::CmdResponse ActiveSerialComponentBase ::
paramSave_ParamEnum()
{
if (this->m_prmSetOut_OutputPort[0].isConnected()) {
Fw::ParamBuffer saveBuff;
this->m_paramLock.lock();
Fw::SerializeStatus stat = saveBuff.serialize(m_ParamEnum);
this->m_paramLock.unLock();
if (stat != Fw::FW_SERIALIZE_OK) {
return Fw::CmdResponse::VALIDATION_ERROR;
}
FwPrmIdType id = 0;
id = this->getIdBase() + PARAMID_PARAMENUM;
// Save the parameter
this->m_prmSetOut_OutputPort[0].invoke(
id,
saveBuff
);
return Fw::CmdResponse::OK;
}
return Fw::CmdResponse::EXECUTION_ERROR;
}
Fw::CmdResponse ActiveSerialComponentBase ::
paramSave_ParamArray()
{
if (this->m_prmSetOut_OutputPort[0].isConnected()) {
Fw::ParamBuffer saveBuff;
this->m_paramLock.lock();
Fw::SerializeStatus stat = saveBuff.serialize(m_ParamArray);
this->m_paramLock.unLock();
if (stat != Fw::FW_SERIALIZE_OK) {
return Fw::CmdResponse::VALIDATION_ERROR;
}
FwPrmIdType id = 0;
id = this->getIdBase() + PARAMID_PARAMARRAY;
// Save the parameter
this->m_prmSetOut_OutputPort[0].invoke(
id,
saveBuff
);
return Fw::CmdResponse::OK;
}
return Fw::CmdResponse::EXECUTION_ERROR;
}
Fw::CmdResponse ActiveSerialComponentBase ::
paramSave_ParamStruct()
{
if (this->m_prmSetOut_OutputPort[0].isConnected()) {
Fw::ParamBuffer saveBuff;
this->m_paramLock.lock();
Fw::SerializeStatus stat = saveBuff.serialize(m_ParamStruct);
this->m_paramLock.unLock();
if (stat != Fw::FW_SERIALIZE_OK) {
return Fw::CmdResponse::VALIDATION_ERROR;
}
FwPrmIdType id = 0;
id = this->getIdBase() + PARAMID_PARAMSTRUCT;
// Save the parameter
this->m_prmSetOut_OutputPort[0].invoke(
id,
saveBuff
);
return Fw::CmdResponse::OK;
}
return Fw::CmdResponse::EXECUTION_ERROR;
}