liurunyu
2024-11-04 4e96ae4f261c073561f3dfb1a7dff0139bd7cb33
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1/CommonV1.java
@@ -15,7 +15,7 @@
   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) ;
@@ -32,7 +32,9 @@
    * @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("上行数据帧头不正确!") ;
      }
   }