@ProviderType
public interface BluetoothGatt
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkConnection()
Check if the device is connected.
|
boolean |
connect()
Connect to devices GATT server.
|
boolean |
connect(java.lang.String adapterName)
Connect to devices GATT server with a given adapter.
|
void |
disconnect()
Disconnect from devices GATT server.
|
java.util.List<BluetoothGattCharacteristic> |
getCharacteristics(java.lang.String startHandle,
java.lang.String endHandle)
Get a list of GATT characteristics based on start and end handles.
|
BluetoothGattSecurityLevel |
getSecurityLevel()
Get security level.
|
BluetoothGattService |
getService(java.util.UUID uuid)
Return a GATT service based on a UUID.
|
java.util.List<BluetoothGattService> |
getServices()
Get a list of GATT services offered by the device.
|
java.lang.String |
readCharacteristicValue(java.lang.String handle)
Read characteristic value from handle.
|
java.lang.String |
readCharacteristicValueByUuid(java.util.UUID uuid)
Read value from characteristic by UUID.
|
void |
setBluetoothLeNotificationListener(BluetoothLeNotificationListener listener)
Sets the listener by which asynchronous actions of the GATT
server will be communicated.
|
void |
setSecurityLevel(BluetoothGattSecurityLevel level)
Set security level.
|
void |
writeCharacteristicValue(java.lang.String handle,
java.lang.String value)
Write value to characteristic.
|
boolean connect()
throws KuraException
KuraExceptionboolean connect(java.lang.String adapterName)
throws KuraException
adapterName - the name of the bluetooth adapterKuraExceptionvoid disconnect()
boolean checkConnection()
throws KuraException
KuraExceptionvoid setBluetoothLeNotificationListener(BluetoothLeNotificationListener listener)
listener - BluetoothLeListenerBluetoothGattService getService(java.util.UUID uuid)
uuid - UUID of servicejava.util.List<BluetoothGattService> getServices()
java.util.List<BluetoothGattCharacteristic> getCharacteristics(java.lang.String startHandle, java.lang.String endHandle)
getServices method.startHandle - Start handleendHandle - End handlejava.lang.String readCharacteristicValue(java.lang.String handle)
throws KuraException
handle - Characteristic handleKuraExceptionjava.lang.String readCharacteristicValueByUuid(java.util.UUID uuid)
throws KuraException
uuid - UUID of CharacteristicKuraExceptionvoid writeCharacteristicValue(java.lang.String handle,
java.lang.String value)
handle - Handle of Characteristicvalue - Value to write to CharacteristicBluetoothGattSecurityLevel getSecurityLevel() throws KuraException
KuraExceptionvoid setSecurityLevel(BluetoothGattSecurityLevel level)
level - Security Level