Search in sources :

Example 1 with USBResponseErrorStructure

use of es.inteco.labs.android.usb.device.USBResponseErrorStructure in project jmulticard by ctt-gob-es.

the class UsbResponse method processStatusErrors.

/**
 * Procesa errores en base a ICC Status, Command Status y Error.
 * @param cmd Comando que originó la respuesta
 * @throws UsbResponseException En caso de detectarse algú error en la respuesta
 */
protected void processStatusErrors(final UsbCommand cmd) throws UsbResponseException {
    final USBResponseErrorsMap errorsMap = USBResponseErrorsMap.getErrorsMap();
    final byte error = getError();
    // A continuacion se procesan los campos de error
    final USBResponseErrorStructure structure = new USBResponseErrorStructure(cmd.getCommandID(), getIccStatus(), getCommandStatus(), error);
    final String errorDescription = errorsMap.find(structure);
    if (errorDescription != null) {
        throw new UsbResponseException(error, getIccStatus(), getCommandStatus(), errorDescription);
    }
}
Also used : USBResponseErrorStructure(es.inteco.labs.android.usb.device.USBResponseErrorStructure) UsbResponseException(es.inteco.labs.android.usb.device.exception.UsbResponseException) USBResponseErrorsMap(es.inteco.labs.android.usb.device.USBResponseErrorsMap)

Aggregations

USBResponseErrorStructure (es.inteco.labs.android.usb.device.USBResponseErrorStructure)1 USBResponseErrorsMap (es.inteco.labs.android.usb.device.USBResponseErrorsMap)1 UsbResponseException (es.inteco.labs.android.usb.device.exception.UsbResponseException)1