Loading...
Searching...
No Matches
dynamixel_writer.h File Reference

Interface definition for Dynamixel packet writer. More...

Detailed Description

Interface definition for Dynamixel packet writer.

Author
Loïc Dauphin loic..nosp@m.daup.nosp@m.hin@i.nosp@m.nria.nosp@m..fr

Definition in file dynamixel_writer.h.

#include "dynamixel_protocol.h"
#include <stdint.h>
#include <stdlib.h>
#include <stdbool.h>
+ Include dependency graph for dynamixel_writer.h:

Go to the source code of this file.

Data Structures

struct  dynamixel_writer_t
 Dynamixel packet writer struct. More...
 
void dynamixel_writer_init (dynamixel_writer_t *writer, uint8_t *buffer, size_t limit)
 Initialize the Dynamixel packet writer.
 
const uint8_t * dynamixel_writer_get_data (const dynamixel_writer_t *writer)
 Get the data buffer to send.
 
size_t dynamixel_writer_get_size (const dynamixel_writer_t *writer)
 Get the data buffer's size to send.
 
void dynamixel_writer_ping_make (dynamixel_writer_t *writer, uint8_t id)
 Build a PING packet.
 
void dynamixel_writer_write_make (dynamixel_writer_t *writer, uint8_t id, uint16_t reg, const uint8_t *buffer, size_t size)
 Build a WRITE packet.
 
void dynamixel_writer_read_make (dynamixel_writer_t *writer, uint8_t id, uint16_t reg, size_t size)
 Build a READ packet.
 

Function Documentation

◆ dynamixel_writer_get_data()

const uint8_t * dynamixel_writer_get_data ( const dynamixel_writer_t writer)

Get the data buffer to send.

Parameters
[out]writerthe packet writer
Returns
the beginning address of the buffer

◆ dynamixel_writer_get_size()

size_t dynamixel_writer_get_size ( const dynamixel_writer_t writer)

Get the data buffer's size to send.

Parameters
[out]writerthe packet writer
Returns
the buffer's size

◆ dynamixel_writer_init()

void dynamixel_writer_init ( dynamixel_writer_t writer,
uint8_t *  buffer,
size_t  limit 
)

Initialize the Dynamixel packet writer.

Parameters
[out]writerthe packet writer
[in]bufferthe buffer used to store data
[in]limitthe size of the buffer (= maximum packet size)

◆ dynamixel_writer_ping_make()

void dynamixel_writer_ping_make ( dynamixel_writer_t writer,
uint8_t  id 
)

Build a PING packet.

Parameters
[out]writerthe packet writer
[in]idthe destination's id

◆ dynamixel_writer_read_make()

void dynamixel_writer_read_make ( dynamixel_writer_t writer,
uint8_t  id,
uint16_t  reg,
size_t  size 
)

Build a READ packet.

Parameters
[out]writerthe packet writer
[in]idthe destination's id
[in]regthe register to read
[in]sizethe size to read

◆ dynamixel_writer_write_make()

void dynamixel_writer_write_make ( dynamixel_writer_t writer,
uint8_t  id,
uint16_t  reg,
const uint8_t *  buffer,
size_t  size 
)

Build a WRITE packet.

Parameters
[out]writerthe packet writer
[in]idthe destination's id
[in]regthe register to write in
[in]bufferthe data buffer to write
[in]sizethe data buffer's size