|
@@ -1084,6 +1084,7 @@ void sensor_alarm(GlobalSensorManger *_globalSensorMangerTemp, int nAlarmType)
|
|
|
float *pValData = NULL; //当前值
|
|
float *pValData = NULL; //当前值
|
|
|
char *nCtrlType = NULL; //报警方式
|
|
char *nCtrlType = NULL; //报警方式
|
|
|
char *nCtrlValue= NULL; //控制通道
|
|
char *nCtrlValue= NULL; //控制通道
|
|
|
|
|
+ char strCtrlValue[512]={0};
|
|
|
if (!_globalSensorMangerTemp|| !_globalSensorMangerTemp->over_manager)
|
|
if (!_globalSensorMangerTemp|| !_globalSensorMangerTemp->over_manager)
|
|
|
{
|
|
{
|
|
|
return;
|
|
return;
|
|
@@ -1130,6 +1131,7 @@ void sensor_alarm(GlobalSensorManger *_globalSensorMangerTemp, int nAlarmType)
|
|
|
{
|
|
{
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
+ strcpy(strCtrlValue,nCtrlValue);
|
|
|
if (nAlarmType == SENSOR_VAL1_UPPER || nAlarmType == SENSOR_VAL2_UPPER)//上限
|
|
if (nAlarmType == SENSOR_VAL1_UPPER || nAlarmType == SENSOR_VAL2_UPPER)//上限
|
|
|
{
|
|
{
|
|
|
if (*penable == 1 && *pValthreshold < *pValData)
|
|
if (*penable == 1 && *pValthreshold < *pValData)
|
|
@@ -1137,13 +1139,13 @@ void sensor_alarm(GlobalSensorManger *_globalSensorMangerTemp, int nAlarmType)
|
|
|
if (!*pSave)
|
|
if (!*pSave)
|
|
|
{
|
|
{
|
|
|
*pSave = true;
|
|
*pSave = true;
|
|
|
- log_d("Sensor_Alarm CtrlType=%d,value=%s",*nCtrlType,*nCtrlValue);
|
|
|
|
|
|
|
+ log_d("Sensor_Alarm CtrlType=%d,value=%s",*nCtrlType,strCtrlValue);
|
|
|
dev_sensor_Alarm_send_message(&__globalDeviceManage, _globalSensorMangerTemp, nAlarmType);
|
|
dev_sensor_Alarm_send_message(&__globalDeviceManage, _globalSensorMangerTemp, nAlarmType);
|
|
|
if (*nCtrlType == ALARM_CTRL_CLOSE_CH)
|
|
if (*nCtrlType == ALARM_CTRL_CLOSE_CH)
|
|
|
{
|
|
{
|
|
|
char *pCHlist;
|
|
char *pCHlist;
|
|
|
char *pCHListSave;
|
|
char *pCHListSave;
|
|
|
- pCHlist = strtok_r(nCtrlValue, ",", &pCHListSave);
|
|
|
|
|
|
|
+ pCHlist = strtok_r(strCtrlValue, ",", &pCHListSave);
|
|
|
// 其他版本功能
|
|
// 其他版本功能
|
|
|
while (pCHlist != NULL)
|
|
while (pCHlist != NULL)
|
|
|
{
|
|
{
|
|
@@ -1169,13 +1171,13 @@ void sensor_alarm(GlobalSensorManger *_globalSensorMangerTemp, int nAlarmType)
|
|
|
if (!*pSave)
|
|
if (!*pSave)
|
|
|
{
|
|
{
|
|
|
*pSave = true;
|
|
*pSave = true;
|
|
|
- log_d("Sensor_Alarm CtrlType=%d,value=%s",*nCtrlType,*nCtrlValue);
|
|
|
|
|
|
|
+ log_d("Sensor_Alarm CtrlType=%d,value=%s",*nCtrlType,strCtrlValue);
|
|
|
dev_sensor_Alarm_send_message(&__globalDeviceManage, _globalSensorMangerTemp, nAlarmType);
|
|
dev_sensor_Alarm_send_message(&__globalDeviceManage, _globalSensorMangerTemp, nAlarmType);
|
|
|
if (*nCtrlType == ALARM_CTRL_CLOSE_CH)
|
|
if (*nCtrlType == ALARM_CTRL_CLOSE_CH)
|
|
|
{
|
|
{
|
|
|
char *pCHlist;
|
|
char *pCHlist;
|
|
|
char *pCHListSave;
|
|
char *pCHListSave;
|
|
|
- pCHlist = strtok_r(nCtrlValue, ",", &pCHListSave);
|
|
|
|
|
|
|
+ pCHlist = strtok_r(strCtrlValue, ",", &pCHListSave);
|
|
|
// 其他版本功能
|
|
// 其他版本功能
|
|
|
while (pCHlist != NULL)
|
|
while (pCHlist != NULL)
|
|
|
{
|
|
{
|