b.liu | d440f9f | 2025-04-18 10:44:31 +0800 | [diff] [blame] | 1 | /*-----------------------------------------------------------------------------------------------*/ |
| 2 | /** |
| 3 | @file ql_wifi.h |
| 4 | @brief Wi-Fi service API |
| 5 | |
| 6 | @detailes |
| 7 | Quectel series module Wi-Fi service. |
| 8 | |
| 9 | @htmlonly |
| 10 | <span style="font-weight: bold">History</span> |
| 11 | @endhtmlonly |
| 12 | |
| 13 | when | who | what, where, why |
| 14 | -------- | --- | ---------------------------------------------------------- |
| 15 | 2020-04-03 | ewen.li | Created . |
| 16 | 2021-11-08 | ewen.li | Add Wi-Fi P2P API and callback function . |
| 17 | |
| 18 | Copyright (c) 2019 Quectel Wireless Solution, Co., Ltd. All Rights Reserved. |
| 19 | Quectel Wireless Solution Proprietary and Confidential. |
| 20 | -------------------------------------------------------------------------------------------------*/ |
| 21 | #ifndef __QL_WIFI_H__ |
| 22 | #define __QL_WIFI_H__ |
| 23 | |
| 24 | #include "ql_wifi_common.h" |
| 25 | |
| 26 | #ifdef __cplusplus |
| 27 | extern "C" { |
| 28 | #endif |
| 29 | |
| 30 | /*-----------------------------------------------------------------------------------------------*/ |
| 31 | /** |
| 32 | @brief Wi-Fi enable status callback function. |
| 33 | |
| 34 | @param[in] pre_status: The previous Wi-Fi enable status. |
| 35 | @param[in] status: The current Wi-Fi enable status. |
| 36 | |
| 37 | @retval void |
| 38 | */ |
| 39 | /*-----------------------------------------------------------------------------------------------*/ |
| 40 | typedef void (*ql_wifi_enable_status_ind_cb_f)(QL_WIFI_ENABLE_STATUS_E pre_status, QL_WIFI_ENABLE_STATUS_E status); |
| 41 | |
| 42 | /*-----------------------------------------------------------------------------------------------*/ |
| 43 | /** |
| 44 | @brief AP mode status callback function. |
| 45 | |
| 46 | @param[in] pre_status: The previous AP mode status. |
| 47 | @param[in] p_msg: The current AP mode status information. |
| 48 | |
| 49 | @retval void |
| 50 | */ |
| 51 | /*-----------------------------------------------------------------------------------------------*/ |
| 52 | typedef void (*ql_wifi_ap_status_ind_cb_f)(QL_WIFI_AP_INDEX_E index, QL_WIFI_AP_STATUS_E pre_status, ql_wifi_ap_status_t *p_msg); |
| 53 | |
| 54 | /*-----------------------------------------------------------------------------------------------*/ |
| 55 | /** |
| 56 | @brief STA mode status callback function. |
| 57 | |
| 58 | @param[in] pre_status: The previous STA mode status. |
| 59 | @param[in] p_msg: The current STA mode status information. |
| 60 | |
| 61 | @retval void |
| 62 | */ |
| 63 | /*-----------------------------------------------------------------------------------------------*/ |
| 64 | typedef void (*ql_wifi_sta_status_ind_cb_f)(QL_WIFI_STA_STATUS_E pre_status, ql_wifi_sta_status_t *p_msg); |
| 65 | |
| 66 | /*-----------------------------------------------------------------------------------------------*/ |
| 67 | /** |
| 68 | @brief STA scan results callback function. |
| 69 | |
| 70 | @param[in] p_msg: The information list of external hotspots. |
| 71 | |
| 72 | @retval void |
| 73 | */ |
| 74 | /*-----------------------------------------------------------------------------------------------*/ |
| 75 | typedef void (*ql_wifi_sta_scan_result_ind_cb_f)(ql_wifi_sta_scan_result_t *p_msg); |
| 76 | |
| 77 | /*-----------------------------------------------------------------------------------------------*/ |
| 78 | /** |
| 79 | @brief This is a callback function for status of connection between AP and STA device. |
| 80 | |
| 81 | @param[in] index: The index of AP mode. |
| 82 | @param[in] p_msg: The status of connection between AP and STA device. |
| 83 | |
| 84 | @retval void |
| 85 | */ |
| 86 | /*-----------------------------------------------------------------------------------------------*/ |
| 87 | typedef void (*ql_wifi_ap_sta_connect_ind_cb_f)(QL_WIFI_AP_INDEX_E index, ql_wifi_sta_connect_status_t *p_msg); |
| 88 | |
| 89 | /*-----------------------------------------------------------------------------------------------*/ |
| 90 | /** |
| 91 | @brief Wi-Fi service error callback function. |
| 92 | |
| 93 | @param[in] error: Error code. |
| 94 | |
| 95 | @retval void |
| 96 | */ |
| 97 | /*-----------------------------------------------------------------------------------------------*/ |
| 98 | typedef void (*ql_wifi_service_error_cb_f)(int error); |
| 99 | |
| 100 | /*-----------------------------------------------------------------------------------------------*/ |
| 101 | /** |
| 102 | @brief This is a callback function for status of P2P enable. |
| 103 | |
| 104 | @param[in] pre_status: The previous P2P enable status. |
| 105 | @param[in] status: The current P2P enable status. |
| 106 | |
| 107 | @retval void |
| 108 | */ |
| 109 | /*-----------------------------------------------------------------------------------------------*/ |
| 110 | typedef void (*ql_wifi_p2p_enable_status_ind_cb_f)(QL_WIFI_P2P_ENABLE_STATUS_E pre_status, QL_WIFI_P2P_ENABLE_STATUS_E status); |
| 111 | |
| 112 | /*-----------------------------------------------------------------------------------------------*/ |
| 113 | /** |
| 114 | @brief The found p2p device callback function. |
| 115 | |
| 116 | @param[in] p_msg: The information of p2p device |
| 117 | |
| 118 | @retval void |
| 119 | */ |
| 120 | /*-----------------------------------------------------------------------------------------------*/ |
| 121 | typedef void (*ql_wifi_p2p_dev_found_ind_cb_f)(ql_wifi_p2p_found_dev_info_t *p_msg); |
| 122 | |
| 123 | /*-----------------------------------------------------------------------------------------------*/ |
| 124 | /** |
| 125 | @brief Peer p2p device requesting connection callback function. |
| 126 | |
| 127 | @param[in] p_msg: The information of peer p2p device |
| 128 | |
| 129 | @retval void |
| 130 | */ |
| 131 | /*-----------------------------------------------------------------------------------------------*/ |
| 132 | typedef void (*ql_wifi_p2p_peer_dev_req_ind_cb_f)(ql_wifi_p2p_req_peer_dev_info_t *pmsg); |
| 133 | |
| 134 | /*-----------------------------------------------------------------------------------------------*/ |
| 135 | /** |
| 136 | @brief P2P status callback function. |
| 137 | |
| 138 | @param[in] pre_status: The previous P2P status. |
| 139 | @param[in] status: The current P2P status information. |
| 140 | |
| 141 | @retval void |
| 142 | */ |
| 143 | /*-----------------------------------------------------------------------------------------------*/ |
| 144 | typedef void (*ql_wifi_p2p_status_ind_cb_f)(QL_WIFI_P2P_STATUS_E pre_status, ql_wifi_p2p_status_t *p_msg); |
| 145 | |
| 146 | /*-----------------------------------------------------------------------------------------------*/ |
| 147 | /** |
| 148 | @brief This function initializes Wi-Fi service. |
| 149 | |
| 150 | @retval QL_ERR_OK: Successful execution. |
| 151 | @retval QL_ERR_SERVICE_NOT_READY: Wi-Fi service is not ready. It is recommended to try again. |
| 152 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 153 | |
| 154 | @note Before other Wi-Fi APIs are used, this function must be called to initialize the Wi-Fi service. |
| 155 | */ |
| 156 | /*-----------------------------------------------------------------------------------------------*/ |
| 157 | int ql_wifi_init(void); |
| 158 | |
| 159 | /*-----------------------------------------------------------------------------------------------*/ |
| 160 | /** |
| 161 | @brief This function deinitializes Wi-Fi service. |
| 162 | |
| 163 | @retval QL_ERR_OK: Successful execution. |
| 164 | Other value: Failed execution. See ql_type.h for the error code. |
| 165 | */ |
| 166 | /*-----------------------------------------------------------------------------------------------*/ |
| 167 | int ql_wifi_deinit(void); |
| 168 | |
| 169 | /*-----------------------------------------------------------------------------------------------*/ |
| 170 | /** |
| 171 | @brief This function sets the country code of wlan driver |
| 172 | |
| 173 | @param[in] country_code: The country code to be set. The country code cannot exceed 2 bytes and is not empty. For example, CN represents China. |
| 174 | |
| 175 | @retval QL_ERR_OK: Successful execution. |
| 176 | @retval QL_ERR_NOT_INIT: Failed execution. The Wi-Fi service is not initialized. |
| 177 | @retval QL_ERR_SERVICE_ABORT: Failed execution due to Wi-Fi service error. |
| 178 | @retval QL_ERR_INVALID_ARG: Failed execution due to illegal parameter. |
| 179 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 180 | |
| 181 | @note Before calling the ql_wifi_enable(), call this function firstly to set country code, |
| 182 | If this function is not called, The country code "CN" will be used by default. |
| 183 | */ |
| 184 | /*-----------------------------------------------------------------------------------------------*/ |
| 185 | int ql_wifi_country_code_set(const char *country_code); |
| 186 | |
| 187 | /*-----------------------------------------------------------------------------------------------*/ |
| 188 | /** |
| 189 | @brief This function gets the country code of wlan driver. |
| 190 | |
| 191 | @param[out] country_code_buf: The buffer for storing the current country code. The buffer size is recommended to be 3 bytes. |
| 192 | @param[in] The length of buffer. |
| 193 | |
| 194 | @retval QL_ERR_OK: Successful execution. |
| 195 | @retval QL_ERR_NOT_INIT: Failed execution. The Wi-Fi service is not initialized. |
| 196 | @retval QL_ERR_SERVICE_ABORT: Failed execution due to Wi-Fi service error. |
| 197 | @retval QL_ERR_INVALID_ARG: Failed execution due to illegal parameter. |
| 198 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 199 | */ |
| 200 | /*-----------------------------------------------------------------------------------------------*/ |
| 201 | int ql_wifi_country_code_get(char *country_code_buf, int buf_len); |
| 202 | |
| 203 | /*-----------------------------------------------------------------------------------------------*/ |
| 204 | /** |
| 205 | @brief This function enables Wi-Fi function. |
| 206 | |
| 207 | @retval QL_ERR_OK: Successful execution. |
| 208 | @retval QL_ERR_NOT_INIT: Failed execution. The Wi-Fi service is not initialized. |
| 209 | @retval QL_ERR_SERVICE_ABORT: Failed execution due to Wi-Fi service error. |
| 210 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 211 | */ |
| 212 | /*-----------------------------------------------------------------------------------------------*/ |
| 213 | int ql_wifi_enable(void); |
| 214 | |
| 215 | /*-----------------------------------------------------------------------------------------------*/ |
| 216 | /** |
| 217 | @brief This function disables Wi-Fi function. |
| 218 | |
| 219 | @retval QL_ERR_OK: Successful execution. |
| 220 | @retval QL_ERR_NOT_INIT: Failed execution. The Wi-Fi service is not initialized. |
| 221 | @retval QL_ERR_SERVICE_ABORT: Failed execution due to Wi-Fi service error. |
| 222 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 223 | */ |
| 224 | /*-----------------------------------------------------------------------------------------------*/ |
| 225 | int ql_wifi_disable(void); |
| 226 | |
| 227 | |
| 228 | |
| 229 | /*-----------------------------------------------------------------------------------------------*/ |
| 230 | /** |
| 231 | @brief This function set bridge function. |
| 232 | |
| 233 | @retval QL_ERR_OK: Successful execution. |
| 234 | @retval QL_ERR_NOT_INIT: Failed execution. The Wi-Fi service is not initialized. |
| 235 | @retval QL_ERR_SERVICE_ABORT: Failed execution due to Wi-Fi service error. |
| 236 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 237 | */ |
| 238 | /*-----------------------------------------------------------------------------------------------*/ |
| 239 | int ql_wifi_set_bridge(char *bridge); |
| 240 | |
| 241 | /*-----------------------------------------------------------------------------------------------*/ |
| 242 | /** |
| 243 | @brief This function registers Wi-Fi enable status callback function. |
| 244 | |
| 245 | @param[in] cb: The Wi-Fi enable status callback function. |
| 246 | |
| 247 | @retval QL_ERR_OK: Successful execution. |
| 248 | @retval QL_ERR_NOT_INIT: Failed execution. The Wi-Fi service is not initialized. |
| 249 | @retval QL_ERR_SERVICE_ABORT: Failed execution due to Wi-Fi service error. |
| 250 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 251 | */ |
| 252 | /*-----------------------------------------------------------------------------------------------*/ |
| 253 | int ql_wifi_set_enable_status_ind_cb(ql_wifi_enable_status_ind_cb_f cb); |
| 254 | |
| 255 | /*-----------------------------------------------------------------------------------------------*/ |
| 256 | /** |
| 257 | @brief This function sets the Wi-Fi working mode. |
| 258 | |
| 259 | @param[in] mode: The Wi-Fi working mode to be set. |
| 260 | |
| 261 | @retval QL_ERR_OK: Successful execution. |
| 262 | @retval QL_ERR_NOT_INIT: Failed execution. The Wi-Fi service is not initialized. |
| 263 | @retval QL_ERR_SERVICE_ABORT: Failed execution due to Wi-Fi service error. |
| 264 | @retval QL_ERR_INVALID_ARG: Failed execution due to illegal parameter. |
| 265 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 266 | */ |
| 267 | /*-----------------------------------------------------------------------------------------------*/ |
| 268 | int ql_wifi_work_mode_set(QL_WIFI_WORK_MODE_E mode); |
| 269 | |
| 270 | /*-----------------------------------------------------------------------------------------------*/ |
| 271 | /** |
| 272 | @brief This function gets the current Wi-Fi working mode. |
| 273 | |
| 274 | @param[out] p_mode: The current Wi-Fi working mode. |
| 275 | |
| 276 | @retval QL_ERR_OK: Successful execution. |
| 277 | @retval QL_ERR_NOT_INIT: Failed execution. The Wi-Fi service is not initialized. |
| 278 | @retval QL_ERR_SERVICE_ABORT: Failed execution due to Wi-Fi service error. |
| 279 | @retval QL_ERR_INVALID_ARG: Failed execution due to illegal parameter. |
| 280 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 281 | */ |
| 282 | /*-----------------------------------------------------------------------------------------------*/ |
| 283 | int ql_wifi_work_mode_get(QL_WIFI_WORK_MODE_E *p_mode); |
| 284 | |
| 285 | /*-----------------------------------------------------------------------------------------------*/ |
| 286 | /** |
| 287 | @brief This function sets the SSID in AP mode. |
| 288 | |
| 289 | @param[in] idx: The index of AP mode. |
| 290 | @param[in] ssid: The SSID to be set. It should be within 32 bytes and is not empty. |
| 291 | |
| 292 | @retval QL_ERR_OK: Successful execution. |
| 293 | @retval QL_ERR_NOT_INIT: Failed execution. The Wi-Fi service is not initialized. |
| 294 | @retval QL_ERR_SERVICE_ABORT: Failed execution due to Wi-Fi service error. |
| 295 | @retval QL_ERR_INVALID_ARG: Failed execution due to illegal parameter. |
| 296 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 297 | */ |
| 298 | /*-----------------------------------------------------------------------------------------------*/ |
| 299 | int ql_wifi_ap_ssid_set(QL_WIFI_AP_INDEX_E idx, const char *ssid); |
| 300 | |
| 301 | /*-----------------------------------------------------------------------------------------------*/ |
| 302 | /** |
| 303 | @brief This function gets the SSID in AP mode. |
| 304 | |
| 305 | @param[in] idx: The index of AP mode. |
| 306 | @param[out] ssid_buf: The buffer for storing the current SSID, the buffer size is recommended to be 33 bytes. |
| 307 | @param[in] buf_len: The length of the buffer. |
| 308 | |
| 309 | @retval QL_ERR_OK: Successful execution. |
| 310 | @retval QL_ERR_NOT_INIT: Failed execution. The Wi-Fi service is not initialized. |
| 311 | @retval QL_ERR_SERVICE_ABORT: Failed execution due to Wi-Fi service error. |
| 312 | @retval QL_ERR_INVALID_ARG: Failed execution due to illegal parameter. |
| 313 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 314 | */ |
| 315 | /*-----------------------------------------------------------------------------------------------*/ |
| 316 | int ql_wifi_ap_ssid_get(QL_WIFI_AP_INDEX_E idx, char *ssid_buf, int buf_len); |
| 317 | |
| 318 | /*-----------------------------------------------------------------------------------------------*/ |
| 319 | /** |
| 320 | @brief This function sets the SSID hiding status in AP mode. |
| 321 | |
| 322 | @param[in] idx: The index of AP mode. |
| 323 | @param[in] ssid_hidden: The SSID hiding status to be set. |
| 324 | 0: The SSID is not hidden. |
| 325 | 1: The SSID is hidden. |
| 326 | |
| 327 | @retval QL_ERR_OK: Successful execution. |
| 328 | @retval QL_ERR_NOT_INIT: Failed execution. The Wi-Fi service is not initialized. |
| 329 | @retval QL_ERR_SERVICE_ABORT: Failed execution due to Wi-Fi service error. |
| 330 | @retval QL_ERR_INVALID_ARG: Failed execution due to illegal parameter. |
| 331 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 332 | */ |
| 333 | /*-----------------------------------------------------------------------------------------------*/ |
| 334 | int ql_wifi_ap_ssid_hidden_set(QL_WIFI_AP_INDEX_E idx, int ssid_hidden); |
| 335 | |
| 336 | /*-----------------------------------------------------------------------------------------------*/ |
| 337 | /** |
| 338 | @brief This function gets the SSID hiding status in AP mode. |
| 339 | |
| 340 | @param[in] idx: The index of AP mode. |
| 341 | @param[out] p_ssid_hidden: The current SSID hiding status in AP mode. |
| 342 | |
| 343 | @retval QL_ERR_OK: Successful execution. |
| 344 | @retval QL_ERR_NOT_INIT: Failed execution. The Wi-Fi service is not initialized. |
| 345 | @retval QL_ERR_SERVICE_ABORT: Failed execution due to Wi-Fi service error. |
| 346 | @retval QL_ERR_INVALID_ARG: Failed execution due to illegal parameter. |
| 347 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 348 | */ |
| 349 | /*-----------------------------------------------------------------------------------------------*/ |
| 350 | int ql_wifi_ap_ssid_hidden_get(QL_WIFI_AP_INDEX_E idx, int *p_ssid_hidden); |
| 351 | |
| 352 | /*-----------------------------------------------------------------------------------------------*/ |
| 353 | /** |
| 354 | @brief This function sets the working protocol mode in AP mode. |
| 355 | |
| 356 | @param[in] idx: The index of AP mode. |
| 357 | @param[in] mode: The working protocol mode to be set. |
| 358 | |
| 359 | @retval QL_ERR_OK: Successful execution. |
| 360 | @retval QL_ERR_NOT_INIT: Failed execution. The Wi-Fi service is not initialized. |
| 361 | @retval QL_ERR_SERVICE_ABORT: Failed execution due to Wi-Fi service error. |
| 362 | @retval QL_ERR_INVALID_ARG: Failed execution due to illegal parameter. |
| 363 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 364 | */ |
| 365 | /*-----------------------------------------------------------------------------------------------*/ |
| 366 | int ql_wifi_ap_mode_set(QL_WIFI_AP_INDEX_E idx, QL_WIFI_AP_MODE_TYPE_E mode); |
| 367 | |
| 368 | /*-----------------------------------------------------------------------------------------------*/ |
| 369 | /** |
| 370 | @brief This function gets the working protocol mode in AP mode. |
| 371 | |
| 372 | @param[in] idx: The index of AP mode. |
| 373 | @param[out] p_mode: The current working protocol mode in AP mode. |
| 374 | |
| 375 | @retval QL_ERR_OK: Successful execution. |
| 376 | @retval QL_ERR_NOT_INIT: Failed execution. The Wi-Fi service is not initialized. |
| 377 | @retval QL_ERR_SERVICE_ABORT: Failed execution due to Wi-Fi service error. |
| 378 | @retval QL_ERR_INVALID_ARG: Failed execution due to illegal parameter. |
| 379 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 380 | */ |
| 381 | /*-----------------------------------------------------------------------------------------------*/ |
| 382 | int ql_wifi_ap_mode_get(QL_WIFI_AP_INDEX_E idx, QL_WIFI_AP_MODE_TYPE_E *p_mode); |
| 383 | |
| 384 | /*-----------------------------------------------------------------------------------------------*/ |
| 385 | /** |
| 386 | @brief This function sets the bandwidth in AP mode. |
| 387 | |
| 388 | @param[in] idx: The index of AP mode. |
| 389 | @param[in] bandwidth: The bandwidth to be set. |
| 390 | |
| 391 | @retval QL_ERR_OK: Successful execution. |
| 392 | @retval QL_ERR_NOT_INIT: Failed execution. The Wi-Fi service is not initialized. |
| 393 | @retval QL_ERR_SERVICE_ABORT: Failed execution due to Wi-Fi service error. |
| 394 | @retval QL_ERR_INVALID_ARG: Failed execution due to illegal parameter. |
| 395 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 396 | */ |
| 397 | /*-----------------------------------------------------------------------------------------------*/ |
| 398 | int ql_wifi_ap_bandwidth_set(QL_WIFI_AP_INDEX_E idx, QL_WIFI_BANDWIDTH_E bandwidth); |
| 399 | |
| 400 | /*-----------------------------------------------------------------------------------------------*/ |
| 401 | /** |
| 402 | @brief This function gets the bandwidth in AP mode. |
| 403 | |
| 404 | @param[in] idx: The index of AP mode. |
| 405 | @param[out] p_bandwidth: The current bandwidth in AP mode. |
| 406 | |
| 407 | @retval QL_ERR_OK: Successful execution. |
| 408 | @retval QL_ERR_NOT_INIT: Failed execution. The Wi-Fi service is not initialized. |
| 409 | @retval QL_ERR_SERVICE_ABORT: Failed execution due to Wi-Fi service error. |
| 410 | @retval QL_ERR_INVALID_ARG: Failed execution due to illegal parameter. |
| 411 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 412 | */ |
| 413 | /*-----------------------------------------------------------------------------------------------*/ |
| 414 | int ql_wifi_ap_bandwidth_get(QL_WIFI_AP_INDEX_E idx, QL_WIFI_BANDWIDTH_E *p_bandwidth); |
| 415 | |
| 416 | /*-----------------------------------------------------------------------------------------------*/ |
| 417 | /** |
| 418 | @brief This function sets the channel in AP mode. |
| 419 | |
| 420 | @param[in] idx: The index of AP mode. |
| 421 | @param[in] channel: The channel to be set. |
| 422 | 0: Adaptive |
| 423 | 1/2/3/4/5/6/7/8/9/10/11/12/13/14: 2.4G channel. |
| 424 | 36/40/44/48/52/56/60/64/100/104/108/112/116/120/124/128/132/136/140/144/149/153/157/161/165: 5GHZ channel. |
| 425 | |
| 426 | @retval QL_ERR_OK: Successful execution. |
| 427 | @retval QL_ERR_NOT_INIT: Failed execution. The Wi-Fi service is not initialized. |
| 428 | @retval QL_ERR_SERVICE_ABORT: Failed execution due to Wi-Fi service error. |
| 429 | @retval QL_ERR_INVALID_ARG: Failed execution due to illegal parameter. |
| 430 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 431 | */ |
| 432 | /*-----------------------------------------------------------------------------------------------*/ |
| 433 | int ql_wifi_ap_channel_set(QL_WIFI_AP_INDEX_E idx, int channel); |
| 434 | |
| 435 | /*-----------------------------------------------------------------------------------------------*/ |
| 436 | /** |
| 437 | @brief This function gets the channel in AP mode. |
| 438 | |
| 439 | @param[in] idx: The index of AP mode. |
| 440 | @param[out] p_channel: The currently-used channel in AP mode. |
| 441 | |
| 442 | @retval QL_ERR_OK: Successful execution. |
| 443 | @retval QL_ERR_NOT_INIT: Failed execution. The Wi-Fi service is not initialized. |
| 444 | @retval QL_ERR_SERVICE_ABORT: Failed execution due to Wi-Fi service error. |
| 445 | @retval QL_ERR_INVALID_ARG: Failed execution due to illegal parameter. |
| 446 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 447 | */ |
| 448 | /*-----------------------------------------------------------------------------------------------*/ |
| 449 | int ql_wifi_ap_channel_get(QL_WIFI_AP_INDEX_E idx, int *p_channel); |
| 450 | |
| 451 | /*-----------------------------------------------------------------------------------------------*/ |
| 452 | /** |
| 453 | @brief This function sets the maximum number of terminal connections in AP mode. |
| 454 | |
| 455 | @param[in] idx: The index of AP mode. |
| 456 | @param[in] max_sta_num: The maximum number of terminal connections in AP mode to be set. Range: 1~32. |
| 457 | |
| 458 | @retval QL_ERR_OK: Successful execution. |
| 459 | @retval QL_ERR_NOT_INIT: Failed execution. The Wi-Fi service is not initialized. |
| 460 | @retval QL_ERR_SERVICE_ABORT: Failed execution due to Wi-Fi service error. |
| 461 | @retval QL_ERR_INVALID_ARG: Failed execution due to illegal parameter. |
| 462 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 463 | */ |
| 464 | /*-----------------------------------------------------------------------------------------------*/ |
| 465 | int ql_wifi_ap_max_sta_num_set(QL_WIFI_AP_INDEX_E idx, int max_sta_num); |
| 466 | |
| 467 | /*-----------------------------------------------------------------------------------------------*/ |
| 468 | /** |
| 469 | @brief This function gets the maximum number of terminal connections in AP mode. |
| 470 | |
| 471 | @param[in] idx: The index of AP mode. |
| 472 | @param[out] p_max_sta_num: The current maximum number of terminal connections in AP mode. |
| 473 | |
| 474 | @retval QL_ERR_OK: Successful execution. |
| 475 | @retval QL_ERR_NOT_INIT: Failed execution. The Wi-Fi service is not initialized. |
| 476 | @retval QL_ERR_SERVICE_ABORT: Failed execution due to Wi-Fi service error. |
| 477 | @retval QL_ERR_INVALID_ARG: Failed execution due to illegal parameter. |
| 478 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 479 | */ |
| 480 | /*-----------------------------------------------------------------------------------------------*/ |
| 481 | int ql_wifi_ap_max_sta_num_get(QL_WIFI_AP_INDEX_E idx, int *p_max_sta_num); |
| 482 | |
| 483 | /*-----------------------------------------------------------------------------------------------*/ |
| 484 | /** |
| 485 | @brief This function sets the country code in AP mode. |
| 486 | |
| 487 | @param[in] idx: The index of AP mode. |
| 488 | @param[in] country_code: The country code to be set. The country code cannot exceed 2 bytes and is not empty. For example, CN represents China. |
| 489 | |
| 490 | @retval QL_ERR_OK: Successful execution. |
| 491 | @retval QL_ERR_NOT_INIT: Failed execution. The Wi-Fi service is not initialized. |
| 492 | @retval QL_ERR_SERVICE_ABORT: Failed execution due to Wi-Fi service error. |
| 493 | @retval QL_ERR_INVALID_ARG: Failed execution due to illegal parameter. |
| 494 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 495 | */ |
| 496 | /*-----------------------------------------------------------------------------------------------*/ |
| 497 | int ql_wifi_ap_country_code_set(QL_WIFI_AP_INDEX_E idx, const char *country_code); |
| 498 | |
| 499 | /*-----------------------------------------------------------------------------------------------*/ |
| 500 | /** |
| 501 | @brief This function gets the country code in AP mode. |
| 502 | |
| 503 | @param[in] idx: The index of AP mode. |
| 504 | @param[out] country_code_buf: The buffer for storing the current country code. The buffer size is recommended to be 3 bytes. |
| 505 | @param[in] The length of buffer. |
| 506 | |
| 507 | @retval QL_ERR_OK: Successful execution. |
| 508 | @retval QL_ERR_NOT_INIT: Failed execution. The Wi-Fi service is not initialized. |
| 509 | @retval QL_ERR_SERVICE_ABORT: Failed execution due to Wi-Fi service error. |
| 510 | @retval QL_ERR_INVALID_ARG: Failed execution due to illegal parameter. |
| 511 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 512 | */ |
| 513 | /*-----------------------------------------------------------------------------------------------*/ |
| 514 | int ql_wifi_ap_country_code_get(QL_WIFI_AP_INDEX_E idx, char *country_code_buf, int buf_len); |
| 515 | |
| 516 | /*-----------------------------------------------------------------------------------------------*/ |
| 517 | /** |
| 518 | @brief This function sets the AP isolation state. |
| 519 | |
| 520 | @param[in] idx: The index of AP mode. |
| 521 | @param[in] isolate: AP isolation status to be set. |
| 522 | 0: AP is not isolated. |
| 523 | 1: AP is isolated. |
| 524 | |
| 525 | @retval QL_ERR_OK: Successful execution. |
| 526 | @retval QL_ERR_NOT_INIT: Failed execution. The Wi-Fi service is not initialized. |
| 527 | @retval QL_ERR_SERVICE_ABORT: Failed execution due to Wi-Fi service error. |
| 528 | @retval QL_ERR_INVALID_ARG: Failed execution due to illegal parameter. |
| 529 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 530 | */ |
| 531 | /*-----------------------------------------------------------------------------------------------*/ |
| 532 | int ql_wifi_ap_isolate_set(QL_WIFI_AP_INDEX_E idx, int isolate); |
| 533 | |
| 534 | /*-----------------------------------------------------------------------------------------------*/ |
| 535 | /** |
| 536 | @brief This function gets the AP isolation state. |
| 537 | |
| 538 | @param[in] idx: The index of AP mode. |
| 539 | @param[out] p_isolate: The current AP isolation status. |
| 540 | 0: AP is not isolated. |
| 541 | 1: AP is isolated. |
| 542 | |
| 543 | @retval QL_ERR_OK: Successful execution. |
| 544 | @retval QL_ERR_NOT_INIT: Failed execution. The Wi-Fi service is not initialized. |
| 545 | @retval QL_ERR_SERVICE_ABORT: Failed execution due to Wi-Fi service error. |
| 546 | @retval QL_ERR_INVALID_ARG: Failed execution due to illegal parameter. |
| 547 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 548 | */ |
| 549 | /*-----------------------------------------------------------------------------------------------*/ |
| 550 | int ql_wifi_ap_isolate_get(QL_WIFI_AP_INDEX_E idx, int *p_isolate); |
| 551 | |
| 552 | /*-----------------------------------------------------------------------------------------------*/ |
| 553 | /** |
| 554 | @brief This function sets MAC address access rules in AP mode. |
| 555 | |
| 556 | @param[in] idx: The index of AP mode. |
| 557 | @param[in] acl_rule: MAC address access rules to be set. |
| 558 | |
| 559 | @retval QL_ERR_OK: Successful execution. |
| 560 | @retval QL_ERR_NOT_INIT: Failed execution. The Wi-Fi service is not initialized. |
| 561 | @retval QL_ERR_SERVICE_ABORT: Failed execution due to Wi-Fi service error. |
| 562 | @retval QL_ERR_INVALID_ARG: Failed execution due to illegal parameter. |
| 563 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 564 | */ |
| 565 | /*-----------------------------------------------------------------------------------------------*/ |
| 566 | int ql_wifi_ap_mac_acl_rule_set(QL_WIFI_AP_INDEX_E idx, QL_WIFI_MAC_ACL_RULE_E acl_rule); |
| 567 | |
| 568 | /*-----------------------------------------------------------------------------------------------*/ |
| 569 | /** |
| 570 | @brief This function gets MAC address access rules in AP mode. |
| 571 | |
| 572 | @param[in] idx: The index of AP mode. |
| 573 | @param[out] p_acl_rule: The current MAC address access rules. |
| 574 | |
| 575 | @retval QL_ERR_OK: Successful execution. |
| 576 | @retval QL_ERR_NOT_INIT: Failed execution. The Wi-Fi service is not initialized. |
| 577 | @retval QL_ERR_SERVICE_ABORT: Failed execution due to Wi-Fi service error. |
| 578 | @retval QL_ERR_INVALID_ARG: Failed execution due to illegal parameter. |
| 579 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 580 | */ |
| 581 | /*-----------------------------------------------------------------------------------------------*/ |
| 582 | int ql_wifi_ap_mac_acl_rule_get(QL_WIFI_AP_INDEX_E idx, QL_WIFI_MAC_ACL_RULE_E *p_acl_rule); |
| 583 | |
| 584 | /*-----------------------------------------------------------------------------------------------*/ |
| 585 | /** |
| 586 | @brief This function adds or deletes the specified MAC address for the current MAC address access rule. |
| 587 | |
| 588 | @param[in] idx: The index of AP mode. |
| 589 | @param[in] cmd: MAC address operation command. |
| 590 | @param[in] macaddr: MAC address to be added or deleted., The format of MAC address |
| 591 | must be %02X:%02X:%02X:%02X:%02X:%02X, For example: 1A:2B:3C:4D:56:78. |
| 592 | |
| 593 | @retval QL_ERR_OK: Successful execution. |
| 594 | @retval QL_ERR_NOT_INIT: Failed execution. The Wi-Fi service is not initialized. |
| 595 | @retval QL_ERR_SERVICE_ABORT: Failed execution due to Wi-Fi service error. |
| 596 | @retval QL_ERR_INVALID_ARG: Failed execution due to illegal parameter. |
| 597 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 598 | */ |
| 599 | /*-----------------------------------------------------------------------------------------------*/ |
| 600 | int ql_wifi_ap_acl_mac_set(QL_WIFI_AP_INDEX_E idx, QL_WIFI_ACL_MAC_CMD_E cmd, const char *macaddr); |
| 601 | |
| 602 | /*-----------------------------------------------------------------------------------------------*/ |
| 603 | /** |
| 604 | @brief This function gets all MAC addresses in the current MAC address access rule. |
| 605 | |
| 606 | @param[in] idx: The index of AP mode. |
| 607 | @param[out] p_mac_list: MAC address list. |
| 608 | |
| 609 | @retval QL_ERR_OK: Successful execution. |
| 610 | @retval QL_ERR_NOT_INIT: Failed execution. The Wi-Fi service is not initialized. |
| 611 | @retval QL_ERR_SERVICE_ABORT: Failed execution due to Wi-Fi service error. |
| 612 | @retval QL_ERR_INVALID_ARG: Failed execution due to illegal parameter. |
| 613 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 614 | */ |
| 615 | /*-----------------------------------------------------------------------------------------------*/ |
| 616 | int ql_wifi_ap_acl_mac_get(QL_WIFI_AP_INDEX_E idx, ql_wifi_acl_mac_list_t *p_mac_list); |
| 617 | |
| 618 | /*-----------------------------------------------------------------------------------------------*/ |
| 619 | /** |
| 620 | @brief This function sets the authentication in AP mode. |
| 621 | |
| 622 | @param[in] idx: The index of AP mode. |
| 623 | @param[in] p_auth: The authentication information to be set. |
| 624 | |
| 625 | @retval QL_ERR_OK: Successful execution. |
| 626 | @retval QL_ERR_NOT_INIT: Failed execution. The Wi-Fi service is not initialized. |
| 627 | @retval QL_ERR_SERVICE_ABORT: Failed execution due to Wi-Fi service error. |
| 628 | @retval QL_ERR_INVALID_ARG: Failed execution due to illegal parameter. |
| 629 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 630 | */ |
| 631 | /*-----------------------------------------------------------------------------------------------*/ |
| 632 | int ql_wifi_ap_auth_set(QL_WIFI_AP_INDEX_E idx, ql_wifi_ap_auth_t *p_auth); |
| 633 | |
| 634 | /*-----------------------------------------------------------------------------------------------*/ |
| 635 | /** |
| 636 | @brief This function gets the authentication information in AP mode. |
| 637 | |
| 638 | @param[in] idx: The index of AP mode. |
| 639 | @param[out] p_auth: The current authentication information. |
| 640 | |
| 641 | @retval QL_ERR_OK: Successful execution. |
| 642 | @retval QL_ERR_NOT_INIT: Failed execution. The Wi-Fi service is not initialized. |
| 643 | @retval QL_ERR_SERVICE_ABORT: Failed execution due to Wi-Fi service error. |
| 644 | @retval QL_ERR_INVALID_ARG: Failed execution due to illegal parameter. |
| 645 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 646 | */ |
| 647 | /*-----------------------------------------------------------------------------------------------*/ |
| 648 | int ql_wifi_ap_auth_get(QL_WIFI_AP_INDEX_E idx, ql_wifi_ap_auth_t *p_auth); |
| 649 | |
| 650 | /*-----------------------------------------------------------------------------------------------*/ |
| 651 | /** |
| 652 | @brief This function registers the AP mode status callback function. |
| 653 | |
| 654 | @param[in] cb: The AP mode status callback function. |
| 655 | |
| 656 | @retval QL_ERR_OK: Successful execution. |
| 657 | @retval QL_ERR_NOT_INIT: Failed execution. The Wi-Fi service is not initialized. |
| 658 | @retval QL_ERR_SERVICE_ABORT: Failed execution due to Wi-Fi service error. |
| 659 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 660 | */ |
| 661 | /*-----------------------------------------------------------------------------------------------*/ |
| 662 | int ql_wifi_ap_set_status_ind_cb(ql_wifi_ap_status_ind_cb_f cb); |
| 663 | |
| 664 | /*-----------------------------------------------------------------------------------------------*/ |
| 665 | /** |
| 666 | @brief This function starts the AP function. |
| 667 | |
| 668 | @param[in] index: The index of AP mode. |
| 669 | |
| 670 | @retval QL_ERR_OK: Successful execution. |
| 671 | @retval QL_ERR_NOT_INIT: Failed execution. The Wi-Fi service is not initialized. |
| 672 | @retval QL_ERR_SERVICE_ABORT: Failed execution due to Wi-Fi service error. |
| 673 | @retval QL_ERR_INVALID_ARG: Failed execution due to illegal parameter. |
| 674 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 675 | */ |
| 676 | /*-----------------------------------------------------------------------------------------------*/ |
| 677 | int ql_wifi_ap_start(QL_WIFI_AP_INDEX_E index); |
| 678 | |
| 679 | /*-----------------------------------------------------------------------------------------------*/ |
| 680 | /** |
| 681 | @brief This function stops the AP function. |
| 682 | |
| 683 | @param[in] index: The index of AP mode. |
| 684 | |
| 685 | @retval QL_ERR_OK: Successful execution. |
| 686 | @retval QL_ERR_NOT_INIT: Failed execution. The Wi-Fi service is not initialized. |
| 687 | @retval QL_ERR_SERVICE_ABORT: Failed execution due to Wi-Fi service error. |
| 688 | @retval QL_ERR_INVALID_ARG: Failed execution due to illegal parameter. |
| 689 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 690 | */ |
| 691 | /*-----------------------------------------------------------------------------------------------*/ |
| 692 | int ql_wifi_ap_stop(QL_WIFI_AP_INDEX_E index); |
| 693 | |
| 694 | /*-----------------------------------------------------------------------------------------------*/ |
| 695 | /** |
| 696 | @brief This function gets the AP mode status information. |
| 697 | |
| 698 | @param[in] index: The index of AP mode. |
| 699 | @param[out] p_sta: The current AP mode status information. |
| 700 | |
| 701 | @retval QL_ERR_OK: Successful execution. |
| 702 | @retval QL_ERR_NOT_INIT: Failed execution. The Wi-Fi service is not initialized. |
| 703 | @retval QL_ERR_SERVICE_ABORT: Failed execution due to Wi-Fi service error. |
| 704 | @retval QL_ERR_INVALID_ARG: Failed execution due to illegal parameter. |
| 705 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 706 | */ |
| 707 | /*-----------------------------------------------------------------------------------------------*/ |
| 708 | int ql_wifi_ap_get_status(QL_WIFI_AP_INDEX_E index, ql_wifi_ap_status_t *p_sta); |
| 709 | |
| 710 | /*-----------------------------------------------------------------------------------------------*/ |
| 711 | /** |
| 712 | @brief This function sets the SSID in STA mode. |
| 713 | |
| 714 | @param[in] ssid: The SSID to be set. The SSID cannot exceed 32 bytes and is not empty. |
| 715 | |
| 716 | @retval QL_ERR_OK: Successful execution. |
| 717 | @retval QL_ERR_NOT_INIT: Failed execution. The Wi-Fi service is not initialized. |
| 718 | @retval QL_ERR_SERVICE_ABORT: Failed execution due to Wi-Fi service error. |
| 719 | @retval QL_ERR_INVALID_ARG: Failed execution due to illegal parameter. |
| 720 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 721 | */ |
| 722 | /*-----------------------------------------------------------------------------------------------*/ |
| 723 | int ql_wifi_sta_ssid_set(const char *ssid); |
| 724 | |
| 725 | /*-----------------------------------------------------------------------------------------------*/ |
| 726 | /** |
| 727 | @brief This function gets the SSID in STA mode. |
| 728 | |
| 729 | @param[out] ssid_buf: The buffer for storing the current SSID. |
| 730 | @param[in] buf_len: The length of the buffer. |
| 731 | |
| 732 | @retval QL_ERR_OK: Successful execution. |
| 733 | @retval QL_ERR_NOT_INIT: Failed execution. The Wi-Fi service is not initialized. |
| 734 | @retval QL_ERR_SERVICE_ABORT: Failed execution due to Wi-Fi service error. |
| 735 | @retval QL_ERR_INVALID_ARG: Failed execution due to illegal parameter. |
| 736 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 737 | */ |
| 738 | /*-----------------------------------------------------------------------------------------------*/ |
| 739 | int ql_wifi_sta_ssid_get(char *ssid_buf, int buf_len); |
| 740 | |
| 741 | /*-----------------------------------------------------------------------------------------------*/ |
| 742 | /** |
| 743 | @brief This function sets the authentication in STA mode. |
| 744 | |
| 745 | @param[in] p_auth: The authentication information to be set. |
| 746 | |
| 747 | @retval QL_ERR_OK: Successful execution. |
| 748 | @retval QL_ERR_NOT_INIT: Failed execution. The Wi-Fi service is not initialized. |
| 749 | @retval QL_ERR_SERVICE_ABORT: Failed execution due to Wi-Fi service error. |
| 750 | @retval QL_ERR_INVALID_ARG: Failed execution due to illegal parameter. |
| 751 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 752 | */ |
| 753 | /*-----------------------------------------------------------------------------------------------*/ |
| 754 | int ql_wifi_sta_auth_set(ql_wifi_sta_auth_t *p_auth); |
| 755 | |
| 756 | /*-----------------------------------------------------------------------------------------------*/ |
| 757 | /** |
| 758 | @brief This function gets the authentication information in STA mode. |
| 759 | |
| 760 | @param[out] p_auth: The current authentication information. |
| 761 | |
| 762 | @retval QL_ERR_OK: Successful execution. |
| 763 | @retval QL_ERR_NOT_INIT: Failed execution. The Wi-Fi service is not initialized. |
| 764 | @retval QL_ERR_SERVICE_ABORT: Failed execution due to Wi-Fi service error. |
| 765 | @retval QL_ERR_INVALID_ARG: Failed execution due to illegal parameter. |
| 766 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 767 | */ |
| 768 | /*-----------------------------------------------------------------------------------------------*/ |
| 769 | int ql_wifi_sta_auth_get(ql_wifi_sta_auth_t *p_auth); |
| 770 | |
| 771 | /*-----------------------------------------------------------------------------------------------*/ |
| 772 | /** |
| 773 | @brief This function registers the STA mode status callback function. |
| 774 | |
| 775 | @param[in] cb: The STA mode status callback function. |
| 776 | |
| 777 | @retval QL_ERR_OK: Successful execution. |
| 778 | @retval QL_ERR_NOT_INIT: Failed execution. The Wi-Fi service is not initialized. |
| 779 | @retval QL_ERR_SERVICE_ABORT: Failed execution due to Wi-Fi service error. |
| 780 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 781 | */ |
| 782 | /*-----------------------------------------------------------------------------------------------*/ |
| 783 | int ql_wifi_sta_set_status_ind_cb(ql_wifi_sta_status_ind_cb_f cb); |
| 784 | |
| 785 | /*-----------------------------------------------------------------------------------------------*/ |
| 786 | /** |
| 787 | @brief This function starts the STA function. |
| 788 | |
| 789 | @retval QL_ERR_OK: Successful execution. |
| 790 | @retval QL_ERR_NOT_INIT: Failed execution. The Wi-Fi service is not initialized. |
| 791 | @retval QL_ERR_SERVICE_ABORT: Failed execution due to Wi-Fi service error. |
| 792 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 793 | */ |
| 794 | /*-----------------------------------------------------------------------------------------------*/ |
| 795 | int ql_wifi_sta_start(void); |
| 796 | |
| 797 | /*-----------------------------------------------------------------------------------------------*/ |
| 798 | /** |
| 799 | @brief This function stops the STA function. |
| 800 | |
| 801 | @retval QL_ERR_OK: Successful execution. |
| 802 | @retval QL_ERR_NOT_INIT: Failed execution. The Wi-Fi service is not initialized. |
| 803 | @retval QL_ERR_SERVICE_ABORT: Failed execution due to Wi-Fi service error. |
| 804 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 805 | */ |
| 806 | /*-----------------------------------------------------------------------------------------------*/ |
| 807 | int ql_wifi_sta_stop(void); |
| 808 | |
| 809 | /*-----------------------------------------------------------------------------------------------*/ |
| 810 | /** |
| 811 | @brief This function gets the STA mode status information. |
| 812 | |
| 813 | @param[out] p_sta: The current STA mode status information. |
| 814 | |
| 815 | @retval QL_ERR_OK: Successful execution. |
| 816 | @retval QL_ERR_NOT_INIT: Failed execution. The Wi-Fi service is not initialized. |
| 817 | @retval QL_ERR_SERVICE_ABORT: Failed execution due to Wi-Fi service error. |
| 818 | @retval QL_ERR_INVALID_ARG: Failed execution due to illegal parameter. |
| 819 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 820 | */ |
| 821 | /*-----------------------------------------------------------------------------------------------*/ |
| 822 | int ql_wifi_sta_get_status(ql_wifi_sta_status_t *p_sta); |
| 823 | |
| 824 | /*-----------------------------------------------------------------------------------------------*/ |
| 825 | /** |
| 826 | @brief This function scans for external hotspots in STA mode. |
| 827 | |
| 828 | @retval QL_ERR_OK: Successful execution. |
| 829 | @retval QL_ERR_NOT_INIT: Failed execution. The Wi-Fi service is not initialized. |
| 830 | @retval QL_ERR_SERVICE_ABORT: Failed execution due to Wi-Fi service error. |
| 831 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 832 | */ |
| 833 | /*-----------------------------------------------------------------------------------------------*/ |
| 834 | int ql_wifi_sta_start_scan(void); |
| 835 | |
| 836 | /*-----------------------------------------------------------------------------------------------*/ |
| 837 | /** |
| 838 | @brief This function registers the scan result callback function. |
| 839 | |
| 840 | @param[in] cb: The scan result callback function. |
| 841 | |
| 842 | @retval QL_ERR_OK: Successful execution. |
| 843 | @retval QL_ERR_NOT_INIT: Failed execution. The Wi-Fi service is not initialized. |
| 844 | @retval QL_ERR_SERVICE_ABORT: Failed execution due to Wi-Fi service error. |
| 845 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 846 | */ |
| 847 | /*-----------------------------------------------------------------------------------------------*/ |
| 848 | int ql_wifi_sta_set_scan_result_ind_cb(ql_wifi_sta_scan_result_ind_cb_f cb); |
| 849 | |
| 850 | /*-----------------------------------------------------------------------------------------------*/ |
| 851 | /** |
| 852 | @brief This function registers the callback function for status of connection between AP and STA device. |
| 853 | |
| 854 | @param[in] cb: The callback function for status of connection between AP and STA device. |
| 855 | |
| 856 | @retval QL_ERR_OK: Successful execution. |
| 857 | @retval QL_ERR_NOT_INIT: Failed execution. The Wi-Fi service is not initialized. |
| 858 | @retval QL_ERR_SERVICE_ABORT: Failed execution due to Wi-Fi service error. |
| 859 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 860 | */ |
| 861 | /*-----------------------------------------------------------------------------------------------*/ |
| 862 | int ql_wifi_set_ap_sta_connect_ind_cb(ql_wifi_ap_sta_connect_ind_cb_f cb); |
| 863 | |
| 864 | /*-----------------------------------------------------------------------------------------------*/ |
| 865 | /** |
| 866 | @brief This function registers the Wi-Fi service error callback function. |
| 867 | |
| 868 | @param[in] cb: Wi-Fi service error callback function, executed only when the Wi-Fi service exits abnormally. |
| 869 | |
| 870 | @retval QL_ERR_OK: Successful execution. |
| 871 | @retval QL_ERR_NOT_INIT: Failed execution. The Wi-Fi service is not initialized. |
| 872 | @retval QL_ERR_SERVICE_ABORT: Failed execution due to Wi-Fi service error. |
| 873 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 874 | */ |
| 875 | /*-----------------------------------------------------------------------------------------------*/ |
| 876 | int ql_wifi_set_service_error_cb(ql_wifi_service_error_cb_f cb); |
| 877 | |
| 878 | /*-----------------------------------------------------------------------------------------------*/ |
| 879 | /** |
| 880 | @brief This function sets the P2P device name. |
| 881 | |
| 882 | @param[in] dev_name: The device name to be set. |
| 883 | |
| 884 | @retval QL_ERR_OK: Successful execution. |
| 885 | @retval QL_ERR_NOT_INIT: Failed execution. The Wi-Fi service is not initialized. |
| 886 | @retval QL_ERR_SERVICE_ABORT: Failed execution due to Wi-Fi service error. |
| 887 | @retval QL_ERR_INVALID_ARG: Failed execution due to illegal parameter. |
| 888 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 889 | */ |
| 890 | /*-----------------------------------------------------------------------------------------------*/ |
| 891 | int ql_wifi_p2p_dev_name_set(const char *dev_name); |
| 892 | |
| 893 | /*-----------------------------------------------------------------------------------------------*/ |
| 894 | /** |
| 895 | @brief This function gets the P2P device name. |
| 896 | |
| 897 | @param[out] dev_name_buf: The buffer for storing the current device name. |
| 898 | @param[in] buf_len: The length of the buffer. |
| 899 | |
| 900 | @retval QL_ERR_OK: Successful execution. |
| 901 | @retval QL_ERR_NOT_INIT: Failed execution. The Wi-Fi service is not initialized. |
| 902 | @retval QL_ERR_SERVICE_ABORT: Failed execution due to Wi-Fi service error. |
| 903 | @retval QL_ERR_INVALID_ARG: Failed execution due to illegal parameter. |
| 904 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 905 | */ |
| 906 | /*-----------------------------------------------------------------------------------------------*/ |
| 907 | int ql_wifi_p2p_dev_name_get(char *dev_name_buf, int buf_len); |
| 908 | |
| 909 | /*-----------------------------------------------------------------------------------------------*/ |
| 910 | /** |
| 911 | @brief This function sets the P2P device type. |
| 912 | |
| 913 | @param[in] dev_type: The device type to be set. |
| 914 | |
| 915 | @retval QL_ERR_OK: Successful execution. |
| 916 | @retval QL_ERR_NOT_INIT: Failed execution. The Wi-Fi service is not initialized. |
| 917 | @retval QL_ERR_SERVICE_ABORT: Failed execution due to Wi-Fi service error. |
| 918 | @retval QL_ERR_INVALID_ARG: Failed execution due to illegal parameter. |
| 919 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 920 | */ |
| 921 | /*-----------------------------------------------------------------------------------------------*/ |
| 922 | int ql_wifi_p2p_dev_type_set(const char *dev_type); |
| 923 | |
| 924 | /*-----------------------------------------------------------------------------------------------*/ |
| 925 | /** |
| 926 | @brief This function gets the P2P device type. |
| 927 | |
| 928 | @param[out] dev_type_buf: The buffer for storing the current device type. |
| 929 | @param[in] buf_len: The length of the buffer. |
| 930 | |
| 931 | @retval QL_ERR_OK: Successful execution. |
| 932 | @retval QL_ERR_NOT_INIT: Failed execution. The Wi-Fi service is not initialized. |
| 933 | @retval QL_ERR_SERVICE_ABORT: Failed execution due to Wi-Fi service error. |
| 934 | @retval QL_ERR_INVALID_ARG: Failed execution due to illegal parameter. |
| 935 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 936 | */ |
| 937 | /*-----------------------------------------------------------------------------------------------*/ |
| 938 | int ql_wifi_p2p_dev_type_get(char *dev_type_buf, int buf_len); |
| 939 | |
| 940 | /*-----------------------------------------------------------------------------------------------*/ |
| 941 | /** |
| 942 | @brief This function sets the operating class and operating channel in P2P mode. |
| 943 | |
| 944 | @param[in] oper_class: The operating class to be set. |
| 945 | @param[in] oper_channel: The operating channel to be set. |
| 946 | |
| 947 | @retval QL_ERR_OK: Successful execution. |
| 948 | @retval QL_ERR_NOT_INIT: Failed execution. The Wi-Fi service is not initialized. |
| 949 | @retval QL_ERR_SERVICE_ABORT: Failed execution due to Wi-Fi service error. |
| 950 | @retval QL_ERR_INVALID_ARG: Failed execution due to illegal parameter. |
| 951 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 952 | |
| 953 | @note The operating class and operating channel can determine the center frequency, |
| 954 | The following are the corresponding values. |
| 955 | -------------------------------------------------------------------------------------------- |
| 956 | | oper_class | oper_channel | frequency | channel spacing | |
| 957 | |------------------------------------------------------------------------------------------- |
| 958 | | 81 | 1-13 | 2407 + 5 * oper_channel | 25MHz | |
| 959 | | 82 | 14 | 2414 + 5 * oper_channel | 25MHz | |
| 960 | | 115 | 36,40,44,48 | 5000 + 5 * oper_channel | 20MHz | |
| 961 | | 116 | 36,44 | 5000 + 5 * oper_channel | 40MHz | |
| 962 | | 117 | 40,48 | 5000 + 5 * oper_channel | 40MHz | |
| 963 | | 124 | 149,153,157,161 | 5000 + 5 * oper_channel | 20MHz | |
| 964 | | 125 | 149,153,157,161,165 | 5000 + 5 * oper_channel | 20MHz | |
| 965 | | 126 | 149,157 | 5000 + 5 * oper_channel | 40MHz | |
| 966 | | 127 | 153,161 | 5000 + 5 * oper_channel | 40MHz | |
| 967 | -------------------------------------------------------------------------------------------- |
| 968 | */ |
| 969 | /*-----------------------------------------------------------------------------------------------*/ |
| 970 | int ql_wifi_p2p_oper_class_channel_set(int oper_class, int oper_channel); |
| 971 | |
| 972 | /*-----------------------------------------------------------------------------------------------*/ |
| 973 | /** |
| 974 | @brief This function gets the operating class and operating channel in P2P mode. |
| 975 | |
| 976 | @param[out] p_oper_class: The currently-used operating class in p2p mode. |
| 977 | @param[out] p_oper_channel: The currently-used operating channel in p2p mode. |
| 978 | |
| 979 | @retval QL_ERR_OK: Successful execution. |
| 980 | @retval QL_ERR_NOT_INIT: Failed execution. The Wi-Fi service is not initialized. |
| 981 | @retval QL_ERR_SERVICE_ABORT: Failed execution due to Wi-Fi service error. |
| 982 | @retval QL_ERR_INVALID_ARG: Failed execution due to illegal parameter. |
| 983 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 984 | */ |
| 985 | /*-----------------------------------------------------------------------------------------------*/ |
| 986 | int ql_wifi_p2p_oper_class_channel_get(int *p_oper_class, int *p_oper_channel); |
| 987 | |
| 988 | /*-----------------------------------------------------------------------------------------------*/ |
| 989 | /** |
| 990 | @brief This function sets the suffix of ssid. |
| 991 | |
| 992 | @param[in] ssid_postfix: The suffix of ssid to be set. |
| 993 | |
| 994 | @retval QL_ERR_OK: Successful execution. |
| 995 | @retval QL_ERR_NOT_INIT: Failed execution. The Wi-Fi service is not initialized. |
| 996 | @retval QL_ERR_SERVICE_ABORT: Failed execution due to Wi-Fi service error. |
| 997 | @retval QL_ERR_INVALID_ARG: Failed execution due to illegal parameter. |
| 998 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 999 | */ |
| 1000 | /*-----------------------------------------------------------------------------------------------*/ |
| 1001 | int ql_wifi_p2p_ssid_postfix_set(const char *ssid_postfix); |
| 1002 | |
| 1003 | /*-----------------------------------------------------------------------------------------------*/ |
| 1004 | /** |
| 1005 | @brief This function gets the suffix of ssid. |
| 1006 | |
| 1007 | @param[out] ssid_postfix_buf: The buffer for storing the current suffix of ssid. |
| 1008 | @param[in] buf_len: The length of the buffer. |
| 1009 | |
| 1010 | @retval QL_ERR_OK: Successful execution. |
| 1011 | @retval QL_ERR_NOT_INIT: Failed execution. The Wi-Fi service is not initialized. |
| 1012 | @retval QL_ERR_SERVICE_ABORT: Failed execution due to Wi-Fi service error. |
| 1013 | @retval QL_ERR_INVALID_ARG: Failed execution due to illegal parameter. |
| 1014 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 1015 | */ |
| 1016 | /*-----------------------------------------------------------------------------------------------*/ |
| 1017 | int ql_wifi_p2p_ssid_postfix_get(char *ssid_postfix_buf, int buf_len); |
| 1018 | |
| 1019 | /*-----------------------------------------------------------------------------------------------*/ |
| 1020 | /** |
| 1021 | @brief This function registers the P2P enable status callback function. |
| 1022 | |
| 1023 | @param[in] cb: P2P enable status callback function. |
| 1024 | |
| 1025 | @retval QL_ERR_OK: Successful execution. |
| 1026 | @retval QL_ERR_NOT_INIT: Failed execution. The Wi-Fi service is not initialized. |
| 1027 | @retval QL_ERR_SERVICE_ABORT: Failed execution due to Wi-Fi service error. |
| 1028 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 1029 | */ |
| 1030 | /*-----------------------------------------------------------------------------------------------*/ |
| 1031 | int ql_wifi_p2p_set_enable_status_ind_cb(ql_wifi_p2p_enable_status_ind_cb_f cb); |
| 1032 | |
| 1033 | /*-----------------------------------------------------------------------------------------------*/ |
| 1034 | /** |
| 1035 | @brief This function enables P2P function. |
| 1036 | |
| 1037 | @retval QL_ERR_OK: Successful execution. |
| 1038 | @retval QL_ERR_NOT_INIT: Failed execution. The Wi-Fi service is not initialized. |
| 1039 | @retval QL_ERR_SERVICE_ABORT: Failed execution due to Wi-Fi service error. |
| 1040 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 1041 | */ |
| 1042 | /*-----------------------------------------------------------------------------------------------*/ |
| 1043 | int ql_wifi_p2p_enable(void); |
| 1044 | |
| 1045 | /*-----------------------------------------------------------------------------------------------*/ |
| 1046 | /** |
| 1047 | @brief This function disables P2P function. |
| 1048 | |
| 1049 | @retval QL_ERR_OK: Successful execution. |
| 1050 | @retval QL_ERR_NOT_INIT: Failed execution. The Wi-Fi service is not initialized. |
| 1051 | @retval QL_ERR_SERVICE_ABORT: Failed execution due to Wi-Fi service error. |
| 1052 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 1053 | */ |
| 1054 | /*-----------------------------------------------------------------------------------------------*/ |
| 1055 | int ql_wifi_p2p_disable(void); |
| 1056 | |
| 1057 | /*-----------------------------------------------------------------------------------------------*/ |
| 1058 | /** |
| 1059 | @brief This function registers the found p2p device callback function. |
| 1060 | |
| 1061 | @param[in] cb: The found p2p device callback function. |
| 1062 | |
| 1063 | @retval QL_ERR_OK: Successful execution. |
| 1064 | @retval QL_ERR_NOT_INIT: Failed execution. The Wi-Fi service is not initialized. |
| 1065 | @retval QL_ERR_SERVICE_ABORT: Failed execution due to Wi-Fi service error. |
| 1066 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 1067 | */ |
| 1068 | /*-----------------------------------------------------------------------------------------------*/ |
| 1069 | int ql_wifi_p2p_set_dev_found_ind_cb(ql_wifi_p2p_dev_found_ind_cb_f cb); |
| 1070 | |
| 1071 | /*-----------------------------------------------------------------------------------------------*/ |
| 1072 | /** |
| 1073 | @brief This function start finding P2P device. |
| 1074 | |
| 1075 | @retval QL_ERR_OK: Successful execution. |
| 1076 | @retval QL_ERR_NOT_INIT: Failed execution. The Wi-Fi service is not initialized. |
| 1077 | @retval QL_ERR_SERVICE_ABORT: Failed execution due to Wi-Fi service error. |
| 1078 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 1079 | */ |
| 1080 | /*-----------------------------------------------------------------------------------------------*/ |
| 1081 | int ql_wifi_p2p_dev_find_start(void); |
| 1082 | |
| 1083 | /*-----------------------------------------------------------------------------------------------*/ |
| 1084 | /** |
| 1085 | @brief This function stop finding P2P device. |
| 1086 | |
| 1087 | @retval QL_ERR_OK: Successful execution. |
| 1088 | @retval QL_ERR_NOT_INIT: Failed execution. The Wi-Fi service is not initialized. |
| 1089 | @retval QL_ERR_SERVICE_ABORT: Failed execution due to Wi-Fi service error. |
| 1090 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 1091 | */ |
| 1092 | /*-----------------------------------------------------------------------------------------------*/ |
| 1093 | int ql_wifi_p2p_dev_find_stop(void); |
| 1094 | |
| 1095 | /*-----------------------------------------------------------------------------------------------*/ |
| 1096 | /** |
| 1097 | @brief This function gets P2P mode status information. |
| 1098 | |
| 1099 | @param[out] p_status: The current P2P mode status information. |
| 1100 | |
| 1101 | @retval QL_ERR_OK: Successful execution. |
| 1102 | @retval QL_ERR_NOT_INIT: Failed execution. The Wi-Fi service is not initialized. |
| 1103 | @retval QL_ERR_SERVICE_ABORT: Failed execution due to Wi-Fi service error. |
| 1104 | @retval QL_ERR_INVALID_ARG: Failed execution due to illegal parameter. |
| 1105 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 1106 | */ |
| 1107 | /*-----------------------------------------------------------------------------------------------*/ |
| 1108 | int ql_wifi_p2p_get_status(ql_wifi_p2p_status_t *p_status); |
| 1109 | |
| 1110 | /*-----------------------------------------------------------------------------------------------*/ |
| 1111 | /** |
| 1112 | @brief This function registers the P2P status callback function. |
| 1113 | |
| 1114 | @param[in] cb: The P2P status callback function. |
| 1115 | |
| 1116 | @retval QL_ERR_OK: Successful execution. |
| 1117 | @retval QL_ERR_NOT_INIT: Failed execution. The Wi-Fi service is not initialized. |
| 1118 | @retval QL_ERR_SERVICE_ABORT: Failed execution due to Wi-Fi service error. |
| 1119 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 1120 | */ |
| 1121 | /*-----------------------------------------------------------------------------------------------*/ |
| 1122 | int ql_wifi_p2p_set_status_ind_cb(ql_wifi_p2p_status_ind_cb_f cb); |
| 1123 | |
| 1124 | /*-----------------------------------------------------------------------------------------------*/ |
| 1125 | /** |
| 1126 | @brief This function registers peer p2p device requesting connection callback function. |
| 1127 | |
| 1128 | @param[in] cb: Peer p2p device requesting connection callback function. |
| 1129 | |
| 1130 | @retval QL_ERR_OK: Successful execution. |
| 1131 | @retval QL_ERR_NOT_INIT: Failed execution. The Wi-Fi service is not initialized. |
| 1132 | @retval QL_ERR_SERVICE_ABORT: Failed execution due to Wi-Fi service error. |
| 1133 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 1134 | */ |
| 1135 | /*-----------------------------------------------------------------------------------------------*/ |
| 1136 | int ql_wifi_p2p_set_peer_dev_req_ind_cb(ql_wifi_p2p_peer_dev_req_ind_cb_f cb); |
| 1137 | |
| 1138 | /*-----------------------------------------------------------------------------------------------*/ |
| 1139 | /** |
| 1140 | @brief This function establishes a P2P connection. |
| 1141 | |
| 1142 | @param[in] macaddr: The MAC address of peer P2P device. |
| 1143 | @param[in] wps_method: key words: "pbc", "pin" and pin_code, The pin_code is a string that |
| 1144 | dynamically generated random from peer display. |
| 1145 | @param[in] go_intent: Degree of desire to be GO, range: 0-15. |
| 1146 | |
| 1147 | @retval QL_ERR_OK: Successful execution. |
| 1148 | @retval QL_ERR_NOT_INIT: Failed execution. The Wi-Fi service is not initialized. |
| 1149 | @retval QL_ERR_SERVICE_ABORT: Failed execution due to Wi-Fi service error. |
| 1150 | @retval QL_ERR_INVALID_ARG: Failed execution due to illegal parameter. |
| 1151 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 1152 | */ |
| 1153 | /*-----------------------------------------------------------------------------------------------*/ |
| 1154 | int ql_wifi_p2p_connect(const char *macaddr, const char *method, int go_intent); |
| 1155 | |
| 1156 | /*-----------------------------------------------------------------------------------------------*/ |
| 1157 | /** |
| 1158 | @brief This function disconnects a P2P connection |
| 1159 | |
| 1160 | @retval QL_ERR_OK: Successful execution. |
| 1161 | @retval QL_ERR_NOT_INIT: Failed execution. The Wi-Fi service is not initialized. |
| 1162 | @retval QL_ERR_SERVICE_ABORT: Failed execution due to Wi-Fi service error. |
| 1163 | @retval Other value: Failed execution. See ql_type.h for the error code. |
| 1164 | */ |
| 1165 | /*-----------------------------------------------------------------------------------------------*/ |
| 1166 | int ql_wifi_p2p_disconnect(void); |
| 1167 | |
| 1168 | #ifdef __cplusplus |
| 1169 | } |
| 1170 | #endif |
| 1171 | #endif |
| 1172 | |