#include <CoLaCommand.h>
Public Types | |
using | ByteBuffer = std::vector< std::uint8_t > |
Public Member Functions | |
CoLaCommand () | |
CoLaCommand (const ByteBuffer &buffer) | |
const ByteBuffer & | getBuffer () const |
Get the binary data buffer. More... | |
CoLaError::Enum | getError () const |
Get error. More... | |
const char * | getName () const |
Get the name of command. More... | |
std::size_t | getParameterOffset () const |
Get offset in bytes to where first parameter starts. More... | |
CoLaCommandType::Enum | getType () const |
Get the type of command. More... | |
~CoLaCommand () | |
Static Public Member Functions | |
static CoLaCommand | errorCommand () |
Create a command for network errors. More... | |
static CoLaCommand | networkErrorCommand () |
Create a command for network errors. More... | |
Private Member Functions | |
CoLaCommand (CoLaCommandType::Enum commandType, CoLaError::Enum error, const std::string &name) | |
Construct a new CoLaCommand with the given command type, error, and name, but without any data. More... | |
bool | fromBuffer (const ByteBuffer &buffer) |
Decode a CoLa command from a given buffer. More... | |
Private Attributes | |
ByteBuffer | m_buffer |
CoLaError::Enum | m_error |
std::string | m_name |
std::size_t | m_parameterOffset |
CoLaCommandType::Enum | m_type |
Definition at line 17 of file CoLaCommand.h.
using visionary::CoLaCommand::ByteBuffer = std::vector<std::uint8_t> |
Definition at line 20 of file CoLaCommand.h.
visionary::CoLaCommand::CoLaCommand | ( | ) |
|
default |
visionary::CoLaCommand::CoLaCommand | ( | const ByteBuffer & | buffer | ) |
Construct a new CoLaCommand from the given data buffer
Definition at line 126 of file CoLaCommand.cpp.
|
private |
Construct a new CoLaCommand with the given command type, error, and name, but without any data.
Definition at line 121 of file CoLaCommand.cpp.
|
static |
Create a command for network errors.
|
private |
Decode a CoLa command from a given buffer.
Definition at line 15 of file CoLaCommand.cpp.
const CoLaCommand::ByteBuffer & visionary::CoLaCommand::getBuffer | ( | ) | const |
Get the binary data buffer.
Definition at line 139 of file CoLaCommand.cpp.
CoLaError::Enum visionary::CoLaCommand::getError | ( | ) | const |
Get error.
Definition at line 159 of file CoLaCommand.cpp.
const char * visionary::CoLaCommand::getName | ( | ) | const |
Get the name of command.
Definition at line 149 of file CoLaCommand.cpp.
std::size_t visionary::CoLaCommand::getParameterOffset | ( | ) | const |
Get offset in bytes to where first parameter starts.
Definition at line 154 of file CoLaCommand.cpp.
CoLaCommandType::Enum visionary::CoLaCommand::getType | ( | ) | const |
Get the type of command.
Definition at line 144 of file CoLaCommand.cpp.
|
static |
Create a command for network errors.
Definition at line 164 of file CoLaCommand.cpp.
|
private |
Definition at line 51 of file CoLaCommand.h.
|
private |
Definition at line 55 of file CoLaCommand.h.
|
private |
Definition at line 53 of file CoLaCommand.h.
|
private |
Definition at line 54 of file CoLaCommand.h.
|
private |
Definition at line 52 of file CoLaCommand.h.