blob: 5b76d849d22177bdc2bffbdf8a6f126829e1911c [file] [log] [blame]
Nick Pelly038cabe2010-09-23 16:12:11 -07001/*
Nick Pelly590b73b2010-10-12 13:00:50 -07002 * Copyright (C) 2010, The Android Open Source Project
Nick Pelly038cabe2010-09-23 16:12:11 -07003 *
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 *
Nick Pelly590b73b2010-10-12 13:00:50 -07008 * http://www.apache.org/licenses/LICENSE-2.0
Nick Pelly038cabe2010-09-23 16:12:11 -07009 *
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
Nick Pelly590b73b2010-10-12 13:00:50 -070017package android.nfc;
Nick Pelly038cabe2010-09-23 16:12:11 -070018
19/**
20 * This class defines all the error codes that can be returned by the service
21 * and producing an exception on the application level. These are needed since
22 * binders does not support exceptions.
Nick Pelly590b73b2010-10-12 13:00:50 -070023 *
Nick Pelly038cabe2010-09-23 16:12:11 -070024 * @hide
25 */
26public class ErrorCodes {
27
28 public static boolean isError(int code) {
29 if (code < 0) {
30 return true;
31 } else {
32 return false;
33 }
34 }
35
36 public static final int SUCCESS = 0;
Nick Pelly590b73b2010-10-12 13:00:50 -070037
Nick Pelly038cabe2010-09-23 16:12:11 -070038 public static final int ERROR_IO = -1;
39
40 public static final int ERROR_CANCELLED = -2;
41
42 public static final int ERROR_TIMEOUT = -3;
43
44 public static final int ERROR_BUSY = -4;
45
46 public static final int ERROR_CONNECT = -5;
47
48 public static final int ERROR_DISCONNECT = -5;
49
50 public static final int ERROR_READ = -6;
51
52 public static final int ERROR_WRITE = -7;
53
54 public static final int ERROR_INVALID_PARAM = -8;
Nick Pelly590b73b2010-10-12 13:00:50 -070055
Nick Pelly038cabe2010-09-23 16:12:11 -070056 public static final int ERROR_INSUFFICIENT_RESOURCES = -9;
Nick Pelly590b73b2010-10-12 13:00:50 -070057
Nick Pelly038cabe2010-09-23 16:12:11 -070058 public static final int ERROR_SOCKET_CREATION = -10;
Nick Pelly590b73b2010-10-12 13:00:50 -070059
Nick Pelly038cabe2010-09-23 16:12:11 -070060 public static final int ERROR_SOCKET_NOT_CONNECTED = -11;
Nick Pelly590b73b2010-10-12 13:00:50 -070061
Nick Pelly038cabe2010-09-23 16:12:11 -070062 public static final int ERROR_BUFFER_TO_SMALL = -12;
63
64 public static final int ERROR_SAP_USED = -13;
Nick Pelly590b73b2010-10-12 13:00:50 -070065
Nick Pelly038cabe2010-09-23 16:12:11 -070066 public static final int ERROR_SERVICE_NAME_USED = -14;
Nick Pelly590b73b2010-10-12 13:00:50 -070067
Nick Pelly038cabe2010-09-23 16:12:11 -070068 public static final int ERROR_SOCKET_OPTIONS = -15;
Nick Pelly590b73b2010-10-12 13:00:50 -070069
Nick Pelly038cabe2010-09-23 16:12:11 -070070 public static final int ERROR_NFC_ON = -16;
Nick Pelly590b73b2010-10-12 13:00:50 -070071
Nick Pelly038cabe2010-09-23 16:12:11 -070072 public static final int ERROR_NOT_INITIALIZED = -17;
Nick Pelly590b73b2010-10-12 13:00:50 -070073
Nick Pelly038cabe2010-09-23 16:12:11 -070074 public static final int ERROR_SE_ALREADY_SELECTED = -18;
Nick Pelly590b73b2010-10-12 13:00:50 -070075
Nick Pelly038cabe2010-09-23 16:12:11 -070076 public static final int ERROR_SE_CONNECTED = -19;
Nick Pelly590b73b2010-10-12 13:00:50 -070077
Nick Pelly038cabe2010-09-23 16:12:11 -070078 public static final int ERROR_NO_SE_CONNECTED = -20;
Nick Pelly590b73b2010-10-12 13:00:50 -070079
80}