Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
taks committed Sep 29, 2024
1 parent facf7bc commit 9104cd6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion examples/ble_l2cap_client.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use core::str;

use bstr::ByteSlice;
use esp32_nimble::{l2cap::L2capClient, BLEClient, BLEDevice};
use esp_idf_hal::task::block_on;
Expand Down Expand Up @@ -25,7 +27,7 @@ fn main() {
let mut l2cap = L2capClient::connect(&client, 0x1002, 512).await.unwrap();
for i in 0..4 {
l2cap.tx(format!("test{}", i).as_bytes()).unwrap();
::log::info!("< {:#?}", l2cap.rx().await.data());
::log::info!("< {:?}", str::from_utf8(l2cap.rx().await.data()));
esp_idf_hal::delay::FreeRtos::delay_ms(1000);
}
l2cap.disconnect().await.unwrap();
Expand Down
1 change: 1 addition & 0 deletions examples/ble_l2cap_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ fn main() {
async fn run_callback(server: &mut L2capServer) {
loop {
let recv = server.rx().await;
::log::info!("< {:?}", recv.data());
server.tx(recv.data()).unwrap();
}
}

0 comments on commit 9104cd6

Please sign in to comment.