public class DefaultScanFilter extends java.lang.Object implements ScanFilter
ScanFilter
which filters using
a whitelist of known primary advertising UUID
s passed in to the constructor.ScanFilter.ApplyMode, ScanFilter.Please, ScanFilter.ScanEvent
Constructor and Description |
---|
DefaultScanFilter(java.util.Collection<java.util.UUID> whitelist)
|
DefaultScanFilter(java.util.Collection<java.util.UUID> uuidList,
java.lang.String... names)
Constructor to use if you wish to filter by multiple names and
UUID s. |
DefaultScanFilter(java.lang.String... nameList)
Constructor which sets up a name filter, with the provided names to filter for.
|
DefaultScanFilter(java.util.UUID whitelist)
Similar to
DefaultScanFilter(Collection) , only a convenience constructor if you are only concerned with looking for one UUID in particular. |
DefaultScanFilter(java.util.UUID uuid,
java.lang.String name)
Constructor to use if you wish to filter by name AND by
UUID . |
Modifier and Type | Method and Description |
---|---|
ScanFilter.Please |
onEvent(ScanFilter.ScanEvent e)
Acknowledges the discovery if there's an overlap between the given advertisedServices
and the
Collection passed into the constructor of DefaultScanFilter , OR the name given
by BleDevice.getName_native() contains any of the names given from DefaultScanFilter(String...) ,
DefaultScanFilter(UUID, String) , or DefaultScanFilter(Collection, String...) . |
public DefaultScanFilter(java.util.Collection<java.util.UUID> whitelist)
ScanFilter
with the provided Collection
of UUID
s. This "whitelists" the provided UUIDs, and will
only dispatch BleDevice
s that are advertising with any of those UUIDs to the DiscoveryListener
.public DefaultScanFilter(java.util.UUID whitelist)
DefaultScanFilter(Collection)
, only a convenience constructor if you are only concerned with looking for one UUID
in particular.public DefaultScanFilter(java.lang.String... nameList)
BleDevice.getName_native()
to
do the filtering. If any of the provided names are contained in the name, the device will be discovered. This filter check is case insensitive.public DefaultScanFilter(java.util.UUID uuid, java.lang.String name)
UUID
.public DefaultScanFilter(java.util.Collection<java.util.UUID> uuidList, java.lang.String... names)
UUID
s.public ScanFilter.Please onEvent(ScanFilter.ScanEvent e)
Collection
passed into the constructor of DefaultScanFilter
, OR the name given
by BleDevice.getName_native()
contains any of the names given from DefaultScanFilter(String...)
,
DefaultScanFilter(UUID, String)
, or DefaultScanFilter(Collection, String...)
.onEvent
in interface ScanFilter
ScanFilter.Please.acknowledge()
, ScanFilter.Please.ignore()
, or ScanFilter.Please.acknowledge(BleDeviceConfig)
(or other static constructor methods that may be added in the future).