dtu_uart2.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. * Copyright (c) 2006-2020, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2020-05-28 Administrator the first version
  9. */
  10. #ifndef APPLICATIONS_INC_DTU_UART2_H_
  11. #define APPLICATIONS_INC_DTU_UART2_H_
  12. #define DTU_UART_NAME "uart2" /*串口设备名称*/
  13. #define MAX_DTU_SIZE 512
  14. typedef struct{
  15. char msg_pool[MAX_DTU_SIZE];
  16. }DataTemp;
  17. //查询数据---{"cmd": "read"}
  18. //重启-------{"cmd": "reboot"}
  19. //升级-------{"cmd": "update"}
  20. //拍照-------{"cmd": "takephoto"}
  21. //{"cmd":"paramconf","ext":{"hst":110,"collt":10,"et":6,"datt":2,"shake_sec":1,"tpl":5,"shake":1,"tph":70,"ts":1,"st":20,"imgres":2,"htim":20,"tt":8}}
  22. //{"cmd":"synchronization","ext":{"year":1,"month":1,"day":0,"hour":25,"min":0,"sec":0,"lat":"113.2056","lng":"21.0596","csq",31,"net",0,"iccid","123135453","imei":"895864646464464"}}
  23. void DTU_Write(char *fmt, ...);
  24. int dtu_data_play(void);
  25. int parseDtu(char *json_string);
  26. char *makeJson(uint8_t type);
  27. char *makeJson_platform(char *plt);
  28. char *makeJson_Rtutakephoto();
  29. char *makeJson_takephoto();
  30. char *makeJson_Warn(char * s,char *t);
  31. void UpLoad_Data(uint8_t type);
  32. char * uint8tostring(uint8_t dat);
  33. typedef enum
  34. {
  35. read_limit_rcd = 0,
  36. TEMP_ON_rcd,
  37. TEMP_OFF_rcd,
  38. RAIN_ON_rcd,
  39. RAIN_OFF_rcd,
  40. RunLight_rcd,
  41. RunTime_rcd,
  42. Read_ecode_rcd,
  43. Read_status_rcd,
  44. FBtest_rcd,
  45. SCMtest_rcd,
  46. Clear_log_rcd,
  47. TypeMAX_rcd
  48. }RCD;
  49. typedef struct
  50. {
  51. RCD rcd;
  52. char keyword[15];
  53. }RC_Def;
  54. #endif /* APPLICATIONS_INC_DTU_UART2_H_ */