F´ Flight Software - C/C++ Documentation  NASA-v1.5.0
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 
18 #include <Os/Mutex.hpp>
20 
21 namespace Svc {
22 
31 
33  public:
41  CommandDispatcherImpl(const char* name);
48  void init(
49  NATIVE_INT_TYPE queueDepth,
50  NATIVE_INT_TYPE instance
51  );
52  virtual ~CommandDispatcherImpl();
57  PRIVATE:
76  void seqCmdBuff_handler(NATIVE_INT_TYPE portNum, Fw::ComBuffer &data, U32 context);
94  void pingIn_handler(NATIVE_INT_TYPE portNum, U32 key);
120  void CMD_TEST_CMD_1_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, I32 arg1, F32 arg2, U8 arg3);
131 
142 
143  struct DispatchEntry {
144  bool used;
145  U32 opcode;
148 
161 
163  bool used;
164  U32 seq;
166  U32 context;
169 
170  I32 m_seq;
171 
174 
175  };
176 }
177 
178 #endif /* COMMANDDISPATCHERIMPL_HPP_ */
Svc::CommandDispatcherImpl::SequenceTracker::context
U32 context
context passed by user
Definition: CommandDispatcherImpl.hpp:166
PRIVATE
#define PRIVATE
overridable private for unit testing
Definition: BasicTypes.hpp:118
Svc::CommandDispatcherImpl::m_seq
I32 m_seq
current command sequence number
Definition: CommandDispatcherImpl.hpp:170
Svc::CommandDispatcherComponentBase
Auto-generated base for CommandDispatcher component.
Definition: CommandDispatcherComponentAc.hpp:50
Svc::CommandDispatcherComponentBase::portNum
PRIVATE NATIVE_INT_TYPE portNum
Definition: CommandDispatcherComponentAc.hpp:1057
Fw::CommandResponse
CommandResponse
Definition: CmdResponsePortAc.hpp:24
Svc::CommandDispatcherImpl::pingIn_handler
void pingIn_handler(NATIVE_INT_TYPE portNum, U32 key)
component ping handler
Definition: CommandDispatcherImpl.cpp:229
Svc::CommandDispatcherImpl::DispatchEntry::opcode
U32 opcode
opcode of entry
Definition: CommandDispatcherImpl.hpp:145
Svc::CommandDispatcherImpl::m_entryTable
struct Svc::CommandDispatcherImpl::DispatchEntry m_entryTable[CMD_DISPATCHER_DISPATCH_TABLE_SIZE]
table of dispatch entries
U8
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.hpp:76
Svc::CommandDispatcherImpl::DispatchEntry
table used to store opcode to port mappings
Definition: CommandDispatcherImpl.hpp:143
Svc::CommandDispatcherImpl::m_numCmdErrors
U32 m_numCmdErrors
number of commands with an error
Definition: CommandDispatcherImpl.hpp:173
Svc::CommandDispatcherImpl::DispatchEntry::port
NATIVE_INT_TYPE port
which port the entry invokes
Definition: CommandDispatcherImpl.hpp:146
Svc::CommandDispatcherImpl::CommandDispatcherImpl
CommandDispatcherImpl(const char *name)
Command Dispatcher constructor.
Definition: CommandDispatcherImpl.cpp:14
Svc::CommandDispatcherImpl
Command Dispatcher component class.
Definition: CommandDispatcherImpl.hpp:32
Svc::CommandDispatcherImpl::SequenceTracker::callerPort
NATIVE_INT_TYPE callerPort
port command source port
Definition: CommandDispatcherImpl.hpp:167
Fw::CmdStringArg
Definition: CmdString.hpp:11
Svc::CommandDispatcherImpl::CMD_NO_OP_STRING_cmdHandler
void CMD_NO_OP_STRING_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &arg1)
NO_OP with string command handler.
Definition: CommandDispatcherImpl.cpp:209
Svc::CommandDispatcherImpl::response
PROTECTED FwOpcodeType U32 Fw::CommandResponse response
Definition: CommandDispatcherImpl.hpp:67
Svc::CommandDispatcherImpl::CMD_NO_OP_cmdHandler
void CMD_NO_OP_cmdHandler(FwOpcodeType opCode, U32 cmdSeq)
NO_OP command handler.
Definition: CommandDispatcherImpl.cpp:202
CommandDispatcherImplCfg.hpp
Fw::ObjBase::init
void init(void)
Object initializer.
Definition: ObjBase.cpp:26
Svc::CommandDispatcherImpl::opCode
PROTECTED FwOpcodeType opCode
Definition: CommandDispatcherImpl.hpp:67
F32
float F32
32-bit floating point
Definition: BasicTypes.hpp:94
FwOpcodeType
#define FwOpcodeType
Type representation for a command opcode.
Definition: FpConfig.hpp:62
CMD_DISPATCHER_DISPATCH_TABLE_SIZE
@ CMD_DISPATCHER_DISPATCH_TABLE_SIZE
Definition: CommandDispatcherImplCfg.hpp:14
Svc::CommandDispatcherImpl::SequenceTracker
table used to store opcode that are being executed
Definition: CommandDispatcherImpl.hpp:162
CommandDispatcherComponentAc.hpp
Svc::CommandDispatcherImpl::cmdSeq
PROTECTED FwOpcodeType U32 cmdSeq
Definition: CommandDispatcherImpl.hpp:67
Svc::CommandDispatcherComponentBase::PROTECTED
PROTECTED PROTECTED
Definition: CommandDispatcherComponentAc.hpp:666
Svc::CommandDispatcherImpl::CMD_CLEAR_TRACKING_cmdHandler
void CMD_CLEAR_TRACKING_cmdHandler(FwOpcodeType opCode, U32 cmdSeq)
A command to clear the command tracking.
Definition: CommandDispatcherImpl.cpp:221
Svc::CommandDispatcherImpl::m_sequenceTracker
struct Svc::CommandDispatcherImpl::SequenceTracker m_sequenceTracker[CMD_DISPATCHER_SEQUENCER_TABLE_SIZE]
sequence tracking port for command completions;
Svc::CommandDispatcherImpl::m_numCmdsDispatched
U32 m_numCmdsDispatched
number of commands dispatched
Definition: CommandDispatcherImpl.hpp:172
Svc::CommandDispatcherImpl::seqCmdBuff_handler
void seqCmdBuff_handler(NATIVE_INT_TYPE portNum, Fw::ComBuffer &data, U32 context)
component command buffer handler
Definition: CommandDispatcherImpl.cpp:109
Svc::CommandDispatcherImpl::SequenceTracker::used
bool used
if this slot is used
Definition: CommandDispatcherImpl.hpp:163
Svc::CommandDispatcherImpl::SequenceTracker::opCode
FwOpcodeType opCode
opcode being tracked
Definition: CommandDispatcherImpl.hpp:165
Svc::CommandDispatcherImpl::compCmdReg_handler
void compCmdReg_handler(NATIVE_INT_TYPE portNum, FwOpcodeType opCode)
component command registration handler
Definition: CommandDispatcherImpl.cpp:34
Svc
Definition: ActiveLoggerComponentAc.cpp:22
Svc::CommandDispatcherImpl::DispatchEntry::used
bool used
if entry has been used yet
Definition: CommandDispatcherImpl.hpp:144
Svc::CommandDispatcherImpl::~CommandDispatcherImpl
virtual ~CommandDispatcherImpl()
Component destructor.
Definition: CommandDispatcherImpl.cpp:24
Svc::CommandDispatcherComponentBase::compCmdStat_handler
virtual void compCmdStat_handler(NATIVE_INT_TYPE portNum, FwOpcodeType opCode, U32 cmdSeq, Fw::CommandResponse response)=0
Handler for input port compCmdStat.
CMD_DISPATCHER_SEQUENCER_TABLE_SIZE
@ CMD_DISPATCHER_SEQUENCER_TABLE_SIZE
Definition: CommandDispatcherImplCfg.hpp:15
Mutex.hpp
Svc::CommandDispatcherImpl::CMD_TEST_CMD_1_cmdHandler
void CMD_TEST_CMD_1_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, I32 arg1, F32 arg2, U8 arg3)
A test command with different argument types.
Definition: CommandDispatcherImpl.cpp:216
NATIVE_INT_TYPE
int NATIVE_INT_TYPE
native integer type declaration
Definition: BasicTypes.hpp:29
Fw::ComBuffer
Definition: ComBuffer.hpp:21
Svc::CommandDispatcherImpl::SequenceTracker::seq
U32 seq
command sequence number
Definition: CommandDispatcherImpl.hpp:164