ScanFilter.Builder
public
static
final
class
ScanFilter.Builder
extends Object
Builder class for ScanFilter
.
Summary
Inherited methods |
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this object.
|
boolean
|
equals(Object obj)
Indicates whether some other object is "equal to" this one.
|
void
|
finalize()
Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
|
final
Class<?>
|
getClass()
Returns the runtime class of this Object .
|
int
|
hashCode()
Returns a hash code value for the object.
|
final
void
|
notify()
Wakes up a single thread that is waiting on this object's
monitor.
|
final
void
|
notifyAll()
Wakes up all threads that are waiting on this object's monitor.
|
String
|
toString()
Returns a string representation of the object.
|
final
void
|
wait(long timeout, int nanos)
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object, or
some other thread interrupts the current thread, or a certain
amount of real time has elapsed.
|
final
void
|
wait(long timeout)
Causes the current thread to wait until either another thread invokes the
notify() method or the
notifyAll() method for this object, or a
specified amount of time has elapsed.
|
final
void
|
wait()
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object.
|
|
Public constructors
Builder
public Builder ()
Public methods
setDeviceName
public ScanFilter.Builder setDeviceName (String deviceName)
Set filter on device name.
Parameters |
deviceName |
String |
setManufacturerData
public ScanFilter.Builder setManufacturerData (int manufacturerId,
byte[] manufacturerData)
Set filter on on manufacturerData. A negative manufacturerId is considered as invalid id.
Parameters |
manufacturerId |
int |
manufacturerData |
byte |
setManufacturerData
public ScanFilter.Builder setManufacturerData (int manufacturerId,
byte[] manufacturerData,
byte[] manufacturerDataMask)
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
.
Parameters |
manufacturerId |
int |
manufacturerData |
byte |
manufacturerDataMask |
byte |
Throws |
IllegalArgumentException |
If the manufacturerId is invalid, or manufacturerData is null while manufacturerDataMask is not, or manufacturerData and manufacturerDataMask have different length. |
setServiceData
public ScanFilter.Builder setServiceData (ParcelUuid serviceDataUuid,
byte[] serviceData)
Set filtering on service data.
Parameters |
serviceDataUuid |
ParcelUuid |
serviceData |
byte |
setServiceData
public ScanFilter.Builder setServiceData (ParcelUuid serviceDataUuid,
byte[] serviceData,
byte[] serviceDataMask)
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
.
Parameters |
serviceDataUuid |
ParcelUuid |
serviceData |
byte |
serviceDataMask |
byte |
Throws |
IllegalArgumentException |
If serviceDataUuid is null or serviceDataMask is null while serviceData is not or serviceDataMask and serviceData has different length. |
setServiceSolicitationUuid
public ScanFilter.Builder setServiceSolicitationUuid (ParcelUuid serviceSolicitationUuid,
ParcelUuid solicitationUuidMask)
Set filter on partial service Solicitation uuid. The SolicitationUuidMask
is the
bit mask for the serviceSolicitationUuid
. Set any bit in the mask to 1 to
indicate a match is needed for the bit in serviceSolicitationUuid
, and 0 to
ignore that bit.
Parameters |
serviceSolicitationUuid |
ParcelUuid : can only be null if solicitationUuidMask is null.
This value may be null . |
solicitationUuidMask |
ParcelUuid : can be null or a mask with no restriction.
This value may be null . |
setServiceSolicitationUuid
public ScanFilter.Builder setServiceSolicitationUuid (ParcelUuid serviceSolicitationUuid)
Set filter on service solicitation uuid.
Parameters |
serviceSolicitationUuid |
ParcelUuid : This value may be null . |
setServiceUuid
public ScanFilter.Builder setServiceUuid (ParcelUuid serviceUuid,
ParcelUuid uuidMask)
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.
Parameters |
serviceUuid |
ParcelUuid |
uuidMask |
ParcelUuid |
setServiceUuid
public ScanFilter.Builder setServiceUuid (ParcelUuid serviceUuid)
Set filter on service uuid.
Parameters |
serviceUuid |
ParcelUuid |