wjc
2025-04-24 8a249407f9a91b696b88d74eea0fbf789d0ee6a4
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
package com.hdl.sdk.link.core.bean;
 
import androidx.annotation.NonNull;
 
import com.hdl.sdk.link.common.utils.LogUtils;
import com.hdl.sdk.link.common.utils.gson.GsonConvert;
import com.hdl.sdk.link.core.utils.ByteUtils;
 
import java.io.Serializable;
 
/**
 * Created by hxb on 2021/12/19.
 */
public class BusProResponse implements Serializable {
    /**
     * 原生主题
     */
    private String topic;
    /**
     * 原生数据
     */
    private byte []data;
 
    /**
     * 网关Oid
     */
    private String oid;
    /**
     * IP地址
     */
    private String ipAddress;
    // 源子网号
    private byte sourceSubnetId;
    // 源设备号
    private byte sourceDeviceId ;
    //设备类型
    private byte[]deviceType;
    //操作码
    private byte[] command ;
    //目标子网号
    private byte desSubnetId;
    //目标设备号
    private byte desDeviceId;
 
    private byte []extraBytes;
 
    /**
     * 获取原生主题
     *
     * @return
     */
    public String getTopic() {
        return topic;
    }
 
    /**
     * 设置原生主题
     *
     * @param topic
     */
    public void setTopic(String topic) {
        this.topic = topic;
    }
 
    /**
     * 获取原生数据
     *
     * @return
     */
    public byte []getData() {
        return data;
    }
 
    /**
     * 设置原生数据
     *
     * @param data
     */
    public void setData(byte []data) {
        this.data=data;
    }
 
    /**
     * 获取网关主要信息,可能是oid,可能是网关Id,可能是mac
     *
     * @return
     */
    public String getOid() {
        return oid;
    }
 
    /**
     * 设置Oid
     *
     * @param
     */
    public void setOid(String oid) {
        this.oid = oid;
    }
 
    public byte getSourceSubnetId() {
        return sourceSubnetId;
    }
 
    public void setSourceSubnetId(byte sourceSubnetId) {
        this.sourceSubnetId = sourceSubnetId;
    }
 
    public byte getSourceDeviceId() {
        return sourceDeviceId;
    }
 
    public void setSourceDeviceId(byte sourceDeviceId) {
        this.sourceDeviceId = sourceDeviceId;
    }
 
    public byte[] getDeviceType() {
        return deviceType;
    }
 
    public void setDeviceType(byte[] deviceType) {
        this.deviceType = deviceType;
    }
 
    public byte[] getCommand() {
        return command;
    }
 
    public void setCommand(byte[] command) {
        this.command = command;
    }
 
    public byte getDesSubnetId() {
        return desSubnetId;
    }
 
    public void setDesSubnetId(byte desSubnetId) {
        this.desSubnetId = desSubnetId;
    }
 
    public byte getDesDeviceId() {
        return desDeviceId;
    }
 
    public void setDesDeviceId(byte desDeviceId) {
        this.desDeviceId = desDeviceId;
    }
 
    public byte[] getExtraBytes() {
        return extraBytes;
    }
 
    public void setExtraBytes(byte[] extraBytes) {
        this.extraBytes = extraBytes;
    }
 
    /**
     * IP地址
     * @return
     */
    public String getIpAddress() {
        return ipAddress;
    }
 
    /**
     * IP地址
     * @param ipAddress
     */
    public void setIpAddress(String ipAddress) {
        this.ipAddress = ipAddress;
    }
 
    @Override
    public String toString() {
        return String.format("IP地址 %s、源子网号 %s、源设备号 %s、设备类型 %s、操作码 %s、目标子网号 %s、目标设备号 %s、附加数据 %s",getIpAddress(), ByteUtils.encodeHexString(getSourceSubnetId()), ByteUtils.encodeHexString(getSourceDeviceId()), ByteUtils.encodeHexString(getDeviceType()), ByteUtils.encodeHexString(getCommand()), ByteUtils.encodeHexString(getDesSubnetId()),ByteUtils.encodeHexString (getDesDeviceId()), ByteUtils.encodeHexString(getExtraBytes()));
    }
}