summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorDario Nieuwenhuis <dirbaio@dirbaio.net>2020-12-04 16:17:01 +0100
committerDario Nieuwenhuis <dirbaio@dirbaio.net>2020-12-04 16:17:01 +0100
commit0867b0d36912a7ddadffe818b838cca6398fccdd (patch)
treebfb97c39f78b317a24f68531b23b6889c33c5b21 /examples
parent18312e0473979592e21c621c853cfbd8b29f7a2d (diff)
downloadnrf-softdevice-0867b0d36912a7ddadffe818b838cca6398fccdd.zip
More rusty Address type
Diffstat (limited to 'examples')
-rw-r--r--examples/src/bin/ble_bas_central.rs9
-rw-r--r--examples/src/bin/ble_l2cap_central.rs2
2 files changed, 6 insertions, 5 deletions
diff --git a/examples/src/bin/ble_bas_central.rs b/examples/src/bin/ble_bas_central.rs
index 2b37593..6bf9a1d 100644
--- a/examples/src/bin/ble_bas_central.rs
+++ b/examples/src/bin/ble_bas_central.rs
@@ -14,7 +14,7 @@ use defmt::{panic, *};
use embassy::executor::{task, Executor};
use embassy::util::Forever;
-use nrf_softdevice::ble::{central, gatt_client, Address, Connection, Uuid};
+use nrf_softdevice::ble::{central, gatt_client, Address, AddressType, Connection, Uuid};
use nrf_softdevice::raw;
use nrf_softdevice::Softdevice;
@@ -33,9 +33,10 @@ struct BatteryServiceClient {
#[task]
async fn ble_central_task(sd: &'static Softdevice) {
- let addrs = &[Address::new_random_static([
- 0x06, 0x6b, 0x71, 0x2c, 0xf5, 0xc0,
- ])];
+ let addrs = &[Address::new(
+ AddressType::RandomStatic,
+ [0x06, 0x6b, 0x71, 0x2c, 0xf5, 0xc0],
+ )];
let config = central::Config::default();
let conn = unwrap!(central::connect(sd, addrs, &config).await);
diff --git a/examples/src/bin/ble_l2cap_central.rs b/examples/src/bin/ble_l2cap_central.rs
index 24e5565..5c1b856 100644
--- a/examples/src/bin/ble_l2cap_central.rs
+++ b/examples/src/bin/ble_l2cap_central.rs
@@ -57,7 +57,7 @@ async fn ble_central_task(sd: &'static Softdevice) {
0x18, 0xce, 0x9c, 0x82,
]
{
- return Some(Address::new_random_static(params.peer_addr.addr));
+ return Some(Address::from_raw(params.peer_addr));
}
data = &data[len + 1..];
}