Class Command

Nested Relationships

Nested Types

Inheritance Relationships

Base Type

Class Documentation

class Command : public packet_handler::payloadBase

Public Types

enum Name

These values are used to detect the type of sub-payload that is ensuing.

Values:

enumerator BaseControl
enumerator Sound
enumerator SoundSequence
enumerator RequestExtra
enumerator ChangeFrame
enumerator RequestEeprom
enumerator SetDigitalOut
enumerator SetController
enumerator GetController
enum VersionFlag

Values:

enumerator HardwareVersion
enumerator FirmwareVersion
enumerator UniqueDeviceID
typedef ecl::PushAndPop<unsigned char> Buffer
typedef ecl::Stencil<Buffer> BufferStencil

Public Functions

inline virtual ~Command()
void resetBuffer(Buffer &buffer)
virtual bool serialise(ecl::PushAndPop<unsigned char> &byteStream)
inline virtual bool deserialise(ecl::PushAndPop<unsigned char>&)

Unused

Public Members

Data data

Public Static Functions

static Command SetLedArray(const enum LedNumber &number, const enum LedColour &colour, Command::Data &current_data)
static Command SetDigitalOutput(const DigitalOutput &digital_output, Command::Data &current_data)
static Command SetExternalPower(const DigitalOutput &digital_output, Command::Data &current_data)
static Command PlaySoundSequence(const enum SoundSequences &number)
static Command GetVersionInfo()
static Command SetVelocityControl(DiffDrive &diff_drive)
static Command SetVelocityControl(const int16_t &speed, const int16_t &radius)
static Command SetControllerGain(const unsigned char &type, const unsigned int &p_gain, const unsigned int &i_gain, const unsigned int &d_gain)
static Command GetControllerGain()
struct Data

Data structure containing data for commands.

It is important to keep this state as it will have to retain knowledge of the last known command in some instances - e.g. for gp_out commands, quite often the incoming command is only to set the output for a single led while keeping the rest of the current gp_out values as is.

For generating individual commands we modify the data here, then copy the command class (avoid doing mutexes) and spin it off for sending down to the device.

Public Functions

inline Data()

Public Members

Name command
int16_t speed
int16_t radius
uint16_t note
unsigned char duration
unsigned char segment_name
uint16_t request_flags
unsigned char frame_id
uint16_t gp_out
unsigned char type
unsigned int p_gain
unsigned int i_gain
unsigned int d_gain
unsigned char reserved