MCPcopy Create free account
hub / github.com/deviceplug/btleplug / read

Method read

src/winrtble/peripheral.rs:592–603  ·  view source on GitHub ↗
(&self, characteristic: &Characteristic)

Source from the content-addressed store, hash-verified

590 }
591
592 async fn read(&self, characteristic: &Characteristic) -> Result<Vec<u8>> {
593 let ble_service = &*self
594 .shared
595 .ble_services
596 .get(&characteristic.service_uuid)
597 .ok_or_else(|| Error::NotSupported("Service not found for read".into()))?;
598 let ble_characteristic = ble_service
599 .characteristics
600 .get(&characteristic.uuid)
601 .ok_or_else(|| Error::NotSupported("Characteristic not found for read".into()))?;
602 ble_characteristic.read_value().await
603 }
604
605 async fn notifications(&self) -> Result<Pin<Box<dyn Stream<Item = ValueNotification> + Send>>> {
606 let receiver = self.shared.notifications_channel.subscribe();

Callers 3

derive_propertiesMethod · 0.45
update_propertiesMethod · 0.45
read_rssiMethod · 0.45

Calls 2

getMethod · 0.65
read_valueMethod · 0.45

Tested by

no test coverage detected