b.liu | 8583dce | 2024-04-03 13:30:08 +0800 | [diff] [blame] | 1 | /******************************************************* |
| 2 | * |
| 3 | * @brief: Add wifi api |
| 4 | * @details: add liblynq-qser-wifi api |
| 5 | * @author: wz.wang |
| 6 | * @date: 2024.3.15 |
| 7 | * @version: V1.0 |
| 8 | * @copyright:Copyright (c) MobileTek |
| 9 | * |
| 10 | *********************************************/ |
| 11 | #ifndef LYNQ_QSER_WIFI |
| 12 | #define LYNQ_QSER_WIFI |
| 13 | |
| 14 | #ifdef __cplusplus |
| 15 | extern "C" { |
| 16 | #endif |
| 17 | |
| 18 | typedef enum { |
| 19 | LYNQ_WIFI_AP_INDEX_AP0 = 0, /* Index 0 of AP/AP-STA/AP-AP Mode */ |
| 20 | LYNQ_WIFI_AP_INDEX_AP1 /* Index 1 of AP/AP-STA/AP-AP Mode */ |
| 21 | } lynq_wifi_ap_index_e; |
| 22 | |
| 23 | typedef enum |
| 24 | { |
| 25 | LYNQ_WIFI_MODE_MIN = -1, |
| 26 | LYNQ_WIFI_MODE_80211B = 0, |
| 27 | LYNQ_WIFI_MODE_80211BG, |
| 28 | LYNQ_WIFI_MODE_80211BGN, |
| 29 | LYNQ_WIFI_MODE_80211A, |
| 30 | LYNQ_WIFI_MODE_80211AN, |
| 31 | LYNQ_WIFI_MODE_80211AC, |
| 32 | LYNQ_WIFI_MODE_80211BGNAX_2G, |
| 33 | LYNQ_WIFI_AP_MODE_MAX |
| 34 | } lynq_wifi_mode_type_e; |
| 35 | |
| 36 | typedef enum LYNQ_WIFI_BANDWIDTH_ENUM |
| 37 | { |
| 38 | LYNQ_WIFI_BANDWIDTH_MIN = -1, |
| 39 | LYNQ_WIFI_BANDWIDTH_HT20 = 0, |
| 40 | LYNQ_WIFI_BANDWIDTH_HT40, |
| 41 | LYNQ_WIFI_BANDWIDTH_HT80, |
| 42 | LYNQ_WIFI_BANDWIDTH_MAX |
| 43 | } lynq_wifi_bandwidth_type_e; |
| 44 | |
| 45 | typedef enum |
| 46 | { |
| 47 | LYNQ_WIFI_AUTH_MIN = -1, |
| 48 | LYNQ_WIFI_AUTH_OPEN = 0, |
| 49 | LYNQ_WIFI_AUTH_WPA_PSK, |
| 50 | LYNQ_WIFI_AUTH_WPA2_PSK, //AES |
| 51 | LYNQ_WIFI_AUTH_WPA_WPA2_PSK_BOTH, //TKIP & AES |
| 52 | LYNQ_WIFI_AUTH_WPA3_PSK, //AES |
| 53 | LYNQ_WIFI_AUTH_WPA2_WPA3_PSK_BOTH, //AES |
| 54 | LYNQ_WIFI_AUTH_MAX |
| 55 | } lynq_wifi_auth_e; |
| 56 | |
| 57 | int qser_wifi_enable(void); |
| 58 | int qser_wifi_disable(void); |
| 59 | int qser_wifi_ap_ssid_set(lynq_wifi_ap_index_e idx, const char *ssid); |
| 60 | int qser_wifi_ap_ssid_get(lynq_wifi_ap_index_e idx, char *ssid); |
| 61 | int qser_wifi_ap_mode_set(lynq_wifi_ap_index_e idx, lynq_wifi_mode_type_e mode); |
| 62 | int qser_wifi_ap_mode_get(lynq_wifi_ap_index_e idx, lynq_wifi_mode_type_e *mode); |
| 63 | int qser_wifi_ap_bandwidth_set(lynq_wifi_ap_index_e idx, lynq_wifi_bandwidth_type_e bandwidth); |
| 64 | int qser_wifi_ap_bandwidth_get(lynq_wifi_ap_index_e idx, lynq_wifi_bandwidth_type_e *bandwidth); |
| 65 | int qser_wifi_ap_channel_set(lynq_wifi_ap_index_e idx, const char *country_code, int channel); |
| 66 | int qser_wifi_ap_channel_get(lynq_wifi_ap_index_e idx, char *country_code, int *channel); |
| 67 | int qser_wifi_ap_auth_set(lynq_wifi_ap_index_e idx, lynq_wifi_auth_e auth_mode, const char * auth_passwd); |
| 68 | int qser_wifi_ap_auth_get(lynq_wifi_ap_index_e idx, lynq_wifi_auth_e *auth_mode, char * auth_passwd); |
| 69 | int qser_wifi_ap_max_sta_set(lynq_wifi_ap_index_e idx, int max_sta_num); |
| 70 | int qser_wifi_ap_max_sta_get(lynq_wifi_ap_index_e idx, int *max_sta_num); |
| 71 | int qser_wifi_ap_start(lynq_wifi_ap_index_e idx); |
| 72 | int qser_wifi_ap_stop(lynq_wifi_ap_index_e idx); |
| 73 | int qser_wifi_ap_restart(lynq_wifi_ap_index_e idx); |
| 74 | |
| 75 | |
| 76 | |
| 77 | #ifdef __cplusplus |
| 78 | } |
| 79 | #endif |
| 80 | #endif |
| 81 | |