if(found->second.time_threshold>0)//if enabled time threshold
if(found->second.time_threshold>0)//if enabled time threshold
status_time_threshold=((int)res.value)&&(found->second.counter>=1)&&((ts.tv_sec-found->second.time_threshold)>found->second.ts_time_threshold.tv_sec);//formula gives true and time threshold is passed
status_time_threshold=((int)(res.value))&&(found->second.counter>=1)&&((ts.tv_sec-found->second.time_threshold)>found->second.ts_time_threshold.tv_sec);//formula gives true and time threshold is passed
else
else
status_time_threshold=(int)res.value;
status_time_threshold=(int)(res.value);
//if status changed:
//if status changed:
// - from S_NORMAL to S_ALARM considering also time threshold
// - from S_NORMAL to S_ALARM considering also time threshold