#
whycq
2024-08-15 e54492fb532366faac8aa5d46ad8905ea3ff38d5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
package com.example.agvcontroller.protocol;
 
/**
 * 报文标识枚举
 * 下标1: 起始索引
 * 下标2: 长度
 * 下标3: 描述
 * Created by vincent on 2019-04-03
 */
public enum PackagePart {
 
    /**
     * 起始符
     */
    START_SYMBOL(0, 1, "起始符"),
 
    /**
     * 数据单元长度
     */
    CONTENT_LENGTH(1, 2, "数据单元长度"),
 
 
    /**
     * 唯一标识码
     */
    UNIQUENO(3, 4, "唯一标识码"),
 
    /**
     * 时间戳
     */
    TIMESTAMP(7, 4, "时间戳"),
 
    /**
     * 命令标识
     */
    COMMAND_MARK(11, 1, "命令标识"),
 
    /**
     * 数据单元
     */
    CONTENT(12, -1, "数据单元"),
 
    /**
     * 校验码
     */
    VALIDE_CODE( -1, 2, "校验码"),
 
    /**
     * 应答标志
     */
    ACK_MARK(3, 1, "应答标志"),
 
    /**
     * 数据单元加密方式
     */
    ENCRYPT_TYPE(21, 1, "数据单元加密方式"),
 
    ;
 
    // 字节段开始索引
    private Integer startIndex;
 
    // 字节段总字节数
    private Integer len;
 
    // 描述
    private String des;
 
    PackagePart(int startIndex, int len, String des) {
        this.startIndex = startIndex;
        this.len = len;
        this.des = des;
    }
 
    public Integer getStartIndex() {
        return startIndex;
    }
 
    public Integer getLen() {
        return len;
    }
 
    public String getDes() {
        return des;
    }
 
}