FileDocCategorySizeDatePackage
ErrorCodes.javaAPI DocAndroid 5.1 API3759Thu Mar 12 22:22:10 GMT 2015android.nfc

ErrorCodes

public class ErrorCodes extends Object
This class defines all the error codes that can be returned by the service and producing an exception on the application level. These are needed since binders does not support exceptions.
hide

Fields Summary
public static final int
SUCCESS
public static final int
ERROR_IO
public static final int
ERROR_CANCELLED
public static final int
ERROR_TIMEOUT
public static final int
ERROR_BUSY
public static final int
ERROR_CONNECT
public static final int
ERROR_DISCONNECT
public static final int
ERROR_READ
public static final int
ERROR_WRITE
public static final int
ERROR_INVALID_PARAM
public static final int
ERROR_INSUFFICIENT_RESOURCES
public static final int
ERROR_SOCKET_CREATION
public static final int
ERROR_SOCKET_NOT_CONNECTED
public static final int
ERROR_BUFFER_TO_SMALL
public static final int
ERROR_SAP_USED
public static final int
ERROR_SERVICE_NAME_USED
public static final int
ERROR_SOCKET_OPTIONS
public static final int
ERROR_NFC_ON
public static final int
ERROR_NOT_INITIALIZED
public static final int
ERROR_SE_ALREADY_SELECTED
public static final int
ERROR_SE_CONNECTED
public static final int
ERROR_NO_SE_CONNECTED
public static final int
ERROR_NOT_SUPPORTED
Constructors Summary
Methods Summary
public static java.lang.StringasString(int code)

        switch (code) {
            case SUCCESS: return "SUCCESS";
            case ERROR_IO: return "IO";
            case ERROR_CANCELLED: return "CANCELLED";
            case ERROR_TIMEOUT: return "TIMEOUT";
            case ERROR_BUSY: return "BUSY";
            case ERROR_CONNECT: return "CONNECT/DISCONNECT";
//            case ERROR_DISCONNECT: return "DISCONNECT";
            case ERROR_READ: return "READ";
            case ERROR_WRITE: return "WRITE";
            case ERROR_INVALID_PARAM: return "INVALID_PARAM";
            case ERROR_INSUFFICIENT_RESOURCES: return "INSUFFICIENT_RESOURCES";
            case ERROR_SOCKET_CREATION: return "SOCKET_CREATION";
            case ERROR_SOCKET_NOT_CONNECTED: return "SOCKET_NOT_CONNECTED";
            case ERROR_BUFFER_TO_SMALL: return "BUFFER_TO_SMALL";
            case ERROR_SAP_USED: return "SAP_USED";
            case ERROR_SERVICE_NAME_USED: return "SERVICE_NAME_USED";
            case ERROR_SOCKET_OPTIONS: return "SOCKET_OPTIONS";
            case ERROR_NFC_ON: return "NFC_ON";
            case ERROR_NOT_INITIALIZED: return "NOT_INITIALIZED";
            case ERROR_SE_ALREADY_SELECTED: return "SE_ALREADY_SELECTED";
            case ERROR_SE_CONNECTED: return "SE_CONNECTED";
            case ERROR_NO_SE_CONNECTED: return "NO_SE_CONNECTED";
            case ERROR_NOT_SUPPORTED: return "NOT_SUPPORTED";
            default: return "UNKNOWN ERROR";
        }
    
public static booleanisError(int code)

        if (code < 0) {
            return true;
        } else {
            return false;
        }