user_webserver.h 784 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #ifndef __USER_WEBSERVER_H__
  2. #define __USER_WEBSERVER_H__
  3. #define SERVER_PORT 80
  4. #define SERVER_SSL_PORT 443
  5. #define URLSize 10
  6. typedef enum Result_Resp {
  7. RespFail = 0,
  8. RespSuc,
  9. } Result_Resp;
  10. typedef enum ProtocolType {
  11. GET = 0,
  12. POST,
  13. } ProtocolType;
  14. typedef enum _ParmType {
  15. SWITCH_STATUS = 0,
  16. INFOMATION,
  17. WIFI,
  18. SCAN,
  19. REBOOT,
  20. DEEP_SLEEP,
  21. LIGHT_STATUS,
  22. CONNECT_STATUS,
  23. USER_BIN
  24. } ParmType;
  25. typedef struct URL_Frame {
  26. enum ProtocolType Type;
  27. char pSelect[URLSize];
  28. char pCommand[URLSize];
  29. char pFilename[URLSize];
  30. } URL_Frame;
  31. typedef struct _rst_parm {
  32. ParmType parmtype;
  33. struct espconn *pespconn;
  34. } rst_parm;
  35. void user_webserver_init(uint32 port);
  36. #endif