(&self, descriptor: &Descriptor, data: &[u8])
| 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| { |
nothing calls this directly
no test coverage detected