wifi.h 1012 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #ifndef __WIFI_Hx__
  2. #define __WIFI_Hx__
  3. #include <stdint.h>
  4. #include "common.h"
  5. enum {
  6. CRYPT_NONE=0,
  7. CRYPT_ERR,
  8. CRYPT_WEP,
  9. CRYPT_WPA,
  10. CRYPT_WPA2,
  11. CRYPT_WPA3,
  12. CRYPT_MAX,
  13. };
  14. enum {
  15. AUTH_NONE=0,
  16. AUTH_ERR,
  17. AUTH_PSK,
  18. AUTH_EAP,
  19. AUTH_MAX,
  20. };
  21. enum {
  22. MODE_STA=0,
  23. MODE_AP,
  24. MODE_MAX,
  25. };
  26. typedef struct {
  27. char ssid[40]; //���32���ַ�
  28. char bssid[16]; //���12���ַ�
  29. char password[40];
  30. char ipaddr[64];
  31. int auth;
  32. int crypt;
  33. uint32_t freq; //MHz
  34. }ap_info_t;
  35. typedef struct {
  36. int link;
  37. int signal; //dB
  38. char ipaddr[64];
  39. }ap_stat_t;
  40. typedef struct {
  41. int cnt;
  42. int max;
  43. ap_info_t *info;
  44. }ap_list_t;
  45. int wifi_init(void);
  46. int wifi_scan(ap_list_t *list);
  47. int wifi_list_free(ap_list_t *list);
  48. int wifi_set(WIFIInfo_t *wm);
  49. int wifi_sta_stat(ap_stat_t *stat);
  50. int wifi_sta_info(ap_info_t *info);
  51. int wifi_ap_info(ap_info_t *info);
  52. #endif