Class payloadBase

Inheritance Relationships

Derived Types

Class Documentation

class payloadBase

Provides base class for payloads.

Subclassed by kobuki::Cliff, kobuki::Command, kobuki::ControllerInfo, kobuki::CoreSensors, kobuki::Current, kobuki::DockIR, kobuki::Eeprom, kobuki::Firmware, kobuki::GpInput, kobuki::Hardware, kobuki::Inertia, kobuki::ThreeAxisGyro, kobuki::UniqueDeviceID

Public Functions

inline payloadBase(const bool is_dynamic_ = false, const unsigned char length_ = 0)
inline virtual ~payloadBase()
virtual bool serialise(ecl::PushAndPop<unsigned char> &byteStream) = 0
virtual bool deserialise(ecl::PushAndPop<unsigned char> &byteStream) = 0

Public Members

bool yes

this is simple magic to write the flag, when we get the packet from the host or when we want to send the data

const bool is_dynamic

it indicates the type of derived packet. if packet type is dynamic, length of packet can be changed during communication session. Ohterwise can not.

const unsigned char length

it indicates length of data part of packet, except header and length field. if packet is fixed type, this value should be matched with length field. if packet is dynamic type, this value indicates minimal value of length field.

Protected Functions

template<typename T>
inline void buildVariable(T &V, ecl::PushAndPop<unsigned char> &buffer)
template<typename T>
inline void buildBytes(const T &V, ecl::PushAndPop<unsigned char> &buffer)