Skip to content

Commit

Permalink
fix(ble): fix invalid state after reconnection on Windows
Browse files Browse the repository at this point in the history
Signed-off-by: Haobo Gu <[email protected]>
  • Loading branch information
HaoboGu committed Dec 4, 2024
1 parent f18154b commit 2368f29
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions rmk/src/ble/nrf/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,7 @@ pub(crate) async fn initialize_nrf_ble_keyboard_and_run<
Either3::Second(_) => info!("Detected USB configured, quit BLE"),
Either3::Third(_) => info!("Switch profile"),
}
bonder.save_sys_attrs(&conn);
}
_ => {
// Wait 10ms
Expand Down Expand Up @@ -432,6 +433,7 @@ pub(crate) async fn initialize_nrf_ble_keyboard_and_run<
Either3::Second(_) => info!("Detected USB configured, quit BLE"),
Either3::Third(_) => info!("Switch profile"),
}
bonder.save_sys_attrs(&conn);
}
_ => {
// Wait 10ms for usb resuming/switching profile/advertising error
Expand Down Expand Up @@ -460,6 +462,7 @@ pub(crate) async fn initialize_nrf_ble_keyboard_and_run<
update_profile(bonder),
)
.await;
bonder.save_sys_attrs(&conn);
}
Err(e) => error!("Advertise error: {}", e),
}
Expand Down

0 comments on commit 2368f29

Please sign in to comment.