package com.hdl.sdk.link.common.exception;
|
|
import com.hdl.sdk.link.HDLLinkLocalSdk;
|
|
/**
|
* Created by jlchen on 11/15/21.
|
*
|
* @Description : HDLError
|
*/
|
public enum HDLLinkCode {
|
HDL_DATA_ERROR(-2000, isZh() == true ? "参数异常" : "Parameter exception"),
|
HDL_DATA_NULL_ERROR(-2001, isZh() == true ? "参数不能为空" : "Parameter cannot be empty"),
|
HDL_AUTH_ERROR(-2002, isZh() == true ? "认证失败" : "Authentication failed"),
|
HDL_SEND_ERROR(-2003, isZh() == true ? "发送失败" : "fail in send"),
|
HDL_TIMEOUT_ERROR(-2004, isZh() == true ? "超时" : "timeout"),
|
HDL_UNAUTHORIZED_ERROR(-2005, isZh() == true ? "未认证,请先认证" : "Not certified, please authenticate first"),
|
HDL_AUTH_ERROR_GATEWAY_NOT_REGISTERED(-2006, isZh() == true ? "认证失败,网关未注册到云端" : "Authentication failed. The gateway is not registered to the cloud"),
|
HDL_SEARCH_GATEWAY_TIMEOUT_ERROR(-2007, isZh() == true ? "搜索网关失败,超时" : "Failed to search gateway, timeout"),
|
HDL_AUTH_MAC_KEY_ERROR(-2008, isZh() == true ? "认证失败,该MAC对应的设备密钥不存在" : "Authentication failed. The device key corresponding to the MAC does not exist"),
|
HDL_DATA_PARSING_ERROR(-2009, isZh() == true ? "数据解析异常" : "Data parsing error"),
|
HDL_GET_DEVICE_LIST_ERROR(-2100, isZh() == true ? "获取设备列表失败" : "Failed to get device list"),
|
HDL_GET_FUNCTION_LIST_ERROR(-2101, isZh() == true ? "获取功能列表失败" : "Failed to get function list"),
|
HDL_GET_FUNCTION_PROPERTIES_ERROR(-2102, isZh() == true ? "获取功能属性失败" : "Failed to get function attribute"),
|
HDL_CONTROL_FAILURE_ERROR(-2103, isZh() == true ? "控制失败" : "Control failure"),
|
HDL_GET_GATEWAY_FAILURE_ERROR(-2104, isZh() == true ? "获取网关列表失败" : "Failed to get gateway list"),
|
HDL_GET_Zigbee_FAILURE_ERROR(-2105, isZh() == true ? "发送超时,网关无响应" : "Sending timeout, no response from gateway"),
|
HDL_GATEWAY_NOT_EXIST(-2106, isZh() == true ? "网关不存在" : "Gateway does not exist"),
|
HDL_GET_Zigbee_DEVICE_LIST_FAILURE_ERROR(-2107, isZh() == true ? "获取原生设备列表失败" : "Failed to get the device list");
|
|
private String msg;
|
private int code;
|
|
private HDLLinkCode(int code, String msg) {
|
this.msg = msg;
|
this.code = code;
|
}
|
|
public String getMsg() {
|
return msg;
|
}
|
|
public void setMsg(String msg) {
|
this.msg = msg;
|
}
|
|
public int getCode() {
|
return code;
|
}
|
|
public void setCode(int code) {
|
this.code = code;
|
}
|
|
static boolean isZh() {
|
if ("zh".equals(HDLLinkLocalSdk.getInstance().getLanguage()))
|
return true;
|
else
|
return false;
|
}
|
}
|