public interface BtleGatt
Modifier and Type | Interface and Description |
---|---|
static interface |
BtleGatt.DisconnectHandler
Handler for disconnect events
|
static interface |
BtleGatt.NotificationListener
Listener for GATT characteristic notifications
|
static class |
BtleGatt.WriteType
Write types for the GATT characteristic
|
Modifier and Type | Method and Description |
---|---|
bolts.Task<java.lang.Void> |
connectAsync()
Connects to the GATT server on the remote device
|
bolts.Task<java.lang.Void> |
enableNotificationsAsync(BtleGattCharacteristic characteristic,
BtleGatt.NotificationListener listener)
Enable notifications for the characteristic
|
bolts.Task<java.lang.Void> |
localDisconnectAsync()
A disconnect attempted initiated by the Android device
|
void |
onDisconnect(BtleGatt.DisconnectHandler handler)
Register a handler for disconnect events
|
bolts.Task<byte[]> |
readCharacteristicAsync(BtleGattCharacteristic characteristic)
Reads the requested characteristic's value
|
bolts.Task<byte[][]> |
readCharacteristicAsync(BtleGattCharacteristic[] characteristics)
Convenience method to do bulk characteristic reads
|
bolts.Task<java.lang.Integer> |
readRssiAsync()
Read the remote device's RSSI value
|
bolts.Task<java.lang.Void> |
remoteDisconnectAsync()
A disconnect attempt that will be initiated by the remote device
|
boolean |
serviceExists(java.util.UUID gattService)
Checks if a service exists
|
bolts.Task<java.lang.Void> |
writeCharacteristicAsync(BtleGattCharacteristic characteristic,
BtleGatt.WriteType type,
byte[] value)
Writes a GATT characteristic and its value to the remote device
|
void onDisconnect(BtleGatt.DisconnectHandler handler)
handler
- Handler to respond to the dc eventsboolean serviceExists(java.util.UUID gattService)
gattService
- UUID identifying the service to lookupbolts.Task<java.lang.Void> writeCharacteristicAsync(BtleGattCharacteristic characteristic, BtleGatt.WriteType type, byte[] value)
characteristic
- GATT characteristic to writetype
- Type of GATT write to usevalue
- Value to be writtenbolts.Task<byte[][]> readCharacteristicAsync(BtleGattCharacteristic[] characteristics)
characteristics
- Array of characteristics to readbolts.Task<byte[]> readCharacteristicAsync(BtleGattCharacteristic characteristic)
characteristic
- Characteristic to readbolts.Task<java.lang.Void> enableNotificationsAsync(BtleGattCharacteristic characteristic, BtleGatt.NotificationListener listener)
characteristic
- Characteristic to enable notifications forlistener
- Listener for handling characteristic notificationsbolts.Task<java.lang.Void> localDisconnectAsync()
bolts.Task<java.lang.Void> remoteDisconnectAsync()
bolts.Task<java.lang.Void> connectAsync()
bolts.Task<java.lang.Integer> readRssiAsync()