public class BLEUtility
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
BLE_NOTIF_MAJOR |
static int |
BLE_NOTIF_MINOR |
Constructor and Description |
---|
BLEUtility() |
Modifier and Type | Method and Description |
---|---|
static boolean |
firmwareHasNotification(int curMajor,
int curMinor) |
static boolean |
isBluetoothEnabled() |
static java.util.List<android.bluetooth.BluetoothDevice> |
listLEDevices(android.bluetooth.BluetoothManager bluetoothManager) |
static boolean |
refreshDeviceCache(android.bluetooth.BluetoothGatt gatt) |
static void |
resetBTAdapter(android.bluetooth.BluetoothAdapter mBluetoothAdapter)
Turn off then on the BT adapter in order to reset it.
|
static boolean |
setBluetooth(boolean enable) |
static boolean |
unbound(android.bluetooth.BluetoothDevice device)
Unbound a bluetooth device
|
static void |
unboundAllDevices(android.bluetooth.BluetoothAdapter mBluetoothAdapter) |
static void |
unboundAllDevices(android.bluetooth.BluetoothAdapter mBluetoothAdapter,
<any> predicate) |
public static final int BLE_NOTIF_MAJOR
public static final int BLE_NOTIF_MINOR
public static boolean firmwareHasNotification(int curMajor, int curMinor)
public static boolean unbound(@NonNull android.bluetooth.BluetoothDevice device)
device
- device to unboundpublic static void unboundAllDevices(android.bluetooth.BluetoothAdapter mBluetoothAdapter)
public static void unboundAllDevices(android.bluetooth.BluetoothAdapter mBluetoothAdapter, <any> predicate)
public static boolean refreshDeviceCache(android.bluetooth.BluetoothGatt gatt)
public static boolean isBluetoothEnabled()
public static boolean setBluetooth(boolean enable)
public static void resetBTAdapter(android.bluetooth.BluetoothAdapter mBluetoothAdapter)
mBluetoothAdapter
- the bluetooth adapterpublic static java.util.List<android.bluetooth.BluetoothDevice> listLEDevices(android.bluetooth.BluetoothManager bluetoothManager)