Skip to content

Commit

Permalink
Make flowcontrol a bool in config trait, and export config trait
Browse files Browse the repository at this point in the history
  • Loading branch information
MathiasKoch committed Aug 30, 2023
1 parent 60d570f commit 07665cc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion ublox-cellular/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ where

// Tell module whether we support flow control
// FIXME: Use AT+IFC=2,2 instead of AT&K here
if Config::FLOW_CONTROL == crate::config::FlowControl::RtsCts {
if Config::FLOW_CONTROL {
self.network.send_internal(
&SetFlowControl {
value: FlowControl::RtsCts,
Expand Down
10 changes: 1 addition & 9 deletions ublox-cellular/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,12 @@ impl OutputPin for NoPin {
}
}

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum FlowControl {
/// No flow control is being used
None,
/// Hardware flow control
RtsCts,
}

pub trait CellularConfig {
type ResetPin: OutputPin;
type PowerPin: OutputPin;
type VintPin: InputPin;

const FLOW_CONTROL: FlowControl = FlowControl::None;
const FLOW_CONTROL: bool = false;
const HEX_MODE: bool = true;

fn reset_pin(&mut self) -> Option<&mut Self::ResetPin>;
Expand Down
2 changes: 2 additions & 0 deletions ublox-cellular/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ pub type UbloxCellularIngress<'a, const INGRESS_BUF_SIZE: usize> = atat::Ingress

pub type UbloxCellularUrcChannel = atat::UrcChannel<Urc, URC_CAPACITY, URC_SUBSCRIBERS>;

pub use config::CellularConfig;

/// Prelude - Include traits
pub mod prelude {
#[cfg(any(feature = "socket-udp", feature = "socket-tcp"))]
Expand Down

0 comments on commit 07665cc

Please sign in to comment.