F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
Svc::CommandDispatcherImpl Class Reference

Command Dispatcher component class. More...

#include <Svc/CmdDispatcher/CommandDispatcherImpl.hpp>

Inheritance diagram for Svc::CommandDispatcherImpl:
Svc::CommandDispatcherComponentBase Fw::ActiveComponentBase Fw::QueuedComponentBase Fw::PassiveComponentBase Fw::ObjBase

Public Member Functions

 CommandDispatcherImpl (const char *name)
 Command Dispatcher constructor. More...
 
void init (NATIVE_INT_TYPE queueDepth, NATIVE_INT_TYPE instance)
 Component initialization routine. More...
 
virtual ~CommandDispatcherImpl ()
 Component destructor. More...
 
- Public Member Functions inherited from Svc::CommandDispatcherComponentBase
void init (FwQueueSizeType queueDepth, FwEnumStoreType instance=0)
 Initialize CommandDispatcherComponentBase object. More...
 
Fw::InputCmdPortget_CmdDisp_InputPort (FwIndexType portNum)
 
Fw::InputCmdRegPortget_compCmdReg_InputPort (FwIndexType portNum)
 
Fw::InputCmdResponsePortget_compCmdStat_InputPort (FwIndexType portNum)
 
Svc::InputPingPortget_pingIn_InputPort (FwIndexType portNum)
 
Fw::InputComPortget_seqCmdBuff_InputPort (FwIndexType portNum)
 
void set_CmdReg_OutputPort (FwIndexType portNum, Fw::InputCmdRegPort *port)
 Connect port to CmdReg[portNum]. More...
 
void set_CmdStatus_OutputPort (FwIndexType portNum, Fw::InputCmdResponsePort *port)
 Connect port to CmdStatus[portNum]. More...
 
void set_Log_OutputPort (FwIndexType portNum, Fw::InputLogPort *port)
 Connect port to Log[portNum]. More...
 
void set_Time_OutputPort (FwIndexType portNum, Fw::InputTimePort *port)
 Connect port to Time[portNum]. More...
 
void set_Tlm_OutputPort (FwIndexType portNum, Fw::InputTlmPort *port)
 Connect port to Tlm[portNum]. More...
 
void set_compCmdSend_OutputPort (FwIndexType portNum, Fw::InputCmdPort *port)
 Connect port to compCmdSend[portNum]. More...
 
void set_pingOut_OutputPort (FwIndexType portNum, Svc::InputPingPort *port)
 Connect port to pingOut[portNum]. More...
 
void set_seqCmdStatus_OutputPort (FwIndexType portNum, Fw::InputCmdResponsePort *port)
 Connect port to seqCmdStatus[portNum]. More...
 
void regCommands ()
 Register commands with the Command Dispatcher. More...
 
- Public Member Functions inherited from Fw::ActiveComponentBase
void start (Os::Task::ParamType priority=Os::Task::TASK_DEFAULT, Os::Task::ParamType stackSize=Os::Task::TASK_DEFAULT, Os::Task::ParamType cpuAffinity=Os::Task::TASK_DEFAULT, Os::Task::ParamType identifier=Os::Task::TASK_DEFAULT)
 called by instantiator when task is to be started More...
 
void exit ()
 exit task in active component More...
 
Os::Task::Status join ()
 Join the thread. More...
 
 DEPRECATED (Os::Task::Status join(void **value_ptr), "Switch to .join()")
 Join to thread with discarded value_ptr. More...
 
- Public Member Functions inherited from Fw::PassiveComponentBase
void setIdBase (const U32)
 Set the ID base. More...
 
U32 getIdBase () const
 

Additional Inherited Members

- Public Types inherited from Fw::ActiveComponentBase
enum  { ACTIVE_COMPONENT_EXIT }
 
- Public Types inherited from Fw::QueuedComponentBase
enum  MsgDispatchStatus { MSG_DISPATCH_OK , MSG_DISPATCH_EMPTY , MSG_DISPATCH_ERROR , MSG_DISPATCH_EXIT }
 
