public class BleCannotSetCharacteristicNotificationException extends BleException
| Modifier and Type | Class and Description |
|---|---|
static interface |
BleCannotSetCharacteristicNotificationException.Reason |
| Modifier and Type | Field and Description |
|---|---|
static int |
CANNOT_FIND_CLIENT_CHARACTERISTIC_CONFIG_DESCRIPTOR
Used when a call to
BluetoothGattCharacteristic.getDescriptor(UUID) does not return the Client Characteristic Configuration
Descriptor ("00002902-0000-1000-8000-00805f9b34fb"). |
static int |
CANNOT_SET_LOCAL_NOTIFICATION
Used when call to
BluetoothGatt.setCharacteristicNotification(BluetoothGattCharacteristic, boolean)
returns false. |
static int |
CANNOT_WRITE_CLIENT_CHARACTERISTIC_CONFIG_DESCRIPTOR
Used when a call to writing to Client Characteristic Configuration Descriptor fails due to
BluetoothGatt.writeDescriptor(BluetoothGattDescriptor) returns `false` or
BluetoothGattCallback.onDescriptorWrite(BluetoothGatt, BluetoothGattDescriptor, int) is called with status
other than BluetoothGatt.GATT_SUCCESS. |
static int |
UNKNOWN
Deprecated.
|
| Constructor and Description |
|---|
BleCannotSetCharacteristicNotificationException(android.bluetooth.BluetoothGattCharacteristic bluetoothGattCharacteristic)
Deprecated.
|
BleCannotSetCharacteristicNotificationException(android.bluetooth.BluetoothGattCharacteristic bluetoothGattCharacteristic,
int reason,
java.lang.Throwable cause) |
| Modifier and Type | Method and Description |
|---|---|
android.bluetooth.BluetoothGattCharacteristic |
getBluetoothGattCharacteristic() |
int |
getReason()
|
@Deprecated public static final int UNKNOWN
BleCannotSetCharacteristicNotificationExceptionpublic static final int CANNOT_SET_LOCAL_NOTIFICATION
BluetoothGatt.setCharacteristicNotification(BluetoothGattCharacteristic, boolean)
returns false.public static final int CANNOT_FIND_CLIENT_CHARACTERISTIC_CONFIG_DESCRIPTOR
BluetoothGattCharacteristic.getDescriptor(UUID) does not return the Client Characteristic Configuration
Descriptor ("00002902-0000-1000-8000-00805f9b34fb"). This usually happens when there is a bug in the implementation of
the peripheral's firmware - according to Bluetooth Core Specification v4.2 [Vol 3, Part G] 3.3.1.1 every characteristic that has
BluetoothGattCharacteristic.PROPERTY_NOTIFY or BluetoothGattCharacteristic.PROPERTY_INDICATE shall contain
the Client Characteristic Configuration Descriptor. This is a violation of the specification and should be fixed on the firmware
side. As a temporary workaround
RxBleConnection.setupNotification(BluetoothGattCharacteristic, NotificationSetupMode) or
RxBleConnection.setupIndication(UUID, NotificationSetupMode) can be used with
NotificationSetupMode.COMPAT - which will make the library call only
BluetoothGatt.setCharacteristicNotification(BluetoothGattCharacteristic, boolean) without writing
the descriptor.public static final int CANNOT_WRITE_CLIENT_CHARACTERISTIC_CONFIG_DESCRIPTOR
BluetoothGatt.writeDescriptor(BluetoothGattDescriptor) returns `false` or
BluetoothGattCallback.onDescriptorWrite(BluetoothGatt, BluetoothGattDescriptor, int) is called with status
other than BluetoothGatt.GATT_SUCCESS.@Deprecated public BleCannotSetCharacteristicNotificationException(android.bluetooth.BluetoothGattCharacteristic bluetoothGattCharacteristic)
public BleCannotSetCharacteristicNotificationException(android.bluetooth.BluetoothGattCharacteristic bluetoothGattCharacteristic,
int reason,
java.lang.Throwable cause)
public android.bluetooth.BluetoothGattCharacteristic getBluetoothGattCharacteristic()
public int getReason()
CANNOT_SET_LOCAL_NOTIFICATION, CANNOT_FIND_CLIENT_CHARACTERISTIC_CONFIG_DESCRIPTOR,
CANNOT_WRITE_CLIENT_CHARACTERISTIC_CONFIG_DESCRIPTOR