summaryrefslogtreecommitdiff
path: root/examples/src/bin/ble_bas_peripheral.rs
diff options
context:
space:
mode:
authorDario Nieuwenhuis <dirbaio@dirbaio.net>2020-09-15 02:56:33 +0200
committerDario Nieuwenhuis <dirbaio@dirbaio.net>2020-09-15 02:56:33 +0200
commit264b97fc3cc15f195059570a081c9ff6d7b1565c (patch)
treef72d8d5bf93c694dc721f57966346eb489355587 /examples/src/bin/ble_bas_peripheral.rs
parentd5e3235632e5d233ac38dfb7ee9c61b5277f7029 (diff)
downloadnrf-softdevice-264b97fc3cc15f195059570a081c9ff6d7b1565c.zip
WIP handle gatt_server writes.
Diffstat (limited to 'examples/src/bin/ble_bas_peripheral.rs')
-rw-r--r--examples/src/bin/ble_bas_peripheral.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/examples/src/bin/ble_bas_peripheral.rs b/examples/src/bin/ble_bas_peripheral.rs
index 6c16940..fc4fd60 100644
--- a/examples/src/bin/ble_bas_peripheral.rs
+++ b/examples/src/bin/ble_bas_peripheral.rs
@@ -56,8 +56,14 @@ impl gatt_server::Server for BatteryServiceServer {
}
#[static_executor::task]
+async fn gatt_server_task(sd: &'static Softdevice, server: BatteryServiceServer) {
+ gatt_server::run(sd, &server).await
+}
+
+#[static_executor::task]
async fn bluetooth_task(sd: &'static Softdevice) {
let server: BatteryServiceServer = gatt_server::register(sd).dewrap();
+ unsafe { gatt_server_task.spawn(sd, server).dewrap() };
#[rustfmt::skip]
let adv_data = &[