wificonfig.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. *
  3. *
  4. *
  5. */
  6. #ifndef _WIFI_CONFIG__H_
  7. #define _WIFI_CONFIG__H_
  8. /******************************************************************************/
  9. #define IPSTRLEN 16
  10. #define PORTSTRLEN 8
  11. #define WIFITYPE_NONE 0
  12. #define WIFITYPE_AP_UDP 1
  13. #define WIFITYPE_AP_TCP 2
  14. #define WIFITYPE_STA_UDP 3
  15. #define WIFITYPE_STA_TCP 4
  16. #pragma pack(4)
  17. typedef struct _netconfig
  18. {
  19. uint8_t ip[IPSTRLEN];
  20. uint8_t gateway[IPSTRLEN];
  21. uint8_t subnetmask[IPSTRLEN];
  22. }stNetworkConfig;
  23. #pragma pack()
  24. #pragma pack(4)
  25. typedef struct _serverconfig
  26. {
  27. uint8_t ip[IPSTRLEN];
  28. uint8_t port[PORTSTRLEN];
  29. }stServerConfig;
  30. #pragma pack()
  31. #define WIFIAPSSIDLEN 32
  32. #define WIFIAPPSWDLEN 32
  33. #pragma pack(4)
  34. typedef struct _wifi_config
  35. {
  36. uint8_t type; // 0:CLOSE, 1:AP_TCP, 2:AP_UDP, 3: STA_TCP, 4: STA_UDP
  37. uint8_t mode; //1,sta;2,ap;
  38. uint8_t rfpower;//0~82
  39. uint8_t dhcp;//0,1
  40. uint8_t name[WIFIAPSSIDLEN];
  41. uint8_t password[WIFIAPPSWDLEN];
  42. }stWifiConfig;
  43. #pragma pack()
  44. /******************************************************************************/
  45. extern stNetworkConfig wifiNetwork;
  46. extern stServerConfig wifiServer;
  47. extern stWifiConfig wifiConfig;
  48. /******************************************************************************/
  49. #endif //_WIFI_CONFIG__H_