(&self, data: &[u8], write_type: WriteType)
| 65 | } |
| 66 | |
| 67 | pub async fn write_value(&self, data: &[u8], write_type: WriteType) -> Result<()> { |
| 68 | let writer = DataWriter::new()?; |
| 69 | writer.WriteBytes(data)?; |
| 70 | let operation = self |
| 71 | .characteristic |
| 72 | .WriteValueWithOptionAsync(&writer.DetachBuffer()?, write_type.into())?; |
| 73 | let result = operation.into_future().await?; |
| 74 | if result == GattCommunicationStatus::Success { |
| 75 | Ok(()) |
| 76 | } else { |
| 77 | Err(Error::Other( |
| 78 | format!("Windows UWP threw error on write: {:?}", result).into(), |
| 79 | )) |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | pub async fn read_value(&self) -> Result<Vec<u8>> { |
| 84 | let result = self |
nothing calls this directly
no test coverage detected