Add firmware build timestamp support for sensors; update detection workflows and UI accordingly.
This commit is contained in:
@@ -43,6 +43,7 @@ pub mod id {
|
||||
// Message group base offsets relative to SENSOR_BASE_ADDRESS
|
||||
pub const MOISTURE_DATA_OFFSET: u16 = 0; // periodic data from sensor (sensor -> controller)
|
||||
pub const IDENTIFY_CMD_OFFSET: u16 = 32; // identify LED command (controller -> sensor)
|
||||
pub const FIRMWARE_BUILD_OFFSET: u16 = 64; // firmware build timestamp (sensor -> controller, sent after identify)
|
||||
|
||||
#[inline]
|
||||
pub const fn plant_id(message_type_offset: u16, sensor: SensorSlot, plant: u16) -> u16 {
|
||||
@@ -55,8 +56,9 @@ pub mod id {
|
||||
/// Kinds of message spaces recognized by the addressing scheme.
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub enum MessageKind {
|
||||
MoistureData, // sensor -> controller
|
||||
IdentifyCmd, // controller -> sensor
|
||||
MoistureData, // sensor -> controller
|
||||
IdentifyCmd, // controller -> sensor
|
||||
FirmwareBuild, // sensor -> controller, sent after receiving identify cmd
|
||||
}
|
||||
|
||||
/// Try to classify a received 11-bit standard ID into a known message kind and extract plant and sensor slot.
|
||||
@@ -93,6 +95,9 @@ pub mod id {
|
||||
if let Some((plant, slot)) = decode_in_group(rel, IDENTIFY_CMD_OFFSET) {
|
||||
return Some((MessageKind::IdentifyCmd, plant, slot));
|
||||
}
|
||||
if let Some((plant, slot)) = decode_in_group(rel, FIRMWARE_BUILD_OFFSET) {
|
||||
return Some((MessageKind::FirmwareBuild, plant, slot));
|
||||
}
|
||||
None
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user