diff --git a/examples/ble_l2cap_client.rs b/examples/ble_l2cap_client.rs index 772ab89..e93395a 100644 --- a/examples/ble_l2cap_client.rs +++ b/examples/ble_l2cap_client.rs @@ -23,11 +23,9 @@ fn main() { client.connect(device.addr()).await.unwrap(); let mut l2cap = L2capClient::connect(&client, 0x1002, 512).await.unwrap(); - l2cap.on_data_received(|x| { - ::log::info!("Data received(0x1001): {:X?}", data.sdu_rx()); - }); for i in 0..4 { - l2cap.send(format!("test{}", i).as_bytes()).unwrap(); + l2cap.tx(format!("test{}", i).as_bytes()).unwrap(); + ::log::info!("< {:#?}", l2cap.rx().await.data()); esp_idf_hal::delay::FreeRtos::delay_ms(1000); } l2cap.disconnect().await.unwrap();