1 #ifndef _MOD_NETWORK_H_ 2 #define _MOD_NETWORK_H_ 3 4 #include "lwip/ip_addr.h" 5 6 #define NETWORK_SSID_MAX_LEN (32) 7 #define NETWORK_PASSWD_MAX_LEN (64) 8 9 typedef struct network_wifi_info { 10 char ssid[NETWORK_SSID_MAX_LEN + 1]; 11 char bssid[6]; 12 int rssi; 13 } network_wifi_info_t; 14 15 typedef struct wifi_ap_info { 16 char ssid[NETWORK_SSID_MAX_LEN + 1]; 17 char passwd[NETWORK_PASSWD_MAX_LEN + 1]; 18 } wifi_ap_info_t; 19 20 enum network_t { 21 NETWORK_TYPE_WIFI = 0, 22 NETWORK_TYPE_CELLULAR, 23 NETWORK_TYPE_ETHERNET, 24 }; 25 26 enum network_event_t { 27 NETWORK_EVT_GOT_IP = 0, 28 NETWORK_EVT_CONN_FAIL, 29 NETWORK_EVT_GOT_SSID_PASSWD, 30 }; 31 32 int network_qrcode_scan(void *gray, int w, int h, char *ouput, int max_len); 33 int network_qrscan_result_process(const char *result, char *ssid, char *passwd); 34 35 #endif /* _MOD_NETWORK_H_ */ 36