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

Method write_descriptor

src/droidplug/peripheral.rs:455–467  ·  view source on GitHub ↗
(&self, descriptor: &Descriptor, data: &[u8])

Source from the content-addressed store, hash-verified

453 }
454
455 async fn write_descriptor(&self, descriptor: &Descriptor, data: &[u8]) -> Result<()> {
456 let future = self.with_obj(|env, obj| {
457 let characteristic = JUuid::new(env, descriptor.characteristic_uuid)?;
458 let uuid = JUuid::new(env, descriptor.uuid)?;
459 let data_obj = super::jni_utils::arrays::slice_to_byte_array(env, data)?;
460 JSendFuture::try_from(obj.write_descriptor(characteristic, uuid, data_obj.into())?)
461 })?;
462 let result_ref = future.await?;
463 self.with_obj(|env, _obj| {
464 let result = JPollResult::from_env(env, result_ref.as_obj())?;
465 get_poll_result(env, result).map(|_| {})
466 })
467 }
468
469 async fn read_descriptor(&self, descriptor: &Descriptor) -> Result<Vec<u8>> {
470 let future = self.with_obj(|env, obj| {

Callers

nothing calls this directly

Calls 3

slice_to_byte_arrayFunction · 0.85
get_poll_resultFunction · 0.85
with_objMethod · 0.80

Tested by

no test coverage detected