Builds one instruction packet in a caller buffer, with byte stuffing for protocol 2.0.
More...
#include <dynamixel_protocol.hpp>
|
| | FrameWriter (std::span< uint8_t > buffer, Protocol protocol, uint8_t id, Instruction instruction) noexcept |
| | Start a packet.
|
| |
| void | Put (uint8_t byte) noexcept |
| | Append one parameter byte (stuffed in protocol 2.0).
|
| |
| void | PutLe16 (uint16_t value) noexcept |
| | Append a 16-bit value, low byte first.
|
| |
| void | PutBytes (std::span< const uint8_t > data) noexcept |
| | Append bytes.
|
| |
| std::size_t | Finish () noexcept |
| | Complete the packet: length and CRC or checksum.
|
| |
Builds one instruction packet in a caller buffer, with byte stuffing for protocol 2.0.
Put the parameters, then Finish(). Any write that does not fit, or a protocol 1.0 packet over 253 parameters, makes Finish() return 0: nothing is sent then.
◆ FrameWriter()
| dynamixel::protocol::FrameWriter::FrameWriter |
( |
std::span< uint8_t > |
buffer, |
|
|
Protocol |
protocol, |
|
|
uint8_t |
id, |
|
|
Instruction |
instruction |
|
) |
| |
|
inlinenoexcept |
Start a packet.
- Parameters
-
| buffer | Where the packet goes; the driver's transmit buffer. |
| protocol | The packet format. |
| id | The target ID (0 to 254). |
| instruction | The instruction code. |
◆ Finish()
| std::size_t dynamixel::protocol::FrameWriter::Finish |
( |
| ) |
|
|
inlinenoexcept |
Complete the packet: length and CRC or checksum.
- Returns
- The packet size in bytes, or 0 when it did not fit or is too long for the protocol.
◆ Put()
| void dynamixel::protocol::FrameWriter::Put |
( |
uint8_t |
byte | ) |
|
|
inlinenoexcept |
Append one parameter byte (stuffed in protocol 2.0).
- Parameters
-
◆ PutBytes()
| void dynamixel::protocol::FrameWriter::PutBytes |
( |
std::span< const uint8_t > |
data | ) |
|
|
inlinenoexcept |
◆ PutLe16()
| void dynamixel::protocol::FrameWriter::PutLe16 |
( |
uint16_t |
value | ) |
|
|
inlinenoexcept |
Append a 16-bit value, low byte first.
- Parameters
-
The documentation for this class was generated from the following file: