public final class AndroidBluetoothGatt extends java.lang.Object implements IBluetoothGatt
IBluetoothGatt
, and wraps BluetoothGatt
. This class is used by default
by the library, and the only time it should NOT be used, is when unit testing.BleDeviceConfig.gattFactory
IBluetoothGatt.DefaultFactory, IBluetoothGatt.Factory
DEFAULT_FACTORY
Constructor and Description |
---|
AndroidBluetoothGatt(IBleDevice device) |
Modifier and Type | Method and Description |
---|---|
void |
abortReliableWrite(android.bluetooth.BluetoothDevice device) |
boolean |
beginReliableWrite() |
UhOhListener.UhOh |
closeGatt() |
void |
connect(IBluetoothDevice device,
android.content.Context context,
boolean useAutoConnect,
android.bluetooth.BluetoothGattCallback callback) |
void |
disconnect() |
boolean |
discoverServices() |
boolean |
equals(P_GattHolder gatt) |
boolean |
executeReliableWrite() |
java.lang.Boolean |
getAuthRetryValue() |
BleDevice |
getBleDevice() |
BleService |
getBleService(java.util.UUID serviceUuid,
LogFunction logger) |
android.bluetooth.BluetoothGatt |
getGatt() |
java.util.List<BleService> |
getNativeServiceList(LogFunction logger) |
boolean |
isGattNull() |
boolean |
readCharacteristic(BleCharacteristic characteristic) |
boolean |
readDescriptor(BleDescriptor descriptor) |
boolean |
readPhy() |
boolean |
readRemoteRssi() |
boolean |
refreshGatt() |
boolean |
requestConnectionPriority(BleConnectionPriority priority) |
boolean |
requestMtu(int mtu) |
boolean |
setCharacteristicNotification(BleCharacteristic characteristic,
boolean enable) |
boolean |
setCharValue(BleCharacteristic characteristic,
byte[] data) |
boolean |
setDescValue(BleDescriptor descriptor,
byte[] data) |
void |
setGatt(android.bluetooth.BluetoothGatt gatt) |
boolean |
setPhy(Phy options) |
boolean |
writeCharacteristic(BleCharacteristic characteristic) |
boolean |
writeDescriptor(BleDescriptor descriptor) |
public AndroidBluetoothGatt(IBleDevice device)
public final BleDevice getBleDevice()
getBleDevice
in interface IBluetoothGatt
public final void setGatt(android.bluetooth.BluetoothGatt gatt)
setGatt
in interface IBluetoothGatt
public final android.bluetooth.BluetoothGatt getGatt()
getGatt
in interface IBluetoothGatt
public final java.lang.Boolean getAuthRetryValue()
getAuthRetryValue
in interface IBluetoothGatt
public boolean setPhy(Phy options)
setPhy
in interface IBluetoothGatt
public boolean readPhy()
readPhy
in interface IBluetoothGatt
public final boolean equals(P_GattHolder gatt)
equals
in interface IBluetoothGatt
public final UhOhListener.UhOh closeGatt()
closeGatt
in interface IBluetoothGatt
public final java.util.List<BleService> getNativeServiceList(LogFunction logger)
getNativeServiceList
in interface IBluetoothGatt
public BleService getBleService(java.util.UUID serviceUuid, LogFunction logger)
getBleService
in interface IBluetoothGatt
public final boolean isGattNull()
isGattNull
in interface IBluetoothGatt
public final void connect(IBluetoothDevice device, android.content.Context context, boolean useAutoConnect, android.bluetooth.BluetoothGattCallback callback)
connect
in interface IBluetoothGatt
public final boolean requestMtu(int mtu)
requestMtu
in interface IBluetoothGatt
public final boolean refreshGatt()
refreshGatt
in interface IBluetoothGatt
public final boolean requestConnectionPriority(BleConnectionPriority priority)
requestConnectionPriority
in interface IBluetoothGatt
public final void disconnect()
disconnect
in interface IBluetoothGatt
public final boolean readCharacteristic(BleCharacteristic characteristic)
readCharacteristic
in interface IBluetoothGatt
public final boolean setCharValue(BleCharacteristic characteristic, byte[] data)
setCharValue
in interface IBluetoothGatt
public final boolean writeCharacteristic(BleCharacteristic characteristic)
writeCharacteristic
in interface IBluetoothGatt
public final boolean setCharacteristicNotification(BleCharacteristic characteristic, boolean enable)
setCharacteristicNotification
in interface IBluetoothGatt
public final boolean readDescriptor(BleDescriptor descriptor)
readDescriptor
in interface IBluetoothGatt
public final boolean setDescValue(BleDescriptor descriptor, byte[] data)
setDescValue
in interface IBluetoothGatt
public final boolean writeDescriptor(BleDescriptor descriptor)
writeDescriptor
in interface IBluetoothGatt
public final boolean discoverServices()
discoverServices
in interface IBluetoothGatt
public final boolean executeReliableWrite()
executeReliableWrite
in interface IBluetoothGatt
public final boolean beginReliableWrite()
beginReliableWrite
in interface IBluetoothGatt
public final void abortReliableWrite(android.bluetooth.BluetoothDevice device)
abortReliableWrite
in interface IBluetoothGatt
public final boolean readRemoteRssi()
readRemoteRssi
in interface IBluetoothGatt