# motorcortex-rust
Motorcortex Rust is a communication library designed for developing client
applications in Rust for the Motorcortex Core. It provides an efficient and
type-safe implementation of the low-level API defined in `motorcortex.proto`.
A core feature of this API is its ability to interact with the **Parameter Tree**.
The library allows developers to query, retrieve, and modify parameters within
a hierarchical structure.
## Features
- Implements the low-level API defined in `motorcortex.proto`.
- Req/Rep requests for the **Parameter Tree**
- Pub/Sub (To be done...)
- Secure communication via Websocket Security protocol.
## Getting Started
Follow the steps below to install and run the project.
### Prerequisites
- Rust (Install via [rustup](https://rustup.rs/))
- Cargo (comes bundled with Rust)
### Installation
Clone the repository:
```bash
git clone https://git.vectioneer.com/pub/motorcortex-rust
cd motorcortex-rust
```
Build the project:
```bash
cargo build
```
Run the project:
```bash
cargo run
```
Run the tests:
```bash
cargo test
```
### Example Usage
Simple example of how to use your project:
```rust
use your_project::Request;
use your_project::ConnectionOptions;
fn main() {
let mut request = Request::new();
let conn_options = ConnectionOptions::new("cert.pem".to_string(), 1000, 1000);
request.connect("tcp://127.0.0.1:5555", conn_options).unwrap();
let parameter: i32 = request.get_parameter("root/Control/dummy1").unwrap();
println!("Retrieved parameter: {}", parameter);
request.set_parameter("root/Control/dummy2", [1, 2, 3]).unwrap();
println!("Modified parameter");
}
```
## Documentation
The project has inline documentation, but you can also generate a comprehensive HTML documentation view using `cargo doc`:
```bash
cargo doc --open
```
## License
This project is licensed under the [MIT License](LICENSE).
You are free to use, modify, and distribute it as per the license terms.