|
1 | 1 | 
|
2 | 2 |
|
3 |
| -# rusp-bin |
| 3 | +# rusp |
4 | 4 |
|
5 | 5 | This crate contains the application part of Rusp, which contains:
|
6 | 6 |
|
7 |
| -* A **rusp** binary granting access to library functionality via command line. Included functionality at the moment are: |
| 7 | +* A `rusp` application, granting access to library functionality via command line. Included functionality at the moment are: |
8 | 8 | * Decoding of **USP** Msg Protobuf bytestreams from standard input
|
9 | 9 | * Decoding of **USP** Msg Protobuf bytestreams from file(s)
|
10 | 10 | * Decoding of **USP** Record Protobuf bytestreams from standard input
|
11 | 11 | * Decoding of **USP** Record Protobuf bytestreams from file(s)
|
12 | 12 | * Extraction of **USP** Msg Protobuf bytestreams from the payload of a **USP** Record Protobuf bytestream
|
13 | 13 | * Generation of **USP** Msg Protobuf bytestreams and C char arrays for selected messages and Error
|
| 14 | +* A `rusp-run` application, providing a simple frontend to the `rhai-rusp` bindings via an embedded [Rhai][] interpreter |
14 | 15 |
|
15 |
| -## How to use the rusp binary? |
| 16 | +In order to download, compile and install the `rusp` binary it is sufficient to have a stable [Rust][] environment and run: |
| 17 | + |
| 18 | +``` |
| 19 | +# cargo install rusp |
| 20 | +``` |
| 21 | + |
| 22 | +## How to use the `rusp` binary? |
16 | 23 |
|
17 | 24 | **rusp** includes a binary with the same name demonstrating some of the uses.
|
18 | 25 |
|
19 | 26 | 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**.
|
20 | 27 |
|
21 |
| -Currently, it also still supports synthesizing USP Records via command line, however this feature is going to be phased out soon in favour of something way better. 😉 |
| 28 | +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`. |
22 | 29 |
|
23 |
| -In order to download, compile and install the `rusp` binary it is sufficient to have a stable Rust environment and run: |
| 30 | +## How to use the `rhai-rusp` binary? |
| 31 | + |
| 32 | +We are now also including a simply binary called `rusp-run`, demonstrating how |
| 33 | +to embed the bindings and allowing you to execute `Rhai` code directly via |
| 34 | +command line, read either from `stdin` or a file. |
24 | 35 |
|
25 | 36 | ```
|
26 |
| -# cargo install rusp |
| 37 | +# rusp-run --script 'let body = rusp::get_builder().with_max_depth(1).with_params(["Device."]).build(); |
| 38 | +let msg = rusp::msg_builder().with_msg_id ("Foo").with_body (body).build(); |
| 39 | +print (msg)' |
| 40 | +{ |
| 41 | + "Header": { |
| 42 | + "msg_id": "Foo", |
| 43 | + "msg_type": "GET" |
| 44 | + }, |
| 45 | + "Body": { |
| 46 | + "Request": { |
| 47 | + "Get": { |
| 48 | + "param_paths": [ |
| 49 | + "Device." |
| 50 | + ], |
| 51 | + "max_depth": 1 |
| 52 | + } |
| 53 | + } |
| 54 | + } |
| 55 | +} |
27 | 56 | ```
|
28 | 57 |
|
29 |
| -After this you should be able to use the `rusp` binary, which has built-in help for all the commands to guide the way. |
30 |
| - |
31 | 58 | ## What else?
|
32 | 59 |
|
33 |
| -You may use this crate however you like under the **BSD 3-Clause Licence**. |
34 |
| - |
35 |
| -The toolkit is still far from feature complete but already a big aid in our product development and also helped to find one or the other discrepancy in the standard. |
| 60 | +You may use this crate however you like under the [BSD 3-Clause Licence](LICENSE). |
36 | 61 |
|
37 |
| -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](https://github.com/axiros/rusp/). |
| 62 | +Feel free to spread the word or drop us a note if you like it. Collaboration on |
| 63 | +this crate is highly welcome as are pull requests in [our GitHub |
| 64 | +repo](https://github.com/axiros/rusp/). |
38 | 65 |
|
39 | 66 | ## Contact us
|
40 | 67 |
|
41 |
| -If you are in need of software for **USP** management software (agent, controller or testing) or expertise please get in touch with us via our [web form](https://www.axiros.com). We're also happy to solve all other device management and monitoring needs! |
42 |
| - |
43 |
| -[Rust]: https://www.rust-lang.org/ |
44 |
| -[USP]: https://usp.technology/ |
45 |
| -[BBF]: https://www.broadband-forum.org/ |
46 |
| -[Axiros]: https://www.axiros.com/ |
| 68 | +If you are in need of software for [USP][] management software (agent, |
| 69 | +controller or testing) or expertise please get [in touch with us][Axiros]. We're |
| 70 | +also happy to solve all other device management and monitoring needs! |
47 | 71 |
|
48 | 72 | Licence
|
49 | 73 | -------
|
50 | 74 |
|
51 | 75 | [BSD 3-Clause Licence](LICENSE).
|
| 76 | + |
| 77 | +[Rhai]: https://rhai.rs |
| 78 | +[Rust]: https://www.rust-lang.org/ |
| 79 | +[USP]: https://usp.technology/ |
| 80 | +[Axiros]: https://www.axiros.com/ |
0 commit comments