liurunyu
2024-11-08 87a49ccc47abbb3505403d174001ceb3a2d2341d
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1/ProtocolConstantV206V1.java
@@ -17,8 +17,10 @@
     * RTU上报数据的头部最小长度,上报数据中,取这个最小长度的部分数据中,
     * 要一定包含数据帧长度,以备取出数据帧长度来,进行完整性检查,
     * 即断包与粘包检查(取值范围0-100,其中取值为0时,表示headMinLength数据无作用,由协议实现来控制)
     *
     * 2024-11-04增加了远程升级协议,这个值由3改为4
     */
    public static final int headMinLength = 3 ;
    public static final int headMinLength = 4 ;
    //帧起始
@@ -34,6 +36,9 @@
    public static final byte lenHead2ctrl = 3 ; //从头到控制域(不包括)字节数组长度
    public static final byte lenHead2Code = 10 ; //从头到功能码(包括)字节数组长度
    public static final byte lenTail = 2 ; //帧尾部字节数组长度
    public static final byte lenCtrl = 1 ; //控制域字节数组长度
    public static final byte lenRtuAddr = 5 ; //控制器地址字节数组长度
    /**
     * 所在字节数组的位置(下标)
     */
@@ -46,7 +51,29 @@
    public static final int codeIndex = 9 ;//功能码字节数组下标
    public static final int dataIndex = 10 ;//具体数据字节数组下标
    public static final String vsCardAddr = "00000000";//本系统应用的虚拟卡,卡物理地址采用10个0作为模拟
    ////////////////////////////////////////////////
    //
    //远程升级相关
    //
    ////////////////////////////////////////////////
    public static final byte UG_P_Head_Byte = (byte)0xAA ;
    public static final byte UG_P_Tail_Byte = (byte)0x16 ;
    public static final int UG_codeIndex = 4 ;//功能码字节数组下标
    public static final int UG_dataIndex = 12 ;//具体数据字节数组下标
    public static final int UG_dataLenIndex_start = 1 ;//帧长度开始所在 字节数组起始下标
    public static final int UG_dataLenIndex_end = 2 ;//帧长度结束所在 字节数组起始下标
    public static final int UG_rtuAddrIndex_start = 6 ;//控制器地址 字节数组开始下标
    public static final int UG_rtuAddrIndex_end = 11 ;//控制器地址 字节数组开始下标
    public static final byte UG_lenCmd = 2 ; //功能码字节数组长度
    public static final byte UG_lenRtuAddr = 6 ; //功能码字节数组长度
    public static final byte UG_lenHead2Cmd = 4 ; //从头到功能码(不包括)字节数组长度
    public static final byte UG_lenTail = 3 ; //帧尾部字节数组长度
    public static final byte UG_lenHead2RtuAddr = 12 ; //从头到RTU地址(包括)字节数组长度
}