diff options
Diffstat (limited to 'rust/examples/battery_client.rs')
-rw-r--r-- | rust/examples/battery_client.rs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/rust/examples/battery_client.rs b/rust/examples/battery_client.rs index 007ccb6..613d9e8 100644 --- a/rust/examples/battery_client.rs +++ b/rust/examples/battery_client.rs @@ -33,6 +33,7 @@ use bumble::wrapper::{ device::{Device, Peer}, + hci::{packets::AddressType, Address}, profile::BatteryServiceProxy, transport::Transport, PyObjectExt, @@ -52,12 +53,8 @@ async fn main() -> PyResult<()> { let transport = Transport::open(cli.transport).await?; - let device = Device::with_hci( - "Bumble", - "F0:F1:F2:F3:F4:F5", - transport.source()?, - transport.sink()?, - )?; + let address = Address::new("F0:F1:F2:F3:F4:F5", AddressType::RandomDeviceAddress)?; + let device = Device::with_hci("Bumble", address, transport.source()?, transport.sink()?)?; device.power_on().await?; |