From 8a7ae35733156e903a6c9ddc8dc3c0b7dfada59c Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Mon, 18 Oct 2021 17:51:37 +0200 Subject: ble/l2cap: add listen_with, to allow listening on multiple PSMs at once. --- examples/src/bin/ble_l2cap_central.rs | 7 ++----- examples/src/bin/ble_l2cap_peripheral.rs | 7 ++----- 2 files changed, 4 insertions(+), 10 deletions(-) (limited to 'examples') diff --git a/examples/src/bin/ble_l2cap_central.rs b/examples/src/bin/ble_l2cap_central.rs index 186bd93..1637cf5 100644 --- a/examples/src/bin/ble_l2cap_central.rs +++ b/examples/src/bin/ble_l2cap_central.rs @@ -78,11 +78,8 @@ async fn ble_central_task(sd: &'static Softdevice) { info!("connected"); let l = l2cap::L2cap::::init(sd); - let config = l2cap::Config { - psm: PSM, - credits: 8, - }; - let ch = unwrap!(l.setup(&conn, &config).await); + let config = l2cap::Config { credits: 8 }; + let ch = unwrap!(l.setup(&conn, &config, PSM).await); info!("l2cap connected"); for i in 0..10 { diff --git a/examples/src/bin/ble_l2cap_peripheral.rs b/examples/src/bin/ble_l2cap_peripheral.rs index ecda5f4..eccd555 100644 --- a/examples/src/bin/ble_l2cap_peripheral.rs +++ b/examples/src/bin/ble_l2cap_peripheral.rs @@ -53,11 +53,8 @@ async fn bluetooth_task(sd: &'static Softdevice) { info!("advertising done!"); - let config = l2cap::Config { - psm: PSM, - credits: 8, - }; - let ch = unwrap!(l.listen(&conn, &config).await); + let config = l2cap::Config { credits: 8 }; + let ch = unwrap!(l.listen(&conn, &config, PSM).await); info!("l2cap connected"); loop { -- cgit v1.2.3