wjc
2025-04-01 31e89a8697d049410c9d8d5c333cba33223bc9dc
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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
package com.hdl.sdk.link.zigbee.bean;
 
import androidx.annotation.NonNull;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
 
/**
 * Created by jlchen on 12/29/21.
 * 搜索ZigBee设备回路回复
 */
public class ZBDeviceBean implements Serializable {
    /// <summary>
    /// 实际的设备id
    /// <para>258:color dimmable light,调关灯 </para>
    /// <para>10:Door lock,门锁</para>
    /// <para>514:Window covering device,窗帘</para>
    /// <para>515:Window covering controller,窗帘控制器</para>
    /// <para>769:Thermostat,恒温面板/空调</para>
    /// <para>770:Temperature Sensor,温度传感器</para>
    /// <para>775:Temperature Sensor,湿度传感器</para>
    /// <para>262:Light sensor,光照传感器</para>
    /// <para>1026:sensor,传感器,具体类型的传感器DeviceType来区分</para>
    /// </summary>
    private int Device_ID;
    /// MAC地址
    private String DeviceAddr;
    //设备端口号
    //和mac地址共同标识唯一的zigbee设备
    //数值范围0-255
    //如果无设备该字段不存在
    private int Epoint;
    //返回入网设备信息
    private int Data_ID;
    //设备详细信息
    private ZBDataBean Data;
    //自定义添加字段 可能是oid,可能是网关Id,可能是mac
    private String gatewayMac;
 
    /**
     * 模板匹配标记 wxr 自定义 2022-02-23 16:09:44
     */
    private boolean templateSettingFlag = false;
    public boolean isTemplateSettingFlag() {
        return templateSettingFlag;
    }
 
    public void setTemplateSettingFlag(boolean templateSettingFlag) {
        this.templateSettingFlag = templateSettingFlag;
    }
    private String templateAddr ;
 
    private String linkSid;
    private String linkSpk;
    private String linkOid;
    private String linkName;
 
    public ZBDeviceBean() {
    }
 
    public ZBDeviceBean(String linkSid, String linkSpk, String linkOid, String linkName) {
        this.linkSid = linkSid;
        this.linkSpk = linkSpk;
        this.linkOid = linkOid;
        this.linkName = linkName;
    }
 
    public String getLinkSid() {
        return linkSid == null ? "" : linkSid;
    }
 
    public void setLinkSid(@NonNull String linkSid) {
        this.linkSid = linkSid;
    }
 
    public String getLinkSpk() {
        return linkSpk == null ? "" : linkSpk;
    }
 
    public void setLinkSpk(@NonNull String linkSpk) {
        this.linkSpk = linkSpk;
    }
 
    public String getLinkOid() {
        return linkOid == null ? "" : linkOid;
    }
 
    public void setLinkOid(@NonNull String linkOid) {
        this.linkOid = linkOid;
    }
 
    public String getLinkName() {
        return linkName == null ? "" : linkName;
    }
 
    public void setLinkName(@NonNull String linkName) {
        this.linkName = linkName;
    }
 
    public String getTemplateAddr() {
        return templateAddr == null ? "" : templateAddr;
    }
 
    public void setTemplateAddr(String templateAddr) {
        this.templateAddr = templateAddr;
    }
 
    @NonNull
    public String getGatewayMac() {
        return gatewayMac == null ? "" : gatewayMac;
    }
 
    public void setGatewayMac(@NonNull String gatewayMac) {
        this.gatewayMac = gatewayMac;
    }
 
    public int getDevice_ID() {
        return Device_ID;
    }
 
    public void setDevice_ID(int Device_ID) {
        this.Device_ID = Device_ID;
    }
 
    @NonNull
    public String getDeviceAddr() {
        return DeviceAddr == null ? "" : DeviceAddr;
    }
 
    public void setDeviceAddr(@NonNull String DeviceAddr) {
        this.DeviceAddr = DeviceAddr;
    }
 
    public int getEpoint() {
        return Epoint;
    }
 
    public void setEpoint(int Epoint) {
        this.Epoint = Epoint;
    }
 
    public int getData_ID() {
        return Data_ID;
    }
 
    public void setData_ID(int Data_ID) {
        this.Data_ID = Data_ID;
    }
 
 
 
