12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- #ifndef __TASK_H
- #define __TASK_H
- #include "gd32f30x.h"
- #include "gateway_message.h"
- #include "mqttclient.h"
- #include "FreeRTOS.h"
- #include "task.h"
- #include "include.h"
- uint32_t my_pow(int x,int y);
- //主要的数据处理线程
- #define DATA_TASK_PRIO 3
- #define DATA_STK_SIZE 2*1024
- #define GetCurrentTime() xTaskGetTickCount()
- extern int ID;
- extern void data_task(void *pdata);
- void data_task_creat(void);
- /* 写入modbus寄存器 */
- void write_modbus_data(char* cJSONstring);
- /* 发送至mqtt */
- void send_mqtt(char*buf);
- /* 读取设备数据 */
- int read_device_data(DEVICE_PARAMS *current_device,char* string);
- ///* 读取设备数据 */
- //int read_device_data1(DEVICE_PARAMS *current_device,char* buf);
- //int read_device_data2(DEVICE_PARAMS *current_device,char* buf);
- typedef struct __JSON_CMD{
- uint8_t deviceId[25];
- uint8_t identifier[20];
- uint8_t messageId[20];
- uint8_t parameter;
- uint8_t action[1];
-
- }JSON_CMD;
- #endif
|