(&self)
| 258 | } |
| 259 | |
| 260 | async fn is_connected(&self) -> Result<bool> { |
| 261 | let fut = CoreBluetoothReplyFuture::default(); |
| 262 | self.shared |
| 263 | .message_sender |
| 264 | .to_owned() |
| 265 | .send(CoreBluetoothMessage::IsConnected { |
| 266 | peripheral_uuid: self.shared.uuid, |
| 267 | future: fut.get_state_clone(), |
| 268 | }) |
| 269 | .await?; |
| 270 | match fut.await { |
| 271 | CoreBluetoothReply::State(state) => match state { |
| 272 | CBPeripheralState::Connected => Ok(true), |
| 273 | _ => Ok(false), |
| 274 | }, |
| 275 | _ => panic!("Shouldn't get anything but a State!"), |
| 276 | } |
| 277 | } |
| 278 | |
| 279 | async fn connect(&self) -> Result<()> { |
| 280 | let fut = CoreBluetoothReplyFuture::default(); |
nothing calls this directly
no test coverage detected