1 /* 2 * Copyright (c) 2023 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 WIFI_DIRECT_ERROR_CODE_H 17 #define WIFI_DIRECT_ERROR_CODE_H 18 19 #ifdef __cplusplus 20 extern "C" { 21 #endif 22 23 enum WifiDirectErrorCode { 24 /* Error code representing OK */ 25 OK = 0, 26 27 /* Indicating cannot build a p2p link because the device is already connected with a mismatch role. */ 28 V1_ERROR_CONNECTED_WITH_MISMATCHED_ROLE = -1, 29 30 /* Indicating cannot build a p2p link because this device is already be GC. */ 31 V1_ERROR_GC_CONNECTED_TO_ANOTHER_DEVICE = -2, 32 33 /* Indicating cannot build a p2p link because this device cannot be connected with the specified role. */ 34 V1_ERROR_AVAILABLE_WITH_MISMATCHED_ROLE = -3, 35 36 /* Indicating cannot build a p2p link because the remote device is already be GC. */ 37 V1_ERROR_PEER_GC_CONNECTED_TO_ANOTHER_DEVICE = -4, 38 39 /* Indicating cannot build a p2p link because both the devices are GO. */ 40 V1_ERROR_BOTH_GO = -5, 41 42 /* Indicating that two devices initiate a connection to peer device at the same time. */ 43 V1_ERROR_TWO_WAY_SIMULTANEOUS_CONNECTION = -6, 44 45 /* Indicating that this connect request has timed out. */ 46 V1_ERROR_CONNECT_TIMEOUT = -7, 47 48 /* Indicating that failure occurred when reusing p2p link. */ 49 V1_ERROR_REUSE_FAILED = -8, 50 51 /* Indicating that p2p link is used by another service. */ 52 V1_ERROR_LINK_USED_BY_ANOTHER_SERVICE = -9, 53 54 /* Indicating that GOInfo is wrong. */ 55 V1_ERROR_WRONG_GO_INFO = -10, 56 57 /* Indicating that GCInfo is wrong. */ 58 V1_ERROR_WRONG_GC_INFO = -11, 59 60 /* Indicating that post message to remote device via AuthConnection has failed. */ 61 V1_ERROR_POST_MESSAGE_FAILED = -12, 62 63 /* Indicating that cannot build a p2p link because current device is busy. */ 64 V1_ERROR_BUSY = -15, 65 66 /* Indicating that peer device is not a trusted device. */ 67 V1_ERROR_NOT_TRUSTED_DEVICE = -17, 68 69 /* Indicating that connect group failed. */ 70 V1_ERROR_CONNECT_GROUP_FAILED = -18, 71 72 /* Indicating that create group failed. */ 73 V1_ERROR_CREATE_GROUP_FAILED = -19, 74 75 /* Indicating that connect group timeout. */ 76 V1_ERROR_PEER_CONNECT_GROUP_FAILED = -20, 77 78 /* Indicating that create group timeout. */ 79 V1_ERROR_PEER_CREATE_GROUP_FAILED = -21, 80 81 /* Indicating that create group timeout. */ 82 V1_ERROR_RPT_ENABLED = -22, 83 84 /* Indicating that create group timeout. */ 85 V1_ERROR_PEER_RPT_ENABLED = -23, 86 87 /* Indicating unknown reason. */ 88 V1_ERROR_UNKNOWN = -24, 89 90 /* Indicating p2p interface is not available */ 91 V1_ERROR_IF_NOT_AVAILABLE = -25, 92 93 /* Base error code */ 94 ERROR_BASE = -200000, 95 96 /* Error code representing invalid input parameters */ 97 ERROR_INVALID_INPUT_PARAMETERS = ERROR_BASE - 1, 98 99 /* Error code representing not context */ 100 ERROR_NO_CONTEXT = ERROR_BASE - 2, 101 102 /* Error code representing entity is busy */ 103 ERROR_ENTITY_BUSY = ERROR_BASE - 3, 104 105 /* Error code representing fail to generate a command */ 106 ERROR_GENERATE_COMMAND_FAILED = ERROR_BASE - 4, 107 108 /* Error code representing fail to post data */ 109 ERROR_POST_DATA_FAILED = ERROR_BASE - 5, 110 111 /* Error code representing wait link state change timeout */ 112 ERROR_WAIT_LINK_CHANGE_TIMEOUT = ERROR_BASE - 6, 113 114 /* Error code representing reuse link fail */ 115 ERROR_SINK_REUSE_LINK_FAILED = ERROR_BASE - 7, 116 117 /* Error code representing remove link fail */ 118 ERROR_REMOVE_LINK_FAILED = ERROR_BASE - 8, 119 120 /* Error code representing fail to config Ip */ 121 ERROR_CONFIG_IP_FAIL = ERROR_BASE - 9, 122 123 /* Error code representing no interface info on sink end */ 124 ERROR_SINK_NO_INTERFACE_INFO = ERROR_BASE - 10, 125 126 /* Error code representing fail to reuse link on source end */ 127 ERROR_SOURCE_REUSE_LINK_FAILED = ERROR_BASE - 11, 128 129 /* Error code representing no interface info on source end */ 130 ERROR_SOURCE_NO_INTERFACE_INFO = ERROR_BASE - 12, 131 132 /* Error code representing no link on source end */ 133 ERROR_SOURCE_NO_LINK = ERROR_BASE - 13, 134 135 /* Error code representing no link on sink end */ 136 ERROR_SINK_NO_LINK = ERROR_BASE - 14, 137 138 /* Error code representing manager is busy */ 139 ERROR_MANAGER_BUSY = ERROR_BASE - 15, 140 141 /* Error code representing information on auth connection is wrong */ 142 ERROR_WRONG_AUTH_CONNECTION_INFO = ERROR_BASE - 16, 143 144 /* Error code representing start position of wifi direct errors */ 145 ERROR_WIFI_DIRECT_START = ERROR_BASE - 4000, 146 147 /* Error code representing no suitable wifi direct processor */ 148 ERROR_WIFI_DIRECT_NO_SUITABLE_PROCESSOR = ERROR_BASE - 4001, 149 150 /* Error code representing failed to process wifi direct command */ 151 ERROR_WIFI_DIRECT_PROCESS_FAILED = ERROR_BASE - 4002, 152 153 /* Error code representing wrong wifi direct negotiation msg */ 154 ERROR_WIFI_DIRECT_WRONG_NEGOTIATION_MSG = ERROR_BASE - 4003, 155 156 /* Error code representing wifi if off */ 157 ERROR_WIFI_OFF = ERROR_BASE - 4004, 158 159 /* Error code representing rpt is enabled */ 160 ERROR_RPT_ENABLED = ERROR_BASE - 4005, 161 162 /* Error code representing no suitable protocol */ 163 ERROR_WIFI_DIRECT_NO_SUITABLE_PROTOCOL = ERROR_BASE - 4006, 164 165 /* Error code representing fail to pack data */ 166 ERROR_WIFI_DIRECT_PACK_DATA_FAILED = ERROR_BASE - 4007, 167 168 /* Error code representing wait negotiation message timeout */ 169 ERROR_WIFI_DIRECT_WAIT_NEGOTIATION_MSG_TIMEOUT = ERROR_BASE - 4008, 170 171 /* Error code representing wait connect request timeout */ 172 ERROR_WIFI_DIRECT_WAIT_CONNECT_REQUEST_TIMEOUT = ERROR_BASE - 4009, 173 174 /* Error code representing wait connect response timeout */ 175 ERROR_WIFI_DIRECT_WAIT_CONNECT_RESPONSE_TIMEOUT = ERROR_BASE - 4010, 176 177 /* Error code representing fail to get LinkInfo on sink end */ 178 ERROR_WIFI_DIRECT_SINK_GET_LINK_INFO_FAILED = ERROR_BASE - 4011, 179 180 /* Error code representing fail to get remote wifi config info */ 181 ERROR_WIFI_DIRECT_GET_REMOTE_WIFI_CFG_INFO_FAILED = ERROR_BASE - 4012, 182 183 /* Error code representing fail to get local wifi config info */ 184 ERROR_WIFI_DIRECT_SINK_GET_LOCAL_WIFI_CFG_INFO_FAILED = ERROR_BASE - 4013, 185 186 /* Error code representing fail to get LinkInfo on source end */ 187 ERROR_WIFI_DIRECT_SOURCE_GET_LINK_INFO_FAILED = ERROR_BASE - 4014, 188 189 /* Error code representing fail to set connect notify */ 190 ERROR_WIFI_DIRECT_SET_CONNECT_NOTIFY_FAILED = ERROR_BASE - 4015, 191 192 /* Error code representing local link is not connected, but remote link is still connected */ 193 ERROR_WIFI_DIRECT_LOCAL_DISCONNECTED_REMOTE_CONNECTED = ERROR_BASE - 4016, 194 195 /* Error code representing local link is connected, but remote link is not connected */ 196 ERROR_WIFI_DIRECT_LOCAL_CONNECTED_REMOTE_DISCONNECTED = ERROR_BASE - 4017, 197 198 /* Error code representing two devices initiate a connection or a disconnection to peer device simultaneously */ 199 ERROR_WIFI_DIRECT_BIDIRECTIONAL_SIMULTANEOUS_REQ = ERROR_BASE - 4018, 200 201 /* Error code representing there exists no available interface */ 202 ERROR_WIFI_DIRECT_NO_AVAILABLE_INTERFACE = ERROR_BASE - 4019, 203 204 /* Error code representing remote device is not trusted */ 205 ERROR_WIFI_DIRECT_NOT_TRUSTED_DEVICE = ERROR_BASE - 4020, 206 207 /* Error code representing remote device is not trusted */ 208 ERROR_WIFI_DIRECT_UNPACK_DATA_FAILED = ERROR_BASE - 4021, 209 210 /* Error code representing command wait timeout */ 211 ERROR_WIFI_DIRECT_COMMAND_WAIT_TIMEOUT = ERROR_BASE - 4022, 212 213 /* Error code representing p2p link is used by another service */ 214 ERROR_P2P_LINK_USED_BY_ANOTHER_SERVICE = ERROR_BASE - 5000, 215 216 /* Error code representing mismatch role */ 217 ERROR_P2P_GC_AVAILABLE_WITH_MISMATCHED_ROLE = ERROR_BASE - 5001, 218 219 /* Error code representing current GC device has connected to another device */ 220 ERROR_P2P_GC_CONNECTED_TO_ANOTHER_DEVICE = ERROR_BASE - 5002, 221 222 /* Error code representing the GO is not a trusted device */ 223 ERROR_P2P_GO_NOT_TRUSTED = ERROR_BASE - 5003, 224 225 /* Error code representing fail to apply GC ip address */ 226 ERROR_P2P_APPLY_GC_IP_FAIL = ERROR_BASE - 5004, 227 228 /* Error code representing p2p server has already destroyed */ 229 ERROR_P2P_SERVER_ALREADY_DESTROYED = ERROR_BASE - 5005, 230 231 /* Error code representing two devices are both GO */ 232 ERROR_P2P_BOTH_GO = ERROR_BASE - 5006, 233 234 /* Error code representing remote GC device has connected to another GO */ 235 ERROR_P2P_PEER_GC_CONNECTED_TO_ANOTHER_DEVICE = ERROR_BASE - 5007, 236 237 /* Error code representing GO available with mismatched role */ 238 ERROR_P2P_GO_AVAILABLE_WITH_MISMATCHED_ROLE = ERROR_BASE - 5008, 239 240 /* Error code representing fail to remove link */ 241 ERROR_P2P_SHARE_LINK_REMOVE_FAILED = ERROR_BASE - 5009, 242 243 /* Error code representing fail to reuse link */ 244 ERROR_P2P_SHARE_LINK_REUSE_FAILED = ERROR_BASE - 5010, 245 246 /* Error code representing handling an expired request */ 247 ERROR_P2P_EXPIRED_REQ = ERROR_BASE - 5011, 248 249 /* Error code representing fail to connect group */ 250 ERROR_P2P_CONNECT_GROUP_FAILED = ERROR_BASE - 5200, 251 252 /* Error code representing p2p client already exists */ 253 ERROR_P2P_CLIENT_EXISTS = ERROR_BASE - 5201, 254 255 /* Error code representing fail to create p2p group */ 256 ERROR_P2P_CREATE_GROUP_FAILED = ERROR_BASE - 5600, 257 258 /* Error code representing p2p server already exists */ 259 ERROR_P2P_SERVER_EXISTS = ERROR_BASE - 5601, 260 261 /* Error code representing fail disconnect hml */ 262 ERROR_HML_DISCONNECT_FAIL = ERROR_BASE - 6000, 263 264 /* Error code representing config ip fail */ 265 ERROR_HML_CONFIG_IP_FAIL = ERROR_BASE - 6001, 266 267 /* Error code representing apply ip fail */ 268 ERROR_HML_APPLY_IP_FAIL = ERROR_BASE - 6002, 269 270 /* Error code representing fail to connect hml group */ 271 ERROR_HML_CONNECT_GROUP_FAIL = ERROR_BASE - 6200, 272 273 /* Error code representing fail to create hml group */ 274 ERROR_HML_CREATE_GROUP_FAIL = ERROR_BASE - 6600, 275 276 /* Error code representing fail to destroy hml group */ 277 ERROR_HML_DESTROY_FAIL = ERROR_BASE - 6601, 278 279 /* Error code representing fail to notify connect */ 280 ERROR_HML_CONNECT_NOTIFY_FAIL = ERROR_BASE - 6602, 281 282 /* Error code representing 3 vap conflict */ 283 ERROR_LOCAL_THREE_VAP_CONFLICT = ERROR_BASE - 6603, 284 285 /* Error code representing Peer device 3 vap conflict */ 286 ERROR_PEER_THREE_VAP_CONFLICT = ERROR_BASE - 6604, 287 288 /* Error code representing end position of wifi direct errors */ 289 ERROR_WIFI_DIRECT_END = ERROR_BASE - 6999, 290 }; 291 292 #ifdef __cplusplus 293 } 294 #endif 295 #endif