#
LSH
2022-11-28 0956cd2d3f2840f2f26855f05a83165d63dd7ba1
src/main/java/com/zy/core/netty/domain/fire/Fire_3030.java
@@ -5,8 +5,7 @@
import io.netty.buffer.ByteBufAllocator;
import io.netty.buffer.ByteBufUtil;
import lombok.Data;
import java.nio.charset.StandardCharsets;
import org.springframework.cache.annotation.SpringCacheAnnotationParser;
/**
 * 心跳 pac
@@ -16,7 +15,20 @@
@Data
public class Fire_3030 implements IMessageBody {
    /**
     * 机器号
     */
    private Integer no;
    /**
     * 回路
     */
    private Integer loop;
    /**
     * 部位号
     */
    private Integer partNo;
    private Integer year;
@@ -59,6 +71,8 @@
//        byteBuf.release();
//        System.out.println(byteBuf.refCnt());
        this.no = analyze(new byte[]{bytes[3], bytes[4]});
        this.loop = analyze(new byte[]{bytes[5], bytes[6]});
        this.partNo = analyze(new byte[]{bytes[7], bytes[8]});  //0100201 对应  30 31   0200201 对应 34 35
        this.year = analyze(new byte[]{bytes[11], bytes[12]});
        this.month = analyze(new byte[]{bytes[13], bytes[14]});
        this.day = analyze(new byte[]{bytes[15], bytes[16]});
@@ -70,7 +84,7 @@
    }
    public static Integer analyze(byte[] bytes) {
        return Integer.parseInt(new String(bytes, StandardCharsets.US_ASCII), 16);
        return Integer.parseInt(Integer.toString(bytes[0] & 0x0F, 16) + Integer.toString(bytes[1] & 0x0F, 16), 16);
    }
}