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

Method connect

src/winrtble/ble/device.rs:114–122  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

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());

Callers 5

connect_with_timeoutMethod · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45

Calls 3

to_errorFunction · 0.85
get_gatt_servicesMethod · 0.80
is_connectedMethod · 0.45

Tested by 1