|
@@ -435,7 +435,17 @@ function buildMqttData($mqttType, $msgId/*整数 0-4294967295*/, $data) {
|
|
$buff = $data['lower'] . ALTER_SEP . $data['upper'];/*1.236,10.256*/
|
|
$buff = $data['lower'] . ALTER_SEP . $data['upper'];/*1.236,10.256*/
|
|
$bin = $bin . $buff . chr(0);//补零 设备解析是以为\0结尾
|
|
$bin = $bin . $buff . chr(0);//补零 设备解析是以为\0结尾
|
|
} else if ($mqttType == MQTT_TYPE::$GET_ALARM) {
|
|
} else if ($mqttType == MQTT_TYPE::$GET_ALARM) {
|
|
- } else if ($mqttType == MQTT_TYPE::$PUB_CALIBRATION_ZERO) {
|
|
|
|
|
|
+ } else if ($mqttType == MQTT_TYPE::$SET_DAMPING_TIME) {
|
|
|
|
+ $num = floatval($data);
|
|
|
|
+ if ($num < 0.00 || $num > 60.00) {
|
|
|
|
+ rlog("err damping time " . $data);
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $buff = $data;/*0.00-60.00*/
|
|
|
|
+ $bin = $bin . $buff . chr(0);//补零 设备解析是以为\0结尾
|
|
|
|
+ } else if ($mqttType == MQTT_TYPE::$GET_DAMPING_TIME) {
|
|
|
|
+ }else if ($mqttType == MQTT_TYPE::$PUB_CALIBRATION_ZERO) {
|
|
} else {
|
|
} else {
|
|
rlog("warn unknown type " . ord($mqttType));
|
|
rlog("warn unknown type " . ord($mqttType));
|
|
return false;
|
|
return false;
|