summaryrefslogtreecommitdiff
path: root/examples/src/bin/ble_bas_peripheral.rs
diff options
context:
space:
mode:
authorDario Nieuwenhuis <dirbaio@dirbaio.net>2020-09-15 00:09:42 +0200
committerDario Nieuwenhuis <dirbaio@dirbaio.net>2020-09-15 00:09:42 +0200
commitd810e7bf93cca08d8b92d608f5535e3e1abc52bf (patch)
tree885139c9ea0138cb242b2c1f00627c7e89089e66 /examples/src/bin/ble_bas_peripheral.rs
parent35ac1d84210c04a7a86a74b21a3fc4978a8affd3 (diff)
downloadnrf-softdevice-d810e7bf93cca08d8b92d608f5535e3e1abc52bf.zip
Add Connection.detach() to avoid auto-disconnect on drop
Diffstat (limited to 'examples/src/bin/ble_bas_peripheral.rs')
-rw-r--r--examples/src/bin/ble_bas_peripheral.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/examples/src/bin/ble_bas_peripheral.rs b/examples/src/bin/ble_bas_peripheral.rs
index f148005..b330b91 100644
--- a/examples/src/bin/ble_bas_peripheral.rs
+++ b/examples/src/bin/ble_bas_peripheral.rs
@@ -103,6 +103,9 @@ async fn bluetooth_task(sd: &'static Softdevice) {
.dewrap();
info!("advertising done!");
+
+ // Detach the connection so it isn't disconnected when dropped.
+ conn.detach();
}
}