(
event: BluetoothEvent,
device_id: &DeviceId,
services: Arc<Mutex<HashMap<Uuid, ServiceInternal>>>,
)
| 305 | } |
| 306 | |
| 307 | fn value_notification( |
| 308 | event: BluetoothEvent, |
| 309 | device_id: &DeviceId, |
| 310 | services: Arc<Mutex<HashMap<Uuid, ServiceInternal>>>, |
| 311 | ) -> Option<ValueNotification> { |
| 312 | match event { |
| 313 | BluetoothEvent::Characteristic { |
| 314 | id, |
| 315 | event: CharacteristicEvent::Value { value }, |
| 316 | } if id.service().device() == *device_id => { |
| 317 | let services = services.lock().unwrap(); |
| 318 | let (charac, service) = find_characteristic_by_id(&services, id.clone())?; |
| 319 | Some(ValueNotification { |
| 320 | uuid: charac.uuid, |
| 321 | service_uuid: service.uuid, |
| 322 | value, |
| 323 | }) |
| 324 | } |
| 325 | _ => None, |
| 326 | } |
| 327 | } |
| 328 | |
| 329 | fn find_characteristic_by_id( |
| 330 | services: &HashMap<Uuid, ServiceInternal>, |
no test coverage detected