dynamixel_reader.h

Interface definition for Dynamixel packet reader.

DXL_PING_SIZE
1
(10)
DXL_STATUS_SIZE( len)
1
(11+len)
DXL_READ_SIZE
1
(14)
DXL_WRITE_SIZE( len)
1
(12+len)
void dynamixel_reader_init(dynamixel_reader_t * reader, const uint8_t * buffer, msp430_types.h::size_t size)

Initialize the Dynamixel packet reader.

Parameters

reader:the packet reader
buffer:the buffer used to store data
size:the size of the buffer

bool dynamixel_reader_is_valid(const dynamixel_reader_t * reader)

Check if the packet is valid.

Parameters

reader:the packet reader

Return values

  • true if the packet is valid
  • false otherwise
uint8_t dynamixel_reader_get_id(const dynamixel_reader_t * reader)

Get the packet’s device id.

Parameters

reader:the packet reader

Return values

  • the packet’s device id
uint8_t dynamixel_reader_get_instr(const dynamixel_reader_t * reader)

Get the packet’s instruction code.

Parameters

reader:the packet reader

Return values

  • the packet’s instruction code
uint16_t dynamixel_reader_get_length(const dynamixel_reader_t * reader)

Get the packet’s length field.

Parameters

reader:the packet reader

Return values

  • the packet’s length field
uint16_t dynamixel_reader_get_crc(const dynamixel_reader_t * reader)

Get the packet’s crc.

Parameters

reader:the packet reader

Return values

  • the packet’s length field
const uint8_t * dynamixel_reader_status_get_payload(const dynamixel_reader_t * reader)

Get the packet’s payload (response)

Parameters

reader:the packet reader

Return values

  • the addess of the begining of the payload
msp430_types.h::size_t dynamixel_reader_status_get_payload_size(const dynamixel_reader_t * reader)

Get the packet’s payload size (response)

Parameters

reader:the packet reader

Return values

  • the size of the payload
struct dynamixel_reader_t

Dynamixel packet reader struct.

const uint8_t * buffer

data buffer

msp430_types.h::size_t size

data buffer’s size