(&self, data: &[u8])
| 47 | } |
| 48 | |
| 49 | pub async fn write_value(&self, data: &[u8]) -> Result<()> { |
| 50 | let writer = DataWriter::new()?; |
| 51 | writer.WriteBytes(data)?; |
| 52 | let operation = self.descriptor.WriteValueAsync(&writer.DetachBuffer()?)?; |
| 53 | let result = operation.into_future().await?; |
| 54 | if result == GattCommunicationStatus::Success { |
| 55 | Ok(()) |
| 56 | } else { |
| 57 | Err(Error::Other( |
| 58 | format!("Windows UWP threw error on write descriptor: {:?}", result).into(), |
| 59 | )) |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | pub async fn read_value(&self) -> Result<Vec<u8>> { |
| 64 | let result = self |
no test coverage detected