|
|
@@ -10,36 +10,36 @@
|
|
|
#include "common.h"
|
|
|
#include "cJSON.h"
|
|
|
|
|
|
-/// @brief 鑾峰彇鐢ㄦ埛淇℃伅
|
|
|
+/// @brief 获取用户信息
|
|
|
typedef struct
|
|
|
{
|
|
|
char* user_token;
|
|
|
}_Get_Info_Request;
|
|
|
|
|
|
-/// @brief 电压、电流、功率、耗电量统计接口
|
|
|
+/// @brief 电压、电流、功率、耗电量统计接口
|
|
|
typedef struct
|
|
|
{
|
|
|
float ydata[60]; //value
|
|
|
- char xAxis[60][32];//时间点
|
|
|
+ char xAxis[60][32];//时间点
|
|
|
}_Get_Total_Value;
|
|
|
|
|
|
-/// @brief 绯荤粺鎬绘暟淇℃伅
|
|
|
+/// @brief 系统总数信息
|
|
|
typedef struct
|
|
|
{
|
|
|
- int channel_total ;//閫氶亾鎬绘暟
|
|
|
- int warn_total ;//鍛婅�鎬绘暟
|
|
|
- int sensor_total ;//浼犳劅鍣ㄦ€绘暟
|
|
|
- int log_total ;//杩愯�鏃ュ織鎬绘暟
|
|
|
+ int channel_total ;//通道总数
|
|
|
+ int warn_total ;//告警总数
|
|
|
+ int sensor_total ;//传感器总数
|
|
|
+ int log_total ;//运行日志总数
|
|
|
}_Get_System_Total;
|
|
|
|
|
|
-//鍔熺巼瓒嬪娍鎺ュ彛
|
|
|
+//功率趋势接口
|
|
|
typedef struct
|
|
|
{
|
|
|
- float ydata[3][60] ;//0锛氭湁鍔熷姛鐜囷紱1锛氭棤鍔熷姛鐜囷紱2锛氳�鍦ㄥ姛鐜囷紱
|
|
|
- char xAxis[60][32] ;//时间点
|
|
|
+ float ydata[3][60] ;//0:有功功率;1:无功功率;2:视在功率;
|
|
|
+ char xAxis[60][32] ;//时间点
|
|
|
}_Power_Trend_Info;
|
|
|
|
|
|
-/// @brief 鎬讳綋璁惧�淇℃伅
|
|
|
+/// @brief 总体设备信息
|
|
|
typedef struct
|
|
|
{
|
|
|
char* user_token;
|
|
|
@@ -58,7 +58,7 @@ typedef struct
|
|
|
|
|
|
|
|
|
|
|
|
-/// @brief 总设备信息返回
|
|
|
+/// @brief 总设备信息返回
|
|
|
typedef struct
|
|
|
{
|
|
|
char* product_name;
|
|
|
@@ -70,14 +70,14 @@ typedef struct
|
|
|
char* productPwrType;
|
|
|
char* productVersion;
|
|
|
char* productConsumption;
|
|
|
- int productMemory; //鍐呭瓨
|
|
|
- char* occupancyRate;//磁盘占用率
|
|
|
- char* productAddr; //IP鍦板潃
|
|
|
- char productCount; //级联设备数
|
|
|
+ int productMemory; //内存
|
|
|
+ char* occupancyRate;//磁盘占用率
|
|
|
+ char* productAddr; //IP地址
|
|
|
+ char productCount; //级联设备数
|
|
|
_Get_System_Total system_total;
|
|
|
}_OverBackStsInfo;
|
|
|
|
|
|
-/// @brief 鐢垫簮鎬讳綋鐩戞帶璇锋眰淇℃伅
|
|
|
+/// @brief 电源总体监控请求信息
|
|
|
typedef struct
|
|
|
{
|
|
|
char* user_token;
|
|
|
@@ -87,7 +87,7 @@ typedef struct
|
|
|
}_OverAllPwrRequest;
|
|
|
|
|
|
|
|
|
-/// @brief 鐢垫簮閫氶亾鐩戞帶璇锋眰淇℃伅
|
|
|
+/// @brief 电源通道监控请求信息
|
|
|
typedef struct
|
|
|
{
|
|
|
char* user_token;
|
|
|
@@ -106,7 +106,7 @@ typedef struct
|
|
|
int outputType;
|
|
|
}_OverChnPwrRequest;
|
|
|
|
|
|
-/// @brief 鎬讳綋鐢垫簮杩斿洖淇℃伅
|
|
|
+/// @brief 总体电源返回信息
|
|
|
typedef struct
|
|
|
{
|
|
|
char* product_name;
|
|
|
@@ -115,60 +115,60 @@ typedef struct
|
|
|
char* productChName;
|
|
|
char productChId;
|
|
|
int status;
|
|
|
- float voltage ;//鐢靛帇
|
|
|
- float current ;//鐢垫祦
|
|
|
- float power ;//鍔熺巼
|
|
|
- float freq ;//棰戠巼
|
|
|
- float consumption ;//耗电量
|
|
|
+ float voltage ;//电压
|
|
|
+ float current ;//电流
|
|
|
+ float power ;//功率
|
|
|
+ float freq ;//频率
|
|
|
+ float consumption ;//耗电量
|
|
|
float factor ;
|
|
|
- unsigned short product_ch_start_delay ;//閫氶亾寤舵椂
|
|
|
- unsigned short product_ch_stop_delay ;//閫氶亾寤舵椂
|
|
|
- int product_type; //閫氶亾绫诲瀷
|
|
|
- int product_phType; //涓夌浉绫诲瀷
|
|
|
- float ph_voltage ;//鐢靛帇
|
|
|
- float ph_current ;//鐢垫祦
|
|
|
- float ph_power ;//鍔熺巼
|
|
|
- float ph_consumption ;//耗电量
|
|
|
- int ph_outputType ;//杈撳嚭绫诲瀷
|
|
|
- int ph_outputStatus ;//输出状态-该通道是否输出
|
|
|
+ unsigned short product_ch_start_delay ;//通道延时
|
|
|
+ unsigned short product_ch_stop_delay ;//通道延时
|
|
|
+ int product_type; //通道类型
|
|
|
+ int product_phType; //三相类型
|
|
|
+ float ph_voltage ;//电压
|
|
|
+ float ph_current ;//电流
|
|
|
+ float ph_power ;//功率
|
|
|
+ float ph_consumption ;//耗电量
|
|
|
+ int ph_outputType ;//输出类型
|
|
|
+ int ph_outputStatus ;//输出状态-该通道是否输出
|
|
|
struct list_head list;
|
|
|
}_OverChnPwrAckInfo;
|
|
|
|
|
|
-/// @brief 鎬讳綋鐢垫簮杩斿洖淇℃伅
|
|
|
+/// @brief 总体电源返回信息
|
|
|
typedef struct
|
|
|
{
|
|
|
char* product_name;
|
|
|
char* product_number;
|
|
|
int product_id;
|
|
|
- float voltage ;//鐢靛帇
|
|
|
- float current ;//鐢垫祦
|
|
|
- float power ;//鍔熺巼
|
|
|
- float freq ;//棰戠巼
|
|
|
- float consumption ;//耗电量
|
|
|
- float factor ;//鍔熺巼鍥犵礌
|
|
|
- _Get_Total_Value _total_voltage ;//鐢靛帇缁熻�
|
|
|
- _Get_Total_Value _total_current ;//鐢垫祦缁熻�
|
|
|
- _Get_Total_Value _total_power ;//鍔熺巼缁熻�
|
|
|
- _Get_Total_Value _total_consumption ;//耗电量统计
|
|
|
- _Power_Trend_Info _Power_Trend_Info ;//有功、无功、视在功率统计
|
|
|
+ float voltage ;//电压
|
|
|
+ float current ;//电流
|
|
|
+ float power ;//功率
|
|
|
+ float freq ;//频率
|
|
|
+ float consumption ;//耗电量
|
|
|
+ float factor ;//功率因素
|
|
|
+ _Get_Total_Value _total_voltage ;//电压统计
|
|
|
+ _Get_Total_Value _total_current ;//电流统计
|
|
|
+ _Get_Total_Value _total_power ;//功率统计
|
|
|
+ _Get_Total_Value _total_consumption ;//耗电量统计
|
|
|
+ _Power_Trend_Info _Power_Trend_Info ;//有功、无功、视在功率统计
|
|
|
}_OverAllPwrAckInfo;
|
|
|
|
|
|
|
|
|
-/// @brief 浼犳劅鍣ㄦ€讳綋璇锋眰淇℃伅
|
|
|
+/// @brief 传感器总体请求信息
|
|
|
typedef struct
|
|
|
{
|
|
|
- float ydata[2][60] ;//0锛氭俯搴︼紝1锛氭箍搴︼紱
|
|
|
- char xAxis[60][32] ;//时间点
|
|
|
+ float ydata[2][60] ;//0:温度,1:湿度;
|
|
|
+ char xAxis[60][32] ;//时间点
|
|
|
}_Sensor_Temp_Humi_Icon;
|
|
|
typedef struct
|
|
|
{
|
|
|
- float ydata[60] ;//气体值
|
|
|
- char xAxis[60][32] ;//时间点
|
|
|
+ float ydata[60] ;//气体值
|
|
|
+ char xAxis[60][32] ;//时间点
|
|
|
}_Sensor_Gas_Icon;
|
|
|
typedef struct
|
|
|
{
|
|
|
- float ydata[2][60] ;//0锛氭皵娴侊紝1锛氭皵鍘嬶紱
|
|
|
- char xAxis[60][32] ;//时间点
|
|
|
+ float ydata[2][60] ;//0:气流,1:气压;
|
|
|
+ char xAxis[60][32] ;//时间点
|
|
|
}_Sensor_Air_Press_Icon;
|
|
|
typedef struct
|
|
|
{
|
|
|
@@ -193,7 +193,7 @@ typedef struct
|
|
|
}_OverSensorRequest;
|
|
|
|
|
|
|
|
|
-/// @brief 传感器应答状态
|
|
|
+/// @brief 传感器应答状态
|
|
|
typedef struct
|
|
|
{
|
|
|
int accessControlStatus;
|
|
|
@@ -219,7 +219,7 @@ typedef struct
|
|
|
struct list_head list;
|
|
|
}_OverSensorBackInfo;
|
|
|
|
|
|
-/// @brief 电源类阈值设置
|
|
|
+/// @brief 电源类阈值设置
|
|
|
typedef struct
|
|
|
{
|
|
|
char* alarmContentUpperValue;
|
|
|
@@ -236,7 +236,7 @@ typedef struct
|
|
|
bool bUpdatevoltageUpperValue;
|
|
|
}_Power_AlarmRequestInfo;
|
|
|
|
|
|
-/// @brief 传感器类阈值设置
|
|
|
+/// @brief 传感器类阈值设置
|
|
|
typedef struct
|
|
|
{
|
|
|
char* connectionStatus ;
|
|
|
@@ -248,7 +248,7 @@ typedef struct
|
|
|
}_Sensor_AlarmRequestInfo;
|
|
|
|
|
|
|
|
|
-/// @brief 鍛婅�淇℃伅鏌ヨ�
|
|
|
+/// @brief 告警信息查询
|
|
|
typedef struct
|
|
|
{
|
|
|
char* user_token;
|
|
|
@@ -259,7 +259,7 @@ typedef struct
|
|
|
_Sensor_AlarmRequestInfo _sensor_info;
|
|
|
}_AlarmRequestInfo;
|
|
|
|
|
|
-/// @brief 鍛婅�鍝嶅簲淇℃伅
|
|
|
+/// @brief 告警响应信息
|
|
|
typedef struct
|
|
|
{
|
|
|
char alarmNumber[16];
|
|
|
@@ -272,7 +272,7 @@ typedef struct
|
|
|
}_AlarmAckInfo;
|
|
|
|
|
|
|
|
|
-/// @brief SMPT鏈嶅姟淇℃伅
|
|
|
+/// @brief SMPT服务信息
|
|
|
typedef struct
|
|
|
{
|
|
|
char* mode;
|
|
|
@@ -284,7 +284,7 @@ typedef struct
|
|
|
char* receiveAccount;
|
|
|
}_SMPT_ServerRequestInfo;
|
|
|
|
|
|
-/// @brief SNMP淇℃伅
|
|
|
+/// @brief SNMP信息
|
|
|
typedef struct
|
|
|
{
|
|
|
char* mode;
|
|
|
@@ -293,14 +293,14 @@ typedef struct
|
|
|
char* trapmode;
|
|
|
}_SNMP_ServerRequestInfo;
|
|
|
|
|
|
-/// @brief SNMP TRAP淇℃伅
|
|
|
+/// @brief SNMP TRAP信息
|
|
|
typedef struct
|
|
|
{
|
|
|
char* mode;
|
|
|
char* stType;
|
|
|
}_SNMPTRAP_ServerRequestInfo;
|
|
|
|
|
|
-/// @brief NTP淇℃伅
|
|
|
+/// @brief NTP信息
|
|
|
typedef struct
|
|
|
{
|
|
|
char* mode;
|
|
|
@@ -313,7 +313,7 @@ typedef struct
|
|
|
}_NTP_ServiceRequestInfo;
|
|
|
|
|
|
|
|
|
-/// @brief 瀹氭椂璁剧疆
|
|
|
+/// @brief 定时设置
|
|
|
typedef struct
|
|
|
{
|
|
|
char* productChName;
|
|
|
@@ -324,7 +324,7 @@ typedef struct
|
|
|
}_DS_ServiceRequestInfo;
|
|
|
|
|
|
|
|
|
-/// @brief 鏃跺簭璁剧疆
|
|
|
+/// @brief 时序设置
|
|
|
typedef struct
|
|
|
{
|
|
|
char* productId;
|
|
|
@@ -336,7 +336,7 @@ typedef struct
|
|
|
// char* closeInterval;
|
|
|
}_POSIX_ServiceRequestInfo;
|
|
|
|
|
|
-/// @brief 鍒嗙粍璁剧疆
|
|
|
+/// @brief 分组设置
|
|
|
typedef struct
|
|
|
{
|
|
|
char* mode;
|
|
|
@@ -347,7 +347,7 @@ typedef struct
|
|
|
|
|
|
|
|
|
|
|
|
-/// @brief 鏈嶅姟淇℃伅鏌ヨ�
|
|
|
+/// @brief 服务信息查询
|
|
|
typedef struct
|
|
|
{
|
|
|
char* user_token;
|
|
|
@@ -362,7 +362,7 @@ typedef struct
|
|
|
}_ServiceManageRequestInfo;
|
|
|
|
|
|
|
|
|
-/// @brief 缃戠粶鍙傛暟閰嶇疆
|
|
|
+/// @brief 网络参数配置
|
|
|
typedef struct
|
|
|
{
|
|
|
char* mode;
|
|
|
@@ -373,7 +373,7 @@ typedef struct
|
|
|
char* dns2;
|
|
|
}_NET_CommunicationRequestInfo;
|
|
|
|
|
|
-/// @brief RS鍙傛暟閰嶇疆
|
|
|
+/// @brief RS参数配置
|
|
|
typedef struct
|
|
|
{
|
|
|
char* mode;
|
|
|
@@ -382,7 +382,7 @@ typedef struct
|
|
|
}_RS_CommunicationRequestInfo;
|
|
|
|
|
|
|
|
|
-/// @brief 閫氫俊淇℃伅鏌ヨ�
|
|
|
+/// @brief 通信信息查询
|
|
|
typedef struct
|
|
|
{
|
|
|
char* user_token;
|
|
|
@@ -393,7 +393,7 @@ typedef struct
|
|
|
|
|
|
|
|
|
|
|
|
-/// @brief鏃ュ織淇℃伅鏌ヨ�
|
|
|
+/// @brief日志信息查询
|
|
|
typedef struct
|
|
|
{
|
|
|
char* user_token;
|
|
|
@@ -406,7 +406,7 @@ typedef struct
|
|
|
char* openName;
|
|
|
}_LogInformationRequestInfo;
|
|
|
|
|
|
-/// @brief 鏃ュ織搴旂瓟绫诲�
|
|
|
+/// @brief 日志应答类容
|
|
|
typedef struct
|
|
|
{
|
|
|
char* alarm_number;
|
|
|
@@ -417,7 +417,7 @@ typedef struct
|
|
|
char alarmContent[64];
|
|
|
}_LogInformationAckInfo;
|
|
|
|
|
|
-/// @brief 璁惧�缁存姢
|
|
|
+/// @brief 设备维护
|
|
|
typedef struct
|
|
|
{
|
|
|
char* user_token;
|
|
|
@@ -427,7 +427,7 @@ typedef struct
|
|
|
char* product_number;
|
|
|
}_Equipment_Mintenance;
|
|
|
|
|
|
- /// @brief 鐢ㄦ埛瑙掕壊绠$悊
|
|
|
+ /// @brief 用户角色管理
|
|
|
typedef struct
|
|
|
{
|
|
|
char* user_token;
|
|
|
@@ -435,8 +435,8 @@ typedef struct
|
|
|
char* createTime;
|
|
|
int userId;
|
|
|
char* userName;
|
|
|
- char* nickName;//鐢ㄩ€斾笉鏄庯紵
|
|
|
- bool delFlag;//鐢ㄩ€斾笉鏄庯紵
|
|
|
+ char* nickName;//用途不明?
|
|
|
+ bool delFlag;//用途不明?
|
|
|
int roleId;
|
|
|
char* roleName;
|
|
|
char* password;
|
|
|
@@ -450,7 +450,7 @@ char* ctrl_sts_ack_to_json(void);
|
|
|
|
|
|
void get_rand_str(char* s,int num);
|
|
|
int json_to_User_login_info(const char* str,_User_Log* _newUserLogin);
|
|
|
-int json_to_User_loginOut_info(const char* str,char* _UserLoginOutToken);
|
|
|
+int json_to_User_loginOut_info(const char* str,char** _UserLoginOutToken);
|
|
|
char* log_info_to_json(const char* token);
|
|
|
char* log_LoginFailedinfo_to_json();
|
|
|
|