Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions pico/app/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,9 @@ async fn urc_handler_task(
v.index, v.mem
);
}
urc::Urc::EnterPinReadResponse(v) => {
info!("URC EnterPinReadResponse code={}", v.code);
}
},
pubsub::WaitResult::Lagged(b) => {
info!("Urc Lagged messages: {}", b);
Expand Down
12 changes: 10 additions & 2 deletions pico/pico-lib/src/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,20 @@ pub struct AtOperatorSelectionRead;
#[derive(Debug, Format, Clone, AtatResp, PartialEq)]
pub struct OperatorSelectionReadResponse {
#[at_arg(position = 0)]
pub mode: u8, // 0 Automatic, 1 Manual
pub mode: OperatorMode,
#[at_arg(position = 1)]
pub format: Option<u8>,
#[at_arg(position = 2)]
pub oper: Option<String<64>>,
}

#[derive(Debug, Format, Clone, PartialEq, AtatEnum, Default)]
pub enum OperatorMode {
#[default]
Automatic = 0,
Manual = 1,
}

#[cfg(test)]
extern crate std;

Expand Down Expand Up @@ -295,7 +303,7 @@ mod tests {
let cmd = AtOperatorSelectionRead;
assert_eq!(
OperatorSelectionReadResponse {
mode: 0,
mode: OperatorMode::Automatic,
format: Some(0),
oper: Some(String::try_from("PANNON GSM").unwrap())
},
Expand Down
3 changes: 3 additions & 0 deletions pico/pico-lib/src/urc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use atat::atat_derive::AtatUrc;
use atat::heapless_bytes::Bytes;

use crate::call::ClipUrc;
use crate::network::EnterPinReadResponse;
use crate::sms::NewMessageIndicationUrc;

// 18.1 CME ERROR
Expand All @@ -21,6 +22,8 @@ pub struct DeactResponse {
// All URCs must be defined (https://github.com/FactbirdHQ/atat/issues/149#issuecomment-1538193692)
#[derive(Clone, AtatUrc)]
pub enum Urc {
#[at_urc("+CPIN")]
EnterPinReadResponse(EnterPinReadResponse),
#[at_urc("RING")]
Ring,
#[at_urc("NORMAL POWER DOWN")]
Expand Down