| | |
| | | if(topicGrp.length != 5){ |
| | | throw new Exception("接收的mqtt消息主题不可识别") ; |
| | | }else{ |
| | | if(NumUtil.isPlusIntNumber(topicGrp[4])){ |
| | | if(!NumUtil.isPlusIntNumber(topicGrp[4])){ |
| | | throw new Exception("接收的mqtt消息主题不可识别") ; |
| | | } |
| | | if(Integer.parseInt(topicGrp[4]) <= 0){ |
| | |
| | | if(com.protocolVersion == null){ |
| | | throw new Exception("接收到MQTT命令,但未提供协议版本号") ; |
| | | } |
| | | if(com.code != null && com.code.trim().length() != 0){ |
| | | if(com.code == null || com.code.trim().length() == 0){ |
| | | throw new Exception("接收到MQTT命令,但未提供功能码") ; |
| | | } |
| | | if(com.protocol.equals(ProtocolConstantSdV1.protocolName)){ |
| | |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | String s = "ym/sd1/10000/control/m1" ; |
| | | String s = "jyg/sd1/2430002404000840/weather/1" ; |
| | | String[] ss = s.split("/") ; |
| | | for (String s1 : ss) { |
| | | System.out.println(s1); |