/* * * * */ #ifndef _WIFI_CONFIG__H_ #define _WIFI_CONFIG__H_ /******************************************************************************/ #define IPSTRLEN 16 #define PORTSTRLEN 8 #define WIFITYPE_NONE 0 #define WIFITYPE_AP_UDP 1 #define WIFITYPE_AP_TCP 2 #define WIFITYPE_STA_UDP 3 #define WIFITYPE_STA_TCP 4 #pragma pack(4) typedef struct _netconfig { uint8_t ip[IPSTRLEN]; uint8_t gateway[IPSTRLEN]; uint8_t subnetmask[IPSTRLEN]; }stNetworkConfig; #pragma pack() #pragma pack(4) typedef struct _serverconfig { uint8_t ip[IPSTRLEN]; uint8_t port[PORTSTRLEN]; }stServerConfig; #pragma pack() #define WIFIAPSSIDLEN 32 #define WIFIAPPSWDLEN 32 #pragma pack(4) typedef struct _wifi_config { uint8_t type; // 0:CLOSE, 1:AP_TCP, 2:AP_UDP, 3: STA_TCP, 4: STA_UDP uint8_t mode; //1,sta;2,ap; uint8_t rfpower;//0~82 uint8_t dhcp;//0,1 uint8_t name[WIFIAPSSIDLEN]; uint8_t password[WIFIAPPSWDLEN]; }stWifiConfig; #pragma pack() /******************************************************************************/ extern stNetworkConfig wifiNetwork; extern stServerConfig wifiServer; extern stWifiConfig wifiConfig; /******************************************************************************/ #endif //_WIFI_CONFIG__H_