F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
CommandDispatcherImpl.hpp
Go to the documentation of this file.
1 
13 #ifndef COMMANDDISPATCHERIMPL_HPP_
14 #define COMMANDDISPATCHERIMPL_HPP_
15 
16 #include <atomic>
17 
20 #include <Os/Mutex.hpp>
22 #include <config/CommandDispatcherImplCfg.hpp>
23 
24 namespace Svc {
25 
34 
37 
38  public:
46  CommandDispatcherImpl(const char* name);
50  virtual ~CommandDispatcherImpl();
51 
55  void configure(bool executeWhenSequenceTableFull = CmdDispatcherCfg::EXECUTE_WHEN_SEQUENCE_TABLE_FULL_DEFAULT);
56 
57  protected:
58  private:
68  void compCmdStat_handler(FwIndexType portNum,
69  FwOpcodeType opCode,
70  U32 cmdSeq,
71  const Fw::CmdResponse& response) override;
80  void seqCmdBuff_handler(FwIndexType portNum, Fw::ComBuffer& data, U32 context) override;
89  void compCmdReg_handler(FwIndexType portNum, FwOpcodeType opCode) override;
98  void pingIn_handler(FwIndexType portNum, U32 key) override;
99 
103  void run_handler(FwIndexType portNum,
104  U32 context
105  ) override;
106 
113  void CMD_NO_OP_cmdHandler(FwOpcodeType opCode, U32 cmdSeq) override;
122  void CMD_NO_OP_STRING_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg& arg1) override;
132  void CMD_TEST_CMD_1_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, I32 arg1, F32 arg2, U8 arg3) override;
143  void CMD_CLEAR_TRACKING_cmdHandler(FwOpcodeType opCode, U32 cmdSeq) override;
144 
153  void seqCmdBuff_overflowHook(FwIndexType portNum, Fw::ComBuffer& data, U32 context) override;
154 
156  void advanceSequenceNumber();
157 
162  U32 allocateSequenceNumber();
163 
170 
176 
177  struct SequenceTrackerEntry {
178  FwOpcodeType opCode;
179  U32 context;
180  FwIndexType callerPort;
181  };
182 
185 
186  U32 m_seq;
187  bool m_seqWrapped;
188 
189  bool m_executeWhenSequenceTableFull;
190 
191  U32 m_numCmdsDispatched;
192  U32 m_numCmdErrors;
193  std::atomic<U32>
194  m_numCmdsDropped;
195 };
196 } // namespace Svc
197 
198 #endif /* COMMANDDISPATCHERIMPL_HPP_ */
FwIdType FwOpcodeType
The type of a command opcode.
Enum representing a command response.
float F32
32-bit floating point
Definition: BasicTypes.h:84
virtual ~CommandDispatcherImpl()
Component destructor.
CommandDispatcherImpl(const char *name)
Command Dispatcher constructor.
constexpr bool EXECUTE_WHEN_SEQUENCE_TABLE_FULL_DEFAULT
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:54
PlatformIndexType FwIndexType
Auto-generated base for CommandDispatcher component.
RateGroupDivider component implementation.
Command Dispatcher component class.
void configure(bool executeWhenSequenceTableFull=CmdDispatcherCfg::EXECUTE_WHEN_SEQUENCE_TABLE_FULL_DEFAULT)
Configure behavior when the sequence tracker table is full.