TuyaOS
tuya_error_code.h
1/*******************************************************************
2* File: tuya_error_code.h
3* Author: auto generate by tuya code gen system
4* Date: 2022-05-06
5* Description:this file defined the error code of tuya IOT
6* you can change it manully if needed
7* Copyright(C),2018-2020, tuya inc, www.tuya.comm
8*******************************************************************/
9
10#ifndef TUYA_ERROR_CODE_H
11#define TUYA_ERROR_CODE_H
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
17
18
19/****************************************************************************
20 the error code marco define for module GLOBAL
21****************************************************************************/
22#define OPRT_OK (-0x0000) //0, 执行成功
23#define OPRT_COM_ERROR (-0x0001) //-1, 通用错误
24#define OPRT_INVALID_PARM (-0x0002) //-2, 无效的入参
25#define OPRT_MALLOC_FAILED (-0x0003) //-3, 内存分配失败
26#define OPRT_NOT_SUPPORTED (-0x0004) //-4, 不支持
27#define OPRT_NETWORK_ERROR (-0x0005) //-5, 网络错误
28#define OPRT_NOT_FOUND (-0x0006) //-6, 没有找到对象
29#define OPRT_CR_CJSON_ERR (-0x0007) //-7, 创建json对象失败
30#define OPRT_CJSON_PARSE_ERR (-0x0008) //-8, json解析失败
31#define OPRT_CJSON_GET_ERR (-0x0009) //-9, 获取json对象失败
32#define OPRT_CR_MUTEX_ERR (-0x000a) //-10, 创建信号量失败
33#define OPRT_SOCK_ERR (-0x000b) //-11, 创建socket失败
34#define OPRT_SET_SOCK_ERR (-0x000c) //-12, socket设置失败
35#define OPRT_SOCK_CONN_ERR (-0x000d) //-13, socket连接失败
36#define OPRT_SEND_ERR (-0x000e) //-14, 发送失败
37#define OPRT_RECV_ERR (-0x000f) //-15, 接收失败
38#define OPRT_RECV_DA_NOT_ENOUGH (-0x0010) //-16, 接收数据不完整
39#define OPRT_KVS_WR_FAIL (-0x0011) //-17, KV写失败
40#define OPRT_KVS_RD_FAIL (-0x0012) //-18, KV读失败
41#define OPRT_CRC32_FAILED (-0x0013) //-19, CRC校验失败
42#define OPRT_TIMEOUT (-0x0014) //-20, 超时
43#define OPRT_INIT_MORE_THAN_ONCE (-0x0015) //-21, 初始化超过一次
44#define OPRT_INDEX_OUT_OF_BOUND (-0x0016) //-22, 索引越界
45#define OPRT_RESOURCE_NOT_READY (-0x0017) //-23, 资源未完善
46#define OPRT_EXCEED_UPPER_LIMIT (-0x0018) //-24, 超过上限
47#define OPRT_FILE_NOT_FIND (-0x0019) //-25, 文件未找到
48#define OPRT_FILE_IS_FULL (-0x001a) //-26, 文件已满
49#define OPRT_FILE_OPEN_FAILED (-0x001b) //-27, 文件打开失败
50#define OPRT_FILE_READ_FAILED (-0x001c) //-28, 文件读取失败
51#define OPRT_FILE_WRITE_FAILED (-0x001d) //-29, 文件写入失败
52#define OPRT_NOT_EXIST (-0x001e) //-30, 不存在
53#define OPRT_BUFFER_NOT_ENOUGH (-0x001f) //-31, 缓存不足
54#define OPRT_ROUTER_NOT_FOUND (-0x0020) //-32, 路由器未找到
55#define OPRT_AUTHENTICATION_NOT_FOUND (-0x0021) //-33, 未认证
56#define OPRT_AUTHENTICATION_FAIL (-0x0022) //-34, 认证失败
57#define OPRT_MSG_OUT_OF_LIMIT (-0x0023) //-35, 消息超出上限
58#define OPRT_VERSION_FMT_ERR (-0x0024) //-36, 版本不匹配
59#define OPRT_GLOBAL_ERRCODE_MAX_CNT 37
60
61
62/****************************************************************************
63 the error code marco define for module BASE_OS_ADAPTER
64****************************************************************************/
65#define OPRT_BASE_OS_ADAPTER_REG_NULL_ERROR (-0x0100) //-256, 系统适配注册失败
66#define OPRT_BASE_OS_ADAPTER_ERRCODE_MAX_CNT 1
67
68
69/****************************************************************************
70 the error code marco define for module BASE_UTILITIES
71****************************************************************************/
72#define OPRT_BASE_UTILITIES_PARTITION_EMPTY (-0x0200) //-512, 无空闲链表
73#define OPRT_BASE_UTILITIES_PARTITION_FULL (-0x0201) //-513, 链表已满
74#define OPRT_BASE_UTILITIES_PARTITION_NOT_FOUND (-0x0202) //-514, 链表未遍历到
75#define OPRT_BASE_UTILITIES_ERRCODE_MAX_CNT 3
76
77
78/****************************************************************************
79 the error code marco define for module BASE_SECURITY
80****************************************************************************/
81#define OPRT_BASE_SECURITY_CRC32_FAILED (-0x0300) //-768, CRC32错误
82#define OPRT_BASE_SECURITY_ERRCODE_MAX_CNT 1
83
84
85/****************************************************************************
86 the error code marco define for module BASE_LOG_MNG
87****************************************************************************/
88#define OPRT_BASE_LOG_MNG_DONOT_FOUND_MODULE (-0x0400) //-1024, 未发现log模块
89#define OPRT_BASE_LOG_MNG_PRINT_LOG_LEVEL_HIGHER (-0x0401) //-1025, log级别低
90#define OPRT_BASE_LOG_MNG_FORMAT_STRING_FAILED (-0x0402) //-1026, log字符串格式化失败
91#define OPRT_BASE_LOG_MNG_LOG_SEQ_OPEN_FILE_FAIL (-0x0403) //-1027, 打开日志序文件失败
92#define OPRT_BASE_LOG_MNG_LOG_SEQ_WRITE_FILE_FAIL (-0x0404) //-1028, 写日志序文件失败
93#define OPRT_BASE_LOG_MNG_LOG_SEQ_FILE_FULL (-0x0405) //-1029, 日志序文件满
94#define OPRT_BASE_LOG_MNG_LOG_SEQ_FILE_NOT_EXIST (-0x0406) //-1030, 日志序文件不存在
95#define OPRT_BASE_LOG_MNG_LOG_SEQ_NAME_INVALIDE (-0x0407) //-1031, 日志序名称无效
96#define OPRT_BASE_LOG_MNG_LOG_SEQ_CREATE_FAIL (-0x0408) //-1032, 日志序创建失败
97#define OPRT_BASE_LOG_MNG_ERRCODE_MAX_CNT 9
98
99
100/****************************************************************************
101 the error code marco define for module BASE_TIMEQ
102****************************************************************************/
103#define OPRT_BASE_TIMEQ_TIMERID_EXIST (-0x0600) //-1536, 定时器ID已存在
104#define OPRT_BASE_TIMEQ_TIMERID_NOT_FOUND (-0x0601) //-1537, 未找到指定定时器ID
105#define OPRT_BASE_TIMEQ_TIMERID_UNVALID (-0x0602) //-1538, 定时器ID非法
106#define OPRT_BASE_TIMEQ_GET_IDLE_TIMERID_ERROR (-0x0603) //-1539, 获取空闲定时器ID错误
107#define OPRT_BASE_TIMEQ_ERRCODE_MAX_CNT 4
108
109
110/****************************************************************************
111 the error code marco define for module BASE_MSGQ
112****************************************************************************/
113#define OPRT_BASE_MSGQ_NOT_FOUND (-0x0700) //-1792, 消息未找到
114#define OPRT_BASE_MSGQ_LIST_EMPTY (-0x0701) //-1793, 列表为空
115#define OPRT_BASE_MSGQ_ERRCODE_MAX_CNT 2
116
117
118/****************************************************************************
119 the error code marco define for module MID_HTTP
120****************************************************************************/
121#define OPRT_MID_HTTP_BUF_NOT_ENOUGH (-0x0800) //-2048, 缓冲区长度不足
122#define OPRT_MID_HTTP_URL_PARAM_OUT_LIMIT (-0x0801) //-2049, URL长度超出限制
123#define OPRT_MID_HTTP_OS_ERROR (-0x0802) //-2050, 系统错误
124#define OPRT_MID_HTTP_PR_REQ_ERROR (-0x0803) //-2051, 准备请求错误
125#define OPRT_MID_HTTP_SD_REQ_ERROR (-0x0804) //-2052, 发送请求错误
126#define OPRT_MID_HTTP_RD_ERROR (-0x0805) //-2053, 读取错误
127#define OPRT_MID_HTTP_AD_HD_ERROR (-0x0806) //-2054, 添加头错误
128#define OPRT_MID_HTTP_GET_RESP_ERROR (-0x0807) //-2055, 获取应答错误
129#define OPRT_MID_HTTP_AES_INIT_ERR (-0x0808) //-2056, AES初始化错误
130#define OPRT_MID_HTTP_AES_OPEN_ERR (-0x0809) //-2057, AES打开错误
131#define OPRT_MID_HTTP_AES_SET_KEY_ERR (-0x080a) //-2058, AES设置KEY错误
132#define OPRT_MID_HTTP_AES_ENCRYPT_ERR (-0x080b) //-2059, AES加密错误
133#define OPRT_MID_HTTP_CR_HTTP_URL_H_ERR (-0x080c) //-2060, 创建HTTP URL头错误
134#define OPRT_MID_HTTP_HTTPS_HANDLE_FAIL (-0x080d) //-2061, HTTPS句柄错误
135#define OPRT_MID_HTTP_HTTPS_RESP_UNVALID (-0x080e) //-2062, HTTPS无效应答
136#define OPRT_MID_HTTP_NO_SUPPORT_RANGE (-0x080f) //-2063, 不支持断点续传
137#define OPRT_MID_HTTP_ERRCODE_MAX_CNT 16
138
139
140/****************************************************************************
141 the error code marco define for module MID_MQTT
142****************************************************************************/
143#define OPRT_MID_MQTT_DEF_ERR (-0x0900) //-2304, 定义失败
144#define OPRT_MID_MQTT_INVALID_PARM (-0x0901) //-2305, 参数无效
145#define OPRT_MID_MQTT_MALLOC_FAILED (-0x0902) //-2306, 内存申请失败
146#define OPRT_MID_MQTT_DNS_PARSED_FAILED (-0x0903) //-2307, DNS解析失败
147#define OPRT_MID_MQTT_SOCK_CREAT_FAILED (-0x0904) //-2308, socket创建失败
148#define OPRT_MID_MQTT_SOCK_SET_FAILED (-0x0905) //-2309, socket set失败
149#define OPRT_MID_MQTT_TCP_CONNECD_FAILED (-0x0906) //-2310, tcp连接失败
150#define OPRT_MID_MQTT_TCP_TLS_CONNECD_FAILED (-0x0907) //-2311, tcp tls连接失败
151#define OPRT_MID_MQTT_PACK_SEND_FAILED (-0x0908) //-2312, 包发送失败
152#define OPRT_MID_MQTT_RECV_DATA_FORMAT_WRONG (-0x0909) //-2313, 接收数据格式错误
153#define OPRT_MID_MQTT_MSGID_NOT_MATCH (-0x090a) //-2314, 接收数据msgid未找到
154#define OPRT_MID_MQTT_START_TM_MSG_ERR (-0x090b) //-2315, 开始事件msg错误
155#define OPRT_MID_MQTT_OVER_MAX_MESSAGE_LEN (-0x090c) //-2316, 超过消息最大长度
156#define OPRT_MID_MQTT_PING_SEND_ERR (-0x090d) //-2317, ping发送失败
157#define OPRT_MID_MQTT_PUBLISH_TIMEOUT (-0x090e) //-2318, 发布超时
158#define OPRT_MID_MQTT_ERRCODE_MAX_CNT 15
159
160
161/****************************************************************************
162 the error code marco define for module MID_TLS
163****************************************************************************/
164#define OPRT_MID_TLS_NET_SOCKET_ERROR (-0x0a00) //-2560, Failed to open a socket
165#define OPRT_MID_TLS_NET_CONNECT_ERROR (-0x0a01) //-2561, The connection to the given server / port failed.
166#define OPRT_MID_TLS_UNKNOWN_HOST_ERROR (-0x0a02) //-2562, Failed to get an IP address for the given hostname.
167#define OPRT_MID_TLS_CONNECTION_ERROR (-0x0a03) //-2563, TLS连接失败
168#define OPRT_MID_TLS_DRBG_ENTROPY_ERROR (-0x0a04) //-2564, mbedtls随机种子生成失败
169#define OPRT_MID_TLS_X509_ROOT_CRT_PARSE_ERROR (-0x0a05) //-2565, X509根证书解析失败
170#define OPRT_MID_TLS_X509_DEVICE_CRT_PARSE_ERROR (-0x0a06) //-2566, X509设备证书解析失败
171#define OPRT_MID_TLS_CTR_DRBG_ENTROPY_SOURCE_ERROR (-0x0a07) //-2567, The entropy source failed
172#define OPRT_MID_TLS_PK_PRIVATE_KEY_PARSE_ERROR (-0x0a08) //-2568, 秘钥解析失败
173#define OPRT_MID_TLS_ERRCODE_MAX_CNT 9
174
175
176/****************************************************************************
177 the error code marco define for module SVC_WIFI
178****************************************************************************/
179#define OPRT_SVC_WIFI_RECV_CONTINUE (-0x0b00) //-2816, 继续接收配网包
180#define OPRT_SVC_WIFI_DONOT_FOUND_MODULE (-0x0b01) //-2817, 模块未找到
181#define OPRT_SVC_WIFI_PEGASUS_DECODE_FAILED (-0x0b02) //-2818, 闪电包解析错误
182#define OPRT_SVC_WIFI_NEED_FACTORY_RESET (-0x0b03) //-2819, wifi初始化配置校验失败,需要恢复出厂设置
183#define OPRT_SVC_WIFI_ERRCODE_MAX_CNT 4
184
185
186/****************************************************************************
187 the error code marco define for module SVC_MF_TEST
188****************************************************************************/
189#define OPRT_SVC_MF_TEST_UPDATE_DATA_LEN_EXECED (-0x0d00) //-3328, 升级数据长度超过处理上限
190#define OPRT_SVC_MF_TEST_UPDATE_CRC_ERROR (-0x0d01) //-3329, 升级crc校验失败
191#define OPRT_SVC_MF_TEST_ERRCODE_MAX_CNT 2
192
193
194/****************************************************************************
195 the error code marco define for module SVC_DP
196****************************************************************************/
197#define OPRT_SVC_DP_ALREADY_PROCESS (-0x0e00) //-3584, DP已经处理
198#define OPRT_SVC_DP_ID_NOT_FOUND (-0x0e01) //-3585, DP ID没有发现
199#define OPRT_SVC_DP_TP_NOT_MATCH (-0x0e02) //-3586, DP 类型未匹配
200#define OPRT_SVC_DP_DEVICE_NOT_BINDED (-0x0e03) //-3587, 设备未绑定
201#define OPRT_SVC_DP_TYPE_PROP_ILLEGAL (-0x0e04) //-3588, 类型属性不合法
202#define OPRT_SVC_DP_NW_INVALID (-0x0e05) //-3589, 网络无效
203#define OPRT_SVC_DP_SECURITY_VERIFY_ERR (-0x0e06) //-3590, 安全校验失败
204#define OPRT_SVC_DP_REPORT_FINISH (-0x0e07) //-3591, DP上报已结束
205#define OPRT_SVC_DP_ERRCODE_MAX_CNT 8
206
207
208/****************************************************************************
209 the error code marco define for module BASE_EVENT
210****************************************************************************/
211#define OPRT_BASE_EVENT_INVALID_EVENT_NAME (-0x0f00) //-3840, 无效的事件名
212#define OPRT_BASE_EVENT_INVALID_EVENT_DESC (-0x0f01) //-3841, 无效的事件描述
213#define OPRT_BASE_EVENT_ERRCODE_MAX_CNT 2
214
215
216/****************************************************************************
217 the error code marco define for module SVC_TIMER_TASK
218****************************************************************************/
219#define OPRT_SVC_TIMER_TASK_LOAD_INVALID_CJSON (-0x1000) //-4096, K/V中保存的数据JSON格式错误
220#define OPRT_SVC_TIMER_TASK_LOAD_INVALID_DATA (-0x1001) //-4097, K/V中保存的数据缺少cnt字段
221#define OPRT_SVC_TIMER_TASK_UPDATE_LAST_FETCH_INVALID (-0x1002) //-4098, 云端返回的数据缺少lastFetchTime字段
222#define OPRT_SVC_TIMER_TASK_UPDATE_TIMER_CNT_INVALID (-0x1003) //-4099, 云端返回的数据缺少count字段
223#define OPRT_SVC_TIMER_TASK_UPDATE_TIMER_CNT_EXCEED (-0x1004) //-4100, 云端返回的定时任务数量超过30个
224#define OPRT_SVC_TIMER_TASK_ERRCODE_MAX_CNT 5
225
226
227/****************************************************************************
228 the error code marco define for module SVC_HTTP
229****************************************************************************/
230#define OPRT_SVC_HTTP_NOT_ENCRYPT_RET (-0x1100) //-4352, 结果未加密
231#define OPRT_SVC_HTTP_FILL_URL_H_ERR (-0x1101) //-4353, 构造header错误
232#define OPRT_SVC_HTTP_FILL_URL_FULL_ERR (-0x1102) //-4354, 构造整个URL错误
233#define OPRT_SVC_HTTP_FILL_DATA_ERR (-0x1103) //-4355, 构造data错误
234#define OPRT_SVC_HTTP_URL_CFG_AI_SPEAKER_ERR (-0x1104) //-4356, 音响配置失败
235#define OPRT_SVC_HTTP_URL_CFG_URL_ERR (-0x1105) //-4357, httpUrl/mqttUrl字段缺失
236#define OPRT_SVC_HTTP_URL_CFG_URL2IP_ERR (-0x1106) //-4358, httpUrl/mqttUrl解析错误
237#define OPRT_SVC_HTTP_URL_CFG_URL2IP_SELF_ERR (-0x1107) //-4359, httpsSelfUrl/mqttsSelfUrl解析错误
238#define OPRT_SVC_HTTP_URL_CFG_URL2IP_VERIFY_ERR (-0x1108) //-4360, httpsVerifyUrl/mqttsVerifyUrl解析错误
239#define OPRT_SVC_HTTP_URL_CFG_URL2IP_PSK_ERR (-0x1109) //-4361, httpsPSKUrl/mqttsPSKUrl解析错误
240#define OPRT_SVC_HTTP_RECV_ERR (-0x110a) //-4362, 接收数据错误
241#define OPRT_SVC_HTTP_RECV_DA_NOT_ENOUGH (-0x110b) //-4363, 接收数据不足
242#define OPRT_SVC_HTTP_API_VERIFY_FAILED (-0x110c) //-4364, 数据校验错误
243#define OPRT_SVC_HTTP_GW_NOT_EXIST (-0x110d) //-4365, 网关信息不存在
244#define OPRT_SVC_HTTP_API_TOKEN_EXPIRE (-0x110e) //-4366, TOKEN过期
245#define OPRT_SVC_HTTP_DEV_RESET_FACTORY (-0x110f) //-4367, 设备需要恢复出厂
246#define OPRT_SVC_HTTP_DEV_NEED_REGISTER (-0x1110) //-4368, 设备未注册
247#define OPRT_SVC_HTTP_ORDER_EXPIRE (-0x1111) //-4369, 订单已过期
248#define OPRT_SVC_HTTP_NOT_EXISTS (-0x1112) //-4370, 不存在
249#define OPRT_SVC_HTTP_SIGNATURE_ERROR (-0x1113) //-4371, 签名错误
250#define OPRT_SVC_HTTP_API_VERSION_WRONG (-0x1114) //-4372, API版本错误
251#define OPRT_SVC_HTTP_DEVICE_REMOVED (-0x1115) //-4373, 设备已移除
252#define OPRT_SVC_HTTP_DEV_ALREADY_BIND (-0x1116) //-4374, 设备已经绑定
253#define OPRT_SVC_HTTP_REMOTE_API_RUN_UNKNOW_FAILED (-0x1117) //-4375, 无法识别API
254#define OPRT_SVC_HTTP_FORMAT_STRING_FAILED (-0x1118) //-4376, 字符串格式化错误
255#define OPRT_SVC_HTTP_API_DECODE_FAILED (-0x1119) //-4377, 数据解密失败
256#define OPRT_SVC_HTTP_SERV_VRFY_FAIL (-0x111a) //-4378, 服务端校验失败
257#define OPRT_SVC_HTTP_DEVICE_IS_SUB_NODE_OR_IN_ELECTION (-0x111b) //-4379, 动态mesh设备云端处于选举中
258#define OPRT_SVC_HTTP_ERRCODE_MAX_CNT 28
259
260
261/****************************************************************************
262 the error code marco define for module SVC_LAN
263****************************************************************************/
264#define OPRT_SVC_LAN_SOCKET_FAULT (-0x1500) //-5376, socket错误
265#define OPRT_SVC_LAN_SEND_ERR (-0x1501) //-5377, socket发送错误
266#define OPRT_SVC_LAN_NO_CLIENT_CONNECTED (-0x1502) //-5378, 没有可以上报的局域网设备连接
267#define OPRT_SVC_LAN_ERRCODE_MAX_CNT 3
268
269
270/****************************************************************************
271 the error code marco define for module SVC_LAN_LINKAGE
272****************************************************************************/
273#define OPRT_SVC_LAN_LINKAGE_SOCK_CREAT_ERR (-0x1600) //-5632, socket创建失败
274#define OPRT_SVC_LAN_LINKAGE_SET_SOCK_ERR (-0x1601) //-5633, socket set失败
275#define OPRT_SVC_LAN_LINKAGE_SOCK_CONN_ERR (-0x1602) //-5634, socket连接失败
276#define OPRT_SVC_LAN_LINKAGE_SEND_ERR (-0x1603) //-5635, 发送失败
277#define OPRT_SVC_LAN_LINKAGE_RECV_ERR (-0x1604) //-5636, 接收失败
278#define OPRT_SVC_LAN_LINKAGE_ERRCODE_MAX_CNT 5
279
280
281/****************************************************************************
282 the error code marco define for module SVC_MQTT
283****************************************************************************/
284#define OPRT_SVC_MQTT_CMD_NOT_EXEC (-0x1700) //-5888, 命令未执行
285#define OPRT_SVC_MQTT_CMD_OUT_OF_TIME (-0x1701) //-5889, 命令未在规定时间内执行
286#define OPRT_SVC_MQTT_GW_MQ_OFFLILNE (-0x1702) //-5890, MQTT离线
287#define OPRT_SVC_MQTT_ERRCODE_MAX_CNT 3
288
289
290/****************************************************************************
291 the error code marco define for module SVC_PEGASUS
292****************************************************************************/
293#define OPRT_SVC_PEGASUS_DECODE_FAILED (-0x1800) //-6144, 解码失败
294#define OPRT_SVC_PEGASUS_DONOT_FOUND_MODULE (-0x1801) //-6145, 模块未找到
295#define OPRT_SVC_PEGASUS_ERRCODE_MAX_CNT 2
296
297
298/****************************************************************************
299 the error code marco define for module SVC_UPGRADE
300****************************************************************************/
301#define OPRT_SVC_UPGRADE_APP_NOT_READY (-0x1900) //-6400, 应用尚未就绪
302#define OPRT_SVC_UPGRADE_NO_VALID_FIRMWARE (-0x1901) //-6401, 升级信息字段校验失败
303#define OPRT_SVC_UPGRADE_LAN_OTA_FINISH (-0x1902) //-6402, 局域网ota完成
304#define OPRT_SVC_UPGRADE_ERRCODE_MAX_CNT 3
305
306
307/****************************************************************************
308 the error code marco define for module SVC_API_IOT
309****************************************************************************/
310#define OPRT_SVC_API_IOT_DISCONNECTED_WITH_ROUTER (-0x1a00) //-6656, 路由器断开
311#define OPRT_SVC_API_IOT_DEV_NOT_BIND (-0x1a01) //-6657, 设备未绑定
312#define OPRT_SVC_API_IOT_ERRCODE_MAX_CNT 2
313
314
315/****************************************************************************
316 the error code marco define for module SVC_CELLULAR
317****************************************************************************/
318#define OPRT_SVC_CELLULAR_CALL_FAILED (-0x1b00) //-6912, 发起呼叫失败
319#define OPRT_SVC_CELLULAR_CALL_VOICE_START_ERR (-0x1b01) //-6913, 开启呼叫语音失败
320#define OPRT_SVC_CELLULAR_CALL_ANSWER_ERR (-0x1b02) //-6914, 呼叫应答失败
321#define OPRT_SVC_CELLULAR_CALL_GET_INFO_ERR (-0x1b03) //-6915, 获取呼叫信息失败
322#define OPRT_SVC_CELLULAR_CALL_HUNGUP_ERR (-0x1b04) //-6916, 呼叫挂机失败
323#define OPRT_SVC_CELLULAR_SMS_SEND_ERR (-0x1b05) //-6917, 短信发送失败
324#define OPRT_SVC_CELLULAR_SMS_SEND_TIMEOUT (-0x1b06) //-6918, 短信发送超时
325#define OPRT_SVC_CELLULAR_SMS_ENCODE_ERR (-0x1b07) //-6919, 短信编码错误
326#define OPRT_SVC_CELLULAR_SMS_SIZE_ERR (-0x1b08) //-6920, 短信超长
327#define OPRT_SVC_CELLULAR_ERRCODE_MAX_CNT 9
328
329
330/****************************************************************************
331 the error code marco define for module SVC_DEVOS
332****************************************************************************/
333#define OPRT_SVC_DEVOS_NOT_EXISTS (-0x1c00) //-7168, 不存在
334#define OPRT_SVC_DEVOS_SCMA_INVALID (-0x1c01) //-7169, SCMA无效
335#define OPRT_SVC_DEVOS_DEV_DP_CNT_INVALID (-0x1c02) //-7170, 设备DP数量无效
336#define OPRT_SVC_DEVOS_NO_AUTHENTICATION (-0x1c03) //-7171, 无授权
337#define OPRT_SVC_DEVOS_ROUTER_NOT_FIND (-0x1c04) //-7172, 路由器未找到
338#define OPRT_SVC_DEVOS_ERRCODE_MAX_CNT 5
339
340
341/****************************************************************************
342 the error code marco define for module BASE_DB
343****************************************************************************/
344#define OPRT_BASE_DB_FLASH_NOT_ENOUGH_PAGE (-0x1d00) //-7424, flash页不够
345#define OPRT_BASE_DB_ERRCODE_MAX_CNT 1
346
347
348/****************************************************************************
349 the error code marco define for module LINK_CORE
350****************************************************************************/
351#define OPRT_LINK_CORE_NET_SOCKET_ERROR (-0x1e00) //-7680, Failed to open a socket
352#define OPRT_LINK_CORE_NET_CONNECT_ERROR (-0x1e01) //-7681, The connection to the given server / port failed.
353#define OPRT_LINK_CORE_UNKNOWN_HOST_ERROR (-0x1e02) //-7682, Failed to get an IP address for the given hostname.
354#define OPRT_LINK_CORE_TLS_CONNECTION_ERROR (-0x1e03) //-7683, TLS连接失败
355#define OPRT_LINK_CORE_DRBG_ENTROPY_ERROR (-0x1e04) //-7684, mbedtls随机种子生成失败
356#define OPRT_LINK_CORE_X509_ROOT_CRT_PARSE_ERROR (-0x1e05) //-7685, X509根证书解析失败
357#define OPRT_LINK_CORE_X509_DEVICE_CRT_PARSE_ERROR (-0x1e06) //-7686, X509设备证书解析失败
358#define OPRT_LINK_CORE_PK_PRIVATE_KEY_PARSE_ERROR (-0x1e07) //-7687, 秘钥解析失败
359#define OPRT_LINK_CORE_HTTP_CLIENT_HEADER_ERROR (-0x1e08) //-7688, HTTP头初始化失败
360#define OPRT_LINK_CORE_HTTP_CLIENT_SEND_ERROR (-0x1e09) //-7689, HTTP请求发送失败
361#define OPRT_LINK_CORE_HTTP_RESPONSE_BUFFER_EMPTY (-0x1e0a) //-7690, HTTPb buffer为空
362#define OPRT_LINK_CORE_HTTP_GW_NOT_EXIST (-0x1e0b) //-7691, 网关不存在,可能设备已被删除
363#define OPRT_LINK_CORE_ERRCODE_MAX_CNT 12
364
365
366/****************************************************************************
367 the error code marco define for module SVC_BT
368****************************************************************************/
369#define OPRT_SVC_BT_API_TRSMITR_CONTINUE (-0x1f00) //-7936, 传输未结束
370#define OPRT_SVC_BT_API_TRSMITR_ERROR (-0x1f01) //-7937, 传输错误
371#define OPRT_SVC_BT_NETCFG_ERROR_ACK (-0x1f02) //-7938, bt命令出错,给app发送ack
372#define OPRT_SVC_BT_ERRCODE_MAX_CNT 3
373
374
375/****************************************************************************
376 the error code marco define for module SVC_NETMGR
377****************************************************************************/
378#define OPRT_SVC_NETMGR_NEED_FACTORY_RESET (-0x2000) //-8192, 网络初始化配置校验失败,需要恢复出厂设置
379#define OPRT_SVC_NETMGR_ERRCODE_MAX_CNT 1
380
381
382/****************************************************************************
383 the error code marco define for module GW_BT_DEV
384****************************************************************************/
385#define OPRT_GW_BT_DEV_BLE_CONNECT_SUCCESS (-0x3100) //-12544, ble设备连接成功
386#define OPRT_GW_BT_DEV_BLE_CONNECT_CNT_EXCEED (-0x3101) //-12545, ble设备连接数量已超出最大限制
387#define OPRT_GW_BT_DEV_BLE_CONNECT_HAL_FAILED (-0x3102) //-12546, ble设备连接HAL层接口返回失败
388#define OPRT_GW_BT_DEV_BLE_CONNECT_HANDS_FAILED (-0x3103) //-12547, ble设备连接握手失败
389#define OPRT_GW_BT_DEV_BLE_CONNECT_HANDS_TIMEOUT (-0x3104) //-12548, ble设备连接握手超时
390#define OPRT_GW_BT_DEV_BLE_CONNECT_GET_INFO_FAILED (-0x3105) //-12549, ble设备连接get_info失败
391#define OPRT_GW_BT_DEV_BLE_CONNECT_GET_LOGIN_KEY_FAILED (-0x3106) //-12550, ble设备连接get_login_key失败
392#define OPRT_GW_BT_DEV_BLE_CONNECT_PAIR_DATA_LEN_ERR (-0x3107) //-12551, ble设备连接pair_data_len_err失败
393#define OPRT_GW_BT_DEV_BLE_CONNECT_SESSION_OPEN_TIMEOUT (-0x3108) //-12552, ble设备连接session_open超时
394#define OPRT_GW_BT_DEV_BLE_CONNECT_SEND_FAILED (-0x3109) //-12553, ble设备连接数据发送失败
395#define OPRT_GW_BT_DEV_BLE_LOCAL_RESET (-0x310a) //-12554, ble设备本地重置
396#define OPRT_GW_BT_DEV_BLE_SCAN_TIMEOUT (-0x310b) //-12555, ble设备广播包扫描超时
397#define OPRT_GW_BT_DEV_BLE_DISCONNECT_SUCCESS (-0x310c) //-12556, ble设备断开成功
398#define OPRT_GW_BT_DEV_BEACON_DEV_NOT_FOUND (-0x310d) //-12557, 设备没有发现
399#define OPRT_GW_BT_DEV_BEACON_DEV_KEY1_NOT_FOUND (-0x310e) //-12558, 设备KEY1没有发现,通信数据加密的key
400#define OPRT_GW_BT_DEV_BEACON_DEV_NOT_BIND (-0x310f) //-12559, 设备未绑定
401#define OPRT_GW_BT_DEV_BEACON_DECODE_PAIR_MSG_FAILED (-0x3110) //-12560, 设备配网时,网关请求云端解密配网信息失败
402#define OPRT_GW_BT_DEV_BEACON_KEY_RESP_TIMEOUT (-0x3111) //-12561, 设备配网时,设备beaconkey应答超时
403#define OPRT_GW_BT_DEV_BEACON_JOIN_NOTIFY_RESP_TIMEOUT (-0x3112) //-12562, 设备配网时,设备入网通知应答超时
404#define OPRT_GW_BT_DEV_ERRCODE_MAX_CNT 19
405
406
407/****************************************************************************
408 the error code marco define for module GW_ZG_DEV
409****************************************************************************/
410#define OPRT_GW_ZG_DEV_ZB_HOST_TABLE_NULL (-0x3200) //-12800, 设备未存在host表,将被移除
411#define OPRT_GW_ZG_DEV_ZB_SEQ_INVALID (-0x3201) //-12801, ZCL seq无效
412#define OPRT_GW_ZG_DEV_ZB_HOST_TO_GATEWAY_ERR (-0x3202) //-12802, 从host端发送数据到gateway组件出错
413#define OPRT_GW_ZG_DEV_ZB_DATA_TOO_BIG (-0x3203) //-12803, zigbee的数据长度太大被丢弃
414#define OPRT_GW_ZG_DEV_ZB_GW_TABLE_NULL (-0x3204) //-12804, 网关设备表未初始化
415#define OPRT_GW_ZG_DEV_ZB_GW_RELIABLE_ERR (-0x3205) //-12805, 可靠上报失败
416#define OPRT_GW_ZG_DEV_ZB_GW_TRD_DEV_ERR (-0x3206) //-12806, 三级设备上报数据失败
417#define OPRT_GW_ZG_DEV_ZB_GATEWAY_DEV_ID_ERR (-0x3207) //-12807, 数据下发设备id不存在
418#define OPRT_GW_ZG_DEV_ZB_GATEWAY_UPDATE_SCE_LIST_ERR (-0x3208) //-12808, 数据下发场景列表不存在
419#define OPRT_GW_ZG_DEV_ZB_GATEWAY_MALLOC_ERR (-0x3209) //-12809, GATEWAY层申请内存失败
420#define OPRT_GW_ZG_DEV_ZB_GATEWAY_DATA_TYPE_ERR (-0x320a) //-12810, 数据下发DP数据类型错误
421#define OPRT_GW_ZG_DEV_ZB_GATEWAY_TRD_DEV_DW_ERR (-0x320b) //-12811, 三级设备数据下发失败
422#define OPRT_GW_ZG_DEV_ZB_GATEWAY_COM_DATALEN_ERR (-0x320c) //-12812, 通用对接数据长度错误
423#define OPRT_GW_ZG_DEV_ZB_GATEWAY_SEND_DATA_FAILED (-0x320d) //-12813, GATEWAY层向HOST层发送数据失败
424#define OPRT_GW_ZG_DEV_ZB_GATEWAY_NCRYPT_DATA_FAILED (-0x320e) //-12814, 数据加密失败
425#define OPRT_GW_ZG_DEV_ZB_GATWAY_STDRELIABLE_DW_FAILED (-0x320f) //-12815, 标准透传命令发送失败
426#define OPRT_GW_ZG_DEV_ZB_GATWAY_CMD_TYPE_NOT_SUPPORT (-0x3210) //-12816, 下发命令类型不支持
427#define OPRT_GW_ZG_DEV_ZB_HOST_RCV_SLABSCMD_MSG_LEN_ERR (-0x3211) //-12817, 下发数据包长度错误
428#define OPRT_GW_ZG_DEV_ZB_HSOT_DEV_REJOIN (-0x3212) //-12818, rejoin过程中
429#define OPRT_GW_ZG_DEV_ZB_HOST_CMD_TYPE_NOT_SUPPORT (-0x3213) //-12819, host命令类型不支持
430#define OPRT_GW_ZG_DEV_ZB_HOST_SEND_DATA_FAILED (-0x3214) //-12820, host底层发送数据失败
431#define OPRT_GW_ZG_DEV_ZB_GATEWAY_DEV_BIND_ERR (-0x3215) //-12821, 绑定出错
432#define OPRT_GW_ZG_DEV_ZB_GATEWAY_SET_HB_STAT_FAILED (-0x3216) //-12822, GATEWAY层设置子设备心跳状态失败
433#define OPRT_GW_ZG_DEV_ZB_GATEWAY_JOIN_STAT_FALSE (-0x3217) //-12823, 网关未开启配网
434#define OPRT_GW_ZG_DEV_ZB_GATEWAY_STAND_JOIN_ERR (-0x3218) //-12824, 标准入网失败
435#define OPRT_GW_ZG_DEV_ZB_GATEWAY_DEV_NOT_SUPPORT (-0x3219) //-12825, 子设备不支持
436#define OPRT_GW_ZG_DEV_ZB_HOST_RCV_JOIN_MSG_ERR (-0x321a) //-12826, zigbeehost层接收MSG长度异常
437#define OPRT_GW_ZG_DEV_ZB_GATEWAY_TRD_DEVID_ERR (-0x321b) //-12827, 三级设备的设备ID错误
438#define OPRT_GW_ZG_DEV_ZB_GATEWAY_THR_DEV_TPE_ERR (-0x321c) //-12828, 三级设备的设备类型错误
439#define OPRT_GW_ZG_DEV_ZB_GATEWAY_RS_PROFILE_NOT_SUPPORT (-0x321d) //-12829, 接受PROFILE不支持
440#define OPRT_GW_ZG_DEV_ZB_SUBDEV_LEAVE_SELF (-0x321e) //-12830, 子设备主动离网
441#define OPRT_GW_ZG_DEV_ERRCODE_MAX_CNT 31
442
443
444/****************************************************************************
445 the error code marco define for module GW_BASE_LINKAGE
446****************************************************************************/
447#define OPRT_GW_BASE_LINKAGE_INIT_FAIL (-0x3300) //-13056, 联动模块初始化失败
448#define OPRT_GW_BASE_LINKAGE_COND_CHECK_FAIL (-0x3301) //-13057, 联动条件不满足
449#define OPRT_GW_BASE_LINKAGE_RULE_ID_NOT_FIND (-0x3302) //-13058, 联动规则ID不存在
450#define OPRT_GW_BASE_LINKAGE_RULE_ID_DISABLE (-0x3303) //-13059, 联动规则未启用
451#define OPRT_GW_BASE_LINKAGE_RULE_IS_UPDATED (-0x3304) //-13060, 联动规需更新
452#define OPRT_GW_BASE_LINKAGE_FLOW_CNTL (-0x3305) //-13061, 联动流控
453#define OPRT_GW_BASE_LINKAGE_THREAD_CREATE_FAIL (-0x3306) //-13062, 联动线程创建失败
454#define OPRT_GW_BASE_LINKAGE_COND_CHECK_NO_ID_MATCH (-0x3307) //-13063, 联动条件不满足(设备ID无匹配项)
455#define OPRT_GW_BASE_LINKAGE_COND_CHECK_NO_DP_MATCH (-0x3308) //-13064, 联动条件不满足(条件DP无匹配项)
456#define OPRT_GW_BASE_LINKAGE_ERRCODE_MAX_CNT 9
457
458
459/****************************************************************************
460 the error code marco define for module GW_ZG_SUB
461****************************************************************************/
462#define OPRT_GW_ZG_SUB_ERR0 (-0x3400) //-13312, 错误0
463#define OPRT_GW_ZG_SUB_ERR1 (-0x3401) //-13313, 错误1
464#define OPRT_GW_ZG_SUB_ERR2 (-0x3402) //-13314, 错误2:FIB重启
465#define OPRT_GW_ZG_SUB_ERR3 (-0x3403) //-13315, 错误3:升级重启
466#define OPRT_GW_ZG_SUB_ERR4 (-0x3404) //-13316, 错误4:外部IO异常重启
467#define OPRT_GW_ZG_SUB_ERR5 (-0x3405) //-13317, 错误5:低电压重启
468#define OPRT_GW_ZG_SUB_ERR6 (-0x3406) //-13318, 错误6:看门狗重启
469#define OPRT_GW_ZG_SUB_ERR7 (-0x3407) //-13319, 错误7:软件主动重启
470#define OPRT_GW_ZG_SUB_ERR8 (-0x3408) //-13320, 错误8:软件crash重启
471#define OPRT_GW_ZG_SUB_ERR9 (-0x3409) //-13321, 错误9:Flash异常重启
472#define OPRT_GW_ZG_SUB_ERR10 (-0x340a) //-13322, 错误10:不可恢复硬件异常重启
473#define OPRT_GW_ZG_SUB_ERR11 (-0x340b) //-13323, 错误11:硬件内部CPU访问错误
474#define OPRT_GW_ZG_SUB_ERR12 (-0x340c) //-13324, 错误12:掉电重启
475#define OPRT_GW_ZG_SUB_ERR13 (-0x340d) //-13325, 错误13
476#define OPRT_GW_ZG_SUB_ERR14 (-0x340e) //-13326, 错误14
477#define OPRT_GW_ZG_SUB_ERR15 (-0x340f) //-13327, 错误15
478#define OPRT_GW_ZG_SUB_ERR16 (-0x3410) //-13328, 错误16:重启
479#define OPRT_GW_ZG_SUB_ERR17 (-0x3411) //-13329, 错误17:失联
480#define OPRT_GW_ZG_SUB_ERR18 (-0x3412) //-13330, 错误18:主动离网
481#define OPRT_GW_ZG_SUB_ERR19 (-0x3413) //-13331, 错误19:被动离网
482#define OPRT_GW_ZG_SUB_ERR20 (-0x3414) //-13332, 错误20:IO异常
483#define OPRT_GW_ZG_SUB_ERR21 (-0x3415) //-13333, 错误21:内存泄漏
484#define OPRT_GW_ZG_SUB_ERR22 (-0x3416) //-13334, 错误22:短地址改变
485#define OPRT_GW_ZG_SUB_ERR23 (-0x3417) //-13335, 错误23:收到恢复出厂设置
486#define OPRT_GW_ZG_SUB_ERR24 (-0x3418) //-13336, 错误24:收到F0命令
487#define OPRT_GW_ZG_SUB_ERR25 (-0x3419) //-13337, 错误25:唤醒时间过长
488#define OPRT_GW_ZG_SUB_ERR26 (-0x341a) //-13338, 错误26:收到异常恢复出厂设置
489#define OPRT_GW_ZG_SUB_ERRCODE_MAX_CNT 27
490
491
492/****************************************************************************
493 the error code marco define for module OS_ADAPTER_MUTEX
494****************************************************************************/
495#define OPRT_OS_ADAPTER_MUTEX_CREAT_FAILED (-0x6500) //-25856, 创建失败
496#define OPRT_OS_ADAPTER_MUTEX_LOCK_FAILED (-0x6501) //-25857, lock失败
497#define OPRT_OS_ADAPTER_MUTEX_UNLOCK_FAILED (-0x6502) //-25858, unlock失败
498#define OPRT_OS_ADAPTER_MUTEX_RELEASE_FAILED (-0x6503) //-25859, 释放失败
499#define OPRT_OS_ADAPTER_MUTEX_ERRCODE_MAX_CNT 4
500
501
502/****************************************************************************
503 the error code marco define for module OS_ADAPTER_SEM
504****************************************************************************/
505#define OPRT_OS_ADAPTER_SEM_CREAT_FAILED (-0x6600) //-26112, 创建失败
506#define OPRT_OS_ADAPTER_SEM_WAIT_FAILED (-0x6601) //-26113, wait失败
507#define OPRT_OS_ADAPTER_SEM_POST_FAILED (-0x6602) //-26114, post失败
508#define OPRT_OS_ADAPTER_SEM_RELEASE_FAILED (-0x6603) //-26115, 释放失败
509#define OPRT_OS_ADAPTER_SEM_ERRCODE_MAX_CNT 4
510
511
512/****************************************************************************
513 the error code marco define for module OS_ADAPTER_QUEUE
514****************************************************************************/
515#define OPRT_OS_ADAPTER_QUEUE_CREAT_FAILED (-0x6700) //-26368, 创建失败
516#define OPRT_OS_ADAPTER_QUEUE_SEND_FAIL (-0x6701) //-26369, send失败
517#define OPRT_OS_ADAPTER_QUEUE_RECV_FAIL (-0x6702) //-26370, recv失败
518#define OPRT_OS_ADAPTER_QUEUE_ERRCODE_MAX_CNT 3
519
520
521/****************************************************************************
522 the error code marco define for module OS_ADAPTER_THRD
523****************************************************************************/
524#define OPRT_OS_ADAPTER_THRD_CREAT_FAILED (-0x6800) //-26624, 创建失败
525#define OPRT_OS_ADAPTER_THRD_RELEASE_FAILED (-0x6801) //-26625, 释放失败
526#define OPRT_OS_ADAPTER_THRD_JUDGE_SELF_FAILED (-0x6802) //-26626, 判断是否self失败
527#define OPRT_OS_ADAPTER_THRD_ERRCODE_MAX_CNT 3
528
529
530/****************************************************************************
531 the error code marco define for module OS_ADAPTER
532****************************************************************************/
533#define OPRT_OS_ADAPTER_COM_ERROR (-0x6900) //-26880, 通用异常
534#define OPRT_OS_ADAPTER_INVALID_PARM (-0x6901) //-26881, 参数非法
535#define OPRT_OS_ADAPTER_MALLOC_FAILED (-0x6902) //-26882, 内存分配失败
536#define OPRT_OS_ADAPTER_NOT_SUPPORTED (-0x6903) //-26883, 不支持操作
537#define OPRT_OS_ADAPTER_NETWORK_ERROR (-0x6904) //-26884, 网络错误
538#define OPRT_OS_ADAPTER_AP_NOT_FOUND (-0x6905) //-26885, AP没有找到
539#define OPRT_OS_ADAPTER_AP_SCAN_FAILED (-0x6906) //-26886, AP扫描失败
540#define OPRT_OS_ADAPTER_AP_RELEASE_FAILED (-0x6907) //-26887, AP释放失败
541#define OPRT_OS_ADAPTER_CHAN_SET_FAILED (-0x6908) //-26888, 信道设置失败
542#define OPRT_OS_ADAPTER_CHAN_GET_FAILED (-0x6909) //-26889, 信道获取失败
543#define OPRT_OS_ADAPTER_IP_GET_FAILED (-0x690a) //-26890, IP获取失败
544#define OPRT_OS_ADAPTER_MAC_SET_FAILED (-0x690b) //-26891, MAC设置失败
545#define OPRT_OS_ADAPTER_MAC_GET_FAILED (-0x690c) //-26892, MAC获取失败
546#define OPRT_OS_ADAPTER_WORKMODE_SET_FAILED (-0x690d) //-26893, 工作模式设置失败
547#define OPRT_OS_ADAPTER_WORKMODE_GET_FAILED (-0x690e) //-26894, 工作模式获取失败
548#define OPRT_OS_ADAPTER_SNIFFER_SET_FAILED (-0x690f) //-26895, SNIFFER设置失败
549#define OPRT_OS_ADAPTER_AP_START_FAILED (-0x6910) //-26896, AP启动失败
550#define OPRT_OS_ADAPTER_AP_STOP_FAILED (-0x6911) //-26897, AP停止失败
551#define OPRT_OS_ADAPTER_APINFO_GET_FAILED (-0x6912) //-26898, AP信息获取失败
552#define OPRT_OS_ADAPTER_FAST_CONN_FAILED (-0x6913) //-26899, 快连失败
553#define OPRT_OS_ADAPTER_CONN_FAILED (-0x6914) //-26900, 连接失败
554#define OPRT_OS_ADAPTER_DISCONN_FAILED (-0x6915) //-26901, 断开失败
555#define OPRT_OS_ADAPTER_RSSI_GET_FAILED (-0x6916) //-26902, RSSI获取失败
556#define OPRT_OS_ADAPTER_BSSID_GET_FAILED (-0x6917) //-26903, BSSID获取失败
557#define OPRT_OS_ADAPTER_STAT_GET_FAILED (-0x6918) //-26904, 状态获取失败
558#define OPRT_OS_ADAPTER_CCODE_SET_FAILE (-0x6919) //-26905, CCODE设置失败
559#define OPRT_OS_ADAPTER_MGNT_SEND_FAILED (-0x691a) //-26906, 管理包发送失败
560#define OPRT_OS_ADAPTER_MGNT_REG_FAILED (-0x691b) //-26907, 管理包回调注册失败
561#define OPRT_OS_ADAPTER_WF_LPMODE_SET_FAILED (-0x691c) //-26908, Fi低功耗设置失败
562#define OPRT_OS_ADAPTER_CPU_LPMODE_SET_FAILED (-0x691d) //-26909, CPU低功耗模式设置失败
563#define OPRT_OS_ADAPTER_ERRCODE_MAX_CNT 30
564
565
566/****************************************************************************
567 the error code marco define for module OS_ADAPTER_FLASH
568****************************************************************************/
569#define OPRT_OS_ADAPTER_FLASH_READ_FAILED (-0x6a00) //-27136, 读取flash失败
570#define OPRT_OS_ADAPTER_FLASH_WRITE_FAILED (-0x6a01) //-27137, 写入flash失败
571#define OPRT_OS_ADAPTER_FLASH_ERASE_FAILED (-0x6a02) //-27138, 擦除flash失败
572#define OPRT_OS_ADAPTER_FLASH_ERRCODE_MAX_CNT 3
573
574
575/****************************************************************************
576 the error code marco define for module OS_ADAPTER_OTA
577****************************************************************************/
578#define OPRT_OS_ADAPTER_OTA_START_INFORM_FAILED (-0x6b00) //-27392, 升级启动通知失败
579#define OPRT_OS_ADAPTER_OTA_PKT_SIZE_FAILED (-0x6b01) //-27393, 升级包尺寸非法
580#define OPRT_OS_ADAPTER_OTA_PROCESS_FAILED (-0x6b02) //-27394, 升级包下载写入失败
581#define OPRT_OS_ADAPTER_OTA_VERIFY_FAILED (-0x6b03) //-27395, 升级包校验失败
582#define OPRT_OS_ADAPTER_OTA_END_INFORM_FAILED (-0x6b04) //-27396, 升级结束通知失败
583#define OPRT_OS_ADAPTER_OTA_ERRCODE_MAX_CNT 5
584
585
586/****************************************************************************
587 the error code marco define for module OS_ADAPTER_WD
588****************************************************************************/
589#define OPRT_OS_ADAPTER_WD_WD_INIT_FAILED (-0x6c00) //-27648, watch dog初始化失败
590#define OPRT_OS_ADAPTER_WD_ERRCODE_MAX_CNT 1
591
592
593/****************************************************************************
594 the error code marco define for module OS_ADAPTER_GPIO
595****************************************************************************/
596#define OPRT_OS_ADAPTER_GPIO_INOUT_SET_FAILED (-0x6d00) //-27904, GPIO INOUT设置失败
597#define OPRT_OS_ADAPTER_GPIO_MODE_SET_FAILED (-0x6d01) //-27905, GPIO 模式设置失败
598#define OPRT_OS_ADAPTER_GPIO_WRITE_FAILED (-0x6d02) //-27906, GPIO 写入失败
599#define OPRT_OS_ADAPTER_GPIO_IRQ_INIT_FAILED (-0x6d03) //-27907, GPIO 中断初始化失败
600#define OPRT_OS_ADAPTER_GPIO_ERRCODE_MAX_CNT 4
601
602
603/****************************************************************************
604 the error code marco define for module OS_ADAPTER_UART
605****************************************************************************/
606#define OPRT_OS_ADAPTER_UART_INIT_FAILED (-0x6e00) //-28160, UART初始化失败
607#define OPRT_OS_ADAPTER_UART_DEINIT_FAILED (-0x6e01) //-28161, UART释放失败
608#define OPRT_OS_ADAPTER_UART_SEND_FAILED (-0x6e02) //-28162, UART发送失败
609#define OPRT_OS_ADAPTER_UART_READ_FAILED (-0x6e03) //-28163, UART接收失败
610#define OPRT_OS_ADAPTER_UART_ERRCODE_MAX_CNT 4
611
612
613/****************************************************************************
614 the error code marco define for module OS_ADAPTER_I2C
615****************************************************************************/
616#define OPRT_OS_ADAPTER_I2C_OPEN_FAILED (-0x6f00) //-28416, I2C 打开失败
617#define OPRT_OS_ADAPTER_I2C_CLOSE_FAILED (-0x6f01) //-28417, I2C 关闭失败
618#define OPRT_OS_ADAPTER_I2C_READ_FAILED (-0x6f02) //-28418, I2C 读取失败
619#define OPRT_OS_ADAPTER_I2C_WRITE_FAILED (-0x6f03) //-28419, I2C 写入失败
620#define OPRT_OS_ADAPTER_I2C_INVALID_PARM (-0x6f04) //-28420, 参数无效
621#define OPRT_OS_ADAPTER_I2C_INIT_FAILED (-0x6f05) //-28421, 初始化失败
622#define OPRT_OS_ADAPTER_I2C_DEINIT_FAILED (-0x6f06) //-28422, 释放失败
623#define OPRT_OS_ADAPTER_I2C_MODE_ERR (-0x6f07) //-28423, 模式错误
624#define OPRT_OS_ADAPTER_I2C_BUSY (-0x6f08) //-28424, 忙
625#define OPRT_OS_ADAPTER_I2C_TIMEOUT (-0x6f09) //-28425, 超时
626#define OPRT_OS_ADAPTER_I2C_MASTER_LOST_ARB (-0x6f0a) //-28426, 主机仲裁失败
627#define OPRT_OS_ADAPTER_I2C_BUS_ERR (-0x6f0b) //-28427, 总线错误
628#define OPRT_OS_ADAPTER_I2C_TRANS_ERR (-0x6f0c) //-28428, 传输错误
629#define OPRT_OS_ADAPTER_I2C_ADDR_NO_ACK (-0x6f0d) //-28429, 无ACK
630#define OPRT_OS_ADAPTER_I2C_IRQ_INIT_FAILED (-0x6f0e) //-28430, 中断初始化失败
631#define OPRT_OS_ADAPTER_I2C_RESERVE1_ERR (-0x6f0f) //-28431, RESERVE ERR1
632#define OPRT_OS_ADAPTER_I2C_RESERVE2_ERR (-0x6f10) //-28432, RESERVE ERR2
633#define OPRT_OS_ADAPTER_I2C_RESERVE3_ERR (-0x6f11) //-28433, RESERVE ERR3
634#define OPRT_OS_ADAPTER_I2C_ERRCODE_MAX_CNT 18
635
636
637/****************************************************************************
638 the error code marco define for module OS_ADAPTER_BLE
639****************************************************************************/
640#define OPRT_OS_ADAPTER_BLE_HANDLE_ERROR (-0x7000) //-28672, Ble 句柄错误
641#define OPRT_OS_ADAPTER_BLE_BUSY (-0x7001) //-28673, Ble 繁忙
642#define OPRT_OS_ADAPTER_BLE_TIMEOUT (-0x7002) //-28674, Ble 超时
643#define OPRT_OS_ADAPTER_BLE_RESERVED1 (-0x7003) //-28675, Ble Reserved Error Code 1
644#define OPRT_OS_ADAPTER_BLE_RESERVED2 (-0x7004) //-28676, Ble Reserved Error Code 2
645#define OPRT_OS_ADAPTER_BLE_RESERVED3 (-0x7005) //-28677, Ble Reserved Error Code 3
646#define OPRT_OS_ADAPTER_BLE_INIT_FAILED (-0x7006) //-28678, Ble 初始化失败
647#define OPRT_OS_ADAPTER_BLE_DEINIT_FAILED (-0x7007) //-28679, Ble 释放失败
648#define OPRT_OS_ADAPTER_BLE_GATT_CONN_FAILED (-0x7008) //-28680, Ble GATT连接失败
649#define OPRT_OS_ADAPTER_BLE_GATT_DISCONN_FAILED (-0x7009) //-28681, Ble GATT断开失败
650#define OPRT_OS_ADAPTER_BLE_ADV_START_FAILED (-0x700a) //-28682, Ble 开启广播失败
651#define OPRT_OS_ADAPTER_BLE_ADV_STOP_FAILED (-0x700b) //-28683, Ble 停止广播失败
652#define OPRT_OS_ADAPTER_BLE_SCAN_START_FAILED (-0x700c) //-28684, Ble 开启扫描失败
653#define OPRT_OS_ADAPTER_BLE_SCAN_STAOP_FAILED (-0x700d) //-28685, Ble 停止扫描失败
654#define OPRT_OS_ADAPTER_BLE_SVC_DISC_FAILED (-0x700e) //-28686, Ble 服务发现失败
655#define OPRT_OS_ADAPTER_BLE_CHAR_DISC_FAILED (-0x700f) //-28687, Ble 特征值发现失败
656#define OPRT_OS_ADAPTER_BLE_DESC_DISC_FAILED (-0x7010) //-28688, Ble 特征值描述符发现失败
657#define OPRT_OS_ADAPTER_BLE_NOTIFY_FAILED (-0x7011) //-28689, Ble Peripheral Notify失败
658#define OPRT_OS_ADAPTER_BLE_INDICATE_FAILED (-0x7012) //-28690, Ble Peripheral Indicate失败
659#define OPRT_OS_ADAPTER_BLE_WRITE_FAILED (-0x7013) //-28691, Ble Central 写失败
660#define OPRT_OS_ADAPTER_BLE_READ_FAILED (-0x7014) //-28692, Ble Central 读失败
661#define OPRT_OS_ADAPTER_BLE_MTU_REQ_FAILED (-0x7015) //-28693, Ble Central MTU请求失败
662#define OPRT_OS_ADAPTER_BLE_MTU_REPLY_FAILED (-0x7016) //-28694, Ble Peripheral MTU 响应失败
663#define OPRT_OS_ADAPTER_BLE_CONN_PARAM_UPDATE_FAILED (-0x7017) //-28695, Ble 连接参数更新失败
664#define OPRT_OS_ADAPTER_BLE_CONN_RSSI_GET_FAILED (-0x7018) //-28696, Ble 连接信号强度获取失败
665#define OPRT_OS_ADAPTER_BLE_MESH_INVALID_OPCODE (-0x7019) //-28697, Ble Mesh 无效的opcode
666#define OPRT_OS_ADAPTER_BLE_MESH_INVALID_ELEMENT (-0x701a) //-28698, Ble Mesh 无效的element
667#define OPRT_OS_ADAPTER_BLE_MESH_INVALID_MODEL (-0x701b) //-28699, Ble Mesh 无效的model
668#define OPRT_OS_ADAPTER_BLE_MESH_INVALID_ADDR (-0x701c) //-28700, Ble Mesh 无效的source, virtual或destination address
669#define OPRT_OS_ADAPTER_BLE_MESH_INVALID_INDEX (-0x701d) //-28701, Ble Mesh 无效的序号,如:appkey index, netkey index等
670#define OPRT_OS_ADAPTER_BLE_MESH_NO_MEMORY (-0x701e) //-28702, Ble Mesh 内存占用已满,如:发包过快导致底层缓存过多等
671#define OPRT_OS_ADAPTER_BLE_MESH_APPKEY_NOT_BOUND_MODEL (-0x701f) //-28703, Ble Mesh Appkey未绑定错误
672#define OPRT_OS_ADAPTER_BLE_MESH_RESERVED1 (-0x7020) //-28704, Ble Mesh Reserved Error Code 1
673#define OPRT_OS_ADAPTER_BLE_MESH_RESERVED2 (-0x7021) //-28705, Ble Mesh Reserved Error Code 2
674#define OPRT_OS_ADAPTER_BLE_MESH_RESERVED3 (-0x7022) //-28706, Ble Mesh Reserved Error Code 3
675#define OPRT_OS_ADAPTER_BLE_MESH_RESERVED4 (-0x7023) //-28707, Ble Mesh Reserved Error Code 4
676#define OPRT_OS_ADAPTER_BLE_MESH_RESERVED5 (-0x7024) //-28708, Ble Mesh Reserved Error Code 5
677#define OPRT_OS_ADAPTER_BLE_MESH_PROVISION_FAIL (-0x7025) //-28709, Ble Mesh 配网失败
678#define OPRT_OS_ADAPTER_BLE_MESH_COMPO_GET_FAIL (-0x7026) //-28710, Ble Mesh 获取Composition数据失败
679#define OPRT_OS_ADAPTER_BLE_MESH_MODEL_BIND_FAIL (-0x7027) //-28711, Ble Mesh 绑定model失败
680#define OPRT_OS_ADAPTER_BLE_MESH_APPKEY_ADD_FAIL (-0x7028) //-28712, Ble Mesh Appkey添加失败
681#define OPRT_OS_ADAPTER_BLE_MESH_NETKEY_ADD_FAIL (-0x7029) //-28713, Ble Mesh Netkey添加失败
682#define OPRT_OS_ADAPTER_BLE_MESH_APPKEY_BIND_FAIL (-0x702a) //-28714, Ble Mesh Appkey绑定失败
683#define OPRT_OS_ADAPTER_BLE_ERRCODE_MAX_CNT 43
684
685
686/****************************************************************************
687 the error code marco define for module MID_TRANSPORT
688****************************************************************************/
689#define OPRT_MID_TRANSPORT_INVALID_PARM (-0x7100) //-28928, 参数无效
690#define OPRT_MID_TRANSPORT_MALLOC_FAILED (-0x7101) //-28929, 内存申请失败
691#define OPRT_MID_TRANSPORT_DNS_PARSED_FAILED (-0x7102) //-28930, DNS解析失败
692#define OPRT_MID_TRANSPORT_SOCK_CREAT_FAILED (-0x7103) //-28931, socket创建失败
693#define OPRT_MID_TRANSPORT_SOCK_SET_REUSE_FAILED (-0x7104) //-28932, socket set reuse 失败
694#define OPRT_MID_TRANSPORT_SOCK_SET_DISABLE_NAGLE_FAILED (-0x7105) //-28933, socket set disable nagle失败
695#define OPRT_MID_TRANSPORT_SOCK_SET_KEEP_ALIVE_FAILED (-0x7106) //-28934, socket set keep alive失败
696#define OPRT_MID_TRANSPORT_SOCK_SET_BLOCK_FAILED (-0x7107) //-28935, socket set block失败
697#define OPRT_MID_TRANSPORT_SOCK_NET_BIND_FAILED (-0x7108) //-28936, socket net bind失败
698#define OPRT_MID_TRANSPORT_SOCK_SET_TIMEOUT_FAILED (-0x7109) //-28937, socket set timeout失败
699#define OPRT_MID_TRANSPORT_TCP_CONNECD_FAILED (-0x710a) //-28938, tcp连接失败
700#define OPRT_MID_TRANSPORT_TCP_TLS_CONNECD_FAILED (-0x710b) //-28939, tcp tls连接失败
701#define OPRT_MID_TRANSPORT_PACK_SEND_FAILED (-0x710c) //-28940, 包发送失败
702#define OPRT_MID_TRANSPORT_ERRCODE_MAX_CNT 13
703
704
705/****************************************************************************
706 the error code marco define for module OS_ADAPTER_SPI
707****************************************************************************/
708#define OPRT_OS_ADAPTER_SPI_INVALID_PARM (-0x7200) //-29184, 参数无效
709#define OPRT_OS_ADAPTER_SPI_INIT_FAILED (-0x7201) //-29185, 初始化失败
710#define OPRT_OS_ADAPTER_SPI_DEINIT_FAILED (-0x7202) //-29186, 释放失败
711#define OPRT_OS_ADAPTER_SPI_MODE_ERR (-0x7203) //-29187, 模式错误
712#define OPRT_OS_ADAPTER_SPI_BUSY (-0x7204) //-29188, 忙
713#define OPRT_OS_ADAPTER_SPI_DATA_LOST (-0x7205) //-29189, 数据丢失
714#define OPRT_OS_ADAPTER_SPI_TIMEOUT (-0x7206) //-29190, 超时
715#define OPRT_OS_ADAPTER_SPI_BUS_ERR (-0x7207) //-29191, 总线错误
716#define OPRT_OS_ADAPTER_SPI_TRANS_ERR (-0x7208) //-29192, 传输错误
717#define OPRT_OS_ADAPTER_SPI_IRQ_ERR (-0x7209) //-29193, 中断异常
718#define OPRT_OS_ADAPTER_SPI_RESERVE1_ERR (-0x720a) //-29194, RESERVE ERR1
719#define OPRT_OS_ADAPTER_SPI_RESERVE2_ERR (-0x720b) //-29195, RESERVE ERR2
720#define OPRT_OS_ADAPTER_SPI_RESERVE3_ERR (-0x720c) //-29196, RESERVE ERR3
721#define OPRT_OS_ADAPTER_SPI_ERRCODE_MAX_CNT 13
722
723
724/****************************************************************************
725 the error code marco define for module OS_ADAPTER_PWM
726****************************************************************************/
727#define OPRT_OS_ADAPTER_PWM_INVALID_PARM (-0x7300) //-29440, 参数无效
728#define OPRT_OS_ADAPTER_PWM_INIT_FAILED (-0x7301) //-29441, 初始化失败
729#define OPRT_OS_ADAPTER_PWM_DEINIT_FAILED (-0x7302) //-29442, 释放失败
730#define OPRT_OS_ADAPTER_PWM_MODE_ERR (-0x7303) //-29443, 模式错误
731#define OPRT_OS_ADAPTER_PWM_BUSY (-0x7304) //-29444, 忙
732#define OPRT_OS_ADAPTER_PWM_IRQ_INIT_FAILED (-0x7305) //-29445, 中断初始化失败
733#define OPRT_OS_ADAPTER_PWM_RESERVE1_ERR (-0x7306) //-29446, RESERVE ERR1
734#define OPRT_OS_ADAPTER_PWM_RESERVE2_ERR (-0x7307) //-29447, RESERVE ERR2
735#define OPRT_OS_ADAPTER_PWM_RESERVE3_ERR (-0x7308) //-29448, RESERVE ERR3
736#define OPRT_OS_ADAPTER_PWM_ERRCODE_MAX_CNT 9
737
738
739/****************************************************************************
740 the error code marco define for module OS_ADAPTER_ADC
741****************************************************************************/
742#define OPRT_OS_ADAPTER_ADC_INVALID_PARM (-0x7400) //-29696, 参数无效
743#define OPRT_OS_ADAPTER_ADC_INIT_FAILED (-0x7401) //-29697, 初始化失败
744#define OPRT_OS_ADAPTER_ADC_DEINIT_FAILED (-0x7402) //-29698, 释放失败
745#define OPRT_OS_ADAPTER_ADC_READ_FAILED (-0x7403) //-29699, ADC读取失败
746#define OPRT_OS_ADAPTER_ADC_MODE_ERR (-0x7404) //-29700, 模式错误
747#define OPRT_OS_ADAPTER_ADC_BUSY (-0x7405) //-29701, 忙
748#define OPRT_OS_ADAPTER_ADC_TIMEOUT (-0x7406) //-29702, 超时
749#define OPRT_OS_ADAPTER_ADC_IRQ_INIT_FAILED (-0x7407) //-29703, 中断初始化失败
750#define OPRT_OS_ADAPTER_ADC_RESERVE1_ERR (-0x7408) //-29704, RESERVE ERR1
751#define OPRT_OS_ADAPTER_ADC_RESERVE2_ERR (-0x7409) //-29705, RESERVE ERR2
752#define OPRT_OS_ADAPTER_ADC_RESERVE3_ERR (-0x740a) //-29706, RESERVE ERR3
753#define OPRT_OS_ADAPTER_ADC_ERRCODE_MAX_CNT 11
754
755
756/****************************************************************************
757 the error code marco define for module OS_ADAPTER_DAC
758****************************************************************************/
759#define OPRT_OS_ADAPTER_DAC_INVALID_PARM (-0x7500) //-29952, 参数无效
760#define OPRT_OS_ADAPTER_DAC_INIT_FAILED (-0x7501) //-29953, 初始化失败
761#define OPRT_OS_ADAPTER_DAC_DEINIT_FAILED (-0x7502) //-29954, 释放失败
762#define OPRT_OS_ADAPTER_DAC_WRITE_FAILED (-0x7503) //-29955, DAC写失败
763#define OPRT_OS_ADAPTER_DAC_MODE_ERR (-0x7504) //-29956, 模式错误
764#define OPRT_OS_ADAPTER_DAC_BUSY (-0x7505) //-29957, 忙
765#define OPRT_OS_ADAPTER_DAC_TIMEOUT (-0x7506) //-29958, 超时
766#define OPRT_OS_ADAPTER_DAC_IRQ_INIT_FAILED (-0x7507) //-29959, 中断初始化失败
767#define OPRT_OS_ADAPTER_DAC_RESERVE1_ERR (-0x7508) //-29960, RESERVE ERR1
768#define OPRT_OS_ADAPTER_DAC_RESERVE2_ERR (-0x7509) //-29961, RESERVE ERR2
769#define OPRT_OS_ADAPTER_DAC_RESERVE3_ERR (-0x750a) //-29962, RESERVE ERR3
770#define OPRT_OS_ADAPTER_DAC_ERRCODE_MAX_CNT 11
771
772
773/****************************************************************************
774 the error code marco define for module OS_ADAPTER_I2S
775****************************************************************************/
776#define OPRT_OS_ADAPTER_I2S_INVALID_PARM (-0x7600) //-30208, 参数无效
777#define OPRT_OS_ADAPTER_I2S_INIT_FAILED (-0x7601) //-30209, 初始化失败
778#define OPRT_OS_ADAPTER_I2S_DEINIT_FAILED (-0x7602) //-30210, 释放失败
779#define OPRT_OS_ADAPTER_I2S_WRITE_FAILED (-0x7603) //-30211, I2S写入失败
780#define OPRT_OS_ADAPTER_I2S_READ_FAILED (-0x7604) //-30212, I2S读取失败
781#define OPRT_OS_ADAPTER_I2S_MODE_ERR (-0x7605) //-30213, 模式错误
782#define OPRT_OS_ADAPTER_I2S_BUSY (-0x7606) //-30214, 忙
783#define OPRT_OS_ADAPTER_I2S_TIMEOUT (-0x7607) //-30215, 超时
784#define OPRT_OS_ADAPTER_I2S_DATA_LOST (-0x7608) //-30216, 数据丢失
785#define OPRT_OS_ADAPTER_I2S_TRANS_ERR (-0x7609) //-30217, 传输错误
786#define OPRT_OS_ADAPTER_I2S_IRQ_INIT_FAILED (-0x760a) //-30218, 中断初始化失败
787#define OPRT_OS_ADAPTER_I2S_RESERVE1_ERR (-0x760b) //-30219, RESERVE ERR1
788#define OPRT_OS_ADAPTER_I2S_RESERVE2_ERR (-0x760c) //-30220, RESERVE ERR2
789#define OPRT_OS_ADAPTER_I2S_RESERVE3_ERR (-0x760d) //-30221, RESERVE ERR3
790#define OPRT_OS_ADAPTER_I2S_ERRCODE_MAX_CNT 14
791
792
793/****************************************************************************
794 the error code marco define for module GW_SUB_MGR
795****************************************************************************/
796#define OPRT_GW_SUB_MGR_INIT_FAIL (-0x7700) //-30464, 子设备管理模块初始化失败
797#define OPRT_GW_SUB_MGR_BIND_THREAD_CREATE_FAIL (-0x7701) //-30465, 绑定线程创建失败
798#define OPRT_GW_SUB_MGR_EXCEED_MAX_CNT (-0x7702) //-30466, 超过子设备最大数目
799#define OPRT_GW_SUB_MGR_NODE_CREATE_FAIL (-0x7703) //-30467, 创建子设备节点失败
800#define OPRT_GW_SUB_MGR_CLOUD_HTTP_BIND_FAIL (-0x7704) //-30468, 与云端http交互失败
801#define OPRT_GW_SUB_MGR_ERRCODE_MAX_CNT 5
802
803
804/****************************************************************************
805 the error code marco define for module APP_TMP
806****************************************************************************/
807#define OPRT_APP_TMP_xxx (-0x7800) //-30720, XXX
808#define OPRT_APP_TMP_ERRCODE_MAX_CNT 1
809
810
811#define ERRCODE2STRING(errcode) #errcode
812#define TUYA_ERROR_STRING(errcode) ("[ErrCode: " ERRCODE2STRING(errcode) "]")
813
814#define TUYA_CHECK_NULL_RETURN(x, y)\
815do{\
816 if (NULL == (x)){\
817 TAL_PR_ERR("%s null", #x);\
818 return (y);\
819 }\
820}while(0)
821
822
823#define TUYA_CHECK_NULL_GOTO(x, label)\
824do{\
825 if (NULL == (x)){\
826 TAL_PR_ERR("%s null", #x);\
827 goto label;\
828 }\
829}while(0)
830
831
832#define TUYA_CALL_ERR_LOG(func)\
833do{\
834 rt = (func);\
835 if (OPRT_OK != (rt)){\
836 TAL_PR_ERR("ret:%d", rt);\
837 }\
838}while(0)
839
840
841#define TUYA_CALL_ERR_GOTO(func, label)\
842do{\
843 rt = (func);\
844 if (OPRT_OK != (rt)){\
845 TAL_PR_ERR("ret:%d", rt);\
846 goto label;\
847 }\
848}while(0)
849
850
851#define TUYA_CALL_ERR_RETURN(func)\
852do{\
853 rt = (func);\
854 if (OPRT_OK != (rt)){\
855 TAL_PR_ERR("ret:%d", rt);\
856 return (rt);\
857 }\
858}while(0)
859
860
861#define TUYA_CALL_ERR_RETURN_VAL(func, y)\
862do{\
863 rt = (func);\
864 if (OPRT_OK != (rt)){\
865 TAL_PR_ERR("ret:%d", rt);\
866 return (y);\
867 }\
868}while(0)
869
870
871#define TUYA_CALL_ERR_LOG_SEQ_RETURN_VAL(func, y, point)\
872do{\
873 rt = (func);\
874 if (OPRT_OK != (rt)){\
875 TAL_PR_ERR("ret:%d", rt);\
876 INSERT_ERROR_LOG_SEQ_DEC((point), rt);\
877 return (y);\
878 }\
879}while(0)
880
881
882#define TUYA_CALL_ERR_LOG_SEQ_RETURN(func, point)\
883do{\
884 rt = (func);\
885 if (OPRT_OK != (rt)){\
886 TAL_PR_ERR("ret:%d", rt);\
887 INSERT_ERROR_LOG_SEQ_DEC((point), rt);\
888 return (rt);\
889 }\
890}while(0)
891
892
893#define TUYA_CALL_ERR_LOG_SEQ_GOTO(func, label)\
894do{\
895 rt = (func);\
896 if (OPRT_OK != (rt)){\
897 TAL_PR_ERR("ret:%d", rt);\
898 INSERT_ERROR_LOG_SEQ_DEC((point), rt);\
899 goto label;\
900 }\
901}while(0)
902
903
904#define TUYA_CALL_ERR_LOG_SEQ(func)\
905do{\
906 rt = (func);\
907 if (OPRT_OK != (rt)) {\
908 TAL_PR_ERR("ret:%d", rt);\
909 INSERT_ERROR_LOG_SEQ_DEC((point), rt);\
910 }\
911}while(0)
912
913
914#define TUYA_CHECK_NULL_LOG_SEQ_RETURN(x, y, point)\
915do{\
916 if (NULL == (x)){\
917 TAL_PR_ERR("%s null", #x);\
918 INSERT_ERROR_LOG_SEQ_DEC((point), y);\
919 return (y);\
920 }\
921}while(0)
922
923
924#define TUYA_CHECK_NULL_LOG_SEQ_GOTO(x, point, label)\
925do{\
926 if (NULL == (x)){\
927 TAL_PR_ERR("%s null", #x);\
928 INSERT_ERROR_LOG_SEQ_NULL((point));\
929 goto label;\
930 }\
931}while(0)
932
933
934#ifdef __cplusplus
935}
936#endif
937#endif