@Test public void testOnError() { when(gatt.getService(eq(serviceUUID))).thenReturn(gattService); when(gattService.getCharacteristic(characteristicUUID)).thenReturn(gattCharacteristic); when(gatt.readCharacteristic(eq(gattCharacteristic))).thenReturn(true); readCommand.execute(device, operationCommandObserver, gatt); readCommand.onError(BluetoothGatt.GATT_FAILURE); verifyCommandFail(); }
@Override protected void onError(int error) { NeatleLogger.e("Unexpected error while reading [" + error + "]"); finish(CommandResult.createErrorResult(characteristicUUID, error)); }
ReadCommand extends SingleCharacteristicsCommand { @Override protected void onError(int error) { NeatleLogger.e("Unexpected error while reading [" + error + "]"); finish(CommandResult.createErrorResult(characteristicUUID, error)); } }
ReadCommand extends SingleCharacteristicsCommand { @Override protected void onError(int error) { NeatleLogger.e("Unexpected error while reading [" + error + "]"); finish(CommandResult.createErrorResult(characteristicUUID, error)); } ReadCommand(UUID serviceUUID, UUID characteristicUUID, CommandObserver observer); }
ReadCommand extends SingleCharacteristicsCommand { @Override protected void onError(int error) { NeatleLogger.e("Unexpected error while reading [" + error + "]"); finish(CommandResult.createErrorResult(characteristicUUID, error)); } ReadCommand(UUID serviceUUID, UUID characteristicUUID, CommandObserver observer); void onCharacteristicRead(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic, int status); @Override String toString(); }
ReadCommand extends SingleCharacteristicsCommand { @Override protected void onError(int error) { NeatleLogger.e("Unexpected error while reading [" + error + "]"); finish(CommandResult.createErrorResult(characteristicUUID, error)); } ReadCommand(UUID serviceUUID, UUID characteristicUUID, CommandObserver observer); void onCharacteristicRead(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic, int status); @Override String toString();  }