Skip to content

Commit ca20236

Browse files
committed
set_flange_baud_rate
1 parent 1b1a88a commit ca20236

File tree

8 files changed

+27
-3
lines changed

8 files changed

+27
-3
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

proto/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ keywords = ["protobuf"]
66
license = "MIT"
77
name = "lebai-proto"
88
repository = "https://github.com/lebai-robotics/lebai-sdk.rs"
9-
version = "3.2.5"
9+
version = "3.2.6"
1010

1111
[dependencies]
1212
jsonrpsee = {version = "0.24", features = ["client-core", "macros"]}

proto/build.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ fn main() -> io::Result<()> {
2626
root.join("serial.proto"),
2727
root.join("modbus.proto"),
2828
root.join("led.proto"),
29+
root.join("flange.proto"),
2930
root.join("claw.proto"),
3031
root.join("backup.proto"),
3132
root.join("hardware.proto"),

proto/lebai-proto

proto/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,11 @@ pub mod lebai {
109109
include!(concat!(env!("OUT_DIR"), "/lebai.led.serde.rs"));
110110
include!(concat!(env!("OUT_DIR"), "/lebai.led.jsonrpc.rs"));
111111
}
112+
pub mod flange {
113+
include!(concat!(env!("OUT_DIR"), "/lebai.flange.rs"));
114+
include!(concat!(env!("OUT_DIR"), "/lebai.flange.serde.rs"));
115+
include!(concat!(env!("OUT_DIR"), "/lebai.flange.jsonrpc.rs"));
116+
}
112117
pub mod claw {
113118
include!(concat!(env!("OUT_DIR"), "/lebai.claw.rs"));
114119
include!(concat!(env!("OUT_DIR"), "/lebai.claw.serde.rs"));

src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,12 @@ mod lebai_sdk {
451451
self.0.get_claw().await
452452
}
453453

454+
//Flange
455+
#[classmethod]
456+
pub async fn set_flange_baud_rate(&self, baud_rate: u32) -> Result<()> {
457+
self.0.set_flange_baud_rate(baud_rate).await
458+
}
459+
454460
//LED
455461
#[classmethod]
456462
#[cmod::tags(ret)]

src/rpc/flange.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
use super::Robot;
2+
use cmod::Result;
3+
use proto::lebai::flange::*;
4+
5+
impl Robot {
6+
pub(crate) async fn set_flange_baud_rate(&self, baud_rate: u32) -> Result<()> {
7+
let req = SetFlangeBaudRateRequest { baud_rate };
8+
let _ = self.c.set_flange_baud_rate(Some(req)).await.map_err(|e| e.to_string())?;
9+
Ok(())
10+
}
11+
}

src/rpc/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
pub mod claw;
22
pub mod dynamic;
3+
pub mod flange;
34
pub mod io;
45
pub mod kinematic;
56
pub mod led;

0 commit comments

Comments
 (0)