diff --git a/src/asynch/network.rs b/src/asynch/network.rs index b145364..6e432b3 100644 --- a/src/asynch/network.rs +++ b/src/asynch/network.rs @@ -6,7 +6,9 @@ use crate::command::control::types::FlowControl; use crate::command::control::SetEcho; use crate::command::dns::ResolveNameIp; +use crate::command::general::responses::FirmwareVersion; use crate::command::general::GetCIMI; +use crate::command::general::GetFirmwareVersion; use crate::command::general::IdentificationInformation; use crate::command::mobile_control::responses::ModuleFunctionality; use crate::command::mobile_control::types::PowerMode; @@ -436,7 +438,10 @@ where .map_err(|_| Error::PoweredDown)?; let model_id = self.at_client.send(&GetModelId).await?; - self.ch.set_module(Module::from_model_id(model_id)); + self.ch.set_module(Module::from_model_id(&model_id)); + + let FirmwareVersion { version } = self.at_client.send(&GetFirmwareVersion).await?; + info!("Found module to be: {=[u8]:a}, {=[u8]:a}", model_id.model.as_slice(), version.as_slice()); // Echo off self.at_client.send(&SetEcho { enabled: Echo::Off }).await?; diff --git a/src/modules/mod.rs b/src/modules/mod.rs index 9ced7b1..1f6aff4 100644 --- a/src/modules/mod.rs +++ b/src/modules/mod.rs @@ -96,7 +96,7 @@ pub(crate) enum Module { } impl Module { - pub fn from_model_id(model_id: ModelId) -> Self { + pub fn from_model_id(model_id: &ModelId) -> Self { match model_id.model.as_slice() { b"LARA-R6001D" => Self::LaraR6(lara_r6::LaraR6), id => {