Skip to content

Commit

Permalink
fix(ingics): add discoveryFilter to stop bluetoothd crashing
Browse files Browse the repository at this point in the history
  • Loading branch information
fujexo committed Aug 24, 2023
1 parent 865c6ea commit f00721c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "terrarium"
version = "0.1.2"
version = "0.1.3"
edition = "2021"

authors = ["Philipp Marmet <fujexo@c0d3.ch>"]
Expand Down
8 changes: 7 additions & 1 deletion src/sensor/ingics.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use bluer::{Adapter, AdapterEvent, Address, DeviceEvent};
use bluer::{Adapter, AdapterEvent, Address, DeviceEvent, DiscoveryFilter, DiscoveryTransport};
use futures::{pin_mut, stream::SelectAll, StreamExt};
use influxdb::{Client, InfluxDbWriteable};
use log::{debug, error, info};
Expand Down Expand Up @@ -64,6 +64,12 @@ pub async fn run() -> bluer::Result<()> {
);
adapter.set_powered(true).await?;

let filter = DiscoveryFilter {
transport: DiscoveryTransport::Le,
..Default::default()
};
adapter.set_discovery_filter(filter).await?;

let device_events = adapter.discover_devices().await?;
pin_mut!(device_events);

Expand Down

0 comments on commit f00721c

Please sign in to comment.