Package ej.bluetooth
Class BluetoothScanFilter
- java.lang.Object
-
- ej.bluetooth.BluetoothScanFilter
-
public class BluetoothScanFilter extends Object
TheBluetoothScanFilterclass represents a scan filter which may be used in order to filter scan results during a scan.Scan filters can be created by calling the static methods of this class.
-
-
Constructor Summary
Constructors Constructor Description BluetoothScanFilter()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static BluetoothScanFilterfieldEquals(byte type, byte[] data)Creates a new scan filter.static BluetoothScanFilterfieldExists(byte type)Creates a new scan filter.static BluetoothScanFilterfieldStartsWith(byte type, byte[] data)Creates a new scan filter.static BluetoothScanFilternoFilter()Creates a new scan filter.
-
-
-
Method Detail
-
noFilter
public static BluetoothScanFilter noFilter()
Creates a new scan filter. If this filter is set, no scan result will be discarded.- Returns:
- the new scan filter.
-
fieldExists
public static BluetoothScanFilter fieldExists(byte type)
Creates a new scan filter. If a scan result is received while this filter is set, the scan result is discarded if its advertisement data does not contain the field with the given type.- Parameters:
type- the type of the field which must be present within the advertisement data (seeBluetoothDataTypes).- Returns:
- the new scan filter.
-
fieldEquals
public static BluetoothScanFilter fieldEquals(byte type, byte[] data)
Creates a new scan filter. If a scan result is received while this filter is set, the scan result is discarded if its advertisement data does not contain the field with the given type or if its data is not equal to the given data.- Parameters:
type- the type of the field which must be present within the advertisement data (seeBluetoothDataTypes).data- the data that the field must be equal to.- Returns:
- the new scan filter.
-
fieldStartsWith
public static BluetoothScanFilter fieldStartsWith(byte type, byte[] data)
Creates a new scan filter. If a scan result is received while this filter is set, the scan result is discarded if its advertisement data does not contain the field with the given type or if its data does not start with the given data.- Parameters:
type- the type of the field which must be present within the advertisement data (seeBluetoothDataTypes).data- the data that the field must start with.- Returns:
- the new scan filter.
-
-