- Protected Types inherited from Svc::CommandDispatcherComponentBase
enum  { NUM_CMDDISP_INPUT_PORTS = 1 }
 Enumerations for numbers of special input ports. More...
 
enum  { NUM_COMPCMDREG_INPUT_PORTS = 30 , NUM_COMPCMDSTAT_INPUT_PORTS = 1 , NUM_PINGIN_INPUT_PORTS = 1 , NUM_SEQCMDBUFF_INPUT_PORTS = 5 }
 Enumerations for numbers of typed input ports. More...
 
enum  {
  NUM_CMDREG_OUTPUT_PORTS = 1 , NUM_CMDSTATUS_OUTPUT_PORTS = 1 , NUM_LOG_OUTPUT_PORTS = 1 , NUM_LOGTEXT_OUTPUT_PORTS = 1 ,
  NUM_TIME_OUTPUT_PORTS = 1 , NUM_TLM_OUTPUT_PORTS = 1
}
 Enumerations for numbers of special output ports. More...
 
enum  { NUM_COMPCMDSEND_OUTPUT_PORTS = 30 , NUM_PINGOUT_OUTPUT_PORTS = 1 , NUM_SEQCMDSTATUS_OUTPUT_PORTS = 5 }
 Enumerations for numbers of typed output ports. More...
 
enum  { OPCODE_CMD_NO_OP = 0x0 , OPCODE_CMD_NO_OP_STRING = 0x1 , OPCODE_CMD_TEST_CMD_1 = 0x2 , OPCODE_CMD_CLEAR_TRACKING = 0x3 }
 Command opcodes. More...
 
enum  {
  EVENTID_OPCODEREGISTERED = 0x0 , EVENTID_OPCODEDISPATCHED = 0x1 , EVENTID_OPCODECOMPLETED = 0x2 , EVENTID_OPCODEERROR = 0x3 ,
  EVENTID_MALFORMEDCOMMAND = 0x4 , EVENTID_INVALIDCOMMAND = 0x5 , EVENTID_TOOMANYCOMMANDS = 0x6 , EVENTID_NOOPRECEIVED = 0x7 ,
  EVENTID_NOOPSTRINGRECEIVED = 0x8 , EVENTID_TESTCMD1ARGS = 0x9 , EVENTID_OPCODEREREGISTERED = 0xa
}
 Event IDs. More...
 
enum  { CHANNELID_COMMANDSDISPATCHED = 0x0 , CHANNELID_COMMANDERRORS = 0x1 }
 Channel IDs. More...
 
- Protected Types inherited from Fw::ActiveComponentBase
enum  Lifecycle { CREATED , DISPATCHING , FINALIZING , DONE }
 Tracks the lifecycle of the component. More...
 
- Protected Member Functions inherited from Svc::CommandDispatcherComponentBase
 CommandDispatcherComponentBase (const char *compName="")
 Construct CommandDispatcherComponentBase object. More...
 
virtual ~CommandDispatcherComponentBase ()
 Destroy CommandDispatcherComponentBase object. More...
 
FwIndexType getNum_CmdDisp_InputPorts () const
 
FwIndexType getNum_compCmdReg_InputPorts () const
 
FwIndexType getNum_compCmdStat_InputPorts () const
 
FwIndexType getNum_pingIn_InputPorts () const
 
FwIndexType getNum_seqCmdBuff_InputPorts () const
 
FwIndexType getNum_CmdReg_OutputPorts () const
 
FwIndexType getNum_CmdStatus_OutputPorts () const
 
FwIndexType getNum_Log_OutputPorts () const
 
FwIndexType getNum_Time_OutputPorts () const
 
FwIndexType getNum_Tlm_OutputPorts () const
 
FwIndexType getNum_compCmdSend_OutputPorts () const
 
FwIndexType getNum_pingOut_OutputPorts () const
 
FwIndexType getNum_seqCmdStatus_OutputPorts () const
 
