command.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. #ifndef __COMMAND_H__
  2. #define __COMMAND_H__
  3. #include<stdio.h>
  4. #include <time.h>
  5. #include <stdbool.h>
  6. #define ENABLE_HTTP_COOKIE 1
  7. #define MAX_TIMEOUT 20
  8. //devices.db http
  9. #define PUB_GET_DEVICES_NONE_HTTP "get/devices/none/http"
  10. #define SUB_GET_DEVICES_NONE_HTTP "ack/get/devices/none/http"
  11. #define PUB_ADD_DEVICES_NONE_HTTP "add/devices/none/http"
  12. #define SUB_ADD_DEVICES_NONE_HTTP "ack/add/devices/none/http"
  13. #define PUB_SET_DEVICES_NONE_HTTP "set/devices/none/http"
  14. #define SUB_SET_DEVICES_NONE_HTTP "ack/set/devices/none/http"
  15. #define PUB_DEL_DEVICES_NONE_HTTP "del/devices/none/http"
  16. #define SUB_DEL_DEVICES_NONE_HTTP "ack/del/devices/none/http"
  17. //platform.json
  18. #define PUB_GET_PLATFORM_NONE_HTTP "get/platform/none/http"
  19. #define SUB_GET_PLATFORM_NONE_HTTP "ack/get/platform/none/http"
  20. #define PUB_ADD_PLATFORM_NONE_HTTP "add/platform/none/http"
  21. #define SUB_ADD_PLATFORM_NONE_HTTP "ack/add/platform/none/http"
  22. #define PUB_SET_PLATFORM_NONE_HTTP "set/platform/none/http"
  23. #define SUB_SET_PLATFORM_NONE_HTTP "ack/set/platform/none/http"
  24. #define PUB_DEL_PLATFORM_NONE_HTTP "del/platform/none/http"
  25. #define SUB_DEL_PLATFORM_NONE_HTTP "ack/del/platform/none/http"
  26. //system.json
  27. #define PUB_GET_SYSTEM_NONE_HTTP "get/system/none/http"
  28. #define SUB_GET_SYSTEM_NONE_HTTP "ack/get/system/none/http"
  29. #define PUB_ADD_SYSTEM_NONE_HTTP "add/system/none/http"
  30. #define SUB_ADD_SYSTEM_NONE_HTTP "ack/add/system/none/http
  31. #define PUB_SET_SYSTEM_NONE_HTTP "set/system/none/http"
  32. #define SUB_SET_SYSTEM_NONE_HTTP "ack/set/system/none/http"
  33. #define PUB_DEL_SYSTEM_NONE_HTTP "del/system/none/http"
  34. #define SUB_DEL_SYSTEM_NONE_HTTP "ack/del/system/none/http"
  35. //user.json
  36. #define PUB_GET_USER_NONE_HTTP "get/user/none/http"
  37. #define SUB_GET_USER_NONE_HTTP "ack/get/user/none/http"
  38. #define PUB_ADD_SYSTEM_NONE_HTTP "add/user/none/http"
  39. #define SUB_ADD_SYSTEM_NONE_HTTP "ack/add/user/none/http"
  40. #define PUB_SET_SYSTEM_NONE_HTTP "set/user/none/http"
  41. #define SUB_SET_SYSTEM_NONE_HTTP "ack/set/user/none/http"
  42. #define PUB_DEL_SYSTEM_NONE_HTTP "del/user/none/http"
  43. #define SUB_DEL_SYSTEM_NONE_HTTP "ack/del/user/none/http"
  44. bool auth_user();
  45. void get_configure_by_type(char *pub_topic, char *sub_topic);
  46. void set_configure_by_type(char *pub_topic, char *sub_topic);
  47. void del_configure_by_type(char *pub_topic, char *sub_topic);
  48. void add_configure_by_type(char *pub_topic, char *sub_topic);
  49. #endif