summaryrefslogtreecommitdiff
path: root/examples/src/bin/ble_l2cap_central.rs
diff options
context:
space:
mode:
authorDario Nieuwenhuis <dirbaio@dirbaio.net>2021-02-03 06:25:30 +0100
committerDario Nieuwenhuis <dirbaio@dirbaio.net>2021-02-03 06:25:30 +0100
commit96e625fc3baa4f258e9e9f761845a76751710b0d (patch)
tree50f25a17c00f23dba5bb67acde88c715e5c322ca /examples/src/bin/ble_l2cap_central.rs
parent1c821300e2b39c8cc31b11f0f857df81b1aaa9f2 (diff)
downloadnrf-softdevice-96e625fc3baa4f258e9e9f761845a76751710b0d.zip
unify and improve central config structs
Diffstat (limited to 'examples/src/bin/ble_l2cap_central.rs')
-rw-r--r--examples/src/bin/ble_l2cap_central.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/examples/src/bin/ble_l2cap_central.rs b/examples/src/bin/ble_l2cap_central.rs
index b00087a..e5f3e3c 100644
--- a/examples/src/bin/ble_l2cap_central.rs
+++ b/examples/src/bin/ble_l2cap_central.rs
@@ -39,6 +39,7 @@ async fn ble_central_task(sd: &'static Softdevice) {
let config = central::ScanConfig {
whitelist: None,
tx_power: TxPower::ZerodBm,
+ ..Default::default()
};
let res = central::scan(sd, &config, |params| unsafe {
let mut data = slice::from_raw_parts(params.data.p_data, params.data.len as usize);
@@ -72,8 +73,9 @@ async fn ble_central_task(sd: &'static Softdevice) {
let addrs = &[&address];
- let config = central::Config::default();
- let conn = unwrap!(central::connect(sd, addrs, &config).await);
+ let mut config = central::ConnectConfig::default();
+ config.scan_config.whitelist = Some(addrs);
+ let conn = unwrap!(central::connect(sd, &config).await);
info!("connected");
let l = l2cap::L2cap::<Packet>::init(sd);