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

Method write_descriptor

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

Source from the content-addressed store, hash-verified

443 }
444
445 async fn write_descriptor(&self, descriptor: &Descriptor, data: &[u8]) -> Result<()> {
446 let fut = CoreBluetoothReplyFuture::default();
447 self.shared
448 .message_sender
449 .to_owned()
450 .send(CoreBluetoothMessage::WriteDescriptorValue {
451 peripheral_uuid: self.shared.uuid,
452 service_uuid: descriptor.service_uuid,
453 characteristic_uuid: descriptor.characteristic_uuid,
454 descriptor_uuid: descriptor.uuid,
455 data: Vec::from(data),
456 future: fut.get_state_clone(),
457 })
458 .await?;
459 match fut.await {
460 CoreBluetoothReply::Ok => {}
461 reply => panic!("Unexpected reply: {:?}", reply),
462 }
463 Ok(())
464 }
465
466 async fn read_rssi(&self) -> Result<i16> {
467 let fut = CoreBluetoothReplyFuture::default();

Callers

nothing calls this directly

Calls 1

get_state_cloneMethod · 0.80

Tested by

no test coverage detected