diff options
author | Ulf Lilleengen <lulf@redhat.com> | 2021-10-11 12:14:12 +0200 |
---|---|---|
committer | Ulf Lilleengen <lulf@redhat.com> | 2021-10-11 12:14:12 +0200 |
commit | 37585e1ffafbfa5b32c9136472ddb3f4ae136856 (patch) | |
tree | 4f9c6f790ac0a713ee8019e0548ae84dcdd206e4 /examples/src/bin/ble_peripheral_onoff.rs | |
parent | 1f73a93a6ddce925ff749d63f4528e50e9efae02 (diff) | |
download | nrf-softdevice-37585e1ffafbfa5b32c9136472ddb3f4ae136856.zip |
Derive event variant from struct field name
Diffstat (limited to 'examples/src/bin/ble_peripheral_onoff.rs')
-rw-r--r-- | examples/src/bin/ble_peripheral_onoff.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/src/bin/ble_peripheral_onoff.rs b/examples/src/bin/ble_peripheral_onoff.rs index 82d0599..067f1d4 100644 --- a/examples/src/bin/ble_peripheral_onoff.rs +++ b/examples/src/bin/ble_peripheral_onoff.rs @@ -62,16 +62,16 @@ async fn run_bluetooth(sd: &'static Softdevice, server: &Server) { info!("advertising done!"); let res = gatt_server::run(&conn, server, |e| match e { - ServerEvent::FooService(FooServiceEvent::FooWrite(val)) => { + ServerEvent::Foo(FooServiceEvent::FooWrite(val)) => { info!("wrote foo level: {}", val); if let Err(e) = server.foo.foo_notify(&conn, val + 1) { info!("send notification error: {:?}", e); } } - ServerEvent::FooService(FooServiceEvent::FooNotificationsEnabled) => { + ServerEvent::Foo(FooServiceEvent::FooNotificationsEnabled) => { info!("notifications enabled") } - ServerEvent::FooService(FooServiceEvent::FooNotificationsDisabled) => { + ServerEvent::Foo(FooServiceEvent::FooNotificationsDisabled) => { info!("notifications disabled") } }) |