2 * ***************************************************************
4 * Copyright 2016 Samsung Electronics All Rights Reserved.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
18 * ****************************************************************
21 package org.iotivity.service.easysetup.mediator.enums;
24 * @brief Indicate last error code to describe a reason of error during easy setup.
26 public enum ESErrorCode {
31 ES_ERRCODE_NO_ERROR(0),
34 * Error Code that given WiFi's SSID is not found
36 ES_ERRCODE_SSID_NOT_FOUND(1),
39 * Error Code that given WiFi's Password is wrong
41 ES_ERRCODE_PW_WRONG(2),
44 * Error Code that IP address is not allocated
46 ES_ERRCODE_IP_NOT_ALLOCATED(3),
49 * Error Code that there is no Internet connection
51 ES_ERRCODE_NO_INTERNETCONNECTION(4),
54 * Error Code that Timeout occured
56 ES_ERRCODE_TIMEOUT(5),
59 * Error Code that cloud server is not reachable due to wrong URL of cloud server, for example.
61 ES_ERRCODE_FAILED_TO_ACCESS_CLOUD_SERVER(6),
64 * Error Code that no response is arrived from cloud server
66 ES_ERRCODE_NO_RESPONSE_FROM_CLOUD_SERVER(7),
69 * Error Code that a delivered authcode is not valid.
71 ES_ERRCODE_INVALID_AUTHCODE(8),
74 * Error Code that a given access token is not valid due to its expiration, for example.
76 ES_ERRCODE_INVALID_ACCESSTOKEN(9),
79 * Error Code that a refresh of expired access token is failed due to some reasons.
81 ES_ERRCODE_FAILED_TO_REFRESH_ACCESSTOKEN(10),
84 * Error Code that a target device is not discovered in cloud server
86 ES_ERRCODE_FAILED_TO_FIND_REGISTERED_DEVICE_IN_CLOUD(11),
89 * Error Code that a target user does not exist in cloud server.
91 ES_ERRCODE_FAILED_TO_FIND_REGISTERED_USER_IN_CLOUD(12),
94 * Error Code that an enrollee can not connect to a target WiFi AP because the AP resides in
95 * an unsupported WiFi frequency.
97 ES_ERRCODE_UNSUPPORTED_WIFI_FREQUENCY(13),
100 * Error Code that Unknown error occured
102 ES_ERRCODE_UNKNOWN(255);
106 private ESErrorCode(int value) {
110 public int getValue() {
114 public static ESErrorCode fromInt(int i) {
115 for (ESErrorCode b : ESErrorCode.values()) {
116 if (b.getValue() == i) { return b; }