Commit 17e80146 by huangjy

mqtt协议包修改

parent 558d62c4
......@@ -119,7 +119,8 @@ public class JetLinksMqttDeviceMessageCodec implements DeviceMessageCodec {
CustomWriteMessage.Header header = new CustomWriteMessage.Header();
header.setTimestamp(deviceMessage.getTimestamp());
header.setVersion(1);
header.setUuid(deviceMessage.getMessageId()); customSendMessage.setHeader(header);
header.setUuid(deviceMessage.getMessageId());
customSendMessage.setHeader(header);
customSendMessage.setDeviceId(((DeviceMessage) message).getDeviceId());
CustomWriteMessage.PayLoad payLoad = new CustomWriteMessage.PayLoad();
......@@ -181,8 +182,12 @@ public class JetLinksMqttDeviceMessageCodec implements DeviceMessageCodec {
Set<String> keySet = jsonObject.keySet();
Map<String,Object> propertiesMap = new HashMap<>();
for (String key : keySet) {
if (key.equals("usrServerInfo")) {
propertiesMap.put(key, JSON.toJSONString(jsonObject.get(key)));
} else {
propertiesMap.put(key, ((JSONObject) jsonObject.get(key)).get("value"));
}
}
map.put("properties", propertiesMap);
map.put("success",true);
map.put("messageId",messageId);
......
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