List of usage examples for android.bluetooth BluetoothGattDescriptor getCharacteristic
public BluetoothGattCharacteristic getCharacteristic()
From source file:com.google.android.apps.forscience.ble.MyBleService.java
public void writeValue(String address, BluetoothGattDescriptor descriptor, byte[] value) { BluetoothGatt bluetoothGatt = addressToGattClient.get(address); if (bluetoothGatt == null) { Log.w(TAG, "No connection found for: " + address); sendGattBroadcast(address, BleEvents.WRITE_DESC_FAIL, null); return;//from w w w. j a v a 2 s .c om } if (!descriptor.setValue(value) || !bluetoothGatt.writeDescriptor(descriptor)) { sendGattBroadcast(address, BleEvents.WRITE_DESC_FAIL, descriptor.getCharacteristic()); } }