    public ZBDataBean getData() {
        if(Data == null){
            Data = new ZBDataBean();
        }
        return Data;
    }
 
    public void setData(ZBDataBean Data) {
        this.Data = Data;
    }
 
    /**
     * 设备详细信息
     */
    public static class ZBDataBean implements Serializable{
        private int TotalNum;//入网设备总数。等于0时,表示没有设备信息,下面字段将不存在。
        private int DeviceNum;//标识当前设备是发送的是第几个设备。DeviceNum从1开始每发送一个设备信息,下一个设备信息的DeviceNum将加1。直到DeviceNum等于TotalNum说明所有设备信息发送完毕
        private int JoinTime;//入网的utc时间戳
        private int ZigbeeType;//1:路由器设备 2:终端设备,电池设备
        private int NwkAddr;//设备网络地址
        private int DeviceType;//该字段主要针对IAS安防设备设立。所有IAS安防设备共用一个DeviceID为1026。所以要区分子设备类型,需要该字段。
        //用于判断设备的zigbee协议版本。49246:ZLL1.0标准设备。260: ZHA1.2标准设备、 Z3.0标准设备。
        // 41440:ZGP3.0标准设备。265:ZSE1.4标准设备。
        private int Profile;
        //设备mac名称
        private String MacName;
        //设备名
        private String DeviceName;
        //0:设备不在线 1:设备在线
        private int IsOnline;
        //输入簇列表
        //端点回路自身拥有多少功能,可以被控制;被控功能
        //参考zigbee联盟文档
        private List<InClusterListBean> InClusterList;
        //输出簇列表
        //端点回路可以控制其他设备多少功能;控制功能
        //参考zigbee联盟文档
        private List<OutClusterListBean> OutClusterList;
        //用于记录设备最新上报的属性状态信息。最大支持记录16个属性状态,且只记录属性值长度不大于4字节的数据。
        private List<AttributeStatusBean> AttributeStatus;
        //当前运行程序版本信息
        private int ImgVersion;
        //当前镜像类型id
        private int ImgTypeId;
        //硬件版本
        private int HwVersion;
        //驱动代码。为0时,表示zigbee协调器设备。其他值表示为虚拟驱动设备
        private int DriveCode;
        //设备所在网关的网关id
        private String GwId;
        //所有指定cluster是否都已经成功绑定协调器
        //0:未完全绑定
        //1:已经绑定
        private int ClusterBindZbSuccess;
        //是否获取所有默认绑定信息
        //0:否
        //1:是
        private int IsGetAllDefaultBind;
        //制造商名字
        private String ManufacturerName;
        //设备型号
        private String ModelIdentifier;
        //产品码 序列号
        private String ProductCode;
        //用来表示实际回路用于什么功能,可扩展
        //0-继电器接普通开关
        //1-继电器接灯光
        //插座
        private String FunctionType;
 
        public int getTotalNum() {
            return TotalNum;
        }
 
        public void setTotalNum(int TotalNum) {
            this.TotalNum = TotalNum;
        }
 
        public int getDeviceNum() {
            return DeviceNum;
        }
 
        public void setDeviceNum(int DeviceNum) {
            this.DeviceNum = DeviceNum;
        }
 
        public int getJoinTime() {
            return JoinTime;
        }
 
        public void setJoinTime(int JoinTime) {
            this.JoinTime = JoinTime;
        }
 
        public int getZigbeeType() {
            return ZigbeeType;
        }
 
        public void setZigbeeType(int ZigbeeType) {
            this.ZigbeeType = ZigbeeType;
        }
 
        public int getNwkAddr() {
            return NwkAddr;
        }
 
        public void setNwkAddr(int NwkAddr) {
            this.NwkAddr = NwkAddr;
        }
 
        public int getDeviceType() {
            return DeviceType;
        }
 
        public void setDeviceType(int DeviceType) {
            this.DeviceType = DeviceType;
        }
 
        public int getProfile() {
            return Profile;
        }
 
        public void setProfile(int Profile) {
            this.Profile = Profile;
        }
 
        @NonNull
        public String getMacName() {
            return MacName == null ? "" : MacName;
        }
 
        public void setMacName(@NonNull String MacName) {
            this.MacName = MacName;
        }
 
        @NonNull
        public String getDeviceName() {
            return DeviceName == null ? "" : DeviceName;
        }
 
