18 static constexpr uint8_t maxArgumentCount = 8;
20 bsp::text_in::Inputs::Command buffer {};
22 uint8_t commandOffset = 0;
23 std::array<uint8_t, maxArgumentCount> argumentOffsets {};
24 uint8_t argumentCount = 0;
27 const char*
name()
const;
30 const char*
argument(
const size_t index)
const;
50ParsedCommand parseCommand(
const bsp::text_in::Inputs::Command& input);
bool parse_uint8(const ParsedCommand &command, const size_t index, uint8_t &value)
Parse an argument as a 8 bit unsigned number.
Definition: cmd_parser.cpp:60
bool parse_uint16(const ParsedCommand &command, const size_t index, uint16_t &value)
Parse an argument as a 16 bit unsigned number.
Definition: cmd_parser.cpp:74
Program scope.
Definition: control_fixed_modes.hpp:12
Definition: cmd_parser.h:17
const char * argument(const size_t index) const
Return the argument at the desired index, or nullptr if it do not exist.
Definition: cmd_parser.cpp:15
const char * name() const
Return the name of the command.
Definition: cmd_parser.cpp:13
ParsedCommand shift_to_first_parameter() const
Create a new command shifted by one argument.
Definition: cmd_parser.cpp:23