-
Notifications
You must be signed in to change notification settings - Fork 0
/
ProtocolV2.h
21 lines (14 loc) · 952 Bytes
/
ProtocolV2.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#pragma once
#include "ProtocolBase.h"
namespace dynamixel {
struct ProtocolV2 : public ProtocolBase {
[[nodiscard]] auto createPacket(MotorID motorID, Instruction instr, Parameter data) const -> Parameter override;
[[nodiscard]] auto readPacket(Timeout timeout, MotorID expectedMotorID, std::size_t numParameters, simplyfile::SerialPort const& port) const -> std::tuple<bool, MotorID, ErrorCode, Parameter> override;
[[nodiscard]] auto extractPayload(Parameter const& raw_packet) const -> std::tuple<MotorID, ErrorCode, Parameter>;
auto convertLength(size_t len) const -> Parameter override;
auto convertAddress(int addr) const -> Parameter override;
auto buildBulkReadPackage(std::vector<std::tuple<MotorID, int, size_t>> const& motors) const -> std::vector<std::byte> override;
private:
Parameter synchronizeOnHeader(Timeout timeout, MotorID expectedMotorID, std::size_t numParameters, simplyfile::SerialPort const& port) const;
};
}