ModbusBuffer
ModbusBuffer
is a Rust crate providing a circular buffer implementation tailored for Modbus communication.
It's designed to handle the buffering of Modbus frames efficiently, with features such as configurable frame length
and optional data overwriting when the buffer is full.
This crate is especially useful in systems where no standard library is available (i.e., no_std
environments).
The initial purpose of this crate was to allow decoding Modbus stream over RS485 without care out the silences
.
Features
- Circular Buffer: Efficiently manages a circular buffer for modbus storage.
- Configurable Frame Lengths: Set minimum and maximum frame sizes.
- Overwrite Option: Choose between overwriting old data or panicking when the buffer is full.
- CRC Check: Includes functionality to compute and verify CRC16 for Modbus frames.
- Frame Decoding: Attempts to decode frames continuously as each byte is received, which is ideal for scenarios where silence (indicating the end of a frame) cannot be reliably detected.
Installation
Add this to your Cargo.toml
:
[]
= "0.0.2"
Example usage:
use ModbusBuffer;
Contributing
Contributions are welcome! Please feel free to submit pull requests or create issues if you find bugs or have suggestions for improvements.