Skip to content

Commit

Permalink
Workaround in SecurityManager
Browse files Browse the repository at this point in the history
  • Loading branch information
bjoernQ committed Dec 15, 2023
1 parent 6d9f2e7 commit 80fe4b2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions bleps/src/sm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,15 @@ impl<'a, B, R> ASYNC AsyncSecurityManager<'a, B, R> where B: AsyncBleWriter, R:
}

async fn write_sm(&self, ble: &mut B, handle: u16, data: Data) {
// Workaround! For unknown reasons this is currently necessary
// Needs to get solved in the underlying esp-wifi implementation
static mut DUMMY: u32 = 0;
unsafe {
for _ in 0..1_000_000 {
(&mut DUMMY as *mut u32).write_volatile(0);
}
}

log::debug!("data {:x?}", data.as_slice());

let res = L2capPacket::encode_sm(data);
Expand Down

0 comments on commit 80fe4b2

Please sign in to comment.