| | |
| | | public Boolean isThisProtocolHead(byte[] bs) throws Exception{ |
| | | if(bs == null){ |
| | | return null ; |
| | | }else if(bs.length >= (ProtocolConstantV206V1.ctrlIndex - 1) |
| | | }else if(bs.length >= (ProtocolConstantV206V1.ctrlIndex) |
| | | && bs[0] == ProtocolConstantV206V1.P_Head_Byte |
| | | && bs[2] == ProtocolConstantV206V1.P_Head_Byte){ |
| | | //String vs = this.parseVersion(bs) ; |
| | |
| | | * @throws Exception 异常 |
| | | */ |
| | | public void checkHead(byte[] bs) throws Exception{ |
| | | if(bs.length < ProtocolConstantV206V1.onLineDataMinLength || bs[0] != ProtocolConstantV206V1.P_Head_Byte || bs[2] != ProtocolConstantV206V1.P_Head_Byte){ |
| | | if(bs.length < ProtocolConstantV206V1.onLineDataMinLength |
| | | || bs[0] != ProtocolConstantV206V1.P_Head_Byte |
| | | || bs[2] != ProtocolConstantV206V1.P_Head_Byte){ |
| | | throw new Exception("上行数据帧头不正确!") ; |
| | | } |
| | | } |