From 9d8fefc9f26180595063626401ad2fa00ae5806b Mon Sep 17 00:00:00 2001 From: Simon Fondrie-Teitler Date: Mon, 15 Jan 2024 22:27:41 -0500 Subject: [PATCH] Don't hardcode serial number --- meateatrs/src/node.rs | 1 + meatweb/src/bluetooth.rs | 2 ++ meatweb/src/history.rs | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/meateatrs/src/node.rs b/meateatrs/src/node.rs index 65d1fe5..5bdb343 100644 --- a/meateatrs/src/node.rs +++ b/meateatrs/src/node.rs @@ -167,6 +167,7 @@ impl CombustionDevice for Node { .unwrap_or(*range.end()); let data = request::ReadLogs { + // TODO: Don't hardcode this. probe_serial_number: SerialNumber { number: 0x10001DED }, sequence_number_start: start, sequence_number_end: end, diff --git a/meatweb/src/bluetooth.rs b/meatweb/src/bluetooth.rs index 880336b..d2d6214 100644 --- a/meatweb/src/bluetooth.rs +++ b/meatweb/src/bluetooth.rs @@ -32,6 +32,7 @@ pub struct CharacteristicArgs { #[derive(Clone)] pub struct CurrentState { pub temperature: f32, + pub serial_number: u32, pub log_start: u32, pub log_end: u32, } @@ -86,6 +87,7 @@ pub fn process_bluetooth_event( temperature: m.status.get_core_temperature().get_celsius(), log_start: m.status.log_start, log_end: m.status.log_end, + serial_number: m.probe_serial_number.number, })); } _ => logging::log!("{:#?}", r), diff --git a/meatweb/src/history.rs b/meatweb/src/history.rs index 7d177f9..129b430 100644 --- a/meatweb/src/history.rs +++ b/meatweb/src/history.rs @@ -66,7 +66,7 @@ pub async fn request_log_updates( .unwrap_or(*range.end()); let mut data = ReadLogs { - probe_serial_number: SerialNumber { number: 0x10001DED }, + probe_serial_number: SerialNumber { number: state.serial_number }, sequence_number_start: start, sequence_number_end: end, }