| | |
| | | /** |
| | | * 检查头 |
| | | * @param bs 上行字节数组 |
| | | * @return [rt1->true:是本协议P206,false:不是本协议; rt2->true:是水资源协议,false:是升级协议] |
| | | * @return [【0】->true:是本协议P206,false:不是本协议; 【1】->true:是水资源协议,false:是升级协议] |
| | | * @throws Exception 异常 |
| | | */ |
| | | public Boolean[] isThisProtocolHead(byte[] bs) throws Exception{ |
| | |
| | | int len = ByteUtilUnsigned.byte2Byte(bs, ProtocolConstantV206V1.dataLenIndex); |
| | | return len + ProtocolConstantV206V1.lenHead2ctrl + ProtocolConstantV206V1.lenTail; |
| | | }else{ |
| | | int len = ByteUtilUnsigned.bytes2Short_LE(bs, ProtocolConstantV206V1.UG_dataLenIndex_start); |
| | | int len = ByteUtilUnsigned.bytes2Short_BE(bs, ProtocolConstantV206V1.UG_dataLenIndex_start); |
| | | return len + ProtocolConstantV206V1.UG_lenHead2Cmd + ProtocolConstantV206V1.UG_lenTail; |
| | | } |
| | | } |