        public void setDeviceName(@NonNull String DeviceName) {
            this.DeviceName = DeviceName;
        }
 
        public int getIsOnline() {
            return IsOnline;
        }
 
        public void setIsOnline(int IsOnline) {
            this.IsOnline = IsOnline;
        }
 
        @NonNull
        public List<InClusterListBean> getInClusterList() {
            if (InClusterList == null) {
                return new ArrayList<>();
            }
            return InClusterList;
        }
 
        public void setInClusterList(@NonNull List<InClusterListBean> InClusterList) {
            this.InClusterList = InClusterList;
        }
 
        @NonNull
        public List<OutClusterListBean> getOutClusterList() {
            if (OutClusterList == null) {
                return new ArrayList<>();
            }
            return OutClusterList;
        }
 
        public void setOutClusterList(@NonNull List<OutClusterListBean> OutClusterList) {
            this.OutClusterList = OutClusterList;
        }
 
        @NonNull
        public List<AttributeStatusBean> getAttributeStatus() {
            if (AttributeStatus == null) {
                return new ArrayList<>();
            }
            return AttributeStatus;
        }
 
        public void setAttributeStatus(@NonNull List<AttributeStatusBean> AttributeStatus) {
            this.AttributeStatus = AttributeStatus;
        }
 
        public int getImgVersion() {
            return ImgVersion;
        }
 
        public void setImgVersion(int ImgVersion) {
            this.ImgVersion = ImgVersion;
        }
 
        public int getImgTypeId() {
            return ImgTypeId;
        }
 
        public void setImgTypeId(int ImgTypeId) {
            this.ImgTypeId = ImgTypeId;
        }
 
        public int getHwVersion() {
            return HwVersion;
        }
 
        public void setHwVersion(int HwVersion) {
            this.HwVersion = HwVersion;
        }
 
        public int getDriveCode() {
            return DriveCode;
        }
 
        public void setDriveCode(int DriveCode) {
            this.DriveCode = DriveCode;
        }
 
        @NonNull
        public String getGwId() {
            return GwId == null ? "" : GwId;
        }
 
        public void setGwId(@NonNull String GwId) {
            this.GwId = GwId;
        }
 
        public int getClusterBindZbSuccess() {
            return ClusterBindZbSuccess;
        }
 
        public void setClusterBindZbSuccess(int ClusterBindZbSuccess) {
            this.ClusterBindZbSuccess = ClusterBindZbSuccess;
        }
 
        public int getIsGetAllDefaultBind() {
            return IsGetAllDefaultBind;
        }
 
        public void setIsGetAllDefaultBind(int IsGetAllDefaultBind) {
            this.IsGetAllDefaultBind = IsGetAllDefaultBind;
        }
 
        @NonNull
        public String getManufacturerName() {
            return ManufacturerName == null ? "" : ManufacturerName;
        }
 
        public void setManufacturerName(@NonNull String ManufacturerName) {
            this.ManufacturerName = ManufacturerName;
        }
 
        @NonNull
        public String getModelIdentifier() {
            return ModelIdentifier == null ? "" : ModelIdentifier;
        }
 
        public void setModelIdentifier(@NonNull String ModelIdentifier) {
            this.ModelIdentifier = ModelIdentifier;
        }
 
        @NonNull
        public String getProductCode() {
            return ProductCode == null ? "" : ProductCode;
        }
 
        public void setProductCode(@NonNull String ProductCode) {
            this.ProductCode = ProductCode;
        }
 
        public String getFunctionType() {
            return FunctionType;
        }
 
        public void setFunctionType(String FunctionType) {
            this.FunctionType = FunctionType;
        }
 
