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 (NATIVE_INT_TYPE queueDepth, NATIVE_INT_TYPE instance=0)
 Initialize CommandDispatcherComponentBase object. More...
 
Fw::InputCmdPortget_CmdDisp_InputPort (NATIVE_INT_TYPE portNum)
 
Fw::InputCmdRegPortget_compCmdReg_InputPort (NATIVE_INT_TYPE portNum)
 
Fw::InputCmdResponsePortget_compCmdStat_InputPort (NATIVE_INT_TYPE portNum)
 
Svc::InputPingPortget_pingIn_InputPort (NATIVE_INT_TYPE portNum)
 
Fw::InputComPortget_seqCmdBuff_InputPort (NATIVE_INT_TYPE portNum)
 
void set_CmdReg_OutputPort (NATIVE_INT_TYPE portNum, Fw::InputCmdRegPort *port)
 Connect port to CmdReg[portNum]. More...
 
void set_CmdStatus_OutputPort (NATIVE_INT_TYPE portNum, Fw::InputCmdResponsePort *port)
 Connect port to CmdStatus[portNum]. More...
 
void set_Log_OutputPort (NATIVE_INT_TYPE portNum, Fw::InputLogPort *port)
 Connect port to Log[portNum]. More...
 
void set_Time_OutputPort (NATIVE_INT_TYPE portNum, Fw::InputTimePort *port)
 Connect port to Time[portNum]. More...
 
void set_Tlm_OutputPort (NATIVE_INT_TYPE portNum, Fw::InputTlmPort *port)
 Connect port to Tlm[portNum]. More...
 
void set_compCmdSend_OutputPort (NATIVE_INT_TYPE portNum, Fw::InputCmdPort *port)
 Connect port to compCmdSend[portNum]. More...
 
void set_pingOut_OutputPort (NATIVE_INT_TYPE portNum, Svc::InputPingPort *port)
 Connect port to pingOut[portNum]. More...
 
void set_seqCmdStatus_OutputPort (NATIVE_INT_TYPE 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 (NATIVE_UINT_TYPE priority=Os::Task::TASK_DEFAULT, NATIVE_UINT_TYPE stackSize=Os::Task::TASK_DEFAULT, NATIVE_UINT_TYPE cpuAffinity=Os::Task::TASK_DEFAULT, NATIVE_UINT_TYPE identifier=Os::Task::TASK_DEFAULT)
 called by instantiator when task is to be started More...
 
 DEPRECATED (void start(NATIVE_INT_TYPE identifier, NATIVE_INT_TYPE priority, NATIVE_INT_TYPE stackSize, NATIVE_INT_TYPE cpuAffinity=-1), "Please switch to start(NATIVE_UINT_TYPE priority, NATIVE_UINT_TYPE stackSize, NATIVE_UINT_TYPE cpuAffinity, NATIVE_UINT_TYPE identifier)")
 called by instantiator when task is to be started More...
 
void exit ()
 exit task in active component More...
 
Os::Task::TaskStatus join (void **value_ptr)
 provide return value of thread if value_ptr is not NULL 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 Member Functions inherited from Svc::CommandDispatcherComponentBase
 CommandDispatcherComponentBase (const char *compName="")
 Construct CommandDispatcherComponentBase object. More...
 
virtual ~CommandDispatcherComponentBase ()
 Destroy CommandDispatcherComponentBase object. More...
 
NATIVE_INT_TYPE getNum_CmdDisp_InputPorts () const
 
NATIVE_INT_TYPE getNum_compCmdReg_InputPorts () const
 
NATIVE_INT_TYPE getNum_compCmdStat_InputPorts () const
 
NATIVE_INT_TYPE getNum_pingIn_InputPorts () const
 
NATIVE_INT_TYPE getNum_seqCmdBuff_InputPorts () const
 
NATIVE_INT_TYPE getNum_CmdReg_OutputPorts () const
 
NATIVE_INT_TYPE getNum_CmdStatus_OutputPorts () const
 
NATIVE_INT_TYPE getNum_Log_OutputPorts () const
 
NATIVE_INT_TYPE getNum_Time_OutputPorts () const
 
NATIVE_INT_TYPE getNum_Tlm_OutputPorts () const
 
NATIVE_INT_TYPE getNum_compCmdSend_OutputPorts () const
 
NATIVE_INT_TYPE getNum_pingOut_OutputPorts () const
 
NATIVE_INT_TYPE getNum_seqCmdStatus_OutputPorts () const
 
bool isConnected_CmdReg_OutputPort (NATIVE_INT_TYPE portNum)
 
bool isConnected_CmdStatus_OutputPort (NATIVE_INT_TYPE portNum)
 
bool isConnected_Log_OutputPort (NATIVE_INT_TYPE portNum)
 
bool isConnected_Time_OutputPort (NATIVE_INT_TYPE portNum)
 
bool isConnected_Tlm_OutputPort (NATIVE_INT_TYPE portNum)
 
bool isConnected_compCmdSend_OutputPort (NATIVE_INT_TYPE portNum)
 
bool isConnected_pingOut_OutputPort (NATIVE_INT_TYPE portNum)
 
bool isConnected_seqCmdStatus_OutputPort (NATIVE_INT_TYPE portNum)
 
void compCmdReg_handlerBase (NATIVE_INT_TYPE portNum, FwOpcodeType opCode)
 Handler base-class function for input port compCmdReg. More...
 
void compCmdStat_handlerBase (NATIVE_INT_TYPE portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response)
 Handler base-class function for input port compCmdStat. More...
 
void pingIn_handlerBase (NATIVE_INT_TYPE portNum, U32 key)
 Handler base-class function for input port pingIn. More...
 
void seqCmdBuff_handlerBase (NATIVE_INT_TYPE portNum, Fw::ComBuffer &data, U32 context)
 Handler base-class function for input port seqCmdBuff. More...
 
virtual void compCmdStat_preMsgHook (NATIVE_INT_TYPE portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response)
 Pre-message hook for async input port compCmdStat. More...
 
virtual void pingIn_preMsgHook (NATIVE_INT_TYPE portNum, U32 key)
 Pre-message hook for async input port pingIn. More...
 
virtual void seqCmdBuff_preMsgHook (NATIVE_INT_TYPE portNum, Fw::ComBuffer &data, U32 context)
 Pre-message hook for async input port seqCmdBuff. More...
 
void compCmdSend_out (NATIVE_INT_TYPE portNum, FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
 Invoke output port compCmdSend. More...
 
void pingOut_out (NATIVE_INT_TYPE portNum, U32 key)
 Invoke output port pingOut. More...
 
void seqCmdStatus_out (NATIVE_INT_TYPE 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::LogStringArg &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...
 
virtual void loop ()
 The function that will loop 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: