From d72694a3ffd3e69685e56070ffb4c90ca9b3922a Mon Sep 17 00:00:00 2001 From: Kenneth Knudsen <98805797+KennethKnudsen97@users.noreply.github.com> Date: Wed, 20 Sep 2023 14:16:54 +0200 Subject: [PATCH] Feature: get signal strength (#82) * Add feature gates for module timing for lara-r6 & toby-r2 * get signal strength * chore(*): add feature gates for module timing for lara-r6 & toby-r2 (#81) * Add feature gates for module timing for lara-r6 & toby-r2 * Bump embedded-hal to rc.1 * cargo alpha 11 fix * chore(*): add feature gates for module timing for lara-r6 & toby-r2 (#81) * Add feature gates for module timing for lara-r6 & toby-r2 * Bump embedded-hal to rc.1 * chore(*): use latest atat, with new urc channel & replace fugit with embassy-time (#83) * - Update ATAT, and implement the new URC subscriber channels - Remove `fugit` and replace it with `embassy-time` - Update `ublox-sockets`, facilitating both of above changes - Remove unimplemented sms, voice and location service skeletons - Remove pin generics in favor of a single `CellularConfig` trait with associated types * Make flowcontrol a bool in config trait, and export config trait * Use latest atat git rev * Fix sometimes stuck in infinite loop at AT probing on initialization * Update CI to use nightly and remove unused workflows * cellular signal strength function wrong merge --------- Co-authored-by: Mathias --- ublox-cellular/Cargo.toml | 13 +++++++++++-- ublox-cellular/src/client.rs | 8 ++++++-- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/ublox-cellular/Cargo.toml b/ublox-cellular/Cargo.toml index 26704ae..f41cf06 100644 --- a/ublox-cellular/Cargo.toml +++ b/ublox-cellular/Cargo.toml @@ -16,7 +16,11 @@ doctest = false [dependencies] # atat = { version = "0.18", features = ["derive", "bytes"] } -atat = { git = "https://github.com/BlackbirdHQ/atat", rev = "c5caaf7", features = ["derive", "defmt", "bytes"] } +atat = { git = "https://github.com/BlackbirdHQ/atat", rev = "c5caaf7", features = [ + "derive", + "defmt", + "bytes", +] } embedded-hal = "=1.0.0-rc.1" embedded-nal = "0.6" hash32 = "^0.2.1" @@ -41,7 +45,12 @@ default = ["socket-udp", "socket-tcp"] async = ["atat/async"] # Use `defmt-impl to enable defmt based logging -defmt-impl = ["defmt", "ublox-sockets/defmt", "atat/defmt", "heapless/defmt-impl"] +defmt-impl = [ + "defmt", + "ublox-sockets/defmt", + "atat/defmt", + "heapless/defmt-impl", +] # Use `log-impl` to enable log based logging log-impl = ["log", "ublox-sockets/log", "atat/log"] diff --git a/ublox-cellular/src/client.rs b/ublox-cellular/src/client.rs index b5c4e44..c1c6509 100644 --- a/ublox-cellular/src/client.rs +++ b/ublox-cellular/src/client.rs @@ -26,8 +26,9 @@ use crate::{ SetGpioConfiguration, }, network_service::{ - responses::OperatorSelection, types::OperatorSelectionMode, GetOperatorSelection, - SetOperatorSelection, + responses::{OperatorSelection, SignalQuality}, + types::OperatorSelectionMode, + GetOperatorSelection, GetSignalQuality, SetOperatorSelection, }, psn::{types::PSEventReportingMode, SetPacketSwitchedEventReporting}, }, @@ -160,6 +161,9 @@ where self.sockets.take() } + pub fn signal_strength(&mut self) -> Result { + self.send_at(&GetSignalQuality) + } /// Run modem state machine /// /// Turns on modem if needed and processes URCs.