Skip to content

Commit d91a54c

Browse files
authored
fix: bluez device disconnection (#446)
1 parent 295f817 commit d91a54c

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/bluez/adapter.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,10 @@ async fn central_event(
143143
Some(CentralEvent::DeviceDiscovered(device.id.into()))
144144
}
145145
DeviceEvent::Connected { connected } => {
146-
let device = session.get_device_info(&id).await.ok()?;
147146
if connected {
148-
Some(CentralEvent::DeviceConnected(device.id.into()))
147+
Some(CentralEvent::DeviceConnected(id.into()))
149148
} else {
150-
Some(CentralEvent::DeviceDisconnected(device.id.into()))
149+
Some(CentralEvent::DeviceDisconnected(id.into()))
151150
}
152151
}
153152
DeviceEvent::Rssi { rssi: _ } => {

0 commit comments

Comments
 (0)