-
- All Implemented Interfaces:
-
android.os.Parcelable,com.polidea.rxandroidble2.internal.scan.ScanFilterInterface
public class ScanFilter implements Parcelable, ScanFilterInterface
Criteria for filtering result from Bluetooth LE scans. A ScanFilter allows clients to restrict scan results to only those that are of interest to them.
Current filtering on the following fields are supported:
Service UUIDs which identify the bluetooth gatt services running on the device. Name of remote Bluetooth LE device. Mac address of the remote device. Service data which is the data associated with a service. Manufacturer specific data which is the data associated with a particular manufacturer.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classScanFilter.BuilderBuilder class for ScanFilter.
-
Field Summary
Fields Modifier and Type Field Description public final static Parcelable.Creator<ScanFilter>CREATOR
-
Method Summary
Modifier and Type Method Description intdescribeContents()voidwriteToParcel(Parcel dest, int flags)StringgetDeviceName()Returns the filter set the device name field of Bluetooth advertisement data. ParcelUuidgetServiceUuid()Returns the filter set on the service uuid. ParcelUuidgetServiceUuidMask()ParcelUuidgetServiceSolicitationUuid()Returns the filter set on the service Solicitation uuid. ParcelUuidgetServiceSolicitationUuidMask()Returns the filter set on the service Solicitation uuid mask. StringgetDeviceAddress()Array<byte>getServiceData()Array<byte>getServiceDataMask()ParcelUuidgetServiceDataUuid()intgetManufacturerId()Returns the manufacturer id. Array<byte>getManufacturerData()Array<byte>getManufacturerDataMask()booleanmatches(ScanResultInterface scanResult)Check if the scan filter matches a {@code scanResult}.StringtoString()inthashCode()booleanequals(Object obj)booleanisAllFieldsEmpty()Checks if the scanfilter is empty static ScanFilterempty()A function that returns an empty filter -
-
Method Detail
-
describeContents
int describeContents()
-
writeToParcel
void writeToParcel(Parcel dest, int flags)
-
getDeviceName
@Nullable() String getDeviceName()
Returns the filter set the device name field of Bluetooth advertisement data.
-
getServiceUuid
@Nullable() ParcelUuid getServiceUuid()
Returns the filter set on the service uuid.
-
getServiceUuidMask
@Nullable() ParcelUuid getServiceUuidMask()
-
getServiceSolicitationUuid
@Nullable() ParcelUuid getServiceSolicitationUuid()
Returns the filter set on the service Solicitation uuid.
-
getServiceSolicitationUuidMask
@Nullable() ParcelUuid getServiceSolicitationUuidMask()
Returns the filter set on the service Solicitation uuid mask.
-
getDeviceAddress
@Nullable() String getDeviceAddress()
-
getServiceData
@Nullable() Array<byte> getServiceData()
-
getServiceDataMask
@Nullable() Array<byte> getServiceDataMask()
-
getServiceDataUuid
@Nullable() ParcelUuid getServiceDataUuid()
-
getManufacturerId
int getManufacturerId()
Returns the manufacturer id. -1 if the manufacturer filter is not set.
-
getManufacturerData
@Nullable() Array<byte> getManufacturerData()
-
getManufacturerDataMask
@Nullable() Array<byte> getManufacturerDataMask()
-
matches
boolean matches(ScanResultInterface scanResult)
Check if the scan filter matches a
{@code scanResult}. A scan result is considered as a matchif it matches all the field filters.
-
hashCode
int hashCode()
-
isAllFieldsEmpty
boolean isAllFieldsEmpty()
Checks if the scanfilter is empty
-
empty
static ScanFilter empty()
A function that returns an empty filter
-
-
-
-