blob: ca3b7e0a987953f3d3c816c381fe14b8e6f20176 [file] [log] [blame]
Nick Pelly038cabe2010-09-23 16:12:11 -07001/*
2 * Copyright (C) 2010 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17/**
18 * File : ErrorCodes.java
19 * Original-Author : Trusted Logic S.A. (Sylvain Fonteneau)
20 * Created : 26-02-2010
21 */
22
23package com.trustedlogic.trustednfc.android.internal;
24
25/**
26 * This class defines all the error codes that can be returned by the service
27 * and producing an exception on the application level. These are needed since
28 * binders does not support exceptions.
29 *
30 * @hide
31 */
32public class ErrorCodes {
33
34 public static boolean isError(int code) {
35 if (code < 0) {
36 return true;
37 } else {
38 return false;
39 }
40 }
41
42 public static final int SUCCESS = 0;
43
44 public static final int ERROR_IO = -1;
45
46 public static final int ERROR_CANCELLED = -2;
47
48 public static final int ERROR_TIMEOUT = -3;
49
50 public static final int ERROR_BUSY = -4;
51
52 public static final int ERROR_CONNECT = -5;
53
54 public static final int ERROR_DISCONNECT = -5;
55
56 public static final int ERROR_READ = -6;
57
58 public static final int ERROR_WRITE = -7;
59
60 public static final int ERROR_INVALID_PARAM = -8;
61
62 public static final int ERROR_INSUFFICIENT_RESOURCES = -9;
63
64 public static final int ERROR_SOCKET_CREATION = -10;
65
66 public static final int ERROR_SOCKET_NOT_CONNECTED = -11;
67
68 public static final int ERROR_BUFFER_TO_SMALL = -12;
69
70 public static final int ERROR_SAP_USED = -13;
71
72 public static final int ERROR_SERVICE_NAME_USED = -14;
73
74 public static final int ERROR_SOCKET_OPTIONS = -15;
75
76 public static final int ERROR_NFC_ON = -16;
77
78 public static final int ERROR_NOT_INITIALIZED = -17;
79
80 public static final int ERROR_SE_ALREADY_SELECTED = -18;
81
82 public static final int ERROR_SE_CONNECTED = -19;
83
84 public static final int ERROR_NO_SE_CONNECTED = -20;
85
86
87
88
89
90
91}