crzyrndm / rust-modbus-frame Goto Github PK
View Code? Open in Web Editor NEWA Rust no_std library focused on providing the common elements needed to parse/generate modbus message frames
License: MIT License
A Rust no_std library focused on providing the common elements needed to parse/generate modbus message frames
License: MIT License
The first cut is workable, but far from user friendly. Naming is a major issue, but I'm probably not particularly idiomatic in many places, and the lifetimes involved also make things slightly more awkward than I would like
A fully worked example for a standard RTU master and slave device (coils, inputs, input regs, holding regs, device ID) would help highlighting points of friction and showing improvement over time. Will also be helpful for benchmarking memory usage
Speed really isn't a focus. This will mostly be about detecting major regressions before they become an issue.
RTU and ASCII are just different encodings of the same protocol. The intention was always to focus on RTU, but it would make sense for the RTU format to be the base and ASCII the extension
ASCII changes
To support this
This is intended for no_std environments, memory consumption is important.
Set up the standard slave example to cross compile to ARMv7m and check: at several opt levels (0, 1, "s", maybe more)
opt="s" should probably be part of CI but that can come later
i.e. viewing the payload as something other than a bag of bytes.
Almost every consumer of the lib will be using some parts of the standard function set, lets not make them all write a "ReadHoldingRegisters(Command/Response)" and similar. Can also serve as examples for writing custom functions
Should at least have command/response pairs for all the standard functions up to 0x11 plus 0x43
Currently builder just dumps bytes into the provided buffer, meaning it panics if the buffer isn't large enough. Is this the wy to keep it? Alternatives?
Right now I'm leaning towards returning a Result<Frame, LengthError(u32)>, with the error case holding the required buffer length (i.e. *snprintf overflow style).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.