From f5c0f6e5532292ec9c2da0b240a156c914d0ccc3 Mon Sep 17 00:00:00 2001 From: Sebastian Urban Date: Sun, 26 Nov 2023 18:36:13 +0100 Subject: [PATCH] monitor example: print instead of log --- bluer/examples/le_passive_scan.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bluer/examples/le_passive_scan.rs b/bluer/examples/le_passive_scan.rs index 8ad292c..9cc3479 100644 --- a/bluer/examples/le_passive_scan.rs +++ b/bluer/examples/le_passive_scan.rs @@ -6,10 +6,12 @@ use futures::StreamExt; #[tokio::main(flavor = "current_thread")] async fn main() -> bluer::Result<()> { env_logger::init(); + let session = bluer::Session::new().await?; let adapter = session.default_adapter().await?; - let mm = adapter.monitor().await?; adapter.set_powered(true).await?; + + let mm = adapter.monitor().await?; let mut monitor_handle = mm .register(Monitor { monitor_type: bluer::monitor::Type::OrPatterns, @@ -25,12 +27,12 @@ async fn main() -> bluer::Result<()> { while let Some(mevt) = &monitor_handle.next().await { if let MonitorEvent::DeviceFound(devid) = mevt { - log::info!("Discovered device {:?}", devid); + println!("Discovered device {:?}", devid); let dev = adapter.device(devid.device)?; tokio::spawn(async move { let mut events = dev.events().await.unwrap(); while let Some(ev) = events.next().await { - log::info!("On device {:?}, received event {:?}", dev, ev); + println!("On device {:?}, received event {:?}", dev, ev); } }); }