diff --git a/src/communication.rs b/src/communication.rs index 5155e8d..03e6fa9 100644 --- a/src/communication.rs +++ b/src/communication.rs @@ -159,6 +159,9 @@ pub struct Info { pub product: Product, #[allow(dead_code)] pub unlocked: bool, + // Is None before firmware version 9.20.0. + #[allow(dead_code)] + pub initialized: Option, } pub struct HwwCommunication { @@ -189,6 +192,7 @@ async fn get_info(communication: &dyn ReadWrite) -> Result { let platform_byte = *response.first().ok_or(Error::Info)?; let edition_byte = *response.get(1).ok_or(Error::Info)?; let unlocked_byte = *response.get(2).ok_or(Error::Info)?; + let initialized_byte = response.get(3); Ok(Info { version, product: match (platform_byte, edition_byte) { @@ -201,6 +205,12 @@ async fn get_info(communication: &dyn ReadWrite) -> Result { 0x01 => true, _ => return Err(Error::Info), }, + initialized: match initialized_byte { + None => None, + Some(0x00) => Some(false), + Some(0x01) => Some(true), + _ => return Err(Error::Info), + }, }) }