Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/marcelbuesing/arduino-cli-client
Rust Arduino CLI client gRPC bindings
https://github.com/marcelbuesing/arduino-cli-client
Last synced: about 1 month ago
JSON representation
Rust Arduino CLI client gRPC bindings
- Host: GitHub
- URL: https://github.com/marcelbuesing/arduino-cli-client
- Owner: marcelbuesing
- License: gpl-3.0
- Created: 2020-11-16T15:35:26.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2020-11-17T19:35:13.000Z (almost 4 years ago)
- Last Synced: 2024-04-25T11:03:24.071Z (7 months ago)
- Language: Rust
- Size: 29.3 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![arduino-cli-client](https://socialify.git.ci/marcelbuesing/arduino-cli-client/image?description=1&descriptionEditable=arduino-cli%20%20gRPC%20client%20bindings%20for%20Rust&font=Inter&forks=1&issues=1&language=1&pattern=Circuit%20Board&pulls=1&stargazers=1&theme=Light)
gRPC bindings for [arduino-cli](https://github.com/arduino/arduino-cli).
Bindings are generated based on the protobuf definitions defined [here](https://github.com/arduino/arduino-cli/tree/master/rpc).[![asciicast](https://asciinema.org/a/373560.svg)](https://asciinema.org/a/373560)
## Example
This examples demonstrates retrieving the list of connected boards.
Make sure you run `arduino-cli daemon` before running this example.You can run the example via `cargo run --example list_boards`.
```Rust
use arduino_cli_client::commands::arduino_core_client::ArduinoCoreClient;
use arduino_cli_client::commands::{BoardListReq, InitReq};#[tokio::main]
async fn main() -> Result<(), Box> {
let mut client = ArduinoCoreClient::connect("http://localhost:50051").await?;// Start a new instance of the Arduino Core Service
let mut init_stream = client
.init(InitReq {
library_manager_only: false,
})
.await?
.into_inner();let resp_instance = init_stream.message().await?.expect("Failed to init");
// List the boards currently connected to the computer.
let resp_boards = client
.board_list(BoardListReq {
instance: resp_instance.instance,
})
.await?
.into_inner();print!("Boards: {:?}", resp_boards.ports);
Ok(())
}
```## Example - Client
The `examples/` folder contains a client example that is analogue to `arduino-cli/client-example`.