data_task.h 921 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #ifndef __TASK_H
  2. #define __TASK_H
  3. #include "gd32f30x.h"
  4. #include "gateway_message.h"
  5. #include "mqttclient.h"
  6. #include "FreeRTOS.h"
  7. #include "task.h"
  8. #include "include.h"
  9. uint32_t my_pow(int x,int y);
  10. //主要的数据处理线程
  11. #define DATA_TASK_PRIO 3
  12. #define DATA_STK_SIZE 2*1024
  13. #define GetCurrentTime() xTaskGetTickCount()
  14. extern int ID;
  15. extern void data_task(void *pdata);
  16. void data_task_creat(void);
  17. /* 写入modbus寄存器 */
  18. void write_modbus_data(char* cJSONstring);
  19. /* 发送至mqtt */
  20. void send_mqtt(char*buf);
  21. /* 读取设备数据 */
  22. int read_device_data(DEVICE_PARAMS *current_device,char* string);
  23. ///* 读取设备数据 */
  24. //int read_device_data1(DEVICE_PARAMS *current_device,char* buf);
  25. //int read_device_data2(DEVICE_PARAMS *current_device,char* buf);
  26. typedef struct __JSON_CMD{
  27. uint8_t deviceId[25];
  28. uint8_t identifier[20];
  29. uint8_t messageId[20];
  30. uint8_t parameter;
  31. uint8_t action[1];
  32. }JSON_CMD;
  33. #endif