• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef SOFTBUS_ERROR_CODE_H
17 #define SOFTBUS_ERROR_CODE_H
18 
19 #ifdef __cplusplus
20 #if __cplusplus
21 extern "C" {
22 #endif
23 #endif
24 
25 enum SoftBusErrNo {
26     SOFTBUS_PUBLIC_ERR_BASE = (-13000),
27 
28     SOFTBUS_FRAMEWORK_ERR_BASE = (-12000),
29     SOFTBUS_INVALID_PKGNAME,
30     SOFTBUS_FUNC_NOT_SUPPORT,
31     SOFTBUS_SERVER_NOT_INIT,
32 
33     SOFTBUS_TRANS_ERR_BASE = (-11000),
34 
35     SOFTBUS_TRANS_INVALID_SESSION_ID,
36     SOFTBUS_TRANS_INVALID_SESSION_NAME,
37     SOFTBUS_TRANS_INVALID_CHANNEL_TYPE,
38     SOFTBUS_TRANS_INVALID_CLOSE_CHANNEL_ID,
39     SOFTBUS_TRANS_SESSION_REPEATED,
40     SOFTBUS_TRANS_SESSION_CNT_EXCEEDS_LIMIT,
41     SOFTBUS_TRANS_SESSIONSERVER_NOT_CREATED,
42     SOFTBUS_TRANS_SESSION_OPENING,
43     SOFTBUS_TRANS_GET_LANE_INFO_ERR,
44     SOFTBUS_TRANS_INVALID_DATA_LENGTH,
45     SOFTBUS_TRANS_FUNC_NOT_SUPPORT,
46     SOFTBUS_TRANS_OPEN_AUTH_CHANNANEL_FAILED,
47     SOFTBUS_TRANS_GET_P2P_INFO_FAILED,
48     SOFTBUS_TRANS_OPEN_AUTH_CONN_FAILED,
49 
50     SOFTBUS_TRANS_PROXY_PACKMSG_ERR,
51     SOFTBUS_TRANS_PROXY_SENDMSG_ERR,
52     SOFTBUS_TRANS_PROXY_SEND_CHANNELID_INVALID,
53     SOFTBUS_TRANS_PROXY_CHANNLE_STATUS_INVALID,
54     SOFTBUS_TRANS_PROXY_DEL_CHANNELID_INVALID,
55     SOFTBUS_TRANS_PROXY_SESS_ENCRYPT_ERR,
56     SOFTBUS_TRANS_PROXY_INVALID_SLICE_HEAD,
57     SOFTBUS_TRANS_PROXY_ASSEMBLE_PACK_NO_INVALID,
58     SOFTBUS_TRANS_PROXY_ASSEMBLE_PACK_EXCEED_LENGTH,
59     SOFTBUS_TRANS_PROXY_ASSEMBLE_PACK_DATA_NULL,
60 
61     SOFTBUS_TRANS_UDP_CLOSE_CHANNELID_INVALID,
62     SOFTBUS_TRANS_UDP_SERVER_ADD_CHANNEL_FAILED,
63     SOFTBUS_TRANS_UDP_CLIENT_ADD_CHANNEL_FAILED,
64     SOFTBUS_TRANS_UDP_SERVER_NOTIFY_APP_OPEN_FAILED,
65     SOFTBUS_TRANS_UDP_CLIENT_NOTIFY_APP_OPEN_FAILED,
66     SOFTBUS_TRANS_UDP_START_STREAM_SERVER_FAILED,
67     SOFTBUS_TRANS_UDP_START_STREAM_CLIENT_FAILED,
68     SOFTBUS_TRANS_UDP_SEND_STREAM_FAILED,
69 
70     SOFTBUS_TRANS_QOS_REPORT_FAILED,
71     SOFTBUS_TRANS_QOS_REPORT_TOO_FREQUENT,
72 
73     SOFTBUS_AUTH_ERR_BASE = (-9000),
74     SOFTBUS_AUTH_VERIFIED,
75     SOFTBUS_AUTH_VERIFYING,
76     SOFTBUS_AUTH_SYNC_DEVID_FAILED,
77     SOFTBUS_AUTH_UNPACK_DEVID_FAILED,
78     SOFTBUS_AUTH_HICHAIN_PROCESS_FAILED,
79     SOFTBUS_AUTH_HICHAIN_AUTH_DEVICE_FAILED,
80     SOFTBUS_AUTH_HICHAIN_AUTH_ERROR,
81     SOFTBUS_AUTH_TIMEOUT,
82     SOFTBUS_AUTH_EXISTED,
83     SOFTBUS_AUTH_NOT_EXISTED,
84 
85     SOFTBUS_NETWORK_ERR_BASE = (-7000),
86     SOFTBUS_NETWORK_CONN_FSM_DEAD,
87     SOFTBUS_NETWORK_JOIN_CANCELED,
88     SOFTBUS_NETWORK_JOIN_LEAVING,
89     SOFTBUS_NETWORK_JOIN_TIMEOUT,
90     SOFTBUS_NETWORK_UNPACK_DEV_INFO_FAILED,
91     SOFTBUS_NETWORK_DEV_NOT_TRUST,
92     SOFTBUS_NETWORK_LEAVE_OFFLINE,
93     SOFTBUS_NETWORK_AUTH_DISCONNECT,
94     SOFTBUS_NETWORK_TIME_SYNC_HANDSHAKE_ERR, // time sync channel pipe broken
95     SOFTBUS_NETWORK_TIME_SYNC_HANDSHAKE_TIMEOUT, // timeout during handshake
96     SOFTBUS_NETWORK_TIME_SYNC_TIMEOUT, // timeout during sync
97     SOFTBUS_NETWORK_TIME_SYNC_INTERFERENCE, // interference
98     SOFTBUS_NETWORK_HEARTBEAT_REPEATED,
99     SOFTBUS_NETWORK_HEARTBEAT_UNTRUSTED,
100     SOFTBUS_NETWORK_NODE_OFFLINE,
101 
102     SOFTBUS_CONN_ERR_BASE = (-5000),
103     SOFTBUS_CONN_FAIL,
104     SOFTBUS_CONN_MANAGER_TYPE_NOT_SUPPORT,
105     SOFTBUS_CONN_MANAGER_OP_NOT_SUPPORT,
106     SOFTBUS_CONN_MANAGER_PKT_LEN_INVALID,
107     SOFTBUS_CONN_MANAGER_LIST_NOT_INIT,
108     SOFTBUS_CONN_INVALID_CONN_TYPE,
109     SOFTBUS_CONNECTION_BASE,
110     SOFTBUS_CONNECTION_ERR_CLOSED,
111     SOFTBUS_CONNECTION_ERR_DRIVER_CONGEST,
112     SOFTBUS_CONNECTION_ERR_SOFTBUS_CONGEST,
113     SOFTBUS_CONNECTION_ERR_CONNID_INVALID,
114     SOFTBUS_CONNECTION_ERR_SENDQUEUE_FULL,
115     SOFTBUS_BRCONNECTION_POSTBYTES_ERROR,
116     SOFTBUS_BRCONNECTION_GETCONNINFO_ERROR,
117     SOFTBUS_BRCONNECTION_STRNCPY_ERROR,
118     SOFTBUS_BRCONNECTION_PACKJSON_ERROR,
119     SOFTBUS_BRCONNECTION_CONNECTDEVICE_MALLOCFAIL,
120     SOFTBUS_BRCONNECTION_CONNECTDEVICE_GETSOCKETIDFAIL,
121     SOFTBUS_BRCONNECTION_DISCONNECT_NOTFIND,
122     SOFTBUS_TCPCONNECTION_SOCKET_ERR,
123     SOFTBUS_BLECONNECTION_REG_GATTS_CALLBACK_FAIL,
124     SOFTBUS_BLECONNECTION_ADD_SERVICE_FAIL,
125     SOFTBUS_BLECONNECTION_ADD_CHAR_FAIL,
126     SOFTBUS_BLECONNECTION_ADD_DES_FAIL,
127     SOFTBUS_BLECONNECTION_NOT_INIT,
128     SOFTBUS_BLECONNECTION_NOT_START,
129     SOFTBUS_BLECONNECTION_GETCONNINFO_ERROR,
130     SOFTBUS_BLECONNECTION_MTU_OVERFLOW_ERROR,
131     SOFTBUS_BLECONNECTION_MUTEX_LOCK_ERROR,
132     SOFTBUS_BLECONNECTION_GATT_CLIENT_NOT_SUPPORT,
133     SOFTBUS_GATTC_INTERFACE_FAILED,
134     SOFTBUS_BLEGATTC_NONT_INIT,
135     SOFTBUS_BLEGATTC_NOT_READY,
136     SOFTBUS_GATTC_DUPLICATE_PARAM,
137     SOFTBUS_GATTC_NONE_PARAM,
138     SOFTBUS_BLEGATTC_NODE_NOT_EXIST,
139 
140     SOFTBUS_DISCOVER_ERR_BASE = (-3000),
141 
142     SOFTBUS_DISCOVER_NOT_INIT,
143     SOFTBUS_DISCOVER_INVALID_PKGNAME,
144     SOFTBUS_DISCOVER_SERVER_NO_PERMISSION,
145     SOFTBUS_DISCOVER_MANAGER_NOT_INIT,
146     SOFTBUS_DISCOVER_MANAGER_ITEM_NOT_CREATE,
147     SOFTBUS_DISCOVER_MANAGER_INFO_NOT_CREATE,
148     SOFTBUS_DISCOVER_MANAGER_INFO_NOT_DELETE,
149     SOFTBUS_DISCOVER_MANAGER_INNERFUNCTION_FAIL,
150     SOFTBUS_DISCOVER_MANAGER_CAPABILITY_INVALID,
151     SOFTBUS_DISCOVER_MANAGER_DUPLICATE_PARAM,
152     SOFTBUS_DISCOVER_MANAGER_INVALID_PARAM,
153     SOFTBUS_DISCOVER_MANAGER_INVALID_MEDIUM,
154     SOFTBUS_DISCOVER_MANAGER_INVALID_PKGNAME,
155     SOFTBUS_DISCOVER_MANAGER_INVALID_MODULE,
156     SOFTBUS_DISCOVER_COAP_NOT_INIT,
157     SOFTBUS_DISCOVER_COAP_INIT_FAIL,
158     SOFTBUS_DISCOVER_COAP_MERGE_CAP_FAIL,
159     SOFTBUS_DISCOVER_COAP_CANCEL_CAP_FAIL,
160     SOFTBUS_DISCOVER_COAP_REGISTER_CAP_FAIL,
161     SOFTBUS_DISCOVER_COAP_SET_FILTER_CAP_FAIL,
162     SOFTBUS_DISCOVER_COAP_REGISTER_DEVICE_FAIL,
163     SOFTBUS_DISCOVER_COAP_START_PUBLISH_FAIL,
164     SOFTBUS_DISCOVER_COAP_STOP_PUBLISH_FAIL,
165     SOFTBUS_DISCOVER_COAP_START_DISCOVER_FAIL,
166     SOFTBUS_DISCOVER_COAP_STOP_DISCOVER_FAIL,
167 
168     SOFTBUS_COMMOM_ERR_BASE = (-1000),
169     SOFTBUS_TIMOUT,
170     SOFTBUS_INVALID_PARAM,
171     SOFTBUS_MEM_ERR,
172     SOFTBUS_NOT_IMPLEMENT,
173     SOFTBUS_NO_URI_QUERY_KEY,
174     SOFTBUS_NO_INIT,
175     SOFTBUS_PARSE_JSON_ERR,
176     SOFTBUS_PERMISSION_DENIED,
177     SOFTBUS_MALLOC_ERR,
178     SOFTBUS_ENCRYPT_ERR,
179     SOFTBUS_DECRYPT_ERR,
180     SOFTBUS_INVALID_SESS_OPCODE,
181     SOFTBUS_INVALID_NUM,
182     SOFTBUS_SERVER_NAME_REPEATED,
183     SOFTBUS_TCP_SOCKET_ERR,
184     SOFTBUS_LOCK_ERR,
185     SOFTBUS_GET_REMOTE_UUID_ERR,
186     SOFTBUS_NO_ENOUGH_DATA,
187     SOFTBUS_INVALID_DATA_HEAD,
188     SOFTBUS_INVALID_FD,
189     SOFTBUS_FILE_ERR,
190     SOFTBUS_DATA_NOT_ENOUGH,
191     SOFTBUS_SLICE_ERROR,
192     SOFTBUS_ALREADY_EXISTED,
193     SOFTBUS_GET_CONFIG_VAL_ERR,
194     SOFTBUS_PEER_PROC_ERR,
195     SOFTBUS_NOT_FIND,
196     SOFTBUS_TRANS_PROXY_ERROR_APP_TYPE,
197 
198     SOFTBUS_ERR = (-1),
199     SOFTBUS_OK = 0,
200 };
201 
202 #ifdef __cplusplus
203 #if __cplusplus
204 }
205 #endif /* __cplusplus */
206 #endif /* __cplusplus */
207 #endif /* SOFTBUS_ERRCODE_H */
208