public interface BluetoothGatt
Modifier and Type | Method and Description |
---|---|
boolean |
checkConnection()
Check if the device is connected.
|
boolean |
connect()
Connect to devices GATT server.
|
void |
disconnect()
Disconnect from devices GATT server.
|
List<BluetoothGattCharacteristic> |
getCharacteristics(String startHandle,
String endHandle)
Get a list of GATT characteristics based on start and end handles.
|
BluetoothGattService |
getService(UUID uuid)
Return a GATT service based on a UUID.
|
List<BluetoothGattService> |
getServices()
Get a list of GATT services offered by the device.
|
String |
readCharacteristicValue(String handle)
Read characteristic value from handle.
|
String |
readCharacteristicValueByUuid(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 |
writeCharacteristicValue(String handle,
String value)
Write value to characteristic.
|
boolean connect()
void disconnect()
boolean checkConnection()
void setBluetoothLeNotificationListener(BluetoothLeNotificationListener listener)
listener
- BluetoothLeListenerBluetoothGattService getService(UUID uuid)
uuid
- UUID of serviceList<BluetoothGattService> getServices()
List<BluetoothGattCharacteristic> getCharacteristics(String startHandle, String endHandle)
getServices
method.startHandle
- Start handleendHandle
- End handleString readCharacteristicValue(String handle)
handle
- Characteristic handleString readCharacteristicValueByUuid(UUID uuid)
uuid
- UUID of CharacteristicCopyright © 2016. All Rights Reserved.