FileDocCategorySizeDatePackage
BluetoothGattCallback.javaAPI DocAndroid 5.1 API6503Thu Mar 12 22:22:10 GMT 2015android.bluetooth

BluetoothGattCallback

public abstract class BluetoothGattCallback extends Object
This abstract class is used to implement {@link BluetoothGatt} callbacks.

Fields Summary
Constructors Summary
Methods Summary
public voidonCharacteristicChanged(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic)
Callback triggered as a result of a remote characteristic notification.

param
gatt GATT client the characteristic is associated with
param
characteristic Characteristic that has been updated as a result of a remote notification event.

    
public voidonCharacteristicRead(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic, int status)
Callback reporting the result of a characteristic read operation.

param
gatt GATT client invoked {@link BluetoothGatt#readCharacteristic}
param
characteristic Characteristic that was read from the associated remote device.
param
status {@link BluetoothGatt#GATT_SUCCESS} if the read operation was completed successfully.

    
public voidonCharacteristicWrite(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic, int status)
Callback indicating the result of a characteristic write operation.

If this callback is invoked while a reliable write transaction is in progress, the value of the characteristic represents the value reported by the remote device. An application should compare this value to the desired value to be written. If the values don't match, the application must abort the reliable write transaction.

param
gatt GATT client invoked {@link BluetoothGatt#writeCharacteristic}
param
characteristic Characteristic that was written to the associated remote device.
param
status The result of the write operation {@link BluetoothGatt#GATT_SUCCESS} if the operation succeeds.

    
public voidonConnectionStateChange(BluetoothGatt gatt, int status, int newState)
Callback indicating when GATT client has connected/disconnected to/from a remote GATT server.

param
gatt GATT client
param
status Status of the connect or disconnect operation. {@link BluetoothGatt#GATT_SUCCESS} if the operation succeeds.
param
newState Returns the new connection state. Can be one of {@link BluetoothProfile#STATE_DISCONNECTED} or {@link BluetoothProfile#STATE_CONNECTED}

    
public voidonDescriptorRead(BluetoothGatt gatt, BluetoothGattDescriptor descriptor, int status)
Callback reporting the result of a descriptor read operation.

param
gatt GATT client invoked {@link BluetoothGatt#readDescriptor}
param
descriptor Descriptor that was read from the associated remote device.
param
status {@link BluetoothGatt#GATT_SUCCESS} if the read operation was completed successfully

    
public voidonDescriptorWrite(BluetoothGatt gatt, BluetoothGattDescriptor descriptor, int status)
Callback indicating the result of a descriptor write operation.

param
gatt GATT client invoked {@link BluetoothGatt#writeDescriptor}
param
descriptor Descriptor that was writte to the associated remote device.
param
status The result of the write operation {@link BluetoothGatt#GATT_SUCCESS} if the operation succeeds.

    
public voidonMtuChanged(BluetoothGatt gatt, int mtu, int status)
Callback indicating the MTU for a given device connection has changed. This callback is triggered in response to the {@link BluetoothGatt#requestMtu} function, or in response to a connection event.

param
gatt GATT client invoked {@link BluetoothGatt#requestMtu}
param
mtu The new MTU size
param
status {@link BluetoothGatt#GATT_SUCCESS} if the MTU has been changed successfully

    
public voidonReadRemoteRssi(BluetoothGatt gatt, int rssi, int status)
Callback reporting the RSSI for a remote device connection. This callback is triggered in response to the {@link BluetoothGatt#readRemoteRssi} function.

param
gatt GATT client invoked {@link BluetoothGatt#readRemoteRssi}
param
rssi The RSSI value for the remote device
param
status {@link BluetoothGatt#GATT_SUCCESS} if the RSSI was read successfully

    
public voidonReliableWriteCompleted(BluetoothGatt gatt, int status)
Callback invoked when a reliable write transaction has been completed.

param
gatt GATT client invoked {@link BluetoothGatt#executeReliableWrite}
param
status {@link BluetoothGatt#GATT_SUCCESS} if the reliable write transaction was executed successfully

    
public voidonServicesDiscovered(BluetoothGatt gatt, int status)
Callback invoked when the list of remote services, characteristics and descriptors for the remote device have been updated, ie new services have been discovered.

param
gatt GATT client invoked {@link BluetoothGatt#discoverServices}
param
status {@link BluetoothGatt#GATT_SUCCESS} if the remote device has been explored successfully.