summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorDario Nieuwenhuis <dirbaio@dirbaio.net>2021-10-18 17:51:37 +0200
committerDario Nieuwenhuis <dirbaio@dirbaio.net>2021-10-18 17:51:37 +0200
commit8a7ae35733156e903a6c9ddc8dc3c0b7dfada59c (patch)
treeaaed7ef2725010348d3b0d52f4097479a7fc0353 /examples
parentb087b61f095a6a383956130a7e95e1d85ae11486 (diff)
downloadnrf-softdevice-8a7ae35733156e903a6c9ddc8dc3c0b7dfada59c.zip
ble/l2cap: add listen_with, to allow listening on multiple PSMs at once.
Diffstat (limited to 'examples')
-rw-r--r--examples/src/bin/ble_l2cap_central.rs7
-rw-r--r--examples/src/bin/ble_l2cap_peripheral.rs7
2 files changed, 4 insertions, 10 deletions
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::<Packet>::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 {