liurunyu
2024-12-02 7fd3ff6715939467e3850763206d37fac8564e41
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/global/GlCreate.java
@@ -146,6 +146,17 @@
        bsNoTail[ProtocolConstantV206V1.dataLenIndex] = (byte)len ;
    }
    public static void createLen4PUg(byte[] bytes) throws Exception {
        int len = bytes.length - 4;
        byte[] bs = ByteUtil.int2BCD_LE(len) ;
        if(bs != null && bs.length == 1){
            bytes[1] = bs[0] ;
        }else if(bs != null && bs.length > 1){
            bytes[1] = bs[0] ;
            bytes[2] = bs[1] ;
        }
    }
    public static byte[] createCrcTail(byte[] bsNoTail) throws Exception {
        int crc = new CRC8_for_2_0().CRC8(bsNoTail, ProtocolConstantV206V1.ctrlIndex, bsNoTail.length -1) ;
        byte[] bytes = new byte[ProtocolConstantV206V1.lenTail] ;