mirror of
https://github.com/hubaldv/bioz-host-rs.git
synced 2025-12-05 21:01:18 +00:00
Included unique ID.
This commit is contained in:
@@ -68,7 +68,7 @@ impl WorkbookClient {
|
||||
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?;
|
||||
Ok(id)
|
||||
}
|
||||
|
||||
@@ -23,7 +23,8 @@ async fn main() {
|
||||
let ping = client.ping(42).await.unwrap();
|
||||
println!("Got: {ping}.");
|
||||
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");
|
||||
let ping = client.ping(42).await.unwrap();
|
||||
println!("Got: {ping}.");
|
||||
|
||||
Reference in New Issue
Block a user