bool isConnected_CmdReg_OutputPort (FwIndexType portNum)
 
bool isConnected_CmdStatus_OutputPort (FwIndexType portNum)
 
bool isConnected_Log_OutputPort (FwIndexType portNum)
 
bool isConnected_Time_OutputPort (FwIndexType portNum)
 
bool isConnected_Tlm_OutputPort (FwIndexType portNum)
 
bool isConnected_compCmdSend_OutputPort (FwIndexType portNum)
 
bool isConnected_pingOut_OutputPort (FwIndexType portNum)
 
bool isConnected_seqCmdStatus_OutputPort (FwIndexType portNum)
 
void compCmdReg_handlerBase (FwIndexType portNum, FwOpcodeType opCode)
 Handler base-class function for input port compCmdReg. More...
 
void compCmdStat_handlerBase (FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response)
 Handler base-class function for input port compCmdStat. More...
 
void pingIn_handlerBase (FwIndexType portNum, U32 key)
 Handler base-class function for input port pingIn. More...
 
void seqCmdBuff_handlerBase (FwIndexType portNum, Fw::ComBuffer &data, U32 context)
 Handler base-class function for input port seqCmdBuff. More...
 
virtual void compCmdStat_preMsgHook (FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response)
 Pre-message hook for async input port compCmdStat. More...
 
virtual void pingIn_preMsgHook (FwIndexType portNum, U32 key)
 Pre-message hook for async input port pingIn. More...
 
virtual void seqCmdBuff_preMsgHook (FwIndexType portNum, Fw::ComBuffer &data, U32 context)
 Pre-message hook for async input port seqCmdBuff. More...
 
