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

Method adapter_state

src/corebluetooth/adapter.rs:151–167  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

149 }
150
151 async fn adapter_state(&self) -> Result<CentralState> {
152 let fut = CoreBluetoothReplyFuture::default();
153 self.sender
154 .to_owned()
155 .send(CoreBluetoothMessage::GetAdapterState {
156 future: fut.get_state_clone(),
157 })
158 .await?;
159
160 match fut.await {
161 CoreBluetoothReply::AdapterState(state) => {
162 let central_state = get_central_state(state);
163 return Ok(central_state.clone());
164 }
165 _ => panic!("Shouldn't get anything but a AdapterState!"),
166 }
167 }
168}

Callers

nothing calls this directly

Calls 2

get_state_cloneMethod · 0.80
get_central_stateFunction · 0.70

Tested by

no test coverage detected