Midnight Sun Firmware
Loading...
Searching...
No Matches
CommandCodes

Commands Supported by the Simulation. More...

Enumerations

enum class  CommandCode {
  METADATA , GPIO_SET_PIN_STATE , GPIO_SET_ALL_STATES , GPIO_GET_PIN_STATE ,
  GPIO_GET_ALL_STATES , GPIO_GET_PIN_MODE , GPIO_GET_ALL_MODES , GPIO_GET_PIN_ALT_FUNCTION ,
  GPIO_GET_ALL_ALT_FUNCTIONS , NUM_COMMAND_CODES
}
 Command Code Class. More...
 

Functions

std::string encodeCommand (const CommandCode commandCode, std::string &message)
 Encode a command code into an existing data payload. More...
 
std::pair< CommandCode, std::string > decodeCommand (std::string &message)
 Decode a command code from existing data. More...
 

Detailed Description

Commands Supported by the Simulation.

Enumeration Type Documentation

◆ CommandCode

enum class CommandCode
strong

Command Code Class.

Enumerator
METADATA 

Retrieve Client Metadata Command

GPIO_SET_PIN_STATE 

Set a Gpio Pin state

GPIO_SET_ALL_STATES 

Set all Gpio Pin states

GPIO_GET_PIN_STATE 

Get a Gpio Pin state

GPIO_GET_ALL_STATES 

Get all Gpio Pin states

GPIO_GET_PIN_MODE 

Get a Gpio Pin mode

GPIO_GET_ALL_MODES 

Get all Gpio Pin modes

GPIO_GET_PIN_ALT_FUNCTION 

Get a Gpio Pin alternate function

GPIO_GET_ALL_ALT_FUNCTIONS 

Get all Gpio Pin alternate functions

NUM_COMMAND_CODES 

Number of command codes

Function Documentation

◆ decodeCommand()

std::pair< CommandCode, std::string > decodeCommand ( std::string &  message)

Decode a command code from existing data.

Parameters
messageString data payload to be decoded
Returns
Pair containing <CommandCode, Data payload without the command Code>

◆ encodeCommand()

std::string encodeCommand ( const CommandCode  commandCode,
std::string &  message 
)

Encode a command code into an existing data payload.

Parameters
commandCodeCommand code to be encoded
messageString data payload to be modified
Returns
Encoded message