Added in API level 26
Builder
class Builder
kotlin.Any | |
↳ | android.companion.BluetoothDeviceFilter.Builder |
A builder for BluetoothDeviceFilter
Summary
Public constructors | |
---|---|
Builder() |
Public methods | |
---|---|
BluetoothDeviceFilter.Builder |
addServiceUuid(serviceUuid: ParcelUuid?, serviceUuidMask: ParcelUuid?) Add filtering by certain bits of |
BluetoothDeviceFilter |
build() |
BluetoothDeviceFilter.Builder |
setAddress(address: String?) |
BluetoothDeviceFilter.Builder! |
setNamePattern(regex: Pattern?) |
Public constructors
Builder
Builder()
Public methods
addServiceUuid
Added in API level 26
fun addServiceUuid(
serviceUuid: ParcelUuid?,
serviceUuidMask: ParcelUuid?
): BluetoothDeviceFilter.Builder
Add filtering by certain bits of BluetoothDevice.getUuids()
A device with any uuid matching the given bits is considered passing
Parameters | |
---|---|
serviceUuid |
ParcelUuid?: the values for the bits to match This value may be null . |
serviceUuidMask |
ParcelUuid?: if provided, only those bits would have to match. This value may be null . |
Return | |
---|---|
BluetoothDeviceFilter.Builder |
This value cannot be null . |
build
Added in API level 26
fun build(): BluetoothDeviceFilter
Return | |
---|---|
BluetoothDeviceFilter |
This value cannot be null . |
setAddress
Added in API level 26
fun setAddress(address: String?): BluetoothDeviceFilter.Builder
Parameters | |
---|---|
address |
String?: if set, only devices with MAC address exactly matching the given one will pass the filter This value may be null . |
Return | |
---|---|
BluetoothDeviceFilter.Builder |
This value cannot be null . |
setNamePattern
Added in API level 26
fun setNamePattern(regex: Pattern?): BluetoothDeviceFilter.Builder!
Parameters | |
---|---|
regex |
Pattern?: if set, only devices with name matching the given regular expression will be shown This value may be null . |