void compCmdSend_out (FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
 Invoke output port compCmdSend. More...
 
void pingOut_out (FwIndexType portNum, U32 key)
 Invoke output port pingOut. More...
 
void seqCmdStatus_out (FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response)
 Invoke output port seqCmdStatus. More...
 
void cmdResponse_out (FwOpcodeType opCode, U32 cmdSeq, Fw::CmdResponse response)
 Emit command response. More...
 
void CMD_NO_OP_cmdHandlerBase (FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
 
void CMD_NO_OP_STRING_cmdHandlerBase (FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
 
void CMD_TEST_CMD_1_cmdHandlerBase (FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
 
void CMD_CLEAR_TRACKING_cmdHandlerBase (FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
 
virtual void CMD_NO_OP_preMsgHook (FwOpcodeType opCode, U32 cmdSeq)
 Pre-message hook for command CMD_NO_OP. More...
 
virtual void CMD_NO_OP_STRING_preMsgHook (FwOpcodeType opCode, U32 cmdSeq)
 Pre-message hook for command CMD_NO_OP_STRING. More...
 
virtual void CMD_TEST_CMD_1_preMsgHook (FwOpcodeType opCode, U32 cmdSeq)
 Pre-message hook for command CMD_TEST_CMD_1. More...
 
virtual void CMD_CLEAR_TRACKING_preMsgHook (FwOpcodeType opCode, U32 cmdSeq)
 Pre-message hook for command CMD_CLEAR_TRACKING. More...
 
void log_DIAGNOSTIC_OpCodeRegistered (U32 Opcode, I32 port, I32 slot)
 Log event OpCodeRegistered. More...
 
void log_COMMAND_OpCodeDispatched (U32 Opcode, I32 port)
 
void log_COMMAND_OpCodeCompleted (U32 Opcode)
 
void log_COMMAND_OpCodeError (U32 Opcode, Fw::CmdResponse error)
 
void log_WARNING_HI_MalformedCommand (Fw::DeserialStatus Status)
 
void log_WARNING_HI_InvalidCommand (U32 Opcode)
 
void log_WARNING_HI_TooManyCommands (U32 Opcode)
 
void log_ACTIVITY_HI_NoOpReceived ()
 
void log_ACTIVITY_HI_NoOpStringReceived (const Fw::StringBase &message)
 
void log_ACTIVITY_HI_TestCmd1Args (I32 arg1, F32 arg2, U8 arg3)
 
void log_DIAGNOSTIC_OpCodeReregistered (U32 Opcode, I32 port)
 
void tlmWrite_CommandsDispatched (U32 arg, Fw::Time _tlmTime=Fw::Time())
 
void tlmWrite_CommandErrors (U32 arg, Fw::Time _tlmTime=Fw::Time())
 
Fw::Time getTime ()
 
virtual void lock ()
 Lock the guarded mutex. More...
 
virtual void unLock ()
 Unlock the guarded mutex. More...
 
- Protected Member Functions inherited from Fw::ActiveComponentBase
 ActiveComponentBase (const char *name)
 Constructor. More...
 
virtual ~ActiveComponentBase ()
 Destructor. More...
 
void init (NATIVE_INT_TYPE instance)
 initialization code More...
 
virtual void preamble ()
 A function that will be called before the event loop is entered. More...
 
MsgDispatchStatus dispatch ()
 The function that will dispatching messages. More...
 
virtual void finalizer ()
 A function that will be called after exiting the loop. More...
 
- Protected Member Functions inherited from Fw::QueuedComponentBase
 QueuedComponentBase (const char *name)
 Constructor. More...
 
virtual ~QueuedComponentBase ()
 Destructor. More...
 
void init (NATIVE_INT_TYPE instance)
 initialization function More...
 
Os::Queue::QueueStatus createQueue (NATIVE_INT_TYPE depth, NATIVE_INT_TYPE msgSize)
 
NATIVE_INT_TYPE getNumMsgsDropped ()
 return number of messages dropped More...
 
void incNumMsgDropped ()
 increment the number of messages dropped More...
 
- Protected Member Functions inherited from Fw::PassiveComponentBase
 PassiveComponentBase (const char *name)
 Named constructor. More...
 
virtual ~PassiveComponentBase ()
 Destructor. More...
 
void init (NATIVE_INT_TYPE instance)
 Initialization function. More...
 
NATIVE_INT_TYPE getInstance () const
 
- Protected Member Functions inherited from Fw::ObjBase
 ObjBase (const char *name)
 ObjBase constructor. More...
 
virtual ~ObjBase ()
 Destructor. More...
 
void init ()
 Object initializer. More...
 
- Protected Attributes inherited from Fw::ActiveComponentBase
Os::Task m_task
 task object for active component More...
 
- Protected Attributes inherited from Fw::QueuedComponentBase
Os::Queue m_queue
 queue object for active component More...
 

Detailed Description

Command Dispatcher component class.

The command dispatcher takes incoming Fw::Com packets that contain encoded commands. It extracts the opcode and looks it up in a table that is populated by components at registration time. If a component is connected to the seqCmdStatus port with the same number as the port that submitted the command, the command status will be returned.

Definition at line 32 of file CommandDispatcherImpl.hpp.

Constructor & Destructor Documentation

◆ CommandDispatcherImpl()

Svc::CommandDispatcherImpl::CommandDispatcherImpl ( const char *  name)

Command Dispatcher constructor.

The constructor initializes the state of the component. In this component, the opcode dispatch and tracking tables are initialized.

Parameters
namethe component instance name

Definition at line 14 of file CommandDispatcherImpl.cpp.

◆ ~CommandDispatcherImpl()

Svc::CommandDispatcherImpl::~CommandDispatcherImpl ( )
virtual

Component destructor.

The destructor for this component is empty

Definition at line 24 of file CommandDispatcherImpl.cpp.

Member Function Documentation

◆ init()

void Svc::CommandDispatcherImpl::init ( NATIVE_INT_TYPE  queueDepth,
NATIVE_INT_TYPE  instance 
)

Component initialization routine.

The initialization function calls the initialization routine for the base class.

Parameters
queueDepththe depth of the message queue for the component initialization function
Parameters
queueDepthThe queue depth
instanceThe instance number

Definition at line 27 of file CommandDispatcherImpl.cpp.


The documentation for this class was generated from the following files: