![]() |
F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
|
Command Dispatcher component class. More...
#include <Svc/CmdDispatcher/CommandDispatcherImpl.hpp>
Public Member Functions | |
CommandDispatcherImpl (const char *name) | |
Command Dispatcher constructor. | |
virtual | ~CommandDispatcherImpl () |
Component destructor. | |
![]() | |
void | init (FwSizeType queueDepth, FwEnumStoreType instance=0) |
Initialize CommandDispatcherComponentBase object. | |
Fw::InputCmdPort * | get_CmdDisp_InputPort (FwIndexType portNum) |
Fw::InputCmdRegPort * | get_compCmdReg_InputPort (FwIndexType portNum) |
Fw::InputCmdResponsePort * | get_compCmdStat_InputPort (FwIndexType portNum) |
Svc::InputPingPort * | get_pingIn_InputPort (FwIndexType portNum) |
Fw::InputComPort * | get_seqCmdBuff_InputPort (FwIndexType portNum) |
void | set_CmdReg_OutputPort (FwIndexType portNum, Fw::InputCmdRegPort *port) |
Connect port to CmdReg[portNum]. | |
void | set_CmdStatus_OutputPort (FwIndexType portNum, Fw::InputCmdResponsePort *port) |
Connect port to CmdStatus[portNum]. | |
void | set_Log_OutputPort (FwIndexType portNum, Fw::InputLogPort *port) |
Connect port to Log[portNum]. | |
void | set_Time_OutputPort (FwIndexType portNum, Fw::InputTimePort *port) |
Connect port to Time[portNum]. | |
void | set_Tlm_OutputPort (FwIndexType portNum, Fw::InputTlmPort *port) |
Connect port to Tlm[portNum]. | |
void | set_compCmdSend_OutputPort (FwIndexType portNum, Fw::InputCmdPort *port) |
Connect port to compCmdSend[portNum]. | |
void | set_pingOut_OutputPort (FwIndexType portNum, Svc::InputPingPort *port) |
Connect port to pingOut[portNum]. | |
void | set_seqCmdStatus_OutputPort (FwIndexType portNum, Fw::InputCmdResponsePort *port) |
Connect port to seqCmdStatus[portNum]. | |
void | regCommands () |
Register commands with the Command Dispatcher. | |
![]() | |
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 | |
void | exit () |
exit task in active component | |
Os::Task::Status | join () |
Join the thread. | |
DEPRECATED (Os::Task::Status join(void **value_ptr), "Switch to .join()") | |
Join to thread with discarded value_ptr. | |
![]() | |
void | setIdBase (const U32) |
Set the ID base. | |
U32 | getIdBase () const |
Additional Inherited Members | |
![]() | |
enum | { ACTIVE_COMPONENT_EXIT } |
![]() | |
enum | MsgDispatchStatus { MSG_DISPATCH_OK , MSG_DISPATCH_EMPTY , MSG_DISPATCH_ERROR , MSG_DISPATCH_EXIT } |
![]() | |
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... | |
![]() | |
enum | Lifecycle { CREATED , DISPATCHING , FINALIZING , DONE } |
Tracks the lifecycle of the component. More... | |
![]() | |
CommandDispatcherComponentBase (const char *compName="") | |
Construct CommandDispatcherComponentBase object. | |
virtual | ~CommandDispatcherComponentBase () |
Destroy CommandDispatcherComponentBase object. | |
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. | |
void | compCmdStat_handlerBase (FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response) |
Handler base-class function for input port compCmdStat. | |
void | pingIn_handlerBase (FwIndexType portNum, U32 key) |
Handler base-class function for input port pingIn. | |
void | seqCmdBuff_handlerBase (FwIndexType portNum, Fw::ComBuffer &data, U32 context) |
Handler base-class function for input port seqCmdBuff. | |
virtual void | compCmdStat_preMsgHook (FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response) |
Pre-message hook for async input port compCmdStat. | |
virtual void | pingIn_preMsgHook (FwIndexType portNum, U32 key) |
Pre-message hook for async input port pingIn. | |
virtual void | seqCmdBuff_preMsgHook (FwIndexType portNum, Fw::ComBuffer &data, U32 context) |
Pre-message hook for async input port seqCmdBuff. | |
void | compCmdSend_out (FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args) |
Invoke output port compCmdSend. | |
void | pingOut_out (FwIndexType portNum, U32 key) |
Invoke output port pingOut. | |
void | seqCmdStatus_out (FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response) |
Invoke output port seqCmdStatus. | |
void | cmdResponse_out (FwOpcodeType opCode, U32 cmdSeq, Fw::CmdResponse response) |
Emit command response. | |
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. | |
virtual void | CMD_NO_OP_STRING_preMsgHook (FwOpcodeType opCode, U32 cmdSeq) |
Pre-message hook for command CMD_NO_OP_STRING. | |
virtual void | CMD_TEST_CMD_1_preMsgHook (FwOpcodeType opCode, U32 cmdSeq) |
Pre-message hook for command CMD_TEST_CMD_1. | |
virtual void | CMD_CLEAR_TRACKING_preMsgHook (FwOpcodeType opCode, U32 cmdSeq) |
Pre-message hook for command CMD_CLEAR_TRACKING. | |
void | log_DIAGNOSTIC_OpCodeRegistered (U32 Opcode, I32 port, I32 slot) const |
Log event OpCodeRegistered. | |
void | log_COMMAND_OpCodeDispatched (U32 Opcode, I32 port) const |
void | log_COMMAND_OpCodeCompleted (U32 Opcode) const |
void | log_COMMAND_OpCodeError (U32 Opcode, Fw::CmdResponse error) const |
void | log_WARNING_HI_MalformedCommand (Fw::DeserialStatus Status) const |
void | log_WARNING_HI_InvalidCommand (U32 Opcode) const |
void | log_WARNING_HI_TooManyCommands (U32 Opcode) const |
void | log_ACTIVITY_HI_NoOpReceived () const |
void | log_ACTIVITY_HI_NoOpStringReceived (const Fw::StringBase &message) const |
void | log_ACTIVITY_HI_TestCmd1Args (I32 arg1, F32 arg2, U8 arg3) const |
void | log_DIAGNOSTIC_OpCodeReregistered (U32 Opcode, I32 port) const |
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. | |
virtual void | unLock () |
Unlock the guarded mutex. | |
![]() | |
ActiveComponentBase (const char *name) | |
Constructor. | |
virtual | ~ActiveComponentBase () |
Destructor. | |
void | init (NATIVE_INT_TYPE instance) |
initialization code | |
virtual void | preamble () |
A function that will be called before the event loop is entered. | |
MsgDispatchStatus | dispatch () |
The function that will dispatching messages. | |
virtual void | finalizer () |
A function that will be called after exiting the loop. | |
![]() | |
QueuedComponentBase (const char *name) | |
Constructor. | |
virtual | ~QueuedComponentBase () |
Destructor. | |
void | init (NATIVE_INT_TYPE instance) |
initialization function | |
Os::Queue::Status | createQueue (FwSizeType depth, FwSizeType msgSize) |
NATIVE_INT_TYPE | getNumMsgsDropped () |
return number of messages dropped | |
void | incNumMsgDropped () |
increment the number of messages dropped | |
![]() | |
PassiveComponentBase (const char *name) | |
Named constructor. | |
virtual | ~PassiveComponentBase () |
Destructor. | |
void | init (NATIVE_INT_TYPE instance) |
Initialization function. | |
NATIVE_INT_TYPE | getInstance () const |
![]() | |
ObjBase (const char *name) | |
ObjBase constructor. | |
virtual | ~ObjBase () |
Destructor. | |
void | init () |
Object initializer. | |
![]() | |
Os::Task | m_task |
task object for active component | |
![]() | |
Os::Queue | m_queue |
queue object for active component | |
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.
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.
name | the component instance name |
Definition at line 14 of file CommandDispatcherImpl.cpp.
|
virtual |
Component destructor.
The destructor for this component is empty
Definition at line 24 of file CommandDispatcherImpl.cpp.