Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use retry send check urc's when initializing #78

Merged
merged 1 commit into from
Jan 30, 2024
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
6 changes: 3 additions & 3 deletions ublox-short-range/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@
config: Config<RST>,
) -> (UbloxWifiIngress<INGRESS_BUF_SIZE>, Self) {
let (ingress, client) =
buffers.split_blocking(tx, EdmDigester::default(), atat::Config::default());

Check warning on line 200 in ublox-short-range/src/client.rs

View workflow job for this annotation

GitHub Actions / clippy

use of `default` to create a unit struct

warning: use of `default` to create a unit struct --> ublox-short-range/src/client.rs:200:51 | 200 | buffers.split_blocking(tx, EdmDigester::default(), atat::Config::default()); | ^^^^^^^^^^^ help: remove this call to `default` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs = note: `#[warn(clippy::default_constructed_unit_structs)]` on by default

(
ingress,
Expand Down Expand Up @@ -275,7 +275,7 @@
}

// TODO: handle EDM settings quirk see EDM datasheet: 2.2.5.1 AT Request Serial settings
self.send_internal(
self.retry_send(
&EdmAtCmdWrapper(SetRS232Settings {
baud_rate: BaudRate::B115200,
flow_control: FlowControl::On,
Expand All @@ -284,7 +284,7 @@
parity: Parity::None,
change_after_confirm: ChangeAfterConfirm::ChangeAfterOK,
}),
false,
5,
)?;

if let Some(hostname) = self.config.hostname.clone() {
Expand Down Expand Up @@ -343,7 +343,7 @@
}

pub fn firmware_version(&mut self) -> Result<FirmwareVersion, Error> {
let response = self.send_internal(&EdmAtCmdWrapper(SoftwareVersion), false)?;
let response = self.send_internal(&EdmAtCmdWrapper(SoftwareVersion), true)?;
Ok(response.version)
}

Expand Down Expand Up @@ -372,7 +372,7 @@
WifiNetwork {
bssid: Bytes::new(),
op_mode: crate::command::wifi::types::OperationMode::Infrastructure,
ssid: ssid,

Check warning on line 375 in ublox-short-range/src/client.rs

View workflow job for this annotation

GitHub Actions / clippy

redundant field names in struct initialization

warning: redundant field names in struct initialization --> ublox-short-range/src/client.rs:375:29 | 375 | ... ssid: ssid, | ^^^^^^^^^^ help: replace it with: `ssid` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names = note: `#[warn(clippy::redundant_field_names)]` on by default
channel: 0,
rssi: 1,
authentication_suites: 0,
Expand Down
2 changes: 1 addition & 1 deletion ublox-short-range/src/wifi/sta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
self.send_internal(
&EdmAtCmdWrapper(SetWifiStationConfig {
config_id: CONFIG_ID,
config_param: WifiStationConfig::WpaPskOrPassphrase(&pass),

Check warning on line 108 in ublox-short-range/src/wifi/sta.rs

View workflow job for this annotation

GitHub Actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler --> ublox-short-range/src/wifi/sta.rs:108:73 | 108 | config_param: WifiStationConfig::WpaPskOrPassphrase(&pass), | ^^^^^ help: change this to: `pass` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
}),
true,
)?;
Expand Down Expand Up @@ -146,7 +146,7 @@
}),
true,
)?;
return Ok(());

Check warning on line 149 in ublox-short-range/src/wifi/sta.rs

View workflow job for this annotation

GitHub Actions / clippy

unneeded `return` statement

warning: unneeded `return` statement --> ublox-short-range/src/wifi/sta.rs:149:9 | 149 | return Ok(()); | ^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return = note: `#[warn(clippy::needless_return)]` on by default help: remove `return` | 149 - return Ok(()); 149 + Ok(()) |
}

pub fn scan(&mut self) -> Result<Vec<WifiNetwork, 32>, WifiError> {
Expand Down Expand Up @@ -198,7 +198,7 @@
return Ok(ssid);
}
};
return Err(WifiConnectionError::Illegal);

Check warning on line 201 in ublox-short-range/src/wifi/sta.rs

View workflow job for this annotation

GitHub Actions / clippy

unneeded `return` statement

warning: unneeded `return` statement --> ublox-short-range/src/wifi/sta.rs:201:9 | 201 | return Err(WifiConnectionError::Illegal); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 201 - return Err(WifiConnectionError::Illegal); 201 + Err(WifiConnectionError::Illegal) |
}

pub fn reset_config_profile(&mut self) -> Result<(), WifiConnectionError> {
Expand All @@ -207,7 +207,7 @@
config_id: CONFIG_ID,
action: WifiStationAction::Reset,
}),
false,
true,
)?;
Ok(())
}
Expand Down
Loading