Skip to content

Commit

Permalink
make sure modem is on when resetting (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
linusharberg authored May 10, 2024
1 parent c73530b commit 57218e7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/at_command/unsolicited/ugnsinf.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use core::str::FromStr;

use crate::at_command::{AtParseErr, AtParseLine};
use crate::util::collect_array;
use core::str::FromStr;

#[derive(Debug, PartialEq)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
Expand Down
4 changes: 4 additions & 0 deletions src/modem/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,10 @@ impl<'c, P: ModemPower> Modem<'c, P> {
self.power_signal.broadcast(PowerState::Off);
self.context.registration_events.signal(NET_REG_DEFAULT);
self.context.tcp.disconnect_all().await;
// modem needs to be enabled for reset
if let PowerState::Off = self.power.state() {
self.power.enable().await;
}
self.power.reset().await;
}

Expand Down

0 comments on commit 57218e7

Please sign in to comment.