Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Power off module if hard_reset fails during AT probing #86

Merged
merged 1 commit into from
Sep 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion ublox-cellular/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
pub struct Device<'buf, 'sub, AtCl, AtUrcCh, Config, const N: usize, const L: usize> {
pub(crate) config: Config,
pub(crate) network: Network<'sub, AtCl>,
urc_channel: &'buf AtUrcCh,

Check warning on line 67 in ublox-cellular/src/client.rs

View workflow job for this annotation

GitHub Actions / clippy

field `urc_channel` is never read

warning: field `urc_channel` is never read --> ublox-cellular/src/client.rs:67:5 | 64 | pub struct Device<'buf, 'sub, AtCl, AtUrcCh, Config, const N: usize, const L: usize> { | ------ field in this struct ... 67 | urc_channel: &'buf AtUrcCh, | ^^^^^^^^^^^ | = note: `#[warn(dead_code)]` on by default
urc_subscription: UrcSubscription<'sub, Urc, URC_CAPACITY, URC_SUBSCRIBERS>,

pub(crate) state: State,
Expand Down Expand Up @@ -208,7 +208,10 @@

// At this point, if is_alive fails, the configured Baud rate is probably wrong
if let Err(e) = self.is_alive(5).map_err(|_| Error::BaudDetection) {
self.hard_reset()?;
if self.hard_reset().is_err() {
self.hard_power_off()?;
BlockingTimer::after(Duration::from_secs(1)).wait();
}
return Err(e);
}

Expand All @@ -229,7 +232,7 @@
false,
)?;

#[cfg(any(feature = "lara-r6"))]

Check warning on line 235 in ublox-cellular/src/client.rs

View workflow job for this annotation

GitHub Actions / clippy

unneeded sub `cfg` when there is only one condition

warning: unneeded sub `cfg` when there is only one condition --> ublox-cellular/src/client.rs:235:15 | 235 | #[cfg(any(feature = "lara-r6"))] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `feature = "lara-r6"` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_minimal_cfg = note: `#[warn(clippy::non_minimal_cfg)]` on by default
self.network.send_internal(
&SetGpioConfiguration {
gpio_id: 42,
Expand Down Expand Up @@ -414,7 +417,7 @@
self.select_sim_card()?;

// Disable Message Waiting URCs (UMWI)
#[cfg(any(feature = "toby-r2"))]

Check warning on line 420 in ublox-cellular/src/client.rs

View workflow job for this annotation

GitHub Actions / clippy

unneeded sub `cfg` when there is only one condition

warning: unneeded sub `cfg` when there is only one condition --> ublox-cellular/src/client.rs:420:15 | 420 | #[cfg(any(feature = "toby-r2"))] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `feature = "toby-r2"` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_minimal_cfg
self.network.send_internal(
&crate::command::sms::SetMessageWaitingIndication {
mode: crate::command::sms::types::MessageWaitingMode::Disabled,
Expand Down
Loading