protocol.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. /*
  2. * Copyright (c) 2006-2021, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2025-03-27 RuoFeng the first version
  9. */
  10. #ifndef APPLICATIONS_PROTOCOL_H_
  11. #define APPLICATIONS_PROTOCOL_H_
  12. /*********************↑ declaration ↑************************/
  13. /**
  14. *
  15. *
  16. *
  17. *
  18. * */
  19. /*********************↓ define ↓************************/
  20. /*********************↑ define ↑************************/
  21. /**
  22. *
  23. *
  24. *
  25. *
  26. * */
  27. /*********************↓ include ↓************************/
  28. #include <cJSON.h>
  29. /*********************↑ include ↑************************/
  30. /**
  31. *
  32. *
  33. *
  34. *
  35. * */
  36. /*********************↓ extern ↓************************/
  37. /*********************↑ extern ↑************************/
  38. /**
  39. *
  40. *
  41. *
  42. *
  43. * */
  44. /********************↓ declaration ↓***********************/
  45. char *makeJson_NEW(uint8_t type);
  46. struct RES_Type
  47. {
  48. char ACTION_ID[22];
  49. char COMMAND[6];
  50. char TIMING[30];
  51. char RESULT[6];
  52. };
  53. typedef enum
  54. {
  55. dev_on = 1,
  56. dev_off,
  57. dev_reboot,
  58. dev_takepho,
  59. dev_sta,
  60. dev_readcfg,
  61. dev_setcfg,
  62. dev_setpara,
  63. dev_typemax
  64. } DevCmd_def;
  65. void prase_NewCmd(char *cmd);
  66. /********************↑ declaration ↑***********************/
  67. /**
  68. *
  69. *
  70. *
  71. *
  72. * */
  73. /*********************↓ global variables ↓************************/
  74. /*********************↑ global variables ↑************************/
  75. /**
  76. *
  77. *
  78. *
  79. *
  80. * */
  81. #endif /* APPLICATIONS_PROTOCOL_H_ */