You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This code will panic under linux, but it can be used normally under windows.
log:A Tokio 1.x context was found, but timers are disabled. Call enable_time on the runtime builder to enable timers
What should I do?
pub fn get_device(services: &[Uuid]) -> (Vec<String>, Device) {
let rt = Runtime::new().unwrap();
let future= async {
let adapter = Adapter::default().await.unwrap();
adapter.wait_available().await.unwrap();
info!("looking for device");
let device = adapter
.discover_devices(services)
.await
.unwrap()
.next()
.await
.ok_or("Failed to discover device")
.unwrap()
.unwrap();
println!(
"found device: {} ({:?})",
device.name_async().await.as_deref().unwrap_or("(unknown)"),
device.id()
);
let services = services.clone();
for uuid in services {
UUID_STR_VEC.write().await.push(uuid.to_string());
}
(UUID_STR_VEC.read().await.to_vec(),device)
};
rt.block_on(future)
}
The text was updated successfully, but these errors were encountered:
This code will panic under linux, but it can be used normally under windows.
log:A Tokio 1.x context was found, but timers are disabled. Call
enable_time
on the runtime builder to enable timersWhat should I do?
The text was updated successfully, but these errors were encountered: