diff options
author | Ulf Lilleengen <ulf.lilleengen@gmail.com> | 2021-10-11 09:53:34 +0200 |
---|---|---|
committer | Ulf Lilleengen <ulf.lilleengen@gmail.com> | 2021-10-11 09:53:34 +0200 |
commit | 59849798ace87c9acc3ef5e5e634114dd1ce7244 (patch) | |
tree | 5f96107a0b42c4b2ce6785064a31e4a3f135e94c /examples/src/bin/ble_bas_peripheral.rs | |
parent | 2ee4c87061004a1c4e59f1445b5e9976c6d83e9b (diff) | |
download | nrf-softdevice-59849798ace87c9acc3ef5e5e634114dd1ce7244.zip |
Remove write from battery service
Diffstat (limited to 'examples/src/bin/ble_bas_peripheral.rs')
-rw-r--r-- | examples/src/bin/ble_bas_peripheral.rs | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/examples/src/bin/ble_bas_peripheral.rs b/examples/src/bin/ble_bas_peripheral.rs index b63d578..2f0328b 100644 --- a/examples/src/bin/ble_bas_peripheral.rs +++ b/examples/src/bin/ble_bas_peripheral.rs @@ -29,7 +29,7 @@ async fn softdevice_task(sd: &'static Softdevice) { #[nrf_softdevice::gatt_server(uuid = "180f")] struct BatteryService { - #[characteristic(uuid = "2a19", read, write, notify)] + #[characteristic(uuid = "2a19", read, notify)] battery_level: u8, } @@ -67,13 +67,6 @@ async fn bluetooth_task(sd: &'static Softdevice) { // Run the GATT server on the connection. This returns when the connection gets disconnected. let res = gatt_server::run(&conn, |e| { match battery_service.on_write(e.clone()) { - Some(BatteryServiceEvent::BatteryLevelWrite(val)) => { - info!("wrote battery level: {}", val); - if let Err(e) = battery_service.battery_level_notify(&conn, val + 1) { - info!("send notification error: {:?}", e); - } - } - Some(BatteryServiceEvent::BatteryLevelNotificationsEnabled) => { info!("battery notifications enabled") } |