        /**
         * 输入簇
         */
        public static class InClusterListBean implements Serializable{
            /// <summary>
            /// 设备支持的输入功能
            /// <para>0:Basic,设备支持“基础属性” </para>
            /// <para>3:Identify,设备支持“识别功能”</para>
            /// <para>4:Groups,设备支持“组功能”</para>
            /// <para>5:Scenes,设备支持“场景功能”</para>
            /// <para>6:on/off,设备支持“开关功能”</para>
            /// 开关功能的设备如:调关灯/继电器/窗帘等。。。
            /// <para>8:Level Control,设备支持“亮度调节功能”</para>
            /// 亮度调节功能的设备如:调关灯。。。
            /// <para>257:Door Lock,设备支持“门锁功能”</para>
            /// 门锁功能的设备如:门锁。。。
            ///  <para>258:Window Covering,设备支持“窗帘控制功能”</para>
            /// 窗帘控制功能的设备如:窗帘/开合帘/卷帘。。。
            /// <para>513:Thermostat,设备支持“恒温器功能”</para>
            /// 恒温器功能的设备如:空调。。。
            /// <para>768:Color Control,设备支持“颜色调节功能”</para>
            /// 颜色调节功能的设备如:调光灯。。。
            /// <para>1026:Temperature Measurement,设备支持“温度测量功能”</para>
            /// 温度测量功能的设备如:温度传感器。。。
            /// <para>1029:Relative Humidity Measurement,设备支持“湿度测量功能”</para>
            /// 湿度测量功能的设备如:湿度传感器。。。
            /// <para>1066:Pm2.5  Measurement,设备支持“pm2.5测量功能”</para>
            /// Pm2.5测量功能的设备如:Pm2.5传感器。。。
            /// </summary>
            private int InCluster;
 
            public int getInCluster() {
                return InCluster;
            }
 
            public void setInCluster(int inCluster) {
                this.InCluster = inCluster;
            }
        }
 
        /**
         * 输出簇
         */
        public static class OutClusterListBean implements Serializable{
            /// <summary>
            /// 设备支持的输出功能
            /// <para>0:Basic,设备支持“基础属性” </para>
            /// <para>3:Identify,设备支持“识别功能”</para>
            /// <para>4:Groups,设备支持“组功能”</para>
            /// <para>5:Scenes,设备支持“场景功能”</para>
            /// <para>6:on/off,设备支持“开关功能”</para>
            /// 开关功能的设备如:调关灯/继电器/窗帘等。。。
            /// <para>8:Level Control,设备支持“亮度调节功能”</para>
            /// 亮度调节功能的设备如:调关灯。。。
            /// <para>257:Door Lock,设备支持“门锁功能”</para>
            /// 门锁功能的设备如:门锁。。。
            ///  <para>258:Window Covering,设备支持“窗帘控制功能”</para>
            /// 窗帘控制功能的设备如:窗帘/开合帘/卷帘。。。
            /// <para>513:Thermostat,设备支持“恒温器功能”</para>
            /// 恒温器功能的设备如:空调。。。
            /// <para>768:Color Control,设备支持“颜色调节功能”</para>
            /// 颜色调节功能的设备如:调光灯。。。
            /// <para>1026:Temperature Measurement,设备支持“温度测量功能”</para>
            /// 温度测量功能的设备如:温度传感器。。。
            /// <para>1029:Relative Humidity Measurement,设备支持“湿度测量功能”</para>
            /// 湿度测量功能的设备如:湿度传感器。。。
            /// </summary>
            private int OutCluster;
 
            public int getOutCluster() {
                return OutCluster;
            }
 
            public void setOutCluster(int outCluster) {
                this.OutCluster = outCluster;
            }
        }
 
        /**
         * 设备最新上报的属性状态信息
         */
        public static class AttributeStatusBean implements Serializable{
 
            /// <summary>
            /// 属性簇id
            /// </summary>
            private int ClusterId;
            /// <summary>
            /// 属性id
            /// </summary>
            private int AttributeId;
            /// <summary>
            /// 属性值,这个东西不需要什么高位在后低位在前,它已经是转为了10进制
            /// </summary>
            private int AttributeData;
            /// <summary>
            /// 属性状态最后更新的utc时间戳
            /// </summary>
            private int ReportTime;
 
            public int getClusterId() {
                return ClusterId;
            }
 
            public void setClusterId(int clusterId) {
                this.ClusterId = ClusterId;
            }
 
            public int getAttributeId() {
                return AttributeId;
            }
 
            public void setAttributeId(int AttributeId) {
                this.AttributeId = AttributeId;
            }
 
            public int getAttributeData() {
                return AttributeData;
            }
 
            public void setAttributeData(int attributeData) {
                this.AttributeData = AttributeData;
            }
 
            public int getReportTime() {
                return ReportTime;
            }
 
            public void setReportTime(int ReportTime) {
                this.ReportTime = ReportTime;
            }
        }
    }
}