|
BASIS 2 Driver 0.1.0
API reference
|
The Modbus RTU codec. More...
Classes | |
| struct | Response |
| A parsed Modbus response. More... | |
Functions | |
| constexpr uint16_t | Crc16 (std::span< const uint8_t > data) noexcept |
| Modbus CRC-16 (polynomial 0xA001 reflected, initial value 0xFFFF). | |
| Result< Request > | BuildRead (uint8_t address, uint16_t first, uint16_t count) noexcept |
| Build a function 3 request. | |
| Result< Request > | BuildWriteSingle (uint8_t address, uint16_t target, uint16_t value) noexcept |
| Build a function 6 request (one register). | |
| Result< Request > | BuildWriteMultiple (uint8_t address, uint16_t target, uint32_t value) noexcept |
| Build a function 16 request for a two-register item (32-bit value, high register first). | |
| bool | IsLegalModbusRequest (std::span< const uint8_t > bytes) noexcept |
Whether bytes is exactly one request the driver may send: a valid CRC, an address 1 to 247, function 3 on readable registers, function 6 or 16 on writable registers with a legal value. | |
| std::size_t | ReplyLength (std::span< const char > bytes) noexcept |
| How long the reply frame is, as far as the bytes received so far tell. | |
| Error | ParseResponse (std::span< const char > frame, uint8_t request_address, uint8_t request_function, std::span< const uint8_t > request_bytes, Response &out) noexcept |
| Parse and validate a response frame. | |
The Modbus RTU codec.