Included unique ID.

This commit is contained in:
2025-08-06 11:21:43 +02:00
parent 8b7d38f338
commit 7fed5112a1
2 changed files with 3 additions and 2 deletions

View File

@@ -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)
}

View File

@@ -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}.");