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 Unknown error occured
61 ES_ERRCODE_UNKNOWN(6);
65 private ESErrorCode(int value) {
69 public int getValue() {
73 public static ESErrorCode fromInt(int i) {
74 for (ESErrorCode b : ESErrorCode.values()) {
75 if (b.getValue() == i) { return b; }