pub struct DiscoveryFilter {
pub uuids: HashSet<Uuid>,
pub rssi: Option<i16>,
pub pathloss: Option<u16>,
pub transport: DiscoveryTransport,
pub duplicate_data: bool,
pub discoverable: bool,
pub pattern: Option<String>,
/* private fields */
}bluetoothd only.Expand description
Bluetooth device discovery filter.
The default discovery filter does not restrict any devices and provides duplicate data.
Fields§
§uuids: HashSet<Uuid>Filter by service UUIDs, empty means match any UUID.
When a remote device is found that advertises any UUID from UUIDs, it will be reported if:
- pathloss and RSSI are both empty.
- only pathloss param is set, device advertise TX power, and computed pathloss is less than pathloss param.
- only RSSI param is set, and received RSSI is higher than RSSI param.
rssi: Option<i16>RSSI threshold value.
PropertiesChanged signals will be emitted for already existing Device objects, with updated RSSI value. If one or more discovery filters have been set, the RSSI delta-threshold, that is imposed by StartDiscovery by default, will not be applied.
pathloss: Option<u16>Pathloss threshold value.
PropertiesChanged signals will be emitted for already existing Device objects, with updated Pathloss value.
Must not be set when rssi is set.
transport: DiscoveryTransportTransport parameter determines the type of scan.
Possible values: “auto” - interleaved scan “bredr” - BR/EDR inquiry “le” - LE scan only
If “le” or “bredr” Transport is requested, and the controller doesn’t support it, org.bluez.Error.Failed error will be returned.
If “auto” transport is requested, scan will use LE, BREDR, or both, depending on what’s currently enabled on the controller.
duplicate_data: boolDisables duplicate detection of advertisement data.
When enabled PropertiesChanged signals will be generated for either ManufacturerData and ServiceData every time they are discovered.
discoverable: boolMake adapter discoverable while discovering.
If the adapter is already discoverable setting this filter won’t do anything.
pattern: Option<String>Discover devices where the pattern matches either the prefix of the address or device name which is convenient way to limited the number of device objects created during a discovery.
When set disregards device discoverable flags.
Note: The pattern matching is ignored if there are other client that don’t set any pattern as it work as a logical OR, also setting empty string “” pattern will match any device found.
Trait Implementations§
Source§impl Clone for DiscoveryFilter
impl Clone for DiscoveryFilter
Source§fn clone(&self) -> DiscoveryFilter
fn clone(&self) -> DiscoveryFilter
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DiscoveryFilter
impl Debug for DiscoveryFilter
Source§impl Default for DiscoveryFilter
impl Default for DiscoveryFilter
Source§fn default() -> DiscoveryFilter
fn default() -> DiscoveryFilter
Source§impl<'de> Deserialize<'de> for DiscoveryFilter
impl<'de> Deserialize<'de> for DiscoveryFilter
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for DiscoveryFilter
impl PartialEq for DiscoveryFilter
Source§fn eq(&self, other: &DiscoveryFilter) -> bool
fn eq(&self, other: &DiscoveryFilter) -> bool
self and other values to be equal, and is used by ==.