Loading...
Searching...
No Matches
dynamixel_writer.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2017 Inria
3 *
4 * This file is subject to the terms and conditions of the GNU Lesser General
5 * Public License v2.1. See the file LICENSE in the top level directory for more
6 * details.
7 */
8
20#ifndef DYNAMIXEL_WRITER_H
21#define DYNAMIXEL_WRITER_H
22
23#include "dynamixel_protocol.h"
24#include <stdint.h>
25#include <stdlib.h>
26#include <stdbool.h>
27
28#ifdef __cplusplus
29extern "C" {
30#endif
31
35typedef struct {
36 uint8_t *buffer;
37 size_t size;
38 size_t limit;
40
48void dynamixel_writer_init(dynamixel_writer_t *writer, uint8_t *buffer, size_t limit);
49
57const uint8_t *dynamixel_writer_get_data(const dynamixel_writer_t *writer);
58
67
75
85void dynamixel_writer_write_make(dynamixel_writer_t *writer, uint8_t id, uint16_t reg, const uint8_t *buffer, size_t size);
86
95void dynamixel_writer_read_make(dynamixel_writer_t *writer, uint8_t id, uint16_t reg, size_t size);
96
97#ifdef __cplusplus
98}
99#endif
100
101#endif /* DYNAMIXEL_WRITER_H */
Dynamixel protocol definitions.
void dynamixel_writer_read_make(dynamixel_writer_t *writer, uint8_t id, uint16_t reg, size_t size)
Build a READ packet.
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_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_ping_make(dynamixel_writer_t *writer, uint8_t id)
Build a PING packet.
void dynamixel_writer_init(dynamixel_writer_t *writer, uint8_t *buffer, size_t limit)
Initialize the Dynamixel packet writer.
Dynamixel packet writer struct.
size_t size
packet's size
size_t limit
data buffer's size
uint8_t * buffer
data buffer