111
k94314517
2025-02-28 04dba6a17f836b5fbdf0eedff8a129c6785fd8a2
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
package org.yzh.protocol.t808;
 
import io.github.yezhihao.protostar.annotation.Field;
import io.github.yezhihao.protostar.annotation.Message;
import org.yzh.protocol.basics.JTMessage;
import org.yzh.protocol.commons.JT808;
 
/**
 * @author yezhihao
 * https://gitee.com/yezhihao/jt808-server
 */
@Message(JT808.终端注册)
public class T0100 extends JTMessage {
 
    @Field(length = 2, desc = "省域ID")
    private int provinceId;
    @Field(length = 2, desc = "市县域ID")
    private int cityId;
    @Field(length = 5, desc = "制造商ID", version = {-1, 0})
    @Field(length = 11, desc = "制造商ID", version = 1)
    private String makerId;
    @Field(length = 8, desc = "终端型号", version = -1)
    @Field(length = 20, desc = "终端型号", version = 0)
    @Field(length = 30, desc = "终端型号", version = 1)
    private String deviceModel;
    @Field(length = 7, desc = "终端ID", version = {-1, 0})
    @Field(length = 30, desc = "终端ID", version = 1)
    private String deviceId;
    @Field(length = 1, desc = "车牌颜色:0.未上车牌 1.蓝色 2.黄色 3.黑色 4.白色 9.其他")
    private int plateColor;
    @Field(desc = "车辆标识")
    private String plateNo;
 
    /** 设备安装车辆所在的省域,省域ID采用GB/T2260中规定的行政区划代码6位中前两位 */
    public int getProvinceId() {
        return provinceId;
    }
 
    public void setProvinceId(int provinceId) {
        this.provinceId = provinceId;
    }
 
    /** 设备安装车辆所在的市域或县域,市县域ID采用GB/T2260中规定的行政区划代码6位中后四位 */
    public int getCityId() {
        return cityId;
    }
 
    public void setCityId(int cityId) {
        this.cityId = cityId;
    }
 
    /** 终端制造商编码 */
 
    public String getMakerId() {
        return makerId;
    }
 
    public void setMakerId(String makerId) {
        this.makerId = makerId;
    }
 
    /** 由制造商自行定义,位数不足时,后补"0x00" */
    public String getDeviceModel() {
        return deviceModel;
    }
 
    public void setDeviceModel(String deviceModel) {
        this.deviceModel = deviceModel;
    }
 
    /** 由大写字母和数字组成,此终端ID由制造商自行定义 */
    public String getDeviceId() {
        return deviceId;
    }
 
    public void setDeviceId(String deviceId) {
        this.deviceId = deviceId;
    }
 
    /** 按照JT/T415-2006的5.4.12 */
    public int getPlateColor() {
        return plateColor;
    }
 
    public void setPlateColor(int licensePlate) {
        this.plateColor = licensePlate;
    }
 
    /** 车牌颜色为0时,表示车辆VIN 否则,表示公安交通管理部门颁发的机动车号牌 */
    public String getPlateNo() {
        return plateNo;
    }
 
    public void setPlateNo(String plateNo) {
        this.plateNo = plateNo;
    }
 
    @Override
    public int getProtocolVersion() {
        int bodyLength = getBodyLength();
        if (bodyLength > 0 && bodyLength < 37)
            return -1;
        return super.getProtocolVersion();
    }
}