| | |
| | | public MqttSubMsgSdV1(MqttTopic subTopic, String msg) { |
| | | this.deviceId = subTopic.devId ; |
| | | this.protocol = subTopic.protocol ; |
| | | this.topic = subTopic.topic ; |
| | | this.msg = msg ; |
| | | this.topic = subTopic ; |
| | | this.metaData = msg ; |
| | | } |
| | | public String toString(){ |
| | | StringBuilder sb = new StringBuilder(); |
| | |
| | | .append("\n") ; |
| | | } |
| | | sb.append("主题:") |
| | | .append(topic) |
| | | .append("\n") ; |
| | | sb.append("消息:") |
| | | .append(msg) |
| | | .append(topic.longName()) |
| | | .append("\n") ; |
| | | if(vo4Up != null){ |
| | | sb.append("数据:") |
| | | .append(vo4Up.toString()) |
| | | .append("\n") ; |
| | | }else{ |
| | | sb.append("元数据:") |
| | | .append(metaData) |
| | | .append("\n") ; |
| | | } |
| | | |
| | | return sb.toString() ; |
| | | } |
| | | |
| | |
| | | if (topic == null || topic.isEmpty()) { |
| | | return false; |
| | | } |
| | | if (msg == null || msg.isEmpty()) { |
| | | if (metaData == null || metaData.isEmpty()) { |
| | | return false; |
| | | } |
| | | return true; |