Commit 9898ffc0 by huangjy

mqtt协议包,新增雷达参数以及雷达拓展参数

parent b2c80565
...@@ -128,11 +128,20 @@ public class JetLinksMqttDeviceMessageCodec implements DeviceMessageCodec { ...@@ -128,11 +128,20 @@ public class JetLinksMqttDeviceMessageCodec implements DeviceMessageCodec {
payLoad.setDeviceId(deviceMessage.getDeviceId()); payLoad.setDeviceId(deviceMessage.getDeviceId());
Map<String, Object> properties = ((WritePropertyMessage) deviceMessage).getProperties(); Map<String, Object> properties = ((WritePropertyMessage) deviceMessage).getProperties();
Object result = properties.get("usrServerInfo"); if (properties.get("usrServerInfo") != null) {
if (result != null) {
Map<String, Object> res = Maps.newConcurrentMap(); Map<String, Object> res = Maps.newConcurrentMap();
UserServerInfo userServerInfo = JSON.parseObject(result.toString(),UserServerInfo.class); UserServerInfo userServerInfo = JSON.parseObject(properties.get("usrServerInfo").toString(), UserServerInfo.class);
res.put("usrServerInfo",userServerInfo); res.put("usrServerInfo", userServerInfo);
payLoad.setProperties(res);
} else if (properties.get("radarAiParam") != null) {
Map<String, Object> res = Maps.newConcurrentMap();
RadarAiParam radarAiParam = JSON.parseObject(properties.get("radarAiParam") .toString(), RadarAiParam.class);
res.put("radarAiParam", radarAiParam);
payLoad.setProperties(res);
} else if (properties.get("radarAiExtent") != null) {
Map<String, Object> res = Maps.newConcurrentMap();
RadarAiExtent radarAiExtent = JSON.parseObject(properties.get("radarAiExtent").toString(), RadarAiExtent.class);
res.put("radarAiExtent", radarAiExtent);
payLoad.setProperties(res); payLoad.setProperties(res);
} else { } else {
payLoad.setProperties(properties); payLoad.setProperties(properties);
......
package org.jetlinks.protocol.official.entity;
import lombok.Data;
@Data
public class RadarAiExtent {
private Integer BorderRightX;
private Integer BorderRightY;
private Integer overallLeftX;
private Integer overallLeftY;
private Integer BorderLeftX;
private Integer BorderLeftY;
private Integer overallRightY;
}
package org.jetlinks.protocol.official.entity;
import lombok.Data;
@Data
public class RadarAiParam {
private Integer groundDeviceOccupancy;
private Integer suspectedDuration;
private Integer middleHeight;
private Integer skeyDeviceOccupancy;
private Integer edgeHeight;
private Integer middleThreshold;
private Integer edgeThreshold;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment