data_task.h 868 B

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