Skip to content

Commit

Permalink
Merge pull request #238 from HaoboGu/fix/split_phy_change
Browse files Browse the repository at this point in the history
Remove PHY setting in central
  • Loading branch information
HaoboGu authored Jan 6, 2025
2 parents 7c0267e + 354c436 commit f649352
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions rmk/src/split/nrf/central.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use embassy_sync::{
blocking_mutex::raw::CriticalSectionRawMutex,
channel::{Channel, Receiver, Sender},
};
use nrf_softdevice::ble::{central, gatt_client, Address, AddressType, PhySet, PhyUpdateError};
use nrf_softdevice::ble::{central, gatt_client, Address, AddressType};

use crate::{
split::{
Expand Down Expand Up @@ -84,7 +84,7 @@ pub(crate) async fn run_ble_client(
conn_sup_timeout: 500, // timeout: 5s
};
config.scan_config.whitelist = Some(addrs);
let mut conn = loop {
let conn = loop {
if let Ok(_) =
CONNECTING_CLIENT.compare_exchange(false, true, Ordering::SeqCst, Ordering::SeqCst)
{
Expand All @@ -104,14 +104,6 @@ pub(crate) async fn run_ble_client(
embassy_time::Timer::after_millis(200).await;
};

// Set PHY used
if let Err(e) = conn.phy_update(PhySet::M2, PhySet::M2) {
error!("Failed to update PHY");
if let PhyUpdateError::Raw(re) = e {
error!("Raw error code: {:?}", re);
}
}

let ble_client: BleSplitCentralClient = match gatt_client::discover(&conn).await {
Ok(client) => client,
Err(e) => {
Expand Down

0 comments on commit f649352

Please sign in to comment.