Go to the documentation of this file.
37 TYPE_RESPONSE, TYPE_ERROR};
129 this->data[3] = (
data >> 0) & 0xFF;
130 this->data[2] = (
data >> 8) & 0xFF;
131 this->data[1] = (
data >> 16) & 0xFF;
132 this->data[0] = (
data >> 24) & 0xFF;
137 return (this->
data[0] << 24) | (this->
data[1] << 16) |
138 (this->
data[2] << 8) | (this->
data[3] << 0);
146 std::copy(
data.begin(),
data.end(), out.begin() + 3);
157 this->
type = serialized[1] & 0x0F;
159 std::copy(serialized.begin() + 3,
160 serialized.begin() + 7,
data.begin());
201 int sum = std::accumulate(
data.begin() + 1,
data.end() - 1, 0);
207 return 0xFF - (sum - tmp);
static uint8_t generateChecksum(const std::vector< uint8_t > &data)
MotorMessage::ErrorCodes deserialize(const RawMotorMessage &serialized)
const static uint8_t delimeter
MotorMessage::MessageTypes getType() const
const static uint8_t valid_registers[]
const static uint8_t valid_types[]
void setData(int32_t data)
RawMotorMessage serialize() const
static int verifyRegister(uint8_t r)
static int verifyType(uint8_t t)
const static uint8_t protocol_version
MotorMessage::Registers getRegister() const
boost::array< uint8_t, 4 > data
boost::array< uint8_t, 8 > RawMotorMessage
void setRegister(MotorMessage::Registers reg)
void setType(MotorMessage::MessageTypes type)