|
|
@@ -1556,7 +1556,12 @@ static void sensorStatusMonitoring(void* conn)
|
|
|
free(node);
|
|
|
break;
|
|
|
}
|
|
|
- }
|
|
|
+ }
|
|
|
+
|
|
|
+ char temp[100];
|
|
|
+ //sprintf(temp,"$删除$|$传感器$|%d",sensor_id_temp);
|
|
|
+ sprintf(temp,"Delete sensor %d",sensor_id_temp);
|
|
|
+ dev_insert_alarm_ctrl(__globalDeviceManage.db,__globalDeviceManage._global_device_info->product_id, 3, temp);
|
|
|
|
|
|
ack_str = ctrl_sts_ack_to_json();
|
|
|
}
|
|
|
@@ -1673,6 +1678,11 @@ static void sensorStatusMonitoring(void* conn)
|
|
|
#endif
|
|
|
}
|
|
|
|
|
|
+ char temp[100];
|
|
|
+ // sprintf(temp,"$修改$|$传感器$|%d",sensor_id_temp);
|
|
|
+ sprintf(temp,"Update sensor %d",sensor_id_temp);
|
|
|
+ dev_insert_alarm_ctrl(__globalDeviceManage.db,__globalDeviceManage._global_device_info->product_id, 3, temp);
|
|
|
+
|
|
|
ack_str = ctrl_sts_ack_to_json();
|
|
|
}
|
|
|
//添加传感器
|
|
|
@@ -1736,6 +1746,10 @@ static void sensorStatusMonitoring(void* conn)
|
|
|
//全局接口体中也需要添加相关参数
|
|
|
list_add_tail(&_globalSensorMangerTemp->list,&__globalDeviceManage._globalSensorManger.list);
|
|
|
|
|
|
+ char temp[100];
|
|
|
+ // sprintf(temp,"$新增$|$传感器$|%d",_over_all_sensor_request.sensorId);
|
|
|
+ sprintf(temp,"Add sensor %d",_over_all_sensor_request.sensorId);
|
|
|
+ dev_insert_alarm_ctrl(__globalDeviceManage.db,__globalDeviceManage._global_device_info->product_id, 3, temp);
|
|
|
|
|
|
ack_str = ctrl_sts_ack_to_json();
|
|
|
}
|
|
|
@@ -2483,7 +2497,7 @@ static void communicationManagement(void *conn)
|
|
|
{
|
|
|
sprintf(buff, "$%s$|$%s$|addr:%d BD:%d",language_RS485_install[0],language_alarm_RS485_slave[0],info->product_modbus_addr,info->product_modbus_baud);
|
|
|
}
|
|
|
- dev_insert_alarm_ctrl(__globalDeviceManage.db,__globalDeviceManage._globalPowerManger.product_id,4,buff);
|
|
|
+ dev_insert_alarm_ctrl(__globalDeviceManage.db,__globalDeviceManage._globalPowerManger.product_id,3,buff);
|
|
|
|
|
|
ack_str = ctrl_sts_ack_to_json();
|
|
|
}
|
|
|
@@ -2569,6 +2583,7 @@ static void serviceManagement(void *conn)
|
|
|
{
|
|
|
log_e("update snmp info err.");
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
//查询snmp_trap信息
|
|
|
else if(strcmp(_serviceManageRequestInfo.type,"listStQuery")==0)
|
|
|
@@ -2705,6 +2720,20 @@ static void serviceManagement(void *conn)
|
|
|
t = mktime(&tm_new);
|
|
|
set_local_timeandzone(&tm_new, _globalNTPManager.tzone);
|
|
|
}
|
|
|
+
|
|
|
+ char temp[100];
|
|
|
+ if (0==_globalNTPManager.mode)
|
|
|
+ {
|
|
|
+ //sprintf(temp,"$设置$|$时间$|%s", _globalNTPManager.time);
|
|
|
+ sprintf(temp,"Set Date & Time %s", _globalNTPManager.time);
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ // sprintf(temp,"$设置$|$时间$|NTP %s", _globalNTPManager.ntpaddress);
|
|
|
+ sprintf(temp,"Set Date & Time sync from NTP %s", _globalNTPManager.ntpaddress);
|
|
|
+ }
|
|
|
+ dev_insert_alarm_ctrl(__globalDeviceManage.db,__globalDeviceManage._global_device_info->product_id, 3, temp);
|
|
|
+
|
|
|
+
|
|
|
ack_str = ctrl_sts_ack_to_json();
|
|
|
if (_serviceManageRequestInfo._ntp_info.mode) free(_serviceManageRequestInfo._ntp_info.mode);
|
|
|
if (_serviceManageRequestInfo._ntp_info.port) free(_serviceManageRequestInfo._ntp_info.port);
|
|
|
@@ -2790,6 +2819,12 @@ static void serviceManagement(void *conn)
|
|
|
}
|
|
|
}
|
|
|
pthread_mutex_unlock(&__globalDeviceManage._power_ds);
|
|
|
+
|
|
|
+ char temp[100];
|
|
|
+ //sprintf(temp, "$设置$|定时$");
|
|
|
+ sprintf(temp, "Add scheduled tasks");
|
|
|
+ dev_insert_alarm_ctrl(__globalDeviceManage.db, __globalDeviceManage._global_device_info->product_id, 3, temp);
|
|
|
+
|
|
|
ack_str = ctrl_sts_ack_to_json();
|
|
|
}
|
|
|
//批量删除
|
|
|
@@ -2828,6 +2863,11 @@ static void serviceManagement(void *conn)
|
|
|
}
|
|
|
}
|
|
|
pthread_mutex_unlock(&__globalDeviceManage._power_ds);
|
|
|
+
|
|
|
+ char temp[100];
|
|
|
+ // sprintf(temp, "$删除$|定时$");
|
|
|
+ sprintf(temp, "Delete scheduled tasks");
|
|
|
+ dev_insert_alarm_ctrl(__globalDeviceManage.db, __globalDeviceManage._global_device_info->product_id, 3, temp);
|
|
|
ack_str = ctrl_sts_ack_to_json();
|
|
|
}
|
|
|
// 时序设置
|
|
|
@@ -3116,6 +3156,11 @@ static void serviceManagement(void *conn)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ char temp[100];
|
|
|
+ //sprintf(temp, "$打开$|$分组$|%d", ngroup);
|
|
|
+ sprintf(temp, "Open group %d", ngroup);
|
|
|
+ dev_insert_alarm_ctrl(__globalDeviceManage.db, __globalDeviceManage._global_device_info->product_id, 3, temp);
|
|
|
+
|
|
|
ack_str = ctrl_sts_ack_to_json();
|
|
|
}
|
|
|
else if (strcmp(_serviceManageRequestInfo.type, "fzClose") == 0) // 分组关
|
|
|
@@ -3214,6 +3259,10 @@ static void serviceManagement(void *conn)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ char temp[100];
|
|
|
+ // sprintf(temp, "$关闭$|$分组$|%d", ngroup);
|
|
|
+ sprintf(temp, "Close group %d", ngroup);
|
|
|
+ dev_insert_alarm_ctrl(__globalDeviceManage.db, __globalDeviceManage._global_device_info->product_id, 3, temp);
|
|
|
ack_str = ctrl_sts_ack_to_json();
|
|
|
}
|
|
|
|
|
|
@@ -3304,6 +3353,11 @@ static void systemManagent(void *conn)
|
|
|
dev_delete_user_info(__globalDeviceManage.db,_UserRoleManageRequestInfo.userIds);
|
|
|
// pUserlist = strtok_r(NULL, ",", &pUserListSave);
|
|
|
// }
|
|
|
+
|
|
|
+ char temp[100];
|
|
|
+ //sprintf(temp, "$删除$|$用户$|%d", _UserRoleManageRequestInfo.userIds);
|
|
|
+ sprintf(temp, "Delete user %d", _UserRoleManageRequestInfo.userIds);
|
|
|
+ dev_insert_alarm_ctrl(__globalDeviceManage.db, __globalDeviceManage._global_device_info->product_id, 3, temp);
|
|
|
}
|
|
|
//添加用户
|
|
|
else if(strcmp(_UserRoleManageRequestInfo.type,"addUser")==0)
|
|
|
@@ -3356,6 +3410,11 @@ static void systemManagent(void *conn)
|
|
|
dev_insert_user_info(__globalDeviceManage.db, new_user);
|
|
|
}
|
|
|
|
|
|
+ char temp[100];
|
|
|
+ //sprintf(temp, "$添加$|$用户$|%s", _UserRoleManageRequestInfo.userName);
|
|
|
+ sprintf(temp, "Add user %s", _UserRoleManageRequestInfo.userName);
|
|
|
+ dev_insert_alarm_ctrl(__globalDeviceManage.db, __globalDeviceManage._global_device_info->product_id, 3, temp);
|
|
|
+
|
|
|
ack_str=ctrl_sts_ack_to_json();
|
|
|
}
|
|
|
//更新用户信息
|
|
|
@@ -3379,6 +3438,11 @@ static void systemManagent(void *conn)
|
|
|
|
|
|
dev_update_user_info(__globalDeviceManage.db, new_user);
|
|
|
|
|
|
+ char temp[100];
|
|
|
+ //sprintf(temp, "$修改$|$用户$|%s", _UserRoleManageRequestInfo.userName);
|
|
|
+ sprintf(temp, "Update user %s", _UserRoleManageRequestInfo.userName);
|
|
|
+ dev_insert_alarm_ctrl(__globalDeviceManage.db, __globalDeviceManage._global_device_info->product_id, 3, temp);
|
|
|
+
|
|
|
ack_str=ctrl_sts_ack_to_json();
|
|
|
}
|
|
|
|
|
|
@@ -3478,9 +3542,21 @@ static void equipmentMintenance(void *conn)
|
|
|
ack_str = vendor_info_to_json(dev);
|
|
|
}
|
|
|
else if(strcmp(_Over_equipment_mintenance.type,"sBRestart")==0) { //restart
|
|
|
+
|
|
|
+ char temp[100];
|
|
|
+ //sprintf(temp, "$系统$|$重启$");
|
|
|
+ sprintf(temp, "System Reboot!");
|
|
|
+ dev_insert_alarm_ctrl(__globalDeviceManage.db, __globalDeviceManage._global_device_info->product_id, 3, temp);
|
|
|
+
|
|
|
sys_reboot();
|
|
|
}
|
|
|
else if(strcmp(_Over_equipment_mintenance.type,"restoreFactorySettings")==0) { //restore to factory
|
|
|
+
|
|
|
+ char temp[100];
|
|
|
+ //sprintf(temp, "$系统$|$恢复出厂设置$");
|
|
|
+ sprintf(temp, "System Reset!");
|
|
|
+ dev_insert_alarm_ctrl(__globalDeviceManage.db, __globalDeviceManage._global_device_info->product_id, 3, temp);
|
|
|
+
|
|
|
sys_set_factory();
|
|
|
}
|
|
|
else {
|