java.lang.Object | |
↳ | android.bluetooth.le.ScanFilter.Builder |
Builder class for ScanFilter
.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Build
ScanFilter . | |||||||||||
Set filter on device mac address.
| |||||||||||
Set filter on on manufacturerData.
| |||||||||||
Set filter on partial manufacture data.
| |||||||||||
Set filter on local name.
| |||||||||||
Set the desired rssi range for the filter.
| |||||||||||
Set partial filter on service data.
| |||||||||||
Set filtering on service data.
| |||||||||||
Set filter on partial service uuid.
| |||||||||||
Set filter on service uuid.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Build ScanFilter
.
IllegalArgumentException | If the filter cannot be built. |
---|
Set filter on device mac address.
macAddress | The device mac address for the filter. It needs to be in the format of
"01:02:03:AB:CD:EF". The mac address can be validated using
checkBluetoothAddress(String) . |
---|
IllegalArgumentException | If the macAddress is invalid.
|
---|
Set filter on on manufacturerData. A negative manufacturerId is considered as invalid id.
Note the first two bytes of the manufacturerData
is the manufacturerId.
IllegalArgumentException | If the manufacturerId is invalid.
|
---|
Set filter on partial manufacture data. For any bit in the mask, set it the 1 if it needs to match the one in manufacturer data, otherwise set it to 0.
The manufacturerDataMask
must have the same length of manufacturerData
.
IllegalArgumentException | If the manufacturerId is invalid, or
manufacturerData is null while manufacturerDataMask is not,
or manufacturerData and manufacturerDataMask have different
length.
|
---|
Set the desired rssi range for the filter. A scan result with rssi in the range of [minRssi, maxRssi] will be consider as a match.
Set partial filter on service data. For any bit in the mask, set it to 1 if it needs to match the one in service data, otherwise set it to 0 to ignore that bit.
The serviceDataMask
must have the same length of the serviceData
.
IllegalArgumentException | If serviceDataMask is null while
serviceData is not or serviceDataMask and serviceData
has different length.
|
---|
Set filter on partial service uuid. The uuidMask
is the bit mask for the
serviceUuid
. Set any bit in the mask to 1 to indicate a match is needed for the
bit in serviceUuid
, and 0 to ignore that bit.
IllegalArgumentException | If serviceUuid is null but
uuidMask is not null .
|
---|