Skip to content

Commit

Permalink
fix type imports for feature flagged toby-r2 module
Browse files Browse the repository at this point in the history
  • Loading branch information
MathiasKoch committed May 4, 2023
1 parent 884ce60 commit f878494
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 28 deletions.
4 changes: 2 additions & 2 deletions ublox-cellular/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -463,8 +463,8 @@ where
// Disable Message Waiting URCs (UMWI)
#[cfg(any(feature = "toby-r2"))]
self.network.send_internal(
&SetMessageWaitingIndication {
mode: MessageWaitingMode::Disabled,
&crate::command::sms::SetMessageWaitingIndication {
mode: crate::command::sms::types::MessageWaitingMode::Disabled,
},
false,
)?;
Expand Down
13 changes: 5 additions & 8 deletions ublox-cellular/src/command/network_service/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ use atat::atat_derive::AtatCmd;
use responses::{
NetworkRegistrationStatus, OperatorSelection, RadioAccessTechnology, SignalQuality,
};
use types::{
FirstRadioAccessTechnology, NetworkRegistrationStat, NetworkRegistrationUrcConfig,
OperatorSelectionMode, SecondRadioAccessTechnology, ThirdRadioAccessTechnology,
};
use types::{NetworkRegistrationStat, NetworkRegistrationUrcConfig, OperatorSelectionMode};

/// 7.4 Extended signal quality +CESQ
///
Expand Down Expand Up @@ -103,17 +100,17 @@ pub struct GetOperatorSelection;
#[cfg(not(feature = "lara-r6"))]
pub struct SetRadioAccessTechnology {
#[at_arg(position = 0)]
pub selected_act: RadioAccessTechnologySelected,
pub selected_act: types::RadioAccessTechnologySelected,
}

#[derive(Clone, AtatCmd)]
#[at_cmd("+URAT", NoResponse)]
#[cfg(feature = "lara-r6")]
pub struct SetRadioAccessTechnology {
#[at_arg(position = 0)]
pub first_act: FirstRadioAccessTechnology,
pub second_act: Option<SecondRadioAccessTechnology>,
pub third_act: Option<ThirdRadioAccessTechnology>,
pub first_act: types::FirstRadioAccessTechnology,
pub second_act: Option<types::SecondRadioAccessTechnology>,
pub third_act: Option<types::ThirdRadioAccessTechnology>,
}

#[derive(Clone, AtatCmd)]
Expand Down
32 changes: 14 additions & 18 deletions ublox-cellular/src/services/data/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -406,11 +406,7 @@ where
/// Activate context using 3GPP commands
/// Required for SARA-R4 and TOBY modules.
#[cfg(not(feature = "upsd-context-activation"))]
fn activate_context(
&mut self,
cid: ContextId,
_profile_id: ProfileId,
) -> nb::Result<(), Error> {
fn activate_context(&mut self, cid: ContextId, profile_id: ProfileId) -> nb::Result<(), Error> {
if self.network.context_state == ContextState::Active {
return Ok(());
}
Expand All @@ -436,15 +432,15 @@ where
// so doesn't require/support AT+UPSD.
#[cfg(not(any(feature = "sara-r4", feature = "lara-r6")))]
{
if let PacketSwitchedConfig {
param: PacketSwitchedParam::MapProfile(context),
if let psn::responses::PacketSwitchedConfig {
param: psn::types::PacketSwitchedParam::MapProfile(context),
..
} = self
.network
.send_internal(
&GetPacketSwitchedConfig {
&psn::GetPacketSwitchedConfig {
profile_id,
param: PacketSwitchedParamReq::MapProfile,
param: psn::types::PacketSwitchedParamReq::MapProfile,
},
true,
)
Expand All @@ -453,32 +449,32 @@ where
if context != cid {
self.network
.send_internal(
&SetPacketSwitchedConfig {
&psn::SetPacketSwitchedConfig {
profile_id,
param: PacketSwitchedParam::MapProfile(cid),
param: psn::types::PacketSwitchedParam::MapProfile(cid),
},
true,
)
.map_err(Error::from)?;

self.network
.send_internal(
&GetPacketSwitchedNetworkData {
&psn::GetPacketSwitchedNetworkData {
profile_id,
param: PacketSwitchedNetworkDataParam::PsdProfileStatus,
param: psn::types::PacketSwitchedNetworkDataParam::PsdProfileStatus,
},
true,
)
.map_err(Error::from)?;
}
}

let PacketSwitchedNetworkData { param_tag, .. } = self
let psn::responses::PacketSwitchedNetworkData { param_tag, .. } = self
.network
.send_internal(
&GetPacketSwitchedNetworkData {
&psn::GetPacketSwitchedNetworkData {
profile_id,
param: PacketSwitchedNetworkDataParam::PsdProfileStatus,
param: psn::types::PacketSwitchedNetworkDataParam::PsdProfileStatus,
},
true,
)
Expand All @@ -487,9 +483,9 @@ where
if param_tag == 0 {
self.network
.send_internal(
&SetPacketSwitchedAction {
&psn::SetPacketSwitchedAction {
profile_id,
action: PacketSwitchedAction::Activate,
action: psn::types::PacketSwitchedAction::Activate,
},
true,
)
Expand Down

0 comments on commit f878494

Please sign in to comment.