| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- /*
- * Copyright (c) 2006-2020, RT-Thread Development Team
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Change Logs:
- * Date Author Notes
- * 2020-05-28 Administrator the first version
- */
- #ifndef APPLICATIONS_INC_DTU_UART2_H_
- #define APPLICATIONS_INC_DTU_UART2_H_
- #define DTU_UART_NAME "uart2" /*串口设备名称*/
- #define MAX_DTU_SIZE 512
- typedef struct{
- char msg_pool[MAX_DTU_SIZE];
- }DataTemp;
- //enum B_2
- //{
- // "STATUS_UNACTIVE",
- // "STATUS_OFFLINE",
- // "STATUS_UNUSUAL",
- // |STATUS_ONLINE""
- //};
- //5.0测报灯数据上报结构体
- typedef struct {
- char DEVICE_SERIAL_NUMBER[32];
- char SIM[32];
- char SIGNAL[16];
- char LOCATION[32];
- double VOLTAGE;
- double CURRENT;
- double TEMPERATURE;
- double HUMIDITY;
- char UPDATE_DATE[64];
- char STATUS[32];
- char STATUS_DESCRIPTION[64];
- char START_TIME[64];
- char END_TIME[64];
- char VERSION[16];
- uint8_t DATT;
- uint8_t TPS;
- uint8_t LPS;
- uint8_t RPS;
- uint8_t WS;
- uint8_t TT;
- }WS_CBDV5;
- void dtu_send_data_start(void);
- //查询数据---{"cmd": "read"}
- //重启-------{"cmd": "reboot"}
- //升级-------{"cmd": "update"}
- //拍照-------{"cmd": "takephoto"}
- //{"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}}
- //{"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"}}
- void DTU_Write(char *fmt, ...);
- int dtu_data_play(void);
- int parseDtu(char *json_string);
- char *makeJson(void);
- char *makeJson_platform(char *plt);
- char *makeJson_Rtutakephoto();
- char *makeJson_ReadInfo();
- char *makeJson_takephoto();
- char *makeJson_Warn(char * s,char *t);
- void UpLoad_Data(void);
- char *uint8tostring(uint8_t dat);
- char *makeJson_Config_Reset(void);
- char *makeJson_Config_BDH(char * deviceId);
- char *makeJson_selfCheck_(uint8_t sta);
- char *makeJson_Cam(char * s,char *t);
- char *makeJson_C01_Warn(uint16_t code,double process);
- char *makeJson_record_read(char *type);
- char *makeJson_record_write(char *mqtt_num,char *photo_num);
- #endif /* APPLICATIONS_INC_DTU_UART2_H_ */
|