mirror of
https://github.com/hubaldv/bioz-host-rs.git
synced 2025-12-06 05:11:17 +00:00
Included unique ID.
This commit is contained in:
@@ -68,7 +68,7 @@ impl WorkbookClient {
|
|||||||
Ok(val)
|
Ok(val)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn get_id(&self) -> Result<u64, WorkbookError<Infallible>> {
|
pub async fn get_id(&self) -> Result<[u8; 12], WorkbookError<Infallible>> {
|
||||||
let id = self.client.send_resp::<GetUniqueIdEndpoint>(&()).await?;
|
let id = self.client.send_resp::<GetUniqueIdEndpoint>(&()).await?;
|
||||||
Ok(id)
|
Ok(id)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,8 @@ async fn main() {
|
|||||||
let ping = client.ping(42).await.unwrap();
|
let ping = client.ping(42).await.unwrap();
|
||||||
println!("Got: {ping}.");
|
println!("Got: {ping}.");
|
||||||
let uid = client.get_id().await.unwrap();
|
let uid = client.get_id().await.unwrap();
|
||||||
println!("ID: {uid:016X}");
|
let hex_uid = uid.iter().map(|b| format!("{:02X}", b)).collect::<Vec<_>>().join(" ");
|
||||||
|
println!("ID (HEX): {}", hex_uid);
|
||||||
println!("Connected! Pinging 42");
|
println!("Connected! Pinging 42");
|
||||||
let ping = client.ping(42).await.unwrap();
|
let ping = client.ping(42).await.unwrap();
|
||||||
println!("Got: {ping}.");
|
println!("Got: {ping}.");
|
||||||
|
|||||||
Reference in New Issue
Block a user