Commit ca4eecca by 罗志长

fix: 读写属性回复

parent 551b0435
......@@ -253,11 +253,15 @@ public class JetLinksMqttDeviceMessageCodec implements DeviceMessageCodec {
Set<String> keySet = jsonObject.keySet();
Map<String,Object> propertiesMap = new HashMap<>();
for (String key : keySet) {
Integer retCode = ((JSONObject) jsonObject.get(key)).getInteger("retCode");
Object value = ((JSONObject) jsonObject.get(key)).get("value");
if (value != null && value.toString().equals("success")) {
propertiesMap.put(key, 0);
} else {
propertiesMap.put(key, value);
propertiesMap.put(key, value);
if (message.getTopic().contains("write")) {
if (retCode != null && retCode == 0) {
if (value != null && value.toString().equals("success")) {
propertiesMap.put(key, 0);
}
}
}
}
map.put("properties", propertiesMap);
......
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