@Test public void testOnDescriptorWriteFail() { setupDescriptorSuccess(); subscribeCommand.execute(device, operationCommandObserver, gatt); subscribeCommand.onDescriptorWrite(gatt, gattDescriptor, BluetoothGatt.GATT_FAILURE); verifyCommandFail(subscribeCommand, BluetoothGatt.GATT_FAILURE); }
@Override protected void onDescriptorWrite(BluetoothGatt gatt, BluetoothGattDescriptor descriptor, int status) { if (status != BluetoothGatt.GATT_SUCCESS) { finish(CommandResult.createErrorResult(characteristicUUID, status)); } else { finish(CommandResult.createEmptySuccess(characteristicUUID)); } }
SubscribeCommand extends SingleCharacteristicsCommand { @Override protected void onDescriptorWrite(BluetoothGatt gatt, BluetoothGattDescriptor descriptor, int status) { if (status != BluetoothGatt.GATT_SUCCESS) { finish(CommandResult.createErrorResult(characteristicUUID, status)); } else { finish(CommandResult.createEmptySuccess(characteristicUUID)); } } }
SubscribeCommand extends SingleCharacteristicsCommand { @Override protected void onDescriptorWrite(BluetoothGatt gatt, BluetoothGattDescriptor descriptor, int status) { if (status != BluetoothGatt.GATT_SUCCESS) { finish(CommandResult.createErrorResult(characteristicUUID, status)); } else { finish(CommandResult.createEmptySuccess(characteristicUUID)); } } SubscribeCommand(@Type int type, UUID serviceUUID, UUID characteristicUUID, CommandObserver observer); }
SubscribeCommand extends SingleCharacteristicsCommand { @Override protected void onDescriptorWrite(BluetoothGatt gatt, BluetoothGattDescriptor descriptor, int status) { if (status != BluetoothGatt.GATT_SUCCESS) { finish(CommandResult.createErrorResult(characteristicUUID, status)); } else { finish(CommandResult.createEmptySuccess(characteristicUUID)); } } SubscribeCommand(@Type int type, UUID serviceUUID, UUID characteristicUUID, CommandObserver observer); @Override String toString(); }
SubscribeCommand extends SingleCharacteristicsCommand { @Override protected void onDescriptorWrite(BluetoothGatt gatt, BluetoothGattDescriptor descriptor, int status) { if (status != BluetoothGatt.GATT_SUCCESS) { finish(CommandResult.createErrorResult(characteristicUUID, status)); } else { finish(CommandResult.createEmptySuccess(characteristicUUID)); } } SubscribeCommand(@Type int type, UUID serviceUUID, UUID characteristicUUID, CommandObserver observer); @Override String toString();  }