(&self)
| 277 | } |
| 278 | |
| 279 | async fn connect(&self) -> Result<()> { |
| 280 | let fut = CoreBluetoothReplyFuture::default(); |
| 281 | self.shared |
| 282 | .message_sender |
| 283 | .to_owned() |
| 284 | .send(CoreBluetoothMessage::ConnectDevice { |
| 285 | peripheral_uuid: self.shared.uuid, |
| 286 | future: fut.get_state_clone(), |
| 287 | }) |
| 288 | .await?; |
| 289 | match fut.await { |
| 290 | CoreBluetoothReply::Connected => { |
| 291 | self.shared |
| 292 | .emit_event(CentralEvent::DeviceConnected(self.shared.uuid.into())); |
| 293 | } |
| 294 | CoreBluetoothReply::Err(msg) => return Err(Error::RuntimeError(msg)), |
| 295 | _ => panic!("Shouldn't get anything but connected or err!"), |
| 296 | } |
| 297 | trace!("Device connected!"); |
| 298 | Ok(()) |
| 299 | } |
| 300 | |
| 301 | async fn disconnect(&self) -> Result<()> { |
| 302 | let fut = CoreBluetoothReplyFuture::default(); |
nothing calls this directly
no test coverage detected