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

Method read_descriptor

src/droidplug/peripheral.rs:469–481  ·  view source on GitHub ↗
(&self, descriptor: &Descriptor)

Source from the content-addressed store, hash-verified

467 }
468
469 async fn read_descriptor(&self, descriptor: &Descriptor) -> Result<Vec<u8>> {
470 let future = self.with_obj(|env, obj| {
471 let characteristic = JUuid::new(env, descriptor.characteristic_uuid)?;
472 let uuid = JUuid::new(env, descriptor.uuid)?;
473 JSendFuture::try_from(obj.read_descriptor(characteristic, uuid)?)
474 })?;
475 let result_ref = future.await?;
476 self.with_obj(|env, _obj| {
477 let result = JPollResult::from_env(env, result_ref.as_obj())?;
478 let bytes = get_poll_result(env, result)?;
479 Ok(byte_array_to_vec(env, bytes.into_inner())?)
480 })
481 }
482
483 async fn connection_parameters(&self) -> Result<Option<ConnectionParameters>> {
484 self.with_obj(|_env, obj| {

Callers

nothing calls this directly

Calls 4

get_poll_resultFunction · 0.85
byte_array_to_vecFunction · 0.85
with_objMethod · 0.80
into_innerMethod · 0.80

Tested by

no test coverage detected