(&self)
| 112 | } |
| 113 | |
| 114 | pub async fn connect(&self) -> Result<()> { |
| 115 | if self.is_connected().await? { |
| 116 | return Ok(()); |
| 117 | } |
| 118 | |
| 119 | let service_result = self.get_gatt_services(BluetoothCacheMode::Uncached).await?; |
| 120 | let status = service_result.Status().map_err(|_| Error::DeviceNotFound)?; |
| 121 | utils::to_error(status) |
| 122 | } |
| 123 | |
| 124 | async fn is_connected(&self) -> Result<bool> { |
| 125 | let winrt_error = |e| Error::Other(format!("{:?}", e).into()); |