71 releases (23 breaking)
new 0.96.1 | Jan 10, 2025 |
---|---|
0.95.0 | Nov 15, 2024 |
0.17.0 | Jul 23, 2024 |
0.16.1 | Mar 28, 2024 |
0.2.0 | Dec 31, 2018 |
#135 in Network programming
124 downloads per month
545KB
11K
SLoC
rusp
This crate contains the application part of Rusp, which contains:
- A
rusp
application, granting access to library functionality via command line. Included functionality at the moment are:- Decoding of USP Msg Protobuf bytestreams from standard input
- Decoding of USP Msg Protobuf bytestreams from file(s)
- Decoding of USP Record Protobuf bytestreams from standard input
- Decoding of USP Record Protobuf bytestreams from file(s)
- Extraction of USP Msg Protobuf bytestreams from the payload of a USP Record Protobuf bytestream
- Generation of USP Msg Protobuf bytestreams and C char arrays for selected messages and Error
- A
rusp-run
application, providing a simple frontend to therhai-rusp
bindings via an embedded Rhai interpreter
In order to download, compile and install the rusp
binary it is sufficient to have a stable Rust environment and run:
# cargo install rusp
How to use the rusp
binary?
rusp includes a binary with the same name demonstrating some of the uses.
At the moment this mostly allows converting Protobuf encapsulated USP Record and Msg structures into human-readable text and other useful formats like code and to extracting a Msg structure from a Record.
Currently, it also still supports synthesizing USP Records via command line, however this feature is going to be phased out soon in favour of the way more flexible rhai-rusp
.
How to use the rhai-rusp
binary?
We are now also including a simply binary called rusp-run
, demonstrating how
to embed the bindings and allowing you to execute Rhai
code directly via
command line, read either from stdin
or a file.
# rusp-run --script 'let body = rusp::get_builder().with_max_depth(1).with_params(["Device."]).build();
let msg = rusp::msg_builder().with_msg_id ("Foo").with_body (body).build();
print (msg)'
{
"Header": {
"msg_id": "Foo",
"msg_type": "GET"
},
"Body": {
"Request": {
"Get": {
"param_paths": [
"Device."
],
"max_depth": 1
}
}
}
}
What else?
You may use this crate however you like under the BSD 3-Clause Licence.
Feel free to spread the word or drop us a note if you like it. Collaboration on this crate is highly welcome as are pull requests in our GitHub repo.
Contact us
If you are in need of software for USP management software (agent, controller or testing) or expertise please get in touch with us. We're also happy to solve all other device management and monitoring needs!
Licence
Dependencies
~7.5MB
~137K SLoC