Go to the documentation of this file.
20 #ifndef DYNAMIXEL_READER_H
21 #define DYNAMIXEL_READER_H
32 #define DXL_PING_SIZE (10)
33 #define DXL_STATUS_SIZE(len) (11+len)
34 #define DXL_READ_SIZE (14)
35 #define DXL_WRITE_SIZE(len) (12+len)
103 (((uint16_t)reader->
buffer[5]) & 0xFF) |
104 ((((uint16_t)reader->
buffer[6]) & 0xFF) << 8);
117 (((uint16_t)reader->
buffer[reader->
size - 2]) & 0xFF) |
118 ((((uint16_t)reader->
buffer[reader->
size - 1]) & 0xFF) << 8);
130 return &reader->
buffer[9];
static uint16_t dynamixel_reader_get_length(const dynamixel_reader_t *reader)
Get the packet's length field.
static void dynamixel_reader_init(dynamixel_reader_t *reader, const uint8_t *buffer, size_t size)
Initialize the Dynamixel packet reader.
Dynamixel packet reader struct.
const uint8_t * buffer
data buffer
Dynamixel protocol definitions.
static uint8_t dynamixel_reader_get_instr(const dynamixel_reader_t *reader)
Get the packet's instruction code.
static size_t dynamixel_reader_status_get_payload_size(const dynamixel_reader_t *reader)
Get the packet's payload size (response)
static const uint8_t * dynamixel_reader_status_get_payload(const dynamixel_reader_t *reader)
Get the packet's payload (response)
bool dynamixel_reader_is_valid(const dynamixel_reader_t *reader)
Check if the packet is valid.
static uint16_t dynamixel_reader_get_crc(const dynamixel_reader_t *reader)
Get the packet's crc.
size_t size
data buffer's size
static uint8_t dynamixel_reader_get_id(const dynamixel_reader_t *reader)
Get the packet's device id.