MCPcopy Create free account
hub / github.com/deviceplug/btleplug / is_connected

Method is_connected

src/corebluetooth/internal.rs:960–974  ·  view source on GitHub ↗
(&mut self, peripheral_uuid: Uuid, fut: CoreBluetoothReplyStateShared)

Source from the content-addressed store, hash-verified

958 }
959
960 fn is_connected(&mut self, peripheral_uuid: Uuid, fut: CoreBluetoothReplyStateShared) {
961 if let Some(p) = self.peripherals.get_mut(&peripheral_uuid) {
962 let state = unsafe { p.peripheral.state() };
963 trace!("Connected state {:?} ", state);
964 fut.lock()
965 .unwrap()
966 .set_reply(CoreBluetoothReply::State(state));
967 } else {
968 // Peripheral was removed after disconnect — report as disconnected
969 // rather than hanging the future forever.
970 fut.lock()
971 .unwrap()
972 .set_reply(CoreBluetoothReply::State(CBPeripheralState::Disconnected));
973 }
974 }
975
976 fn write_value(
977 &mut self,

Callers

nothing calls this directly

Calls 1

set_replyMethod · 0.80

Tested by

no test coverage detected