1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
//! # Example //! //! Make sure to run the following before: //! ```text //! arduino-cli daemon //! ``` //! //! ## Code //! //! ```rust //! use arduino_cli_client::commands::arduino_core_client::ArduinoCoreClient; //! use arduino_cli_client::commands::{BoardListReq, InitReq}; //! //! #[tokio::main] //! async fn main() -> Result<(), Box<dyn std::error::Error>> { //! 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(()) //! } //! ``` //! /// Main Arduino Platform service pub mod commands { tonic::include_proto!("cc.arduino.cli.commands"); } /// Service that abstract a debug Session usage pub mod debug { tonic::include_proto!("cc.arduino.cli.debug"); } /// Service that abstracts a Monitor usage pub mod monitor { tonic::include_proto!("cc.arduino.cli.monitor"); } /// The Settings service provides an interface to Arduino CLI's configuration options pub mod settings { tonic::include_proto!("cc.arduino.cli.settings"); } pub use crate::commands::arduino_core_client::ArduinoCoreClient; pub use crate::debug::debug_client::DebugClient; pub use crate::monitor::monitor_client::MonitorClient; pub use crate::settings::settings_client::SettingsClient;