1
0
Fork 0
mirror of https://codeberg.org/icewind/mitemp-rs.git synced 2026-06-03 17:24:08 +02:00
This commit is contained in:
Robin Appelman 2021-10-31 18:25:55 +01:00
commit 15e70d0212
4 changed files with 24 additions and 22 deletions

View file

@ -41,9 +41,9 @@ const UUID: Uuid = Uuid::from_bytes([
/// Listen for sensor data
///
/// Returns an iterator that will block waiting for new sensor data
pub async fn listen<'a, A: Central + 'static>(
adapter: &'a A,
) -> Result<impl Stream<Item = Sensor> + 'a, btleplug::Error> {
pub async fn listen<A: Central>(
adapter: &A,
) -> Result<impl Stream<Item = Sensor>, btleplug::Error> {
let mut sensors: HashMap<BDAddr, SensorRawData> = HashMap::new();
let event_receiver = adapter.events().await?;