summaryrefslogtreecommitdiff
path: root/examples/src/bin/ble_peripheral_onoff.rs
diff options
context:
space:
mode:
authorDario Nieuwenhuis <dirbaio@dirbaio.net>2020-12-03 20:42:43 +0100
committerDario Nieuwenhuis <dirbaio@dirbaio.net>2020-12-03 20:42:43 +0100
commit1fd0b6290fe23dee4988e370926d6cc00765fdb7 (patch)
tree8d0f77f39a58770eeb43fe0e5c0173f8d7904674 /examples/src/bin/ble_peripheral_onoff.rs
parent61176d7022433a1da60e66026d165cd1ebe2276a (diff)
downloadnrf-softdevice-1fd0b6290fe23dee4988e370926d6cc00765fdb7.zip
Take configs by ref.
Diffstat (limited to 'examples/src/bin/ble_peripheral_onoff.rs')
-rw-r--r--examples/src/bin/ble_peripheral_onoff.rs17
1 files changed, 6 insertions, 11 deletions
diff --git a/examples/src/bin/ble_peripheral_onoff.rs b/examples/src/bin/ble_peripheral_onoff.rs
index 625b895..50f31bf 100644
--- a/examples/src/bin/ble_peripheral_onoff.rs
+++ b/examples/src/bin/ble_peripheral_onoff.rs
@@ -45,17 +45,12 @@ async fn run_bluetooth(sd: &'static Softdevice, server: &FooService) {
];
loop {
- let conn = unwrap!(
- peripheral::advertise(
- sd,
- peripheral::ConnectableAdvertisement::ScannableUndirected {
- adv_data,
- scan_data,
- },
- peripheral::Config::default(),
- )
- .await
- );
+ let config = peripheral::Config::default();
+ let adv = peripheral::ConnectableAdvertisement::ScannableUndirected {
+ adv_data,
+ scan_data,
+ };
+ let conn = unwrap!(peripheral::advertise(sd, adv, &config).await);
info!("advertising done!");