F´ Flight Software - C/C++ Documentation  NASA-v2.0.1
A framework for building embedded system applications to NASA flight quality standards.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CommandDispatcherImpl.hpp
Go to the documentation of this file.
1 
14 #ifndef COMMANDDISPATCHERIMPL_HPP_
15 #define COMMANDDISPATCHERIMPL_HPP_
16 
17 #include <Svc/CmdDispatcher/CommandDispatcherComponentAc.hpp>
18 #include <Os/Mutex.hpp>
20 
21 namespace Svc {
22 
31 
32  class CommandDispatcherImpl : public CommandDispatcherComponentBase {
33  public:
41  CommandDispatcherImpl(const char* name);
48  void init(
49  NATIVE_INT_TYPE queueDepth,
50  NATIVE_INT_TYPE instance
51  );
52  virtual ~CommandDispatcherImpl();
56  PROTECTED:
57  PRIVATE:
67  void compCmdStat_handler(NATIVE_INT_TYPE portNum, FwOpcodeType opCode, U32 cmdSeq, Fw::CommandResponse response);
76  void seqCmdBuff_handler(NATIVE_INT_TYPE portNum, Fw::ComBuffer &data, U32 context);
85  void compCmdReg_handler(NATIVE_INT_TYPE portNum, FwOpcodeType opCode);
94  void pingIn_handler(NATIVE_INT_TYPE portNum, U32 key);
101  void CMD_NO_OP_cmdHandler(FwOpcodeType opCode, U32 cmdSeq);
110  void CMD_NO_OP_STRING_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg& arg1);
120  void CMD_TEST_CMD_1_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, I32 arg1, F32 arg2, U8 arg3);
130  void CMD_CLEAR_TRACKING_cmdHandler(FwOpcodeType opCode, U32 cmdSeq);
131 
142 
143  struct DispatchEntry {
144  bool used;
145  U32 opcode;
146  NATIVE_INT_TYPE port;
147  } m_entryTable[CMD_DISPATCHER_DISPATCH_TABLE_SIZE];
148 
161 
162  struct SequenceTracker {
163  bool used;
164  U32 seq;
165  FwOpcodeType opCode;
166  U32 context;
167  NATIVE_INT_TYPE callerPort;
168  } m_sequenceTracker[CMD_DISPATCHER_SEQUENCER_TABLE_SIZE];
169 
170  I32 m_seq;
171 
172  U32 m_numCmdsDispatched;
173  U32 m_numCmdErrors;
174 
175  };
176 }
177 
178 #endif /* COMMANDDISPATCHERIMPL_HPP_ */
Svc::CommandDispatcherImpl::init
void init(NATIVE_INT_TYPE queueDepth, NATIVE_INT_TYPE instance)
Component initialization routine.
Definition: CommandDispatcherImpl.cpp:27
U8
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.hpp:76
CMD_DISPATCHER_SEQUENCER_TABLE_SIZE
@ CMD_DISPATCHER_SEQUENCER_TABLE_SIZE
Definition: CommandDispatcherImplCfg.hpp:15
Svc::CommandDispatcherImpl::CommandDispatcherImpl
CommandDispatcherImpl(const char *name)
Command Dispatcher constructor.
Definition: CommandDispatcherImpl.cpp:14
Svc::CommandDispatcherImpl
Command Dispatcher component class.
Definition: CommandDispatcherImpl.hpp:32
Fw::CmdStringArg
Definition: CmdString.hpp:11
CommandDispatcherImplCfg.hpp
CMD_DISPATCHER_DISPATCH_TABLE_SIZE
@ CMD_DISPATCHER_DISPATCH_TABLE_SIZE
Definition: CommandDispatcherImplCfg.hpp:14
F32
float F32
32-bit floating point
Definition: BasicTypes.hpp:94
FwOpcodeType
#define FwOpcodeType
Type representation for a command opcode.
Definition: FpConfig.hpp:62
Svc
Definition: ActiveRateGroupImplCfg.hpp:18
Svc::CommandDispatcherImpl::~CommandDispatcherImpl
virtual ~CommandDispatcherImpl()
Component destructor.
Definition: CommandDispatcherImpl.cpp:24
Mutex.hpp
NATIVE_INT_TYPE
int NATIVE_INT_TYPE
native integer type declaration
Definition: BasicTypes.hpp:29
Fw::ComBuffer
Definition: ComBuffer.hpp:21