mirror of
https://github.com/nasa/fpp.git
synced 2025-12-12 15:59:33 -06:00
4601 lines
107 KiB
C++
4601 lines
107 KiB
C++
// ======================================================================
|
|
// \title PassiveSerialComponentAc.cpp
|
|
// \author Generated by fpp-to-cpp
|
|
// \brief cpp file for PassiveSerial component base class
|
|
// ======================================================================
|
|
|
|
#include <cstdio>
|
|
|
|
#include "Fw/Types/Assert.hpp"
|
|
#if FW_ENABLE_TEXT_LOGGING
|
|
#include "Fw/Types/String.hpp"
|
|
#endif
|
|
#include "base/PassiveSerialComponentAc.hpp"
|
|
|
|
// ----------------------------------------------------------------------
|
|
// Component initialization
|
|
// ----------------------------------------------------------------------
|
|
|
|
void PassiveSerialComponentBase ::
|
|
init(FwEnumStoreType instance)
|
|
{
|
|
// Initialize base class
|
|
Fw::PassiveComponentBase::init(instance);
|
|
|
|
// Connect input port cmdIn
|
|
for (
|
|
FwIndexType port = 0;
|
|
port < static_cast<FwIndexType>(this->getNum_cmdIn_InputPorts());
|
|
port++
|
|
) {
|
|
this->m_cmdIn_InputPort[port].init();
|
|
this->m_cmdIn_InputPort[port].addCallComp(
|
|
this,
|
|
m_p_cmdIn_in
|
|
);
|
|
this->m_cmdIn_InputPort[port].setPortNum(port);
|
|
|
|
#if FW_OBJECT_NAMES == 1
|
|
Fw::ObjectName portName;
|
|
portName.format(
|
|
"%s_cmdIn_InputPort[%" PRI_PlatformIntType "]",
|
|
this->m_objName.toChar(),
|
|
port
|
|
);
|
|
this->m_cmdIn_InputPort[port].setObjName(portName.toChar());
|
|
#endif
|
|
}
|
|
|
|
// Connect input port noArgsGuarded
|
|
for (
|
|
FwIndexType port = 0;
|
|
port < static_cast<FwIndexType>(this->getNum_noArgsGuarded_InputPorts());
|
|
port++
|
|
) {
|
|
this->m_noArgsGuarded_InputPort[port].init();
|
|
this->m_noArgsGuarded_InputPort[port].addCallComp(
|
|
this,
|
|
m_p_noArgsGuarded_in
|
|
);
|
|
this->m_noArgsGuarded_InputPort[port].setPortNum(port);
|
|
|
|
#if FW_OBJECT_NAMES == 1
|
|
Fw::ObjectName portName;
|
|
portName.format(
|
|
"%s_noArgsGuarded_InputPort[%" PRI_PlatformIntType "]",
|
|
this->m_objName.toChar(),
|
|
port
|
|
);
|
|
this->m_noArgsGuarded_InputPort[port].setObjName(portName.toChar());
|
|
#endif
|
|
}
|
|
|
|
// Connect input port noArgsReturnGuarded
|
|
for (
|
|
FwIndexType port = 0;
|
|
port < static_cast<FwIndexType>(this->getNum_noArgsReturnGuarded_InputPorts());
|
|
port++
|
|
) {
|
|
this->m_noArgsReturnGuarded_InputPort[port].init();
|
|
this->m_noArgsReturnGuarded_InputPort[port].addCallComp(
|
|
this,
|
|
m_p_noArgsReturnGuarded_in
|
|
);
|
|
this->m_noArgsReturnGuarded_InputPort[port].setPortNum(port);
|
|
|
|
#if FW_OBJECT_NAMES == 1
|
|
Fw::ObjectName portName;
|
|
portName.format(
|
|
"%s_noArgsReturnGuarded_InputPort[%" PRI_PlatformIntType "]",
|
|
this->m_objName.toChar(),
|
|
port
|
|
);
|
|
this->m_noArgsReturnGuarded_InputPort[port].setObjName(portName.toChar());
|
|
#endif
|
|
}
|
|
|
|
// Connect input port noArgsReturnSync
|
|
for (
|
|
FwIndexType port = 0;
|
|
port < static_cast<FwIndexType>(this->getNum_noArgsReturnSync_InputPorts());
|
|
port++
|
|
) {
|
|
this->m_noArgsReturnSync_InputPort[port].init();
|
|
this->m_noArgsReturnSync_InputPort[port].addCallComp(
|
|
this,
|
|
m_p_noArgsReturnSync_in
|
|
);
|
|
this->m_noArgsReturnSync_InputPort[port].setPortNum(port);
|
|
|
|
#if FW_OBJECT_NAMES == 1
|
|
Fw::ObjectName portName;
|
|
portName.format(
|
|
"%s_noArgsReturnSync_InputPort[%" PRI_PlatformIntType "]",
|
|
this->m_objName.toChar(),
|
|
port
|
|
);
|
|
this->m_noArgsReturnSync_InputPort[port].setObjName(portName.toChar());
|
|
#endif
|
|
}
|
|
|
|
// Connect input port noArgsSync
|
|
for (
|
|
FwIndexType port = 0;
|
|
port < static_cast<FwIndexType>(this->getNum_noArgsSync_InputPorts());
|
|
port++
|
|
) {
|
|
this->m_noArgsSync_InputPort[port].init();
|
|
this->m_noArgsSync_InputPort[port].addCallComp(
|
|
this,
|
|
m_p_noArgsSync_in
|
|
);
|
|
this->m_noArgsSync_InputPort[port].setPortNum(port);
|
|
|
|
#if FW_OBJECT_NAMES == 1
|
|
Fw::ObjectName portName;
|
|
portName.format(
|
|
"%s_noArgsSync_InputPort[%" PRI_PlatformIntType "]",
|
|
this->m_objName.toChar(),
|
|
port
|
|
);
|
|
this->m_noArgsSync_InputPort[port].setObjName(portName.toChar());
|
|
#endif
|
|
}
|
|
|
|
// Connect input port typedGuarded
|
|
for (
|
|
FwIndexType port = 0;
|
|
port < static_cast<FwIndexType>(this->getNum_typedGuarded_InputPorts());
|
|
port++
|
|
) {
|
|
this->m_typedGuarded_InputPort[port].init();
|
|
this->m_typedGuarded_InputPort[port].addCallComp(
|
|
this,
|
|
m_p_typedGuarded_in
|
|
);
|
|
this->m_typedGuarded_InputPort[port].setPortNum(port);
|
|
|
|
#if FW_OBJECT_NAMES == 1
|
|
Fw::ObjectName portName;
|
|
portName.format(
|
|
"%s_typedGuarded_InputPort[%" PRI_PlatformIntType "]",
|
|
this->m_objName.toChar(),
|
|
port
|
|
);
|
|
this->m_typedGuarded_InputPort[port].setObjName(portName.toChar());
|
|
#endif
|
|
}
|
|
|
|
// Connect input port typedReturnGuarded
|
|
for (
|
|
FwIndexType port = 0;
|
|
port < static_cast<FwIndexType>(this->getNum_typedReturnGuarded_InputPorts());
|
|
port++
|
|
) {
|
|
this->m_typedReturnGuarded_InputPort[port].init();
|
|
this->m_typedReturnGuarded_InputPort[port].addCallComp(
|
|
this,
|
|
m_p_typedReturnGuarded_in
|
|
);
|
|
this->m_typedReturnGuarded_InputPort[port].setPortNum(port);
|
|
|
|
#if FW_OBJECT_NAMES == 1
|
|
Fw::ObjectName portName;
|
|
portName.format(
|
|
"%s_typedReturnGuarded_InputPort[%" PRI_PlatformIntType "]",
|
|
this->m_objName.toChar(),
|
|
port
|
|
);
|
|
this->m_typedReturnGuarded_InputPort[port].setObjName(portName.toChar());
|
|
#endif
|
|
}
|
|
|
|
// Connect input port typedReturnSync
|
|
for (
|
|
FwIndexType port = 0;
|
|
port < static_cast<FwIndexType>(this->getNum_typedReturnSync_InputPorts());
|
|
port++
|
|
) {
|
|
this->m_typedReturnSync_InputPort[port].init();
|
|
this->m_typedReturnSync_InputPort[port].addCallComp(
|
|
this,
|
|
m_p_typedReturnSync_in
|
|
);
|
|
this->m_typedReturnSync_InputPort[port].setPortNum(port);
|
|
|
|
#if FW_OBJECT_NAMES == 1
|
|
Fw::ObjectName portName;
|
|
portName.format(
|
|
"%s_typedReturnSync_InputPort[%" PRI_PlatformIntType "]",
|
|
this->m_objName.toChar(),
|
|
port
|
|
);
|
|
this->m_typedReturnSync_InputPort[port].setObjName(portName.toChar());
|
|
#endif
|
|
}
|
|
|
|
// Connect input port typedSync
|
|
for (
|
|
FwIndexType port = 0;
|
|
port < static_cast<FwIndexType>(this->getNum_typedSync_InputPorts());
|
|
port++
|
|
) {
|
|
this->m_typedSync_InputPort[port].init();
|
|
this->m_typedSync_InputPort[port].addCallComp(
|
|
this,
|
|
m_p_typedSync_in
|
|
);
|
|
this->m_typedSync_InputPort[port].setPortNum(port);
|
|
|
|
#if FW_OBJECT_NAMES == 1
|
|
Fw::ObjectName portName;
|
|
portName.format(
|
|
"%s_typedSync_InputPort[%" PRI_PlatformIntType "]",
|
|
this->m_objName.toChar(),
|
|
port
|
|
);
|
|
this->m_typedSync_InputPort[port].setObjName(portName.toChar());
|
|
#endif
|
|
}
|
|
|
|
// Connect input port serialGuarded
|
|
for (
|
|
FwIndexType port = 0;
|
|
port < static_cast<FwIndexType>(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
|
|
Fw::ObjectName portName;
|
|
portName.format(
|
|
"%s_serialGuarded_InputPort[%" PRI_PlatformIntType "]",
|
|
this->m_objName.toChar(),
|
|
port
|
|
);
|
|
this->m_serialGuarded_InputPort[port].setObjName(portName.toChar());
|
|
#endif
|
|
}
|
|
|
|
// Connect input port serialSync
|
|
for (
|
|
FwIndexType port = 0;
|
|
port < static_cast<FwIndexType>(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
|
|
Fw::ObjectName portName;
|
|
portName.format(
|
|
"%s_serialSync_InputPort[%" PRI_PlatformIntType "]",
|
|
this->m_objName.toChar(),
|
|
port
|
|
);
|
|
this->m_serialSync_InputPort[port].setObjName(portName.toChar());
|
|
#endif
|
|
}
|
|
|
|
// Connect output port cmdRegOut
|
|
for (
|
|
FwIndexType port = 0;
|
|
port < static_cast<FwIndexType>(this->getNum_cmdRegOut_OutputPorts());
|
|
port++
|
|
) {
|
|
this->m_cmdRegOut_OutputPort[port].init();
|
|
|
|
#if FW_OBJECT_NAMES == 1
|
|
Fw::ObjectName portName;
|
|
portName.format(
|
|
"%s_cmdRegOut_OutputPort[%" PRI_PlatformIntType "]",
|
|
this->m_objName.toChar(),
|
|
port
|
|
);
|
|
this->m_cmdRegOut_OutputPort[port].setObjName(portName.toChar());
|
|
#endif
|
|
}
|
|
|
|
// Connect output port cmdResponseOut
|
|
for (
|
|
FwIndexType port = 0;
|
|
port < static_cast<FwIndexType>(this->getNum_cmdResponseOut_OutputPorts());
|
|
port++
|
|
) {
|
|
this->m_cmdResponseOut_OutputPort[port].init();
|
|
|
|
#if FW_OBJECT_NAMES == 1
|
|
Fw::ObjectName portName;
|
|
portName.format(
|
|
"%s_cmdResponseOut_OutputPort[%" PRI_PlatformIntType "]",
|
|
this->m_objName.toChar(),
|
|
port
|
|
);
|
|
this->m_cmdResponseOut_OutputPort[port].setObjName(portName.toChar());
|
|
#endif
|
|
}
|
|
|
|
// Connect output port eventOut
|
|
for (
|
|
FwIndexType port = 0;
|
|
port < static_cast<FwIndexType>(this->getNum_eventOut_OutputPorts());
|
|
port++
|
|
) {
|
|
this->m_eventOut_OutputPort[port].init();
|
|
|
|
#if FW_OBJECT_NAMES == 1
|
|
Fw::ObjectName portName;
|
|
portName.format(
|
|
"%s_eventOut_OutputPort[%" PRI_PlatformIntType "]",
|
|
this->m_objName.toChar(),
|
|
port
|
|
);
|
|
this->m_eventOut_OutputPort[port].setObjName(portName.toChar());
|
|
#endif
|
|
}
|
|
|
|
// Connect output port prmGetOut
|
|
for (
|
|
FwIndexType port = 0;
|
|
port < static_cast<FwIndexType>(this->getNum_prmGetOut_OutputPorts());
|
|
port++
|
|
) {
|
|
this->m_prmGetOut_OutputPort[port].init();
|
|
|
|
#if FW_OBJECT_NAMES == 1
|
|
Fw::ObjectName portName;
|
|
portName.format(
|
|
"%s_prmGetOut_OutputPort[%" PRI_PlatformIntType "]",
|
|
this->m_objName.toChar(),
|
|
port
|
|
);
|
|
this->m_prmGetOut_OutputPort[port].setObjName(portName.toChar());
|
|
#endif
|
|
}
|
|
|
|
// Connect output port prmSetOut
|
|
for (
|
|
FwIndexType port = 0;
|
|
port < static_cast<FwIndexType>(this->getNum_prmSetOut_OutputPorts());
|
|
port++
|
|
) {
|
|
this->m_prmSetOut_OutputPort[port].init();
|
|
|
|
#if FW_OBJECT_NAMES == 1
|
|
Fw::ObjectName portName;
|
|
portName.format(
|
|
"%s_prmSetOut_OutputPort[%" PRI_PlatformIntType "]",
|
|
this->m_objName.toChar(),
|
|
port
|
|
);
|
|
this->m_prmSetOut_OutputPort[port].setObjName(portName.toChar());
|
|
#endif
|
|
}
|
|
|
|
#if FW_ENABLE_TEXT_LOGGING == 1
|
|
// Connect output port textEventOut
|
|
for (
|
|
FwIndexType port = 0;
|
|
port < static_cast<FwIndexType>(this->getNum_textEventOut_OutputPorts());
|
|
port++
|
|
) {
|
|
this->m_textEventOut_OutputPort[port].init();
|
|
|
|
#if FW_OBJECT_NAMES == 1
|
|
Fw::ObjectName portName;
|
|
portName.format(
|
|
"%s_textEventOut_OutputPort[%" PRI_PlatformIntType "]",
|
|
this->m_objName.toChar(),
|
|
port
|
|
);
|
|
this->m_textEventOut_OutputPort[port].setObjName(portName.toChar());
|
|
#endif
|
|
}
|
|
#endif
|
|
|
|
// Connect output port timeGetOut
|
|
for (
|
|
FwIndexType port = 0;
|
|
port < static_cast<FwIndexType>(this->getNum_timeGetOut_OutputPorts());
|
|
port++
|
|
) {
|
|
this->m_timeGetOut_OutputPort[port].init();
|
|
|
|
#if FW_OBJECT_NAMES == 1
|
|
Fw::ObjectName portName;
|
|
portName.format(
|
|
"%s_timeGetOut_OutputPort[%" PRI_PlatformIntType "]",
|
|
this->m_objName.toChar(),
|
|
port
|
|
);
|
|
this->m_timeGetOut_OutputPort[port].setObjName(portName.toChar());
|
|
#endif
|
|
}
|
|
|
|
// Connect output port tlmOut
|
|
for (
|
|
FwIndexType port = 0;
|
|
port < static_cast<FwIndexType>(this->getNum_tlmOut_OutputPorts());
|
|
port++
|
|
) {
|
|
this->m_tlmOut_OutputPort[port].init();
|
|
|
|
#if FW_OBJECT_NAMES == 1
|
|
Fw::ObjectName portName;
|
|
portName.format(
|
|
"%s_tlmOut_OutputPort[%" PRI_PlatformIntType "]",
|
|
this->m_objName.toChar(),
|
|
port
|
|
);
|
|
this->m_tlmOut_OutputPort[port].setObjName(portName.toChar());
|
|
#endif
|
|
}
|
|
|
|
// Connect output port noArgsOut
|
|
for (
|
|
FwIndexType port = 0;
|
|
port < static_cast<FwIndexType>(this->getNum_noArgsOut_OutputPorts());
|
|
port++
|
|
) {
|
|
this->m_noArgsOut_OutputPort[port].init();
|
|
|
|
#if FW_OBJECT_NAMES == 1
|
|
Fw::ObjectName portName;
|
|
portName.format(
|
|
"%s_noArgsOut_OutputPort[%" PRI_PlatformIntType "]",
|
|
this->m_objName.toChar(),
|
|
port
|
|
);
|
|
this->m_noArgsOut_OutputPort[port].setObjName(portName.toChar());
|
|
#endif
|
|
}
|
|
|
|
// Connect output port noArgsReturnOut
|
|
for (
|
|
FwIndexType port = 0;
|
|
port < static_cast<FwIndexType>(this->getNum_noArgsReturnOut_OutputPorts());
|
|
port++
|
|
) {
|
|
this->m_noArgsReturnOut_OutputPort[port].init();
|
|
|
|
#if FW_OBJECT_NAMES == 1
|
|
Fw::ObjectName portName;
|
|
portName.format(
|
|
"%s_noArgsReturnOut_OutputPort[%" PRI_PlatformIntType "]",
|
|
this->m_objName.toChar(),
|
|
port
|
|
);
|
|
this->m_noArgsReturnOut_OutputPort[port].setObjName(portName.toChar());
|
|
#endif
|
|
}
|
|
|
|
// Connect output port typedOut
|
|
for (
|
|
FwIndexType port = 0;
|
|
port < static_cast<FwIndexType>(this->getNum_typedOut_OutputPorts());
|
|
port++
|
|
) {
|
|
this->m_typedOut_OutputPort[port].init();
|
|
|
|
#if FW_OBJECT_NAMES == 1
|
|
Fw::ObjectName portName;
|
|
portName.format(
|
|
"%s_typedOut_OutputPort[%" PRI_PlatformIntType "]",
|
|
this->m_objName.toChar(),
|
|
port
|
|
);
|
|
this->m_typedOut_OutputPort[port].setObjName(portName.toChar());
|
|
#endif
|
|
}
|
|
|
|
// Connect output port typedReturnOut
|
|
for (
|
|
FwIndexType port = 0;
|
|
port < static_cast<FwIndexType>(this->getNum_typedReturnOut_OutputPorts());
|
|
port++
|
|
) {
|
|
this->m_typedReturnOut_OutputPort[port].init();
|
|
|
|
#if FW_OBJECT_NAMES == 1
|
|
Fw::ObjectName portName;
|
|
portName.format(
|
|
"%s_typedReturnOut_OutputPort[%" PRI_PlatformIntType "]",
|
|
this->m_objName.toChar(),
|
|
port
|
|
);
|
|
this->m_typedReturnOut_OutputPort[port].setObjName(portName.toChar());
|
|
#endif
|
|
}
|
|
|
|
// Connect output port serialOut
|
|
for (
|
|
FwIndexType port = 0;
|
|
port < static_cast<FwIndexType>(this->getNum_serialOut_OutputPorts());
|
|
port++
|
|
) {
|
|
this->m_serialOut_OutputPort[port].init();
|
|
|
|
#if FW_OBJECT_NAMES == 1
|
|
Fw::ObjectName portName;
|
|
portName.format(
|
|
"%s_serialOut_OutputPort[%" PRI_PlatformIntType "]",
|
|
this->m_objName.toChar(),
|
|
port
|
|
);
|
|
this->m_serialOut_OutputPort[port].setObjName(portName.toChar());
|
|
#endif
|
|
}
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
// Getters for special input ports
|
|
// ----------------------------------------------------------------------
|
|
|
|
Fw::InputCmdPort* PassiveSerialComponentBase ::
|
|
get_cmdIn_InputPort(FwIndexType portNum)
|
|
{
|
|
FW_ASSERT(
|
|
portNum < this->getNum_cmdIn_InputPorts(),
|
|
static_cast<FwAssertArgType>(portNum)
|
|
);
|
|
|
|
return &this->m_cmdIn_InputPort[portNum];
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
// Getters for typed input ports
|
|
// ----------------------------------------------------------------------
|
|
|
|
Ports::InputNoArgsPort* PassiveSerialComponentBase ::
|
|
get_noArgsGuarded_InputPort(FwIndexType portNum)
|
|
{
|
|
FW_ASSERT(
|
|
portNum < this->getNum_noArgsGuarded_InputPorts(),
|
|
static_cast<FwAssertArgType>(portNum)
|
|
);
|
|
|
|
return &this->m_noArgsGuarded_InputPort[portNum];
|
|
}
|
|
|
|
Ports::InputNoArgsReturnPort* PassiveSerialComponentBase ::
|
|
get_noArgsReturnGuarded_InputPort(FwIndexType portNum)
|
|
{
|
|
FW_ASSERT(
|
|
portNum < this->getNum_noArgsReturnGuarded_InputPorts(),
|
|
static_cast<FwAssertArgType>(portNum)
|
|
);
|
|
|
|
return &this->m_noArgsReturnGuarded_InputPort[portNum];
|
|
}
|
|
|
|
Ports::InputNoArgsReturnPort* PassiveSerialComponentBase ::
|
|
get_noArgsReturnSync_InputPort(FwIndexType portNum)
|
|
{
|
|
FW_ASSERT(
|
|
portNum < this->getNum_noArgsReturnSync_InputPorts(),
|
|
static_cast<FwAssertArgType>(portNum)
|
|
);
|
|
|
|
return &this->m_noArgsReturnSync_InputPort[portNum];
|
|
}
|
|
|
|
Ports::InputNoArgsPort* PassiveSerialComponentBase ::
|
|
get_noArgsSync_InputPort(FwIndexType portNum)
|
|
{
|
|
FW_ASSERT(
|
|
portNum < this->getNum_noArgsSync_InputPorts(),
|
|
static_cast<FwAssertArgType>(portNum)
|
|
);
|
|
|
|
return &this->m_noArgsSync_InputPort[portNum];
|
|
}
|
|
|
|
Ports::InputTypedPort* PassiveSerialComponentBase ::
|
|
get_typedGuarded_InputPort(FwIndexType portNum)
|
|
{
|
|
FW_ASSERT(
|
|
portNum < this->getNum_typedGuarded_InputPorts(),
|
|
static_cast<FwAssertArgType>(portNum)
|
|
);
|
|
|
|
return &this->m_typedGuarded_InputPort[portNum];
|
|
}
|
|
|
|
Ports::InputTypedReturnPort* PassiveSerialComponentBase ::
|
|
get_typedReturnGuarded_InputPort(FwIndexType portNum)
|
|
{
|
|
FW_ASSERT(
|
|
portNum < this->getNum_typedReturnGuarded_InputPorts(),
|
|
static_cast<FwAssertArgType>(portNum)
|
|
);
|
|
|
|
return &this->m_typedReturnGuarded_InputPort[portNum];
|
|
}
|
|
|
|
Ports::InputTypedReturnPort* PassiveSerialComponentBase ::
|
|
get_typedReturnSync_InputPort(FwIndexType portNum)
|
|
{
|
|
FW_ASSERT(
|
|
portNum < this->getNum_typedReturnSync_InputPorts(),
|
|
static_cast<FwAssertArgType>(portNum)
|
|
);
|
|
|
|
return &this->m_typedReturnSync_InputPort[portNum];
|
|
}
|
|
|
|
Ports::InputTypedPort* PassiveSerialComponentBase ::
|
|
get_typedSync_InputPort(FwIndexType 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* PassiveSerialComponentBase ::
|
|
get_serialGuarded_InputPort(FwIndexType portNum)
|
|
{
|
|
FW_ASSERT(
|
|
portNum < this->getNum_serialGuarded_InputPorts(),
|
|
static_cast<FwAssertArgType>(portNum)
|
|
);
|
|
|
|
return &this->m_serialGuarded_InputPort[portNum];
|
|
}
|
|
|
|
Fw::InputSerializePort* PassiveSerialComponentBase ::
|
|
get_serialSync_InputPort(FwIndexType 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 PassiveSerialComponentBase ::
|
|
set_cmdRegOut_OutputPort(
|
|
FwIndexType portNum,
|
|
Fw::InputCmdRegPort* port
|
|
)
|
|
{
|
|
FW_ASSERT(
|
|
portNum < this->getNum_cmdRegOut_OutputPorts(),
|
|
static_cast<FwAssertArgType>(portNum)
|
|
);
|
|
|
|
this->m_cmdRegOut_OutputPort[portNum].addCallPort(port);
|
|
}
|
|
|
|
void PassiveSerialComponentBase ::
|
|
set_cmdResponseOut_OutputPort(
|
|
FwIndexType portNum,
|
|
Fw::InputCmdResponsePort* port
|
|
)
|
|
{
|
|
FW_ASSERT(
|
|
portNum < this->getNum_cmdResponseOut_OutputPorts(),
|
|
static_cast<FwAssertArgType>(portNum)
|
|
);
|
|
|
|
this->m_cmdResponseOut_OutputPort[portNum].addCallPort(port);
|
|
}
|
|
|
|
void PassiveSerialComponentBase ::
|
|
set_eventOut_OutputPort(
|
|
FwIndexType portNum,
|
|
Fw::InputLogPort* port
|
|
)
|
|
{
|
|
FW_ASSERT(
|
|
portNum < this->getNum_eventOut_OutputPorts(),
|
|
static_cast<FwAssertArgType>(portNum)
|
|
);
|
|
|
|
this->m_eventOut_OutputPort[portNum].addCallPort(port);
|
|
}
|
|
|
|
void PassiveSerialComponentBase ::
|
|
set_prmGetOut_OutputPort(
|
|
FwIndexType portNum,
|
|
Fw::InputPrmGetPort* port
|
|
)
|
|
{
|
|
FW_ASSERT(
|
|
portNum < this->getNum_prmGetOut_OutputPorts(),
|
|
static_cast<FwAssertArgType>(portNum)
|
|
);
|
|
|
|
this->m_prmGetOut_OutputPort[portNum].addCallPort(port);
|
|
}
|
|
|
|
void PassiveSerialComponentBase ::
|
|
set_prmSetOut_OutputPort(
|
|
FwIndexType portNum,
|
|
Fw::InputPrmSetPort* port
|
|
)
|
|
{
|
|
FW_ASSERT(
|
|
portNum < this->getNum_prmSetOut_OutputPorts(),
|
|
static_cast<FwAssertArgType>(portNum)
|
|
);
|
|
|
|
this->m_prmSetOut_OutputPort[portNum].addCallPort(port);
|
|
}
|
|
|
|
#if FW_ENABLE_TEXT_LOGGING == 1
|
|
|
|
void PassiveSerialComponentBase ::
|
|
set_textEventOut_OutputPort(
|
|
FwIndexType portNum,
|
|
Fw::InputLogTextPort* port
|
|
)
|
|
{
|
|
FW_ASSERT(
|
|
portNum < this->getNum_textEventOut_OutputPorts(),
|
|
static_cast<FwAssertArgType>(portNum)
|
|
);
|
|
|
|
this->m_textEventOut_OutputPort[portNum].addCallPort(port);
|
|
}
|
|
|
|
#endif
|
|
|
|
void PassiveSerialComponentBase ::
|
|
set_timeGetOut_OutputPort(
|
|
FwIndexType portNum,
|
|
Fw::InputTimePort* port
|
|
)
|
|
{
|
|
FW_ASSERT(
|
|
portNum < this->getNum_timeGetOut_OutputPorts(),
|
|
static_cast<FwAssertArgType>(portNum)
|
|
);
|
|
|
|
this->m_timeGetOut_OutputPort[portNum].addCallPort(port);
|
|
}
|
|
|
|
void PassiveSerialComponentBase ::
|
|
set_tlmOut_OutputPort(
|
|
FwIndexType portNum,
|
|
Fw::InputTlmPort* port
|
|
)
|
|
{
|
|
FW_ASSERT(
|
|
portNum < this->getNum_tlmOut_OutputPorts(),
|
|
static_cast<FwAssertArgType>(portNum)
|
|
);
|
|
|
|
this->m_tlmOut_OutputPort[portNum].addCallPort(port);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
// Connect typed input ports to typed output ports
|
|
// ----------------------------------------------------------------------
|
|
|
|
void PassiveSerialComponentBase ::
|
|
set_noArgsOut_OutputPort(
|
|
FwIndexType portNum,
|
|
Ports::InputNoArgsPort* port
|
|
)
|
|
{
|
|
FW_ASSERT(
|
|
portNum < this->getNum_noArgsOut_OutputPorts(),
|
|
static_cast<FwAssertArgType>(portNum)
|
|
);
|
|
|
|
this->m_noArgsOut_OutputPort[portNum].addCallPort(port);
|
|
}
|
|
|
|
void PassiveSerialComponentBase ::
|
|
set_noArgsReturnOut_OutputPort(
|
|
FwIndexType portNum,
|
|
Ports::InputNoArgsReturnPort* port
|
|
)
|
|
{
|
|
FW_ASSERT(
|
|
portNum < this->getNum_noArgsReturnOut_OutputPorts(),
|
|
static_cast<FwAssertArgType>(portNum)
|
|
);
|
|
|
|
this->m_noArgsReturnOut_OutputPort[portNum].addCallPort(port);
|
|
}
|
|
|
|
void PassiveSerialComponentBase ::
|
|
set_typedOut_OutputPort(
|
|
FwIndexType portNum,
|
|
Ports::InputTypedPort* port
|
|
)
|
|
{
|
|
FW_ASSERT(
|
|
portNum < this->getNum_typedOut_OutputPorts(),
|
|
static_cast<FwAssertArgType>(portNum)
|
|
);
|
|
|
|
this->m_typedOut_OutputPort[portNum].addCallPort(port);
|
|
}
|
|
|
|
void PassiveSerialComponentBase ::
|
|
set_typedReturnOut_OutputPort(
|
|
FwIndexType portNum,
|
|
Ports::InputTypedReturnPort* port
|
|
)
|
|
{
|
|
FW_ASSERT(
|
|
portNum < this->getNum_typedReturnOut_OutputPorts(),
|
|
static_cast<FwAssertArgType>(portNum)
|
|
);
|
|
|
|
this->m_typedReturnOut_OutputPort[portNum].addCallPort(port);
|
|
}
|
|
|
|
#if FW_PORT_SERIALIZATION
|
|
|
|
// ----------------------------------------------------------------------
|
|
// Connect serial input ports to special output ports
|
|
// ----------------------------------------------------------------------
|
|
|
|
void PassiveSerialComponentBase ::
|
|
set_cmdRegOut_OutputPort(
|
|
FwIndexType portNum,
|
|
Fw::InputSerializePort* port
|
|
)
|
|
{
|
|
FW_ASSERT(
|
|
portNum < this->getNum_cmdRegOut_OutputPorts(),
|
|
static_cast<FwAssertArgType>(portNum)
|
|
);
|
|
|
|
this->m_cmdRegOut_OutputPort[portNum].registerSerialPort(port);
|
|
}
|
|
|
|
void PassiveSerialComponentBase ::
|
|
set_cmdResponseOut_OutputPort(
|
|
FwIndexType portNum,
|
|
Fw::InputSerializePort* port
|
|
)
|
|
{
|
|
FW_ASSERT(
|
|
portNum < this->getNum_cmdResponseOut_OutputPorts(),
|
|
static_cast<FwAssertArgType>(portNum)
|
|
);
|
|
|
|
this->m_cmdResponseOut_OutputPort[portNum].registerSerialPort(port);
|
|
}
|
|
|
|
void PassiveSerialComponentBase ::
|
|
set_eventOut_OutputPort(
|
|
FwIndexType portNum,
|
|
Fw::InputSerializePort* port
|
|
)
|
|
{
|
|
FW_ASSERT(
|
|
portNum < this->getNum_eventOut_OutputPorts(),
|
|
static_cast<FwAssertArgType>(portNum)
|
|
);
|
|
|
|
this->m_eventOut_OutputPort[portNum].registerSerialPort(port);
|
|
}
|
|
|
|
void PassiveSerialComponentBase ::
|
|
set_prmSetOut_OutputPort(
|
|
FwIndexType portNum,
|
|
Fw::InputSerializePort* port
|
|
)
|
|
{
|
|
FW_ASSERT(
|
|
portNum < this->getNum_prmSetOut_OutputPorts(),
|
|
static_cast<FwAssertArgType>(portNum)
|
|
);
|
|
|
|
this->m_prmSetOut_OutputPort[portNum].registerSerialPort(port);
|
|
}
|
|
|
|
#if FW_ENABLE_TEXT_LOGGING == 1
|
|
|
|
void PassiveSerialComponentBase ::
|
|
set_textEventOut_OutputPort(
|
|
FwIndexType portNum,
|
|
Fw::InputSerializePort* port
|
|
)
|
|
{
|
|
FW_ASSERT(
|
|
portNum < this->getNum_textEventOut_OutputPorts(),
|
|
static_cast<FwAssertArgType>(portNum)
|
|
);
|
|
|
|
this->m_textEventOut_OutputPort[portNum].registerSerialPort(port);
|
|
}
|
|
|
|
#endif
|
|
|
|
void PassiveSerialComponentBase ::
|
|
set_timeGetOut_OutputPort(
|
|
FwIndexType portNum,
|
|
Fw::InputSerializePort* port
|
|
)
|
|
{
|
|
FW_ASSERT(
|
|
portNum < this->getNum_timeGetOut_OutputPorts(),
|
|
static_cast<FwAssertArgType>(portNum)
|
|
);
|
|
|
|
this->m_timeGetOut_OutputPort[portNum].registerSerialPort(port);
|
|
}
|
|
|
|
void PassiveSerialComponentBase ::
|
|
set_tlmOut_OutputPort(
|
|
FwIndexType portNum,
|
|
Fw::InputSerializePort* port
|
|
)
|
|
{
|
|
FW_ASSERT(
|
|
portNum < this->getNum_tlmOut_OutputPorts(),
|
|
static_cast<FwAssertArgType>(portNum)
|
|
);
|
|
|
|
this->m_tlmOut_OutputPort[portNum].registerSerialPort(port);
|
|
}
|
|
|
|
#endif
|
|
|
|
#if FW_PORT_SERIALIZATION
|
|
|
|
// ----------------------------------------------------------------------
|
|
// Connect serial input ports to typed output ports
|
|
// ----------------------------------------------------------------------
|
|
|
|
void PassiveSerialComponentBase ::
|
|
set_noArgsOut_OutputPort(
|
|
FwIndexType portNum,
|
|
Fw::InputSerializePort* port
|
|
)
|
|
{
|
|
FW_ASSERT(
|
|
portNum < this->getNum_noArgsOut_OutputPorts(),
|
|
static_cast<FwAssertArgType>(portNum)
|
|
);
|
|
|
|
this->m_noArgsOut_OutputPort[portNum].registerSerialPort(port);
|
|
}
|
|
|
|
void PassiveSerialComponentBase ::
|
|
set_typedOut_OutputPort(
|
|
FwIndexType portNum,
|
|
Fw::InputSerializePort* port
|
|
)
|
|
{
|
|
FW_ASSERT(
|
|
portNum < this->getNum_typedOut_OutputPorts(),
|
|
static_cast<FwAssertArgType>(portNum)
|
|
);
|
|
|
|
this->m_typedOut_OutputPort[portNum].registerSerialPort(port);
|
|
}
|
|
|
|
#endif
|
|
|
|
#if FW_PORT_SERIALIZATION
|
|
|
|
// ----------------------------------------------------------------------
|
|
// Connect serial input ports to serial output ports
|
|
// ----------------------------------------------------------------------
|
|
|
|
void PassiveSerialComponentBase ::
|
|
set_serialOut_OutputPort(
|
|
FwIndexType 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 PassiveSerialComponentBase ::
|
|
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_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 PassiveSerialComponentBase ::
|
|
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 = Fw::String("default");
|
|
}
|
|
}
|
|
else {
|
|
// Set default value
|
|
this->m_param_ParamString_valid = Fw::ParamValid::DEFAULT;
|
|
this->m_ParamString = Fw::String("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
|
|
// ----------------------------------------------------------------------
|
|
|
|
PassiveSerialComponentBase ::
|
|
PassiveSerialComponentBase(const char* compName) :
|
|
Fw::PassiveComponentBase(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;
|
|
}
|
|
|
|
PassiveSerialComponentBase ::
|
|
~PassiveSerialComponentBase()
|
|
{
|
|
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
// Getters for numbers of special input ports
|
|
// ----------------------------------------------------------------------
|
|
|
|
FwIndexType PassiveSerialComponentBase ::
|
|
getNum_cmdIn_InputPorts() const
|
|
{
|
|
return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_cmdIn_InputPort));
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
// Getters for numbers of typed input ports
|
|
// ----------------------------------------------------------------------
|
|
|
|
FwIndexType PassiveSerialComponentBase ::
|
|
getNum_noArgsGuarded_InputPorts() const
|
|
{
|
|
return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_noArgsGuarded_InputPort));
|
|
}
|
|
|
|
FwIndexType PassiveSerialComponentBase ::
|
|
getNum_noArgsReturnGuarded_InputPorts() const
|
|
{
|
|
return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_noArgsReturnGuarded_InputPort));
|
|
}
|
|
|
|
FwIndexType PassiveSerialComponentBase ::
|
|
getNum_noArgsReturnSync_InputPorts() const
|
|
{
|
|
return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_noArgsReturnSync_InputPort));
|
|
}
|
|
|
|
FwIndexType PassiveSerialComponentBase ::
|
|
getNum_noArgsSync_InputPorts() const
|
|
{
|
|
return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_noArgsSync_InputPort));
|
|
}
|
|
|
|
FwIndexType PassiveSerialComponentBase ::
|
|
getNum_typedGuarded_InputPorts() const
|
|
{
|
|
return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_typedGuarded_InputPort));
|
|
}
|
|
|
|
FwIndexType PassiveSerialComponentBase ::
|
|
getNum_typedReturnGuarded_InputPorts() const
|
|
{
|
|
return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_typedReturnGuarded_InputPort));
|
|
}
|
|
|
|
FwIndexType PassiveSerialComponentBase ::
|
|
getNum_typedReturnSync_InputPorts() const
|
|
{
|
|
return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_typedReturnSync_InputPort));
|
|
}
|
|
|
|
FwIndexType PassiveSerialComponentBase ::
|
|
getNum_typedSync_InputPorts() const
|
|
{
|
|
return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_typedSync_InputPort));
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
// Getters for numbers of serial input ports
|
|
// ----------------------------------------------------------------------
|
|
|
|
FwIndexType PassiveSerialComponentBase ::
|
|
getNum_serialGuarded_InputPorts() const
|
|
{
|
|
return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_serialGuarded_InputPort));
|
|
}
|
|
|
|
FwIndexType PassiveSerialComponentBase ::
|
|
getNum_serialSync_InputPorts() const
|
|
{
|
|
return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_serialSync_InputPort));
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
// Getters for numbers of special output ports
|
|
// ----------------------------------------------------------------------
|
|
|
|
FwIndexType PassiveSerialComponentBase ::
|
|
getNum_cmdRegOut_OutputPorts() const
|
|
{
|
|
return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_cmdRegOut_OutputPort));
|
|
}
|
|
|
|
FwIndexType PassiveSerialComponentBase ::
|
|
getNum_cmdResponseOut_OutputPorts() const
|
|
{
|
|
return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_cmdResponseOut_OutputPort));
|
|
}
|
|
|
|
FwIndexType PassiveSerialComponentBase ::
|
|
getNum_eventOut_OutputPorts() const
|
|
{
|
|
return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_eventOut_OutputPort));
|
|
}
|
|
|
|
FwIndexType PassiveSerialComponentBase ::
|
|
getNum_prmGetOut_OutputPorts() const
|
|
{
|
|
return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_prmGetOut_OutputPort));
|
|
}
|
|
|
|
FwIndexType PassiveSerialComponentBase ::
|
|
getNum_prmSetOut_OutputPorts() const
|
|
{
|
|
return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_prmSetOut_OutputPort));
|
|
}
|
|
|
|
#if FW_ENABLE_TEXT_LOGGING == 1
|
|
|
|
FwIndexType PassiveSerialComponentBase ::
|
|
getNum_textEventOut_OutputPorts() const
|
|
{
|
|
return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_textEventOut_OutputPort));
|
|
}
|
|
|
|
#endif
|
|
|
|
FwIndexType PassiveSerialComponentBase ::
|
|
getNum_timeGetOut_OutputPorts() const
|
|
{
|
|
return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_timeGetOut_OutputPort));
|
|
}
|
|
|
|
FwIndexType PassiveSerialComponentBase ::
|
|
getNum_tlmOut_OutputPorts() const
|
|
{
|
|
return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_tlmOut_OutputPort));
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
// Getters for numbers of typed output ports
|
|
// ----------------------------------------------------------------------
|
|
|
|
FwIndexType PassiveSerialComponentBase ::
|
|
getNum_noArgsOut_OutputPorts() const
|
|
{
|
|
return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_noArgsOut_OutputPort));
|
|
}
|
|
|
|
FwIndexType PassiveSerialComponentBase ::
|
|
getNum_noArgsReturnOut_OutputPorts() const
|
|
{
|
|
return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_noArgsReturnOut_OutputPort));
|
|
}
|
|
|
|
FwIndexType PassiveSerialComponentBase ::
|
|
getNum_typedOut_OutputPorts() const
|
|
{
|
|
return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_typedOut_OutputPort));
|
|
}
|
|
|
|
FwIndexType PassiveSerialComponentBase ::
|
|
getNum_typedReturnOut_OutputPorts() const
|
|
{
|
|
return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_typedReturnOut_OutputPort));
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
// Getters for numbers of serial output ports
|
|
// ----------------------------------------------------------------------
|
|
|
|
FwIndexType PassiveSerialComponentBase ::
|
|
getNum_serialOut_OutputPorts() const
|
|
{
|
|
return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_serialOut_OutputPort));
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
// Connection status queries for special output ports
|
|
// ----------------------------------------------------------------------
|
|
|
|
bool PassiveSerialComponentBase ::
|
|
isConnected_cmdRegOut_OutputPort(FwIndexType portNum)
|
|
{
|
|
FW_ASSERT(
|
|
portNum < this->getNum_cmdRegOut_OutputPorts(),
|
|
static_cast<FwAssertArgType>(portNum)
|
|
);
|
|
|
|
return this->m_cmdRegOut_OutputPort[portNum].isConnected();
|
|
}
|
|
|
|
bool PassiveSerialComponentBase ::
|
|
isConnected_cmdResponseOut_OutputPort(FwIndexType portNum)
|
|
{
|
|
FW_ASSERT(
|
|
portNum < this->getNum_cmdResponseOut_OutputPorts(),
|
|
static_cast<FwAssertArgType>(portNum)
|
|
);
|
|
|
|
return this->m_cmdResponseOut_OutputPort[portNum].isConnected();
|
|
}
|
|
|
|
bool PassiveSerialComponentBase ::
|
|
isConnected_eventOut_OutputPort(FwIndexType portNum)
|
|
{
|
|
FW_ASSERT(
|
|
portNum < this->getNum_eventOut_OutputPorts(),
|
|
static_cast<FwAssertArgType>(portNum)
|
|
);
|
|
|
|
return this->m_eventOut_OutputPort[portNum].isConnected();
|
|
}
|
|
|
|
bool PassiveSerialComponentBase ::
|
|
isConnected_prmGetOut_OutputPort(FwIndexType portNum)
|
|
{
|
|
FW_ASSERT(
|
|
portNum < this->getNum_prmGetOut_OutputPorts(),
|
|
static_cast<FwAssertArgType>(portNum)
|
|
);
|
|
|
|
return this->m_prmGetOut_OutputPort[portNum].isConnected();
|
|
}
|
|
|
|
bool PassiveSerialComponentBase ::
|
|
isConnected_prmSetOut_OutputPort(FwIndexType portNum)
|
|
{
|
|
FW_ASSERT(
|
|
portNum < this->getNum_prmSetOut_OutputPorts(),
|
|
static_cast<FwAssertArgType>(portNum)
|
|
);
|
|
|
|
return this->m_prmSetOut_OutputPort[portNum].isConnected();
|
|
}
|
|
|
|
#if FW_ENABLE_TEXT_LOGGING == 1
|
|
|
|
bool PassiveSerialComponentBase ::
|
|
isConnected_textEventOut_OutputPort(FwIndexType portNum)
|
|
{
|
|
FW_ASSERT(
|
|
portNum < this->getNum_textEventOut_OutputPorts(),
|
|
static_cast<FwAssertArgType>(portNum)
|
|
);
|
|
|
|
return this->m_textEventOut_OutputPort[portNum].isConnected();
|
|
}
|
|
|
|
#endif
|
|
|
|
bool PassiveSerialComponentBase ::
|
|
isConnected_timeGetOut_OutputPort(FwIndexType portNum)
|
|
{
|
|
FW_ASSERT(
|
|
portNum < this->getNum_timeGetOut_OutputPorts(),
|
|
static_cast<FwAssertArgType>(portNum)
|
|
);
|
|
|
|
return this->m_timeGetOut_OutputPort[portNum].isConnected();
|
|
}
|
|
|
|
bool PassiveSerialComponentBase ::
|
|
isConnected_tlmOut_OutputPort(FwIndexType portNum)
|
|
{
|
|
FW_ASSERT(
|
|
portNum < this->getNum_tlmOut_OutputPorts(),
|
|
static_cast<FwAssertArgType>(portNum)
|
|
);
|
|
|
|
return this->m_tlmOut_OutputPort[portNum].isConnected();
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
// Connection status queries for typed output ports
|
|
// ----------------------------------------------------------------------
|
|
|
|
bool PassiveSerialComponentBase ::
|
|
isConnected_noArgsOut_OutputPort(FwIndexType portNum)
|
|
{
|
|
FW_ASSERT(
|
|
portNum < this->getNum_noArgsOut_OutputPorts(),
|
|
static_cast<FwAssertArgType>(portNum)
|
|
);
|
|
|
|
return this->m_noArgsOut_OutputPort[portNum].isConnected();
|
|
}
|
|
|
|
bool PassiveSerialComponentBase ::
|
|
isConnected_noArgsReturnOut_OutputPort(FwIndexType portNum)
|
|
{
|
|
FW_ASSERT(
|
|
portNum < this->getNum_noArgsReturnOut_OutputPorts(),
|
|
static_cast<FwAssertArgType>(portNum)
|
|
);
|
|
|
|
return this->m_noArgsReturnOut_OutputPort[portNum].isConnected();
|
|
}
|
|
|
|
bool PassiveSerialComponentBase ::
|
|
isConnected_typedOut_OutputPort(FwIndexType portNum)
|
|
{
|
|
FW_ASSERT(
|
|
portNum < this->getNum_typedOut_OutputPorts(),
|
|
static_cast<FwAssertArgType>(portNum)
|
|
);
|
|
|
|
return this->m_typedOut_OutputPort[portNum].isConnected();
|
|
}
|
|
|
|
bool PassiveSerialComponentBase ::
|
|
isConnected_typedReturnOut_OutputPort(FwIndexType 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 PassiveSerialComponentBase ::
|
|
isConnected_serialOut_OutputPort(FwIndexType 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 PassiveSerialComponentBase ::
|
|
noArgsGuarded_handlerBase(FwIndexType portNum)
|
|
{
|
|
// Make sure port number is valid
|
|
FW_ASSERT(
|
|
portNum < this->getNum_noArgsGuarded_InputPorts(),
|
|
static_cast<FwAssertArgType>(portNum)
|
|
);
|
|
|
|
// Lock guard mutex before calling
|
|
this->lock();
|
|
|
|
// Call handler function
|
|
this->noArgsGuarded_handler(portNum);
|
|
|
|
// Unlock guard mutex
|
|
this->unLock();
|
|
}
|
|
|
|
U32 PassiveSerialComponentBase ::
|
|
noArgsReturnGuarded_handlerBase(FwIndexType portNum)
|
|
{
|
|
// Make sure port number is valid
|
|
FW_ASSERT(
|
|
portNum < this->getNum_noArgsReturnGuarded_InputPorts(),
|
|
static_cast<FwAssertArgType>(portNum)
|
|
);
|
|
|
|
U32 retVal;
|
|
|
|
// Lock guard mutex before calling
|
|
this->lock();
|
|
|
|
// Call handler function
|
|
retVal = this->noArgsReturnGuarded_handler(portNum);
|
|
|
|
// Unlock guard mutex
|
|
this->unLock();
|
|
|
|
return retVal;
|
|
}
|
|
|
|
U32 PassiveSerialComponentBase ::
|
|
noArgsReturnSync_handlerBase(FwIndexType portNum)
|
|
{
|
|
// Make sure port number is valid
|
|
FW_ASSERT(
|
|
portNum < this->getNum_noArgsReturnSync_InputPorts(),
|
|
static_cast<FwAssertArgType>(portNum)
|
|
);
|
|
|
|
U32 retVal;
|
|
|
|
// Call handler function
|
|
retVal = this->noArgsReturnSync_handler(portNum);
|
|
|
|
return retVal;
|
|
}
|
|
|
|
void PassiveSerialComponentBase ::
|
|
noArgsSync_handlerBase(FwIndexType portNum)
|
|
{
|
|
// Make sure port number is valid
|
|
FW_ASSERT(
|
|
portNum < this->getNum_noArgsSync_InputPorts(),
|
|
static_cast<FwAssertArgType>(portNum)
|
|
);
|
|
|
|
// Call handler function
|
|
this->noArgsSync_handler(portNum);
|
|
}
|
|
|
|
void PassiveSerialComponentBase ::
|
|
typedGuarded_handlerBase(
|
|
FwIndexType portNum,
|
|
U32 u32,
|
|
F32 f32,
|
|
bool b,
|
|
const Ports::TypedPortStrings::StringSize80& str1,
|
|
const E& e,
|
|
const A& a,
|
|
const S& s
|
|
)
|
|
{
|
|
// Make sure port number is valid
|
|
FW_ASSERT(
|
|
portNum < this->getNum_typedGuarded_InputPorts(),
|
|
static_cast<FwAssertArgType>(portNum)
|
|
);
|
|
|
|
// Lock guard mutex before calling
|
|
this->lock();
|
|
|
|
// Call handler function
|
|
this->typedGuarded_handler(
|
|
portNum,
|
|
u32,
|
|
f32,
|
|
b,
|
|
str1,
|
|
e,
|
|
a,
|
|
s
|
|
);
|
|
|
|
// Unlock guard mutex
|
|
this->unLock();
|
|
}
|
|
|
|
F32 PassiveSerialComponentBase ::
|
|
typedReturnGuarded_handlerBase(
|
|
FwIndexType portNum,
|
|
U32 u32,
|
|
F32 f32,
|
|
bool b,
|
|
const Ports::TypedReturnPortStrings::StringSize80& str2,
|
|
const E& e,
|
|
const A& a,
|
|
const S& s
|
|
)
|
|
{
|
|
// Make sure port number is valid
|
|
FW_ASSERT(
|
|
portNum < this->getNum_typedReturnGuarded_InputPorts(),
|
|
static_cast<FwAssertArgType>(portNum)
|
|
);
|
|
|
|
F32 retVal;
|
|
|
|
// Lock guard mutex before calling
|
|
this->lock();
|
|
|
|
// Call handler function
|
|
retVal = this->typedReturnGuarded_handler(
|
|
portNum,
|
|
u32,
|
|
f32,
|
|
b,
|
|
str2,
|
|
e,
|
|
a,
|
|
s
|
|
);
|
|
|
|
// Unlock guard mutex
|
|
this->unLock();
|
|
|
|
return retVal;
|
|
}
|
|
|
|
F32 PassiveSerialComponentBase ::
|
|
typedReturnSync_handlerBase(
|
|
FwIndexType portNum,
|
|
U32 u32,
|
|
F32 f32,
|
|
bool b,
|
|
const Ports::TypedReturnPortStrings::StringSize80& str2,
|
|
const E& e,
|
|
const A& a,
|
|
const S& s
|
|
)
|
|
{
|
|
// Make sure port number is valid
|
|
FW_ASSERT(
|
|
portNum < this->getNum_typedReturnSync_InputPorts(),
|
|
static_cast<FwAssertArgType>(portNum)
|
|
);
|
|
|
|
F32 retVal;
|
|
|
|
// Call handler function
|
|
retVal = this->typedReturnSync_handler(
|
|
portNum,
|
|
u32,
|
|
f32,
|
|
b,
|
|
str2,
|
|
e,
|
|
a,
|
|
s
|
|
);
|
|
|
|
return retVal;
|
|
}
|
|
|
|
void PassiveSerialComponentBase ::
|
|
typedSync_handlerBase(
|
|
FwIndexType portNum,
|
|
U32 u32,
|
|
F32 f32,
|
|
bool b,
|
|
const Ports::TypedPortStrings::StringSize80& str1,
|
|
const E& e,
|
|
const A& a,
|
|
const S& s
|
|
)
|
|
{
|
|
// Make sure port number is valid
|
|
FW_ASSERT(
|
|
portNum < this->getNum_typedSync_InputPorts(),
|
|
static_cast<FwAssertArgType>(portNum)
|
|
);
|
|
|
|
// Call handler function
|
|
this->typedSync_handler(
|
|
portNum,
|
|
u32,
|
|
f32,
|
|
b,
|
|
str1,
|
|
e,
|
|
a,
|
|
s
|
|
);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
// Port handler base-class functions for serial input ports
|
|
//
|
|
// Call these functions directly to bypass the corresponding ports
|
|
// ----------------------------------------------------------------------
|
|
|
|
void PassiveSerialComponentBase ::
|
|
serialGuarded_handlerBase(
|
|
FwIndexType 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 PassiveSerialComponentBase ::
|
|
serialSync_handlerBase(
|
|
FwIndexType 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
|
|
);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
// Invocation functions for typed output ports
|
|
// ----------------------------------------------------------------------
|
|
|
|
void PassiveSerialComponentBase ::
|
|
noArgsOut_out(FwIndexType portNum)
|
|
{
|
|
FW_ASSERT(
|
|
portNum < this->getNum_noArgsOut_OutputPorts(),
|
|
static_cast<FwAssertArgType>(portNum)
|
|
);
|
|
this->m_noArgsOut_OutputPort[portNum].invoke();
|
|
}
|
|
|
|
U32 PassiveSerialComponentBase ::
|
|
noArgsReturnOut_out(FwIndexType portNum)
|
|
{
|
|
FW_ASSERT(
|
|
portNum < this->getNum_noArgsReturnOut_OutputPorts(),
|
|
static_cast<FwAssertArgType>(portNum)
|
|
);
|
|
return this->m_noArgsReturnOut_OutputPort[portNum].invoke();
|
|
}
|
|
|
|
void PassiveSerialComponentBase ::
|
|
typedOut_out(
|
|
FwIndexType portNum,
|
|
U32 u32,
|
|
F32 f32,
|
|
bool b,
|
|
const Ports::TypedPortStrings::StringSize80& str1,
|
|
const E& e,
|
|
const A& a,
|
|
const S& s
|
|
)
|
|
{
|
|
FW_ASSERT(
|
|
portNum < this->getNum_typedOut_OutputPorts(),
|
|
static_cast<FwAssertArgType>(portNum)
|
|
);
|
|
this->m_typedOut_OutputPort[portNum].invoke(
|
|
u32,
|
|
f32,
|
|
b,
|
|
str1,
|
|
e,
|
|
a,
|
|
s
|
|
);
|
|
}
|
|
|
|
F32 PassiveSerialComponentBase ::
|
|
typedReturnOut_out(
|
|
FwIndexType portNum,
|
|
U32 u32,
|
|
F32 f32,
|
|
bool b,
|
|
const Ports::TypedReturnPortStrings::StringSize80& str2,
|
|
const E& e,
|
|
const A& a,
|
|
const S& s
|
|
)
|
|
{
|
|
FW_ASSERT(
|
|
portNum < this->getNum_typedReturnOut_OutputPorts(),
|
|
static_cast<FwAssertArgType>(portNum)
|
|
);
|
|
return this->m_typedReturnOut_OutputPort[portNum].invoke(
|
|
u32,
|
|
f32,
|
|
b,
|
|
str2,
|
|
e,
|
|
a,
|
|
s
|
|
);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
// Invocation functions for serial output ports
|
|
// ----------------------------------------------------------------------
|
|
|
|
Fw::SerializeStatus PassiveSerialComponentBase ::
|
|
serialOut_out(
|
|
FwIndexType portNum,
|
|
Fw::SerializeBufferBase& buffer
|
|
)
|
|
{
|
|
FW_ASSERT(
|
|
portNum < this->getNum_serialOut_OutputPorts(),
|
|
static_cast<FwAssertArgType>(portNum)
|
|
);
|
|
return this->m_serialOut_OutputPort[portNum].invokeSerial(
|
|
buffer
|
|
);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
// Command response
|
|
// ----------------------------------------------------------------------
|
|
|
|
void PassiveSerialComponentBase ::
|
|
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 PassiveSerialComponentBase ::
|
|
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 PassiveSerialComponentBase ::
|
|
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 PassiveSerialComponentBase ::
|
|
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 PassiveSerialComponentBase ::
|
|
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 PassiveSerialComponentBase ::
|
|
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 PassiveSerialComponentBase ::
|
|
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 PassiveSerialComponentBase ::
|
|
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 PassiveSerialComponentBase ::
|
|
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 PassiveSerialComponentBase ::
|
|
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 PassiveSerialComponentBase ::
|
|
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 PassiveSerialComponentBase ::
|
|
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 PassiveSerialComponentBase ::
|
|
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();
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
// Event logging functions
|
|
// ----------------------------------------------------------------------
|
|
|
|
void PassiveSerialComponentBase ::
|
|
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
|
|
|
|
Fw::TextLogString _logString;
|
|
_logString.format(
|
|
_formatString,
|
|
#if FW_OBJECT_NAMES == 1
|
|
this->m_objName.toChar(),
|
|
#endif
|
|
"EventActivityHigh "
|
|
);
|
|
|
|
this->m_textEventOut_OutputPort[0].invoke(
|
|
_id,
|
|
_logTime,
|
|
Fw::LogSeverity::ACTIVITY_HI,
|
|
_logString
|
|
);
|
|
}
|
|
#endif
|
|
}
|
|
|
|
void PassiveSerialComponentBase ::
|
|
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
|
|
|
|
Fw::TextLogString _logString;
|
|
_logString.format(
|
|
_formatString,
|
|
#if FW_OBJECT_NAMES == 1
|
|
this->m_objName.toChar(),
|
|
#endif
|
|
"EventActivityLowThrottled ",
|
|
u32,
|
|
f32,
|
|
b
|
|
);
|
|
|
|
this->m_textEventOut_OutputPort[0].invoke(
|
|
_id,
|
|
_logTime,
|
|
Fw::LogSeverity::ACTIVITY_LO,
|
|
_logString
|
|
);
|
|
}
|
|
#endif
|
|
}
|
|
|
|
void PassiveSerialComponentBase ::
|
|
log_COMMAND_EventCommand(
|
|
const Fw::StringBase& str1,
|
|
const Fw::StringBase& 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, FW_MIN(FW_LOG_STRING_MAX_SIZE, 80));
|
|
FW_ASSERT(
|
|
_status == Fw::FW_SERIALIZE_OK,
|
|
static_cast<FwAssertArgType>(_status)
|
|
);
|
|
|
|
_status = str2.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 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
|
|
|
|
Fw::TextLogString _logString;
|
|
_logString.format(
|
|
_formatString,
|
|
#if FW_OBJECT_NAMES == 1
|
|
this->m_objName.toChar(),
|
|
#endif
|
|
"EventCommand ",
|
|
str1.toChar(),
|
|
str2.toChar()
|
|
);
|
|
|
|
this->m_textEventOut_OutputPort[0].invoke(
|
|
_id,
|
|
_logTime,
|
|
Fw::LogSeverity::COMMAND,
|
|
_logString
|
|
);
|
|
}
|
|
#endif
|
|
}
|
|
|
|
void PassiveSerialComponentBase ::
|
|
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
|
|
|
|
Fw::String eStr;
|
|
e.toString(eStr);
|
|
|
|
Fw::TextLogString _logString;
|
|
_logString.format(
|
|
_formatString,
|
|
#if FW_OBJECT_NAMES == 1
|
|
this->m_objName.toChar(),
|
|
#endif
|
|
"EventDiagnostic ",
|
|
eStr.toChar()
|
|
);
|
|
|
|
this->m_textEventOut_OutputPort[0].invoke(
|
|
_id,
|
|
_logTime,
|
|
Fw::LogSeverity::DIAGNOSTIC,
|
|
_logString
|
|
);
|
|
}
|
|
#endif
|
|
}
|
|
|
|
void PassiveSerialComponentBase ::
|
|
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
|
|
|
|
Fw::String aStr;
|
|
a.toString(aStr);
|
|
|
|
Fw::TextLogString _logString;
|
|
_logString.format(
|
|
_formatString,
|
|
#if FW_OBJECT_NAMES == 1
|
|
this->m_objName.toChar(),
|
|
#endif
|
|
"EventFatalThrottled ",
|
|
aStr.toChar()
|
|
);
|
|
|
|
this->m_textEventOut_OutputPort[0].invoke(
|
|
_id,
|
|
_logTime,
|
|
Fw::LogSeverity::FATAL,
|
|
_logString
|
|
);
|
|
}
|
|
#endif
|
|
}
|
|
|
|
void PassiveSerialComponentBase ::
|
|
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
|
|
|
|
Fw::String sStr;
|
|
s.toString(sStr);
|
|
|
|
Fw::TextLogString _logString;
|
|
_logString.format(
|
|
_formatString,
|
|
#if FW_OBJECT_NAMES == 1
|
|
this->m_objName.toChar(),
|
|
#endif
|
|
"EventWarningHigh ",
|
|
sStr.toChar()
|
|
);
|
|
|
|
this->m_textEventOut_OutputPort[0].invoke(
|
|
_id,
|
|
_logTime,
|
|
Fw::LogSeverity::WARNING_HI,
|
|
_logString
|
|
);
|
|
}
|
|
#endif
|
|
}
|
|
|
|
void PassiveSerialComponentBase ::
|
|
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
|
|
|
|
Fw::TextLogString _logString;
|
|
_logString.format(
|
|
_formatString,
|
|
#if FW_OBJECT_NAMES == 1
|
|
this->m_objName.toChar(),
|
|
#endif
|
|
"EventWarningLowThrottled "
|
|
);
|
|
|
|
this->m_textEventOut_OutputPort[0].invoke(
|
|
_id,
|
|
_logTime,
|
|
Fw::LogSeverity::WARNING_LO,
|
|
_logString
|
|
);
|
|
}
|
|
#endif
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
// Event throttle reset functions
|
|
// ----------------------------------------------------------------------
|
|
|
|
void PassiveSerialComponentBase ::
|
|
log_ACTIVITY_LO_EventActivityLowThrottled_ThrottleClear()
|
|
{
|
|
// Reset throttle counter
|
|
this->m_EventActivityLowThrottledThrottle = 0;
|
|
}
|
|
|
|
void PassiveSerialComponentBase ::
|
|
log_FATAL_EventFatalThrottled_ThrottleClear()
|
|
{
|
|
// Reset throttle counter
|
|
this->m_EventFatalThrottledThrottle = 0;
|
|
}
|
|
|
|
void PassiveSerialComponentBase ::
|
|
log_WARNING_LO_EventWarningLowThrottled_ThrottleClear()
|
|
{
|
|
// Reset throttle counter
|
|
this->m_EventWarningLowThrottledThrottle = 0;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
// Telemetry write functions
|
|
// ----------------------------------------------------------------------
|
|
|
|
void PassiveSerialComponentBase ::
|
|
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 PassiveSerialComponentBase ::
|
|
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 PassiveSerialComponentBase ::
|
|
tlmWrite_ChannelStringFormat(
|
|
const Fw::StringBase& 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, FW_MIN(FW_TLM_STRING_MAX_SIZE, 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 PassiveSerialComponentBase ::
|
|
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 PassiveSerialComponentBase ::
|
|
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 PassiveSerialComponentBase ::
|
|
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 PassiveSerialComponentBase ::
|
|
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 PassiveSerialComponentBase ::
|
|
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 PassiveSerialComponentBase ::
|
|
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 PassiveSerialComponentBase ::
|
|
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 PassiveSerialComponentBase ::
|
|
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 PassiveSerialComponentBase ::
|
|
parameterUpdated(FwPrmIdType id)
|
|
{
|
|
// Do nothing by default
|
|
}
|
|
|
|
void PassiveSerialComponentBase ::
|
|
parametersLoaded()
|
|
{
|
|
// Do nothing by default
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
// Parameter get functions
|
|
// ----------------------------------------------------------------------
|
|
|
|
U32 PassiveSerialComponentBase ::
|
|
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 PassiveSerialComponentBase ::
|
|
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 PassiveSerialComponentBase ::
|
|
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 PassiveSerialComponentBase ::
|
|
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 PassiveSerialComponentBase ::
|
|
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 PassiveSerialComponentBase ::
|
|
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 PassiveSerialComponentBase ::
|
|
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 PassiveSerialComponentBase ::
|
|
lock()
|
|
{
|
|
this->m_guardedPortMutex.lock();
|
|
}
|
|
|
|
void PassiveSerialComponentBase ::
|
|
unLock()
|
|
{
|
|
this->m_guardedPortMutex.unLock();
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
// Calls for messages received on special input ports
|
|
// ----------------------------------------------------------------------
|
|
|
|
void PassiveSerialComponentBase ::
|
|
m_p_cmdIn_in(
|
|
Fw::PassiveComponentBase* callComp,
|
|
FwIndexType portNum,
|
|
FwOpcodeType opCode,
|
|
U32 cmdSeq,
|
|
Fw::CmdArgBuffer& args
|
|
)
|
|
{
|
|
FW_ASSERT(callComp);
|
|
PassiveSerialComponentBase* compPtr = static_cast<PassiveSerialComponentBase*>(callComp);
|
|
|
|
const U32 idBase = callComp->getIdBase();
|
|
FW_ASSERT(opCode >= idBase, static_cast<FwAssertArgType>(opCode), static_cast<FwAssertArgType>(idBase));
|
|
|
|
// Select base class function based on opcode
|
|
switch (opCode - idBase) {
|
|
case OPCODE_CMD_SYNC: {
|
|
compPtr->CMD_SYNC_cmdHandlerBase(
|
|
opCode,
|
|
cmdSeq,
|
|
args
|
|
);
|
|
break;
|
|
}
|
|
|
|
case OPCODE_CMD_SYNC_PRIMITIVE: {
|
|
compPtr->CMD_SYNC_PRIMITIVE_cmdHandlerBase(
|
|
opCode,
|
|
cmdSeq,
|
|
args
|
|
);
|
|
break;
|
|
}
|
|
|
|
case OPCODE_CMD_SYNC_STRING: {
|
|
compPtr->CMD_SYNC_STRING_cmdHandlerBase(
|
|
opCode,
|
|
cmdSeq,
|
|
args
|
|
);
|
|
break;
|
|
}
|
|
|
|
case OPCODE_CMD_SYNC_ENUM: {
|
|
compPtr->CMD_SYNC_ENUM_cmdHandlerBase(
|
|
opCode,
|
|
cmdSeq,
|
|
args
|
|
);
|
|
break;
|
|
}
|
|
|
|
case OPCODE_CMD_SYNC_ARRAY: {
|
|
compPtr->CMD_SYNC_ARRAY_cmdHandlerBase(
|
|
opCode,
|
|
cmdSeq,
|
|
args
|
|
);
|
|
break;
|
|
}
|
|
|
|
case OPCODE_CMD_SYNC_STRUCT: {
|
|
compPtr->CMD_SYNC_STRUCT_cmdHandlerBase(
|
|
opCode,
|
|
cmdSeq,
|
|
args
|
|
);
|
|
break;
|
|
}
|
|
|
|
case OPCODE_CMD_GUARDED: {
|
|
compPtr->CMD_GUARDED_cmdHandlerBase(
|
|
opCode,
|
|
cmdSeq,
|
|
args
|
|
);
|
|
break;
|
|
}
|
|
|
|
case OPCODE_CMD_GUARDED_PRIMITIVE: {
|
|
compPtr->CMD_GUARDED_PRIMITIVE_cmdHandlerBase(
|
|
opCode,
|
|
cmdSeq,
|
|
args
|
|
);
|
|
break;
|
|
}
|
|
|
|
case OPCODE_CMD_GUARDED_STRING: {
|
|
compPtr->CMD_GUARDED_STRING_cmdHandlerBase(
|
|
opCode,
|
|
cmdSeq,
|
|
args
|
|
);
|
|
break;
|
|
}
|
|
|
|
case OPCODE_CMD_GUARDED_ENUM: {
|
|
compPtr->CMD_GUARDED_ENUM_cmdHandlerBase(
|
|
opCode,
|
|
cmdSeq,
|
|
args
|
|
);
|
|
break;
|
|
}
|
|
|
|
case OPCODE_CMD_GUARDED_ARRAY: {
|
|
compPtr->CMD_GUARDED_ARRAY_cmdHandlerBase(
|
|
opCode,
|
|
cmdSeq,
|
|
args
|
|
);
|
|
break;
|
|
}
|
|
|
|
case OPCODE_CMD_GUARDED_STRUCT: {
|
|
compPtr->CMD_GUARDED_STRUCT_cmdHandlerBase(
|
|
opCode,
|
|
cmdSeq,
|
|
args
|
|
);
|
|
break;
|
|
}
|
|
|
|
case OPCODE_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 PassiveSerialComponentBase ::
|
|
m_p_noArgsGuarded_in(
|
|
Fw::PassiveComponentBase* callComp,
|
|
FwIndexType portNum
|
|
)
|
|
{
|
|
FW_ASSERT(callComp);
|
|
PassiveSerialComponentBase* compPtr = static_cast<PassiveSerialComponentBase*>(callComp);
|
|
compPtr->noArgsGuarded_handlerBase(portNum);
|
|
}
|
|
|
|
U32 PassiveSerialComponentBase ::
|
|
m_p_noArgsReturnGuarded_in(
|
|
Fw::PassiveComponentBase* callComp,
|
|
FwIndexType portNum
|
|
)
|
|
{
|
|
FW_ASSERT(callComp);
|
|
PassiveSerialComponentBase* compPtr = static_cast<PassiveSerialComponentBase*>(callComp);
|
|
return compPtr->noArgsReturnGuarded_handlerBase(portNum);
|
|
}
|
|
|
|
U32 PassiveSerialComponentBase ::
|
|
m_p_noArgsReturnSync_in(
|
|
Fw::PassiveComponentBase* callComp,
|
|
FwIndexType portNum
|
|
)
|
|
{
|
|
FW_ASSERT(callComp);
|
|
PassiveSerialComponentBase* compPtr = static_cast<PassiveSerialComponentBase*>(callComp);
|
|
return compPtr->noArgsReturnSync_handlerBase(portNum);
|
|
}
|
|
|
|
void PassiveSerialComponentBase ::
|
|
m_p_noArgsSync_in(
|
|
Fw::PassiveComponentBase* callComp,
|
|
FwIndexType portNum
|
|
)
|
|
{
|
|
FW_ASSERT(callComp);
|
|
PassiveSerialComponentBase* compPtr = static_cast<PassiveSerialComponentBase*>(callComp);
|
|
compPtr->noArgsSync_handlerBase(portNum);
|
|
}
|
|
|
|
void PassiveSerialComponentBase ::
|
|
m_p_typedGuarded_in(
|
|
Fw::PassiveComponentBase* callComp,
|
|
FwIndexType portNum,
|
|
U32 u32,
|
|
F32 f32,
|
|
bool b,
|
|
const Ports::TypedPortStrings::StringSize80& str1,
|
|
const E& e,
|
|
const A& a,
|
|
const S& s
|
|
)
|
|
{
|
|
FW_ASSERT(callComp);
|
|
PassiveSerialComponentBase* compPtr = static_cast<PassiveSerialComponentBase*>(callComp);
|
|
compPtr->typedGuarded_handlerBase(
|
|
portNum,
|
|
u32,
|
|
f32,
|
|
b,
|
|
str1,
|
|
e,
|
|
a,
|
|
s
|
|
);
|
|
}
|
|
|
|
F32 PassiveSerialComponentBase ::
|
|
m_p_typedReturnGuarded_in(
|
|
Fw::PassiveComponentBase* callComp,
|
|
FwIndexType portNum,
|
|
U32 u32,
|
|
F32 f32,
|
|
bool b,
|
|
const Ports::TypedReturnPortStrings::StringSize80& str2,
|
|
const E& e,
|
|
const A& a,
|
|
const S& s
|
|
)
|
|
{
|
|
FW_ASSERT(callComp);
|
|
PassiveSerialComponentBase* compPtr = static_cast<PassiveSerialComponentBase*>(callComp);
|
|
return compPtr->typedReturnGuarded_handlerBase(
|
|
portNum,
|
|
u32,
|
|
f32,
|
|
b,
|
|
str2,
|
|
e,
|
|
a,
|
|
s
|
|
);
|
|
}
|
|
|
|
F32 PassiveSerialComponentBase ::
|
|
m_p_typedReturnSync_in(
|
|
Fw::PassiveComponentBase* callComp,
|
|
FwIndexType portNum,
|
|
U32 u32,
|
|
F32 f32,
|
|
bool b,
|
|
const Ports::TypedReturnPortStrings::StringSize80& str2,
|
|
const E& e,
|
|
const A& a,
|
|
const S& s
|
|
)
|
|
{
|
|
FW_ASSERT(callComp);
|
|
PassiveSerialComponentBase* compPtr = static_cast<PassiveSerialComponentBase*>(callComp);
|
|
return compPtr->typedReturnSync_handlerBase(
|
|
portNum,
|
|
u32,
|
|
f32,
|
|
b,
|
|
str2,
|
|
e,
|
|
a,
|
|
s
|
|
);
|
|
}
|
|
|
|
void PassiveSerialComponentBase ::
|
|
m_p_typedSync_in(
|
|
Fw::PassiveComponentBase* callComp,
|
|
FwIndexType portNum,
|
|
U32 u32,
|
|
F32 f32,
|
|
bool b,
|
|
const Ports::TypedPortStrings::StringSize80& str1,
|
|
const E& e,
|
|
const A& a,
|
|
const S& s
|
|
)
|
|
{
|
|
FW_ASSERT(callComp);
|
|
PassiveSerialComponentBase* compPtr = static_cast<PassiveSerialComponentBase*>(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 PassiveSerialComponentBase ::
|
|
m_p_serialGuarded_in(
|
|
Fw::PassiveComponentBase* callComp,
|
|
FwIndexType portNum,
|
|
Fw::SerializeBufferBase& buffer
|
|
)
|
|
{
|
|
FW_ASSERT(callComp);
|
|
PassiveSerialComponentBase* compPtr = static_cast<PassiveSerialComponentBase*>(callComp);
|
|
compPtr->serialGuarded_handlerBase(
|
|
portNum,
|
|
buffer
|
|
);
|
|
}
|
|
|
|
void PassiveSerialComponentBase ::
|
|
m_p_serialSync_in(
|
|
Fw::PassiveComponentBase* callComp,
|
|
FwIndexType portNum,
|
|
Fw::SerializeBufferBase& buffer
|
|
)
|
|
{
|
|
FW_ASSERT(callComp);
|
|
PassiveSerialComponentBase* compPtr = static_cast<PassiveSerialComponentBase*>(callComp);
|
|
compPtr->serialSync_handlerBase(
|
|
portNum,
|
|
buffer
|
|
);
|
|
}
|
|
|
|
#endif
|
|
|
|
// ----------------------------------------------------------------------
|
|
// Parameter set functions
|
|
// ----------------------------------------------------------------------
|
|
|
|
Fw::CmdResponse PassiveSerialComponentBase ::
|
|
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 PassiveSerialComponentBase ::
|
|
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 PassiveSerialComponentBase ::
|
|
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 PassiveSerialComponentBase ::
|
|
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 PassiveSerialComponentBase ::
|
|
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 PassiveSerialComponentBase ::
|
|
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 PassiveSerialComponentBase ::
|
|
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 PassiveSerialComponentBase ::
|
|
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 PassiveSerialComponentBase ::
|
|
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 PassiveSerialComponentBase ::
|
|
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 PassiveSerialComponentBase ::
|
|
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 PassiveSerialComponentBase ::
|
|
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;
|
|
}
|