pub async fn real_time(&self) -> Result<impl Stream<Item = RealTimeData>, BluetoothError> {
        let real_time_data_characteristic = self.real_time_data_characteristic.clone();
        self.bt_session
            .start_notify(&real_time_data_characteristic)
            .await?;
        let events = self
            .bt_session
            .characteristic_event_stream(&real_time_data_characteristic)
            .await?;
        Ok(StreamExt::filter_map(events, move |event| {
            future::ready(match event {
                BluetoothEvent::Characteristic {
                    id,
                    event: CharacteristicEvent::Value { value },
                } if id == real_time_data_characteristic => RealTimeData::try_parse(&value),
                _ => {
                    info!("Unexpected Bluetooth event {:?}", event);
                    None
                }
            })
        }))
    }
/// Get a stream of real time data from the device.
///
/// You must also call `enable_real_time_data(true)` to actually get some data.
Get a stream of real time data from the device.
You must also call `enable_real_time_data(true)` to actually get some data.
Get a stream of real time data from the device . You must also call ` enable_real_time_data ( true ) ` to actually get some data .
pub async fn real_time(&self) -> Result<impl Stream<Item = RealTimeData>, BluetoothError> {
        let real_time_data_characteristic = self.real_time_data_characteristic.clone();
        self.bt_session
            .start_notify(&real_time_data_characteristic)
            .await?;
        let events = self
            .bt_session
            .characteristic_event_stream(&real_time_data_characteristic)
            .await?;
        Ok(StreamExt::filter_map(events, move |event| {
            future::ready(match event {
                BluetoothEvent::Characteristic {
                    id,
                    event: CharacteristicEvent::Value { value },
                } if id == real_time_data_characteristic => RealTimeData::try_parse(&value),
                _ => {
                    info!("Unexpected Bluetooth event {:?}", event);
                    None
                }
            })
        }))
    }
pub async fn real_time ( & self ) -> Result < impl Stream < Item = RealTimeData > , BluetoothError > { let real_time_data_characteristic = self . real_time_data_characteristic . clone ( ) ; self . bt_session . start_notify ( & real_time_data_characteristic ) . await ? ; let events = self . bt_session . characteristic_event_stream ( & real_time_data_characteristic ) . await ? ; Ok ( StreamExt :: filter_map ( events , move | event | { future :: ready ( match event { BluetoothEvent :: Characteristic { id , event : CharacteristicEvent :: Value { value } , } if id == real_time_data_characteristic => RealTimeData :: try_parse ( & value ) , _ => { info ! ( " " event ) ; None } } ) } ) ) }
Get a stream of real time data from the device.
Get a stream of real time data from the device .
&self
&self