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
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
|
/* packet-zbee-zcl-hvac.c
* Dissector routines for the ZigBee ZCL HVAC clusters
* By Aditya Jain <aditya.jain@samsung.com>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
/* Include Files */
#include "config.h"
#include <epan/packet.h>
#include <epan/to_str.h>
#include "packet-zbee.h"
#include "packet-zbee-aps.h"
#include "packet-zbee-zcl.h"
/* ########################################################################## */
/* #### (0x0200) PUMP CONFIGURATION AND CONTROL CLUSTER ##################### */
/* ########################################################################## */
/*************************/
/* Defines */
/*************************/
#define ZBEE_ZCL_PUMP_CONFIG_CONTROL_NUM_ETT 3
/*Attributes*/
#define ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MAX_PRESSURE 0x0000 /* Maximum Pressure */
#define ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MAX_SPEED 0x0001 /* Maximum Speed */
#define ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MAX_FLOW 0x0002 /* Maximum Flow */
#define ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MIN_CONST_PRESSURE 0x0003 /* Minimum Constant Pressure */
#define ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MAX_CONST_PRESSURE 0x0004 /* Maximum Constant Pressure */
#define ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MIN_COMP_PRESSURE 0x0005 /* Minimum Compensated Pressure */
#define ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_POWER_MAX_COMP_PRESSURE 0x0006 /* Maximum Compensated Pressure */
#define ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MIN_CONST_SPEED 0x0007 /* Minimum Constant Speed */
#define ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MAX_CONST_SPEED 0x0008 /* Maximum Constant Speed */
#define ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MIN_CONST_FLOW 0x0009 /* Minimum Constant Flow */
#define ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MAX_CONST_FLOW 0x000a /* Maximum Constant Flow */
#define ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MIN_CONST_TEMP 0x000b /* Minimum Constant Temperature */
#define ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MAX_CONST_TEMP 0x000c /* Maximum Constant Temperature */
#define ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_PUMP_STATUS 0x0010 /* Pump Status */
#define ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_EFFECTIVE_OPR_MODE 0x0011 /* Effective Operation Mode */
#define ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_EFFECTIVE_CTRL_MODE 0x0012 /* Effective Control Mode */
#define ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_CAPACITY 0x0013 /* Capacity */
#define ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_SPEED 0x0014 /* Speed */
#define ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_LIFETIME_RUNNING_HOURS 0x0015 /* Lifetime Running Hours */
#define ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_POWER 0x0016 /* Power */
#define ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_LIFETIME_ENERGY_CONS 0x0017 /* Lifetime Energy Consumed */
#define ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_OPR_MODE 0x0020 /* Operation Mode */
#define ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_CTRL_MODE 0x0021 /* Control Mode */
#define ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_ALARM_MASK 0x0022 /* Alarm Mask */
/*Server commands received - none*/
/*Server commands generated - none*/
/*Pump Status Mask Values*/
#define ZBEE_ZCL_PUMP_CONFIG_CONTROL_STATUS_DEVICE_FAULT 0x0001 /* Device Fault */
#define ZBEE_ZCL_PUMP_CONFIG_CONTROL_STATUS_SUPPLY_FAULT 0x0002 /* Supply Fault */
#define ZBEE_ZCL_PUMP_CONFIG_CONTROL_STATUS_SPEED_LOW 0x0004 /* Speed Low */
#define ZBEE_ZCL_PUMP_CONFIG_CONTROL_STATUS_SPEED_HIGH 0x0008 /* Speed High */
#define ZBEE_ZCL_PUMP_CONFIG_CONTROL_STATUS_LOCAL_OVERRIDE 0x0010 /* Local Override */
#define ZBEE_ZCL_PUMP_CONFIG_CONTROL_STATUS_RUNNING 0x0020 /* Running */
#define ZBEE_ZCL_PUMP_CONFIG_CONTROL_STATUS_REMOTE_PRESSURE 0x0040 /* Remote Pressure */
#define ZBEE_ZCL_PUMP_CONFIG_CONTROL_STATUS_REMOTE_FLOW 0x0080 /* Remote Flow */
#define ZBEE_ZCL_PUMP_CONFIG_CONTROL_STATUS_REMOTE_TEMP 0x0100 /* Remote Temperature */
/*Alarm Mask Values*/
#define ZBEE_ZCL_PUMP_CONFIG_CONTROL_ALARM_VOLTAGE_TOO_LOW 0x0001 /* Supply voltage too low */
#define ZBEE_ZCL_PUMP_CONFIG_CONTROL_ALARM_VOLTAGE_TOO_HIGH 0x0002 /* Supply voltage too high */
#define ZBEE_ZCL_PUMP_CONFIG_CONTROL_ALARM_PWR_MISSING_PHASE 0x0004 /* Power missing phase */
#define ZBEE_ZCL_PUMP_CONFIG_CONTROL_ALARM_PRESSURE_TOO_LOW 0x0008 /* System pressure too low */
#define ZBEE_ZCL_PUMP_CONFIG_CONTROL_ALARM_PRESSURE_TOO_HIGH 0x0010 /* System pressure too high */
#define ZBEE_ZCL_PUMP_CONFIG_CONTROL_ALARM_DRY_RUNNING 0x0020 /* Dry running */
#define ZBEE_ZCL_PUMP_CONFIG_CONTROL_ALARM_MTR_TEMP_TOO_HIGH 0x0040 /* Motor temperature too high */
#define ZBEE_ZCL_PUMP_CONFIG_CONTROL_ALARM_PUMP_MTR_FATAL_FAILURE 0x0080 /* Pump motor has fatal failure */
#define ZBEE_ZCL_PUMP_CONFIG_CONTROL_ALARM_ELEC_TEMP_TOO_HIGH 0x0100 /* Electronic temperature too high */
#define ZBEE_ZCL_PUMP_CONFIG_CONTROL_ALARM_PUMP_BLOCK 0x0200 /* Pump blocked */
#define ZBEE_ZCL_PUMP_CONFIG_CONTROL_ALARM_SENSOR_FAILURE 0x0400 /* Sensor failure */
#define ZBEE_ZCL_PUMP_CONFIG_CONTROL_ALARM_ELEC_NON_FATAL_FAILURE 0x0800 /* Electronic non-fatal failure */
#define ZBEE_ZCL_PUMP_CONFIG_CONTROL_ALARM_ELEC_FATAL_FAILURE 0x1000 /* Electronic fatal failure */
#define ZBEE_ZCL_PUMP_CONFIG_CONTROL_ALARM_GENERAL_FAULT 0x2000 /* General fault */
/*************************/
/* Function Declarations */
/*************************/
void proto_register_zbee_zcl_pump_config_control(void);
void proto_reg_handoff_zbee_zcl_pump_config_control(void);
/* Command Dissector Helpers */
static void dissect_zcl_pump_config_control_attr_data (proto_tree *tree, tvbuff_t *tvb, unsigned *offset, uint16_t attr_id, unsigned data_type, bool client_attr);
/* Private functions prototype */
/*************************/
/* Global Variables */
/*************************/
/* Initialize the protocol and registered fields */
static int proto_zbee_zcl_pump_config_control;
static int hf_zbee_zcl_pump_config_control_attr_id;
static int hf_zbee_zcl_pump_config_control_attr_eff_opr_mode;
static int hf_zbee_zcl_pump_config_control_attr_opr_mode;
static int hf_zbee_zcl_pump_config_control_attr_eff_ctrl_mode;
static int hf_zbee_zcl_pump_config_control_attr_ctrl_mode;
static int hf_zbee_zcl_pump_config_control_status;
static int hf_zbee_zcl_pump_config_control_status_device_fault;
static int hf_zbee_zcl_pump_config_control_status_supply_fault;
static int hf_zbee_zcl_pump_config_control_status_speed_low;
static int hf_zbee_zcl_pump_config_control_status_speed_high;
static int hf_zbee_zcl_pump_config_control_status_local_override;
static int hf_zbee_zcl_pump_config_control_status_running;
static int hf_zbee_zcl_pump_config_control_status_rem_pressure;
static int hf_zbee_zcl_pump_config_control_status_rem_flow;
static int hf_zbee_zcl_pump_config_control_status_rem_temp;
static int hf_zbee_zcl_pump_config_control_alarm;
static int hf_zbee_zcl_pump_config_control_alarm_volt_too_low;
static int hf_zbee_zcl_pump_config_control_alarm_volt_too_high;
static int hf_zbee_zcl_pump_config_control_alarm_pwr_missing_phase;
static int hf_zbee_zcl_pump_config_control_alarm_press_too_low;
static int hf_zbee_zcl_pump_config_control_alarm_press_too_high;
static int hf_zbee_zcl_pump_config_control_alarm_dry_running;
static int hf_zbee_zcl_pump_config_control_alarm_mtr_temp_too_high;
static int hf_zbee_zcl_pump_config_control_alarm_pump_mtr_fatal_fail;
static int hf_zbee_zcl_pump_config_control_alarm_elec_temp_too_high;
static int hf_zbee_zcl_pump_config_control_alarm_pump_block;
static int hf_zbee_zcl_pump_config_control_alarm_sensor_fail;
static int hf_zbee_zcl_pump_config_control_alarm_elec_non_fatal_fail;
static int hf_zbee_zcl_pump_config_control_alarm_fatal_fail;
static int hf_zbee_zcl_pump_config_control_alarm_gen_fault;
/* Initialize the subtree pointers */
static int ett_zbee_zcl_pump_config_control;
static int ett_zbee_zcl_pump_config_control_status;
static int ett_zbee_zcl_pump_config_control_alarm;
/* Attributes */
static const value_string zbee_zcl_pump_config_control_attr_names[] = {
{ ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MAX_PRESSURE, "Maximum Pressure" },
{ ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MAX_SPEED, "Maximum Speed" },
{ ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MAX_FLOW, "Maximum Flow" },
{ ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MIN_CONST_PRESSURE, "Minimum Constant Pressure" },
{ ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MAX_CONST_PRESSURE, "Maximum Constant Pressure" },
{ ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MIN_COMP_PRESSURE, "Minimum Compensated Pressure" },
{ ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_POWER_MAX_COMP_PRESSURE, "Maximum Compensated Pressure" },
{ ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MIN_CONST_SPEED, "Minimum Constant Speed" },
{ ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MAX_CONST_SPEED, "Maximum Constant Speed" },
{ ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MIN_CONST_FLOW, "Minimum Constant Flow" },
{ ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MAX_CONST_FLOW, "Maximum Constant Flow" },
{ ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MIN_CONST_TEMP, "Minimum Constant Temperature" },
{ ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MAX_CONST_TEMP, "Maximum Constant Temperature" },
{ ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_PUMP_STATUS, "Pump Status" },
{ ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_EFFECTIVE_OPR_MODE, "Effective Operation Mode" },
{ ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_EFFECTIVE_CTRL_MODE, "Effective Control Mode" },
{ ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_CAPACITY, "Capacity" },
{ ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_SPEED, "Speed" },
{ ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_LIFETIME_RUNNING_HOURS, "Lifetime Running Hours" },
{ ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_POWER, "Power" },
{ ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_LIFETIME_ENERGY_CONS, "Lifetime Energy Consumed" },
{ ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_OPR_MODE, "Operation Mode" },
{ ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_CTRL_MODE, "Control Mode" },
{ ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_ALARM_MASK, "Alarm Mask" },
{ 0, NULL }
};
/*Operation Mode Values*/
static const value_string zbee_zcl_pump_config_control_operation_mode_names[] = {
{0, "Normal"},
{1, "Minimum"},
{2, "Maximum"},
{3, "Local"},
{0, NULL}
};
/*Control Mode Values*/
static const value_string zbee_zcl_pump_config_control_control_mode_names[] = {
{0, "Constant Speed"},
{1, "Constant Pressure"},
{2, "Proportional Pressure"},
{3, "Constant Flow"},
{4, "Reserved"},
{5, "Constant Temperature"},
{6, "Reserved"},
{7, "Automatic"},
{0, NULL}
};
/*************************/
/* Function Bodies */
/*************************/
/**
*ZigBee ZCL Pump Configuration and Control cluster dissector for wireshark.
*
*@param tvb pointer to buffer containing raw packet.
*@param pinfo pointer to packet information fields
*@param tree pointer to data tree Wireshark uses to display packet.
*/
static int
dissect_zbee_zcl_pump_config_control(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void* data _U_)
{
return tvb_captured_length(tvb);
} /*dissect_zbee_zcl_pump_config_control*/
/**
*This function is called by ZCL foundation dissector in order to decode
*
*@param tree pointer to data tree Wireshark uses to display packet.
*@param tvb pointer to buffer containing raw packet.
*@param offset pointer to buffer offset
*@param attr_id attribute identifier
*@param data_type attribute data type
*@param client_attr ZCL client
*/
void
dissect_zcl_pump_config_control_attr_data(proto_tree *tree, tvbuff_t *tvb, unsigned *offset, uint16_t attr_id, unsigned data_type, bool client_attr)
{
static int * const pump_status[] = {
&hf_zbee_zcl_pump_config_control_status_device_fault,
&hf_zbee_zcl_pump_config_control_status_supply_fault,
&hf_zbee_zcl_pump_config_control_status_speed_low,
&hf_zbee_zcl_pump_config_control_status_speed_high,
&hf_zbee_zcl_pump_config_control_status_local_override,
&hf_zbee_zcl_pump_config_control_status_running,
&hf_zbee_zcl_pump_config_control_status_rem_pressure,
&hf_zbee_zcl_pump_config_control_status_rem_flow,
&hf_zbee_zcl_pump_config_control_status_rem_temp,
NULL
};
static int * const alarm_mask[] = {
&hf_zbee_zcl_pump_config_control_alarm_volt_too_low,
&hf_zbee_zcl_pump_config_control_alarm_volt_too_high,
&hf_zbee_zcl_pump_config_control_alarm_pwr_missing_phase,
&hf_zbee_zcl_pump_config_control_alarm_press_too_low,
&hf_zbee_zcl_pump_config_control_alarm_press_too_high,
&hf_zbee_zcl_pump_config_control_alarm_dry_running,
&hf_zbee_zcl_pump_config_control_alarm_mtr_temp_too_high,
&hf_zbee_zcl_pump_config_control_alarm_pump_mtr_fatal_fail,
&hf_zbee_zcl_pump_config_control_alarm_elec_temp_too_high,
&hf_zbee_zcl_pump_config_control_alarm_pump_block,
&hf_zbee_zcl_pump_config_control_alarm_sensor_fail,
&hf_zbee_zcl_pump_config_control_alarm_elec_non_fatal_fail,
&hf_zbee_zcl_pump_config_control_alarm_fatal_fail,
&hf_zbee_zcl_pump_config_control_alarm_gen_fault,
NULL
};
/* Dissect attribute data type and data */
switch (attr_id) {
case ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_EFFECTIVE_OPR_MODE:
proto_tree_add_item(tree, hf_zbee_zcl_pump_config_control_attr_eff_opr_mode, tvb, *offset, 1, ENC_NA);
*offset += 1;
break;
case ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_OPR_MODE:
proto_tree_add_item(tree, hf_zbee_zcl_pump_config_control_attr_opr_mode, tvb, *offset, 1, ENC_NA);
*offset += 1;
break;
case ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_EFFECTIVE_CTRL_MODE:
proto_tree_add_item(tree, hf_zbee_zcl_pump_config_control_attr_eff_ctrl_mode, tvb, *offset, 1, ENC_NA);
*offset += 1;
break;
case ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_CTRL_MODE:
proto_tree_add_item(tree, hf_zbee_zcl_pump_config_control_attr_ctrl_mode, tvb, *offset, 1, ENC_NA);
*offset += 1;
break;
case ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_PUMP_STATUS:
proto_tree_add_bitmask(tree, tvb, *offset, hf_zbee_zcl_pump_config_control_status, ett_zbee_zcl_pump_config_control_status, pump_status, ENC_LITTLE_ENDIAN);
*offset += 2;
break;
case ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_ALARM_MASK:
proto_tree_add_bitmask(tree, tvb, *offset, hf_zbee_zcl_pump_config_control_alarm, ett_zbee_zcl_pump_config_control_alarm, alarm_mask, ENC_LITTLE_ENDIAN);
*offset += 2;
break;
case ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MAX_PRESSURE:
case ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MAX_SPEED:
case ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MAX_FLOW:
case ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MIN_CONST_PRESSURE:
case ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MAX_CONST_PRESSURE:
case ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MIN_COMP_PRESSURE:
case ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_POWER_MAX_COMP_PRESSURE:
case ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MIN_CONST_SPEED:
case ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MAX_CONST_SPEED:
case ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MIN_CONST_FLOW:
case ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MAX_CONST_FLOW:
case ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MIN_CONST_TEMP:
case ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MAX_CONST_TEMP:
case ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_CAPACITY:
case ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_SPEED:
case ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_LIFETIME_RUNNING_HOURS:
case ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_POWER:
case ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_LIFETIME_ENERGY_CONS:
default:
dissect_zcl_attr_data(tvb, tree, offset, data_type, client_attr);
break;
}
} /*dissect_zcl_pump_config_control_attr_data*/
/**
*ZigBee ZCL Pump Configuration and Control cluster protocol registration routine.
*
*/
void
proto_register_zbee_zcl_pump_config_control(void)
{
/* Setup list of header fields */
static hf_register_info hf[] = {
{ &hf_zbee_zcl_pump_config_control_attr_id,
{ "Attribute", "zbee_zcl_hvac.pump_config_control.attr_id", FT_UINT16, BASE_HEX, VALS(zbee_zcl_pump_config_control_attr_names),
0x00, NULL, HFILL } },
{ &hf_zbee_zcl_pump_config_control_attr_eff_opr_mode,
{ "Effective Operation Mode", "zbee_zcl_hvac.pump_config_control.attr.effective_opr_mode", FT_UINT8, BASE_DEC, VALS(zbee_zcl_pump_config_control_operation_mode_names),
0x00, NULL, HFILL } },
{ &hf_zbee_zcl_pump_config_control_attr_opr_mode,
{ "Operation Mode", "zbee_zcl_hvac.pump_config_control.attr.opr_mode", FT_UINT8, BASE_DEC, VALS(zbee_zcl_pump_config_control_operation_mode_names),
0x00, NULL, HFILL } },
{ &hf_zbee_zcl_pump_config_control_attr_eff_ctrl_mode,
{ "Effective Control Mode", "zbee_zcl_hvac.pump_config_control.attr.ctrl_mode", FT_UINT8, BASE_DEC, VALS(zbee_zcl_pump_config_control_control_mode_names),
0x00, NULL, HFILL } },
{ &hf_zbee_zcl_pump_config_control_attr_ctrl_mode,
{ "Control Mode", "zbee_zcl_hvac.pump_config_control.attr.ctrl_mode", FT_UINT8, BASE_DEC, VALS(zbee_zcl_pump_config_control_control_mode_names),
0x00, NULL, HFILL } },
/* start Pump Status fields */
{ &hf_zbee_zcl_pump_config_control_status,
{ "Pump Status", "zbee_zcl_hvac.pump_config_control.attr.status", FT_UINT16, BASE_HEX, NULL,
0x00, NULL, HFILL } },
{ &hf_zbee_zcl_pump_config_control_status_device_fault,
{ "Device Fault", "zbee_zcl_hvac.pump_config_control.attr.status.device_fault", FT_BOOLEAN, 16, TFS(&tfs_no_yes),
ZBEE_ZCL_PUMP_CONFIG_CONTROL_STATUS_DEVICE_FAULT, NULL, HFILL } },
{ &hf_zbee_zcl_pump_config_control_status_supply_fault,
{ "Supply Fault", "zbee_zcl_hvac.pump_config_control.attr.status.supply_fault", FT_BOOLEAN, 16, TFS(&tfs_no_yes),
ZBEE_ZCL_PUMP_CONFIG_CONTROL_STATUS_SUPPLY_FAULT, NULL, HFILL } },
{ &hf_zbee_zcl_pump_config_control_status_speed_low,
{ "Speed Low", "zbee_zcl_hvac.pump_config_control.attr.status.speed_low", FT_BOOLEAN, 16, TFS(&tfs_no_yes),
ZBEE_ZCL_PUMP_CONFIG_CONTROL_STATUS_SPEED_LOW, NULL, HFILL } },
{ &hf_zbee_zcl_pump_config_control_status_speed_high,
{ "Speed High", "zbee_zcl_hvac.pump_config_control.attr.status.speed_high", FT_BOOLEAN, 16, TFS(&tfs_no_yes),
ZBEE_ZCL_PUMP_CONFIG_CONTROL_STATUS_SPEED_HIGH, NULL, HFILL } },
{ &hf_zbee_zcl_pump_config_control_status_local_override,
{ "Local Override", "zbee_zcl_hvac.pump_config_control.attr.status.local_override", FT_BOOLEAN, 16, TFS(&tfs_no_yes),
ZBEE_ZCL_PUMP_CONFIG_CONTROL_STATUS_LOCAL_OVERRIDE, NULL, HFILL } },
{ &hf_zbee_zcl_pump_config_control_status_running,
{ "Running", "zbee_zcl_hvac.pump_config_control.attr.status.running", FT_BOOLEAN, 16, TFS(&tfs_no_yes),
ZBEE_ZCL_PUMP_CONFIG_CONTROL_STATUS_RUNNING, NULL, HFILL } },
{ &hf_zbee_zcl_pump_config_control_status_rem_pressure,
{ "Remote Pressure", "zbee_zcl_hvac.pump_config_control.attr.status.rem_pressure", FT_BOOLEAN, 16, TFS(&tfs_no_yes),
ZBEE_ZCL_PUMP_CONFIG_CONTROL_STATUS_REMOTE_PRESSURE, NULL, HFILL } },
{ &hf_zbee_zcl_pump_config_control_status_rem_flow,
{ "Remote Flow", "zbee_zcl_hvac.pump_config_control.attr.status.rem_flow", FT_BOOLEAN, 16, TFS(&tfs_no_yes),
ZBEE_ZCL_PUMP_CONFIG_CONTROL_STATUS_REMOTE_FLOW, NULL, HFILL } },
{ &hf_zbee_zcl_pump_config_control_status_rem_temp,
{ "Remote Temperature", "zbee_zcl_hvac.pump_config_control.attr.status.rem_temp", FT_BOOLEAN, 16, TFS(&tfs_no_yes),
ZBEE_ZCL_PUMP_CONFIG_CONTROL_STATUS_REMOTE_TEMP, NULL, HFILL } },
/* end Pump Status fields */
/*start Alarm Mask fields*/
{ &hf_zbee_zcl_pump_config_control_alarm,
{ "Alarm Mask", "zbee_zcl_hvac.pump_config_control.attr.alarm", FT_UINT16, BASE_HEX, NULL,
0x00, NULL, HFILL } },
{ &hf_zbee_zcl_pump_config_control_alarm_volt_too_low,
{ "Supply voltage too low", "zbee_zcl_hvac.pump_config_control.attr.alarm.volt_too_low", FT_BOOLEAN, 16, TFS(&tfs_disabled_enabled),
ZBEE_ZCL_PUMP_CONFIG_CONTROL_ALARM_VOLTAGE_TOO_LOW, NULL, HFILL } },
{ &hf_zbee_zcl_pump_config_control_alarm_volt_too_high,
{ "Supply voltage too high", "zbee_zcl_hvac.pump_config_control.attr.alarm.volt_too_high", FT_BOOLEAN, 16, TFS(&tfs_disabled_enabled),
ZBEE_ZCL_PUMP_CONFIG_CONTROL_ALARM_VOLTAGE_TOO_HIGH, NULL, HFILL } },
{ &hf_zbee_zcl_pump_config_control_alarm_pwr_missing_phase,
{ "Power missing phase", "zbee_zcl_hvac.pump_config_control.attr.alarm.pwr_missing_phase", FT_BOOLEAN, 16, TFS(&tfs_disabled_enabled),
ZBEE_ZCL_PUMP_CONFIG_CONTROL_ALARM_PWR_MISSING_PHASE, NULL, HFILL } },
{ &hf_zbee_zcl_pump_config_control_alarm_press_too_low,
{ "System pressure too low", "zbee_zcl_hvac.pump_config_control.attr.alarm.press_too_low", FT_BOOLEAN, 16, TFS(&tfs_disabled_enabled),
ZBEE_ZCL_PUMP_CONFIG_CONTROL_ALARM_PRESSURE_TOO_LOW, NULL, HFILL } },
{ &hf_zbee_zcl_pump_config_control_alarm_press_too_high,
{ "System pressure too high", "zbee_zcl_hvac.pump_config_control.attr.alarm.press_too_high", FT_BOOLEAN, 16, TFS(&tfs_disabled_enabled),
ZBEE_ZCL_PUMP_CONFIG_CONTROL_ALARM_PRESSURE_TOO_HIGH, NULL, HFILL } },
{ &hf_zbee_zcl_pump_config_control_alarm_dry_running,
{ "Dry running", "zbee_zcl_hvac.pump_config_control.attr.alarm.dry_running", FT_BOOLEAN, 16, TFS(&tfs_disabled_enabled),
ZBEE_ZCL_PUMP_CONFIG_CONTROL_ALARM_DRY_RUNNING, NULL, HFILL } },
{ &hf_zbee_zcl_pump_config_control_alarm_mtr_temp_too_high,
{ "Motor temperature too high", "zbee_zcl_hvac.pump_config_control.attr.alarm.mtr_temp_too_high", FT_BOOLEAN, 16, TFS(&tfs_disabled_enabled),
ZBEE_ZCL_PUMP_CONFIG_CONTROL_ALARM_MTR_TEMP_TOO_HIGH, NULL, HFILL } },
{ &hf_zbee_zcl_pump_config_control_alarm_pump_mtr_fatal_fail,
{ "Pump motor has fatal failure", "zbee_zcl_hvac.pump_config_control.attr.alarm.mtr_fatal_fail", FT_BOOLEAN, 16, TFS(&tfs_disabled_enabled),
ZBEE_ZCL_PUMP_CONFIG_CONTROL_ALARM_PUMP_MTR_FATAL_FAILURE, NULL, HFILL } },
{ &hf_zbee_zcl_pump_config_control_alarm_elec_temp_too_high,
{ "Electronic temperature too high", "zbee_zcl_hvac.pump_config_control.attr.alarm.elec_temp_too_high", FT_BOOLEAN, 16, TFS(&tfs_disabled_enabled),
ZBEE_ZCL_PUMP_CONFIG_CONTROL_ALARM_ELEC_TEMP_TOO_HIGH, NULL, HFILL } },
{ &hf_zbee_zcl_pump_config_control_alarm_pump_block,
{ "Pump blocked", "zbee_zcl_hvac.pump_config_control.attr.alarm.pump_block", FT_BOOLEAN, 16, TFS(&tfs_disabled_enabled),
ZBEE_ZCL_PUMP_CONFIG_CONTROL_ALARM_PUMP_BLOCK, NULL, HFILL } },
{ &hf_zbee_zcl_pump_config_control_alarm_sensor_fail,
{ "Sensor failure", "zbee_zcl_hvac.pump_config_control.attr.alarm.sensor_fail", FT_BOOLEAN, 16, TFS(&tfs_disabled_enabled),
ZBEE_ZCL_PUMP_CONFIG_CONTROL_ALARM_SENSOR_FAILURE, NULL, HFILL } },
{ &hf_zbee_zcl_pump_config_control_alarm_elec_non_fatal_fail,
{ "Electronic non-fatal failure", "zbee_zcl_hvac.pump_config_control.attr.alarm.elec_non_fatal_fail", FT_BOOLEAN, 16, TFS(&tfs_disabled_enabled),
ZBEE_ZCL_PUMP_CONFIG_CONTROL_ALARM_ELEC_NON_FATAL_FAILURE, NULL, HFILL } },
{ &hf_zbee_zcl_pump_config_control_alarm_fatal_fail,
{ "Electronic fatal failure", "zbee_zcl_hvac.pump_config_control.attr.alarm.elec_fatal_fail", FT_BOOLEAN, 16, TFS(&tfs_disabled_enabled),
ZBEE_ZCL_PUMP_CONFIG_CONTROL_ALARM_ELEC_FATAL_FAILURE, NULL, HFILL } },
{ &hf_zbee_zcl_pump_config_control_alarm_gen_fault,
{ "General fault", "zbee_zcl_hvac.pump_config_control.attr.alarm.gen_fault", FT_BOOLEAN, 16, TFS(&tfs_disabled_enabled),
ZBEE_ZCL_PUMP_CONFIG_CONTROL_ALARM_GENERAL_FAULT, NULL, HFILL } }
/* end Alarm Mask fields */
};
/* ZCL Pump Configuration and Control subtrees */
static int *ett[ZBEE_ZCL_PUMP_CONFIG_CONTROL_NUM_ETT];
ett[0] = &ett_zbee_zcl_pump_config_control;
ett[1] = &ett_zbee_zcl_pump_config_control_status;
ett[2] = &ett_zbee_zcl_pump_config_control_alarm;
/* Register the ZigBee ZCL Pump Configuration and Control cluster protocol name and description */
proto_zbee_zcl_pump_config_control = proto_register_protocol("ZigBee ZCL Pump Configuration and Control", "ZCL Pump Configuration and Control", ZBEE_PROTOABBREV_ZCL_PUMP_CONFIG_CTRL);
proto_register_field_array(proto_zbee_zcl_pump_config_control, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
/* Register the ZigBee ZCL Pump Configuration and Control dissector. */
register_dissector(ZBEE_PROTOABBREV_ZCL_PUMP_CONFIG_CTRL, dissect_zbee_zcl_pump_config_control, proto_zbee_zcl_pump_config_control);
} /*proto_register_zbee_zcl_pump_config_control*/
/**
*Hands off the ZCL Pump Configuration and Control dissector.
*
*/
void
proto_reg_handoff_zbee_zcl_pump_config_control(void)
{
zbee_zcl_init_cluster( ZBEE_PROTOABBREV_ZCL_PUMP_CONFIG_CTRL,
proto_zbee_zcl_pump_config_control,
ett_zbee_zcl_pump_config_control,
ZBEE_ZCL_CID_PUMP_CONFIG_CONTROL,
ZBEE_MFG_CODE_NONE,
hf_zbee_zcl_pump_config_control_attr_id,
hf_zbee_zcl_pump_config_control_attr_id,
-1, -1,
(zbee_zcl_fn_attr_data)dissect_zcl_pump_config_control_attr_data
);
} /*proto_reg_handoff_zbee_zcl_pump_config_control*/
/* ########################################################################## */
/* #### (0x0202) FAN CONTROL CLUSTER ######################################## */
/* ########################################################################## */
/*************************/
/* Defines */
/*************************/
#define ZBEE_ZCL_FAN_CONTROL_NUM_ETT 1
/*Attributes*/
#define ZBEE_ZCL_ATTR_ID_FAN_CONTROL_FAN_MODE 0x0000 /* Fan Mode */
#define ZBEE_ZCL_ATTR_ID_FAN_CONTROL_FAN_MODE_SEQUENCE 0x0001 /* Fan Mode Sequence */
/*Server commands received - none*/
/*Server commands generated - none*/
/*************************/
/* Function Declarations */
/*************************/
void proto_register_zbee_zcl_fan_control(void);
void proto_reg_handoff_zbee_zcl_fan_control(void);
/* Command Dissector Helpers */
static void dissect_zcl_fan_control_attr_data (proto_tree *tree, tvbuff_t *tvb, unsigned *offset, uint16_t attr_id, unsigned data_type, bool client_attr);
/* Private functions prototype */
/*************************/
/* Global Variables */
/*************************/
/* Initialize the protocol and registered fields */
static int proto_zbee_zcl_fan_control;
static int hf_zbee_zcl_fan_control_attr_id;
static int hf_zbee_zcl_fan_control_attr_fan_mode;
static int hf_zbee_zcl_fan_control_attr_fan_mode_seq;
/* Initialize the subtree pointers */
static int ett_zbee_zcl_fan_control;
/* Attributes */
static const value_string zbee_zcl_fan_control_attr_names[] = {
{ ZBEE_ZCL_ATTR_ID_FAN_CONTROL_FAN_MODE, "Fan Mode" },
{ ZBEE_ZCL_ATTR_ID_FAN_CONTROL_FAN_MODE_SEQUENCE, "Fan Mode Sequence" },
{ 0, NULL }
};
/*Fan Mode Sequence Values*/
static const value_string zbee_zcl_fan_control_fan_mode_seq_names[] = {
{ 0x00, "Low/Med/High" },
{ 0x01, "Low/High" },
{ 0x02, "Low/Med/High/Auto" },
{ 0x03, "Low/High/Auto" },
{ 0x04, "On/Auto" },
{ 0, NULL}
};
/*Fan Mode Values*/
static const value_string zbee_zcl_fan_control_fan_mode_names[] = {
{ 0x00, "Off" },
{ 0x01, "Low" },
{ 0x02, "Medium" },
{ 0x03, "High" },
{ 0x04, "On" },
{ 0x05, "Auto" },
{ 0x06, "Smart" },
{ 0, NULL}
};
/*************************/
/* Function Bodies */
/*************************/
/**
*ZigBee ZCL Fan Control cluster dissector for wireshark.
*
*@param tvb pointer to buffer containing raw packet.
*@param pinfo pointer to packet information fields
*@param tree pointer to data tree Wireshark uses to display packet.
*/
static int
dissect_zbee_zcl_fan_control(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void* data _U_)
{
return tvb_captured_length(tvb);
} /*dissect_zbee_zcl_fan_control*/
/**
*This function is called by ZCL foundation dissector in order to decode
*
*@param tree pointer to data tree Wireshark uses to display packet.
*@param tvb pointer to buffer containing raw packet.
*@param offset pointer to buffer offset
*@param attr_id attribute identifier
*@param data_type attribute data type
*@param client_attr ZCL client
*/
void
dissect_zcl_fan_control_attr_data(proto_tree *tree, tvbuff_t *tvb, unsigned *offset, uint16_t attr_id, unsigned data_type, bool client_attr)
{
/* Dissect attribute data type and data */
switch (attr_id) {
case ZBEE_ZCL_ATTR_ID_FAN_CONTROL_FAN_MODE:
proto_tree_add_item(tree, hf_zbee_zcl_fan_control_attr_fan_mode, tvb, *offset, 1, ENC_NA);
*offset += 1;
break;
case ZBEE_ZCL_ATTR_ID_FAN_CONTROL_FAN_MODE_SEQUENCE:
proto_tree_add_item(tree, hf_zbee_zcl_fan_control_attr_fan_mode_seq, tvb, *offset, 1, ENC_NA);
*offset += 1;
break;
default:
dissect_zcl_attr_data(tvb, tree, offset, data_type, client_attr);
break;
}
} /*dissect_zcl_fan_control_attr_data*/
/**
*ZigBee ZCL Fan Control cluster protocol registration routine.
*
*/
void
proto_register_zbee_zcl_fan_control(void)
{
/* Setup list of header fields */
static hf_register_info hf[] = {
{ &hf_zbee_zcl_fan_control_attr_id,
{ "Attribute", "zbee_zcl_hvac.fan_control.attr_id", FT_UINT16, BASE_HEX, VALS(zbee_zcl_fan_control_attr_names),
0x00, NULL, HFILL } },
{ &hf_zbee_zcl_fan_control_attr_fan_mode,
{ "Fan Mode", "zbee_zcl_hvac.fan_control.attr.fan_mode", FT_UINT8, BASE_HEX, VALS(zbee_zcl_fan_control_fan_mode_names),
0x00, NULL, HFILL } },
{ &hf_zbee_zcl_fan_control_attr_fan_mode_seq,
{ "Fan Mode Sequence", "zbee_zcl_hvac.fan_control.attr.fan_mode_seq", FT_UINT8, BASE_HEX, VALS(zbee_zcl_fan_control_fan_mode_seq_names),
0x00, NULL, HFILL } }
};
/* ZCL Fan Control subtrees */
static int *ett[ZBEE_ZCL_FAN_CONTROL_NUM_ETT];
ett[0] = &ett_zbee_zcl_fan_control;
/* Register the ZigBee ZCL Fan Control cluster protocol name and description */
proto_zbee_zcl_fan_control = proto_register_protocol("ZigBee ZCL Fan Control", "ZCL Fan Control", ZBEE_PROTOABBREV_ZCL_FAN_CONTROL);
proto_register_field_array(proto_zbee_zcl_fan_control, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
/* Register the ZigBee ZCL Fan Control dissector. */
register_dissector(ZBEE_PROTOABBREV_ZCL_FAN_CONTROL, dissect_zbee_zcl_fan_control, proto_zbee_zcl_fan_control);
} /*proto_register_zbee_zcl_fan_control*/
/**
*Hands off the ZCL Fan Control dissector.
*
*/
void
proto_reg_handoff_zbee_zcl_fan_control(void)
{
zbee_zcl_init_cluster( ZBEE_PROTOABBREV_ZCL_FAN_CONTROL,
proto_zbee_zcl_fan_control,
ett_zbee_zcl_fan_control,
ZBEE_ZCL_CID_FAN_CONTROL,
ZBEE_MFG_CODE_NONE,
hf_zbee_zcl_fan_control_attr_id,
hf_zbee_zcl_fan_control_attr_id,
-1, -1,
(zbee_zcl_fn_attr_data)dissect_zcl_fan_control_attr_data
);
} /*proto_reg_handoff_zbee_zcl_fan_control*/
/* ########################################################################## */
/* #### (0x0203) DEHUMIDIFICATION CONTROL CLUSTER ########################### */
/* ########################################################################## */
/*************************/
/* Defines */
/*************************/
#define ZBEE_ZCL_DEHUMIDIFICATION_CONTROL_NUM_ETT 1
/*Attributes*/
#define ZBEE_ZCL_ATTR_ID_DEHUMIDIFICATION_CONTROL_RELATIVE_HUMIDITY 0x0000 /* Relative Humidity */
#define ZBEE_ZCL_ATTR_ID_DEHUMIDIFICATION_CONTROL_DEHUM_COOLING 0x0001 /* Dehumidification Cooling */
#define ZBEE_ZCL_ATTR_ID_DEHUMIDIFICATION_CONTROL_RH_DEHUM_SETPOINT 0x0010 /* Relative Humidity Dehumidification Setpoint */
#define ZBEE_ZCL_ATTR_ID_DEHUMIDIFICATION_CONTROL_RELATIVE_HUMIDITY_MODE 0x0011 /* Relative Humidity Mode */
#define ZBEE_ZCL_ATTR_ID_DEHUMIDIFICATION_CONTROL_DEHUM_LOCKOUT 0x0012 /* Dehumidification Lockout */
#define ZBEE_ZCL_ATTR_ID_DEHUMIDIFICATION_CONTROL_DEHUM_HYSTERESIS 0x0013 /* Dehumidification Hysteresis */
#define ZBEE_ZCL_ATTR_ID_DEHUMIDIFICATION_CONTROL_DEHUM_MAX_COOL 0x0014 /* Dehumidification Max Cool */
#define ZBEE_ZCL_ATTR_ID_DEHUMIDIFICATION_CONTROL_RELATIVE_HUMIDITY_DISPLAY 0x0015 /* Relative Humidity Display */
/*Server commands received - none*/
/*Server commands generated - none*/
/*************************/
/* Function Declarations */
/*************************/
void proto_register_zbee_zcl_dehumidification_control(void);
void proto_reg_handoff_zbee_zcl_dehumidification_control(void);
/* Command Dissector Helpers */
static void dissect_zcl_dehumidification_control_attr_data (proto_tree *tree, tvbuff_t *tvb, unsigned *offset, uint16_t attr_id, unsigned data_type, bool client_attr);
/* Private functions prototype */
/*************************/
/* Global Variables */
/*************************/
/* Initialize the protocol and registered fields */
static int proto_zbee_zcl_dehumidification_control;
static int hf_zbee_zcl_dehumidification_control_attr_id;
static int hf_zbee_zcl_dehumidification_control_attr_rel_hum_mode;
static int hf_zbee_zcl_dehumidification_control_attr_dehum_lockout;
static int hf_zbee_zcl_dehumidification_control_attr_rel_hum_display;
/* Initialize the subtree pointers */
static int ett_zbee_zcl_dehumidification_control;
/* Attributes */
static const value_string zbee_zcl_dehumidification_control_attr_names[] = {
{ ZBEE_ZCL_ATTR_ID_DEHUMIDIFICATION_CONTROL_RELATIVE_HUMIDITY, "Relative Humidity" },
{ ZBEE_ZCL_ATTR_ID_DEHUMIDIFICATION_CONTROL_DEHUM_COOLING, "Dehumidification Cooling" },
{ ZBEE_ZCL_ATTR_ID_DEHUMIDIFICATION_CONTROL_RH_DEHUM_SETPOINT, "Relative Humidity Dehumidification Setpoint" },
{ ZBEE_ZCL_ATTR_ID_DEHUMIDIFICATION_CONTROL_RELATIVE_HUMIDITY_MODE, "Relative Humidity Mode" },
{ ZBEE_ZCL_ATTR_ID_DEHUMIDIFICATION_CONTROL_DEHUM_LOCKOUT, "Dehumidification Lockout" },
{ ZBEE_ZCL_ATTR_ID_DEHUMIDIFICATION_CONTROL_DEHUM_HYSTERESIS, "Dehumidification Hysteresis" },
{ ZBEE_ZCL_ATTR_ID_DEHUMIDIFICATION_CONTROL_DEHUM_MAX_COOL, "Dehumidification Max Cool" },
{ ZBEE_ZCL_ATTR_ID_DEHUMIDIFICATION_CONTROL_RELATIVE_HUMIDITY_DISPLAY, "Relative Humidity Display" },
{ 0, NULL }
};
/*Relative Humidity Mode Values*/
static const value_string zbee_zcl_dehumidification_control_rel_hum_mode_names[] = {
{ 0x00, "Relative Humidity measured locally" },
{ 0x01, "Relative Humidity updated over network" },
{ 0, NULL}
};
/*Dehumidification Lockout Values*/
static const value_string zbee_zcl_dehumidification_control_dehum_lockout_names[] = {
{ 0x00, "Dehumidification is not allowed" },
{ 0x01, "Dehumidification is allowed" },
{ 0, NULL}
};
/*Relative Humidity Display Values*/
static const value_string zbee_zcl_dehumidification_control_rel_hum_display_names[] = {
{ 0x00, "Relative Humidity is not displayed" },
{ 0x01, "Relative Humidity is displayed" },
{ 0, NULL}
};
/*************************/
/* Function Bodies */
/*************************/
/**
*ZigBee ZCL Dehumidification Control cluster dissector for wireshark.
*
*@param tvb pointer to buffer containing raw packet.
*@param pinfo pointer to packet information fields
*@param tree pointer to data tree Wireshark uses to display packet.
*/
static int
dissect_zbee_zcl_dehumidification_control(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void* data _U_)
{
return tvb_captured_length(tvb);
} /*dissect_zbee_zcl_dehumidification_control*/
/**
*This function is called by ZCL foundation dissector in order to decode
*
*@param tree pointer to data tree Wireshark uses to display packet.
*@param tvb pointer to buffer containing raw packet.
*@param offset pointer to buffer offset
*@param attr_id attribute identifier
*@param data_type attribute data type
*@param client_attr ZCL client
*/
void
dissect_zcl_dehumidification_control_attr_data(proto_tree *tree, tvbuff_t *tvb, unsigned *offset, uint16_t attr_id, unsigned data_type, bool client_attr)
{
/* Dissect attribute data type and data */
switch (attr_id) {
case ZBEE_ZCL_ATTR_ID_DEHUMIDIFICATION_CONTROL_RELATIVE_HUMIDITY_MODE:
proto_tree_add_item(tree, hf_zbee_zcl_dehumidification_control_attr_rel_hum_mode, tvb, *offset, 1, ENC_NA);
*offset += 1;
break;
case ZBEE_ZCL_ATTR_ID_DEHUMIDIFICATION_CONTROL_DEHUM_LOCKOUT:
proto_tree_add_item(tree, hf_zbee_zcl_dehumidification_control_attr_dehum_lockout, tvb, *offset, 1, ENC_NA);
*offset += 1;
break;
case ZBEE_ZCL_ATTR_ID_DEHUMIDIFICATION_CONTROL_RELATIVE_HUMIDITY_DISPLAY:
proto_tree_add_item(tree, hf_zbee_zcl_dehumidification_control_attr_rel_hum_display, tvb, *offset, 1, ENC_NA);
*offset += 1;
break;
case ZBEE_ZCL_ATTR_ID_DEHUMIDIFICATION_CONTROL_RELATIVE_HUMIDITY:
case ZBEE_ZCL_ATTR_ID_DEHUMIDIFICATION_CONTROL_DEHUM_COOLING:
case ZBEE_ZCL_ATTR_ID_DEHUMIDIFICATION_CONTROL_RH_DEHUM_SETPOINT:
case ZBEE_ZCL_ATTR_ID_DEHUMIDIFICATION_CONTROL_DEHUM_HYSTERESIS:
case ZBEE_ZCL_ATTR_ID_DEHUMIDIFICATION_CONTROL_DEHUM_MAX_COOL:
default:
dissect_zcl_attr_data(tvb, tree, offset, data_type, client_attr);
break;
}
} /*dissect_zcl_dehumidification_control_attr_data*/
/**
*ZigBee ZCL Dehumidification Control cluster protocol registration routine.
*
*/
void
proto_register_zbee_zcl_dehumidification_control(void)
{
/* Setup list of header fields */
static hf_register_info hf[] = {
{ &hf_zbee_zcl_dehumidification_control_attr_id,
{ "Attribute", "zbee_zcl_hvac.dehumidification_control.attr_id", FT_UINT16, BASE_HEX, VALS(zbee_zcl_dehumidification_control_attr_names),
0x00, NULL, HFILL } },
{ &hf_zbee_zcl_dehumidification_control_attr_rel_hum_mode,
{ "Relative Humidity Mode", "zbee_zcl_hvac.dehumidification_control.attr.rel_humidity_mode", FT_UINT8, BASE_HEX, VALS(zbee_zcl_dehumidification_control_rel_hum_mode_names),
0x00, NULL, HFILL } },
{ &hf_zbee_zcl_dehumidification_control_attr_dehum_lockout,
{ "Dehumidification Lockout", "zbee_zcl_hvac.dehumidification_control.attr.dehumidification_lockout", FT_UINT8, BASE_HEX, VALS(zbee_zcl_dehumidification_control_dehum_lockout_names),
0x00, NULL, HFILL } },
{ &hf_zbee_zcl_dehumidification_control_attr_rel_hum_display,
{ "Relative Humidity Display", "zbee_zcl_hvac.dehumidification_control.attr.rel_humidity_display", FT_UINT8, BASE_HEX, VALS(zbee_zcl_dehumidification_control_rel_hum_display_names),
0x00, NULL, HFILL } }
};
/* ZCL Dehumidification Control subtrees */
static int *ett[ZBEE_ZCL_DEHUMIDIFICATION_CONTROL_NUM_ETT];
ett[0] = &ett_zbee_zcl_dehumidification_control;
/* Register the ZigBee ZCL Dehumidification Control cluster protocol name and description */
proto_zbee_zcl_dehumidification_control = proto_register_protocol("ZigBee ZCL Dehumidification Control", "ZCL Dehumidification Control", ZBEE_PROTOABBREV_ZCL_DEHUMIDIFICATION_CONTROL);
proto_register_field_array(proto_zbee_zcl_dehumidification_control, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
/* Register the ZigBee ZCL Dehumidification Control dissector. */
register_dissector(ZBEE_PROTOABBREV_ZCL_DEHUMIDIFICATION_CONTROL, dissect_zbee_zcl_dehumidification_control, proto_zbee_zcl_dehumidification_control);
} /*proto_register_zbee_zcl_dehumidification_control*/
/**
*Hands off the ZCL Dehumidification Control dissector.
*
*/
void
proto_reg_handoff_zbee_zcl_dehumidification_control(void)
{
zbee_zcl_init_cluster( ZBEE_PROTOABBREV_ZCL_DEHUMIDIFICATION_CONTROL,
proto_zbee_zcl_dehumidification_control,
ett_zbee_zcl_dehumidification_control,
ZBEE_ZCL_CID_DEHUMIDIFICATION_CONTROL,
ZBEE_MFG_CODE_NONE,
hf_zbee_zcl_dehumidification_control_attr_id,
hf_zbee_zcl_dehumidification_control_attr_id,
-1, -1,
(zbee_zcl_fn_attr_data)dissect_zcl_dehumidification_control_attr_data
);
} /*proto_reg_handoff_zbee_zcl_dehumidification_control*/
/* ########################################################################## */
/* #### (0x0204) THERMOSTAT USER INTERFACE CONFIGURATION CLUSTER ############ */
/* ########################################################################## */
/*************************/
/* Defines */
/*************************/
#define ZBEE_ZCL_THERMOSTAT_UI_CONFIG_NUM_ETT 1
/*Attributes*/
#define ZBEE_ZCL_ATTR_ID_THERMOSTAT_UI_CONFIG_TEMP_DISP_MODE 0x0000 /* Temperature Display Mode */
#define ZBEE_ZCL_ATTR_ID_THERMOSTAT_UI_CONFIG_KEYPAD_LOCKOUT 0x0001 /* Keypad Lockout */
/*Server commands received - none*/
/*Server commands generated - none*/
/*************************/
/* Function Declarations */
/*************************/
void proto_register_zbee_zcl_thermostat_ui_config(void);
void proto_reg_handoff_zbee_zcl_thermostat_ui_config(void);
/* Command Dissector Helpers */
static void dissect_zcl_thermostat_ui_config_attr_data (proto_tree *tree, tvbuff_t *tvb, unsigned *offset, uint16_t attr_id, unsigned data_type, bool client_attr);
/* Private functions prototype */
/*************************/
/* Global Variables */
/*************************/
/* Initialize the protocol and registered fields */
static int proto_zbee_zcl_thermostat_ui_config;
static int hf_zbee_zcl_thermostat_ui_config_attr_id;
static int hf_zbee_zcl_thermostat_ui_config_attr_temp_disp_mode;
static int hf_zbee_zcl_thermostat_ui_config_attr_keypad_lockout;
/* Initialize the subtree pointers */
static int ett_zbee_zcl_thermostat_ui_config;
/* Attributes */
static const value_string zbee_zcl_thermostat_ui_config_attr_names[] = {
{ ZBEE_ZCL_ATTR_ID_THERMOSTAT_UI_CONFIG_TEMP_DISP_MODE, "Temperature Display Mode" },
{ ZBEE_ZCL_ATTR_ID_THERMOSTAT_UI_CONFIG_KEYPAD_LOCKOUT, "Keypad Lockout" },
{ 0, NULL }
};
/*Temp Display Mode Values*/
static const value_string zbee_zcl_thermostat_ui_config_temp_disp_mode_names[] = {
{ 0x00, "Temperature in degree Celsius" },
{ 0x01, "Temperature in degree Fahrenheit" },
{ 0, NULL}
};
/*Keypad Lockout Values*/
static const value_string zbee_zcl_thermostat_ui_config_keypad_lockout_names[] = {
{ 0x00, "No lockout" },
{ 0x01, "Level 1 lockout" },
{ 0x02, "Level 2 lockout" },
{ 0x03, "Level 3 lockout" },
{ 0x04, "Level 4 lockout" },
{ 0x05, "Level 5 lockout" },
{ 0, NULL}
};
/*************************/
/* Function Bodies */
/*************************/
/**
*ZigBee ZCL Thermostat User Interface Configuration cluster dissector for wireshark.
*
*@param tvb pointer to buffer containing raw packet.
*@param pinfo pointer to packet information fields
*@param tree pointer to data tree Wireshark uses to display packet.
*/
static int
dissect_zbee_zcl_thermostat_ui_config(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void* data _U_)
{
return tvb_captured_length(tvb);
} /*dissect_zbee_zcl_thermostat_ui_config*/
/**
*This function is called by ZCL foundation dissector in order to decode
*
*@param tree pointer to data tree Wireshark uses to display packet.
*@param tvb pointer to buffer containing raw packet.
*@param offset pointer to buffer offset
*@param attr_id attribute identifier
*@param data_type attribute data type
*@param client_attr ZCL client
*/
void
dissect_zcl_thermostat_ui_config_attr_data(proto_tree *tree, tvbuff_t *tvb, unsigned *offset, uint16_t attr_id, unsigned data_type, bool client_attr)
{
/* Dissect attribute data type and data */
switch (attr_id) {
case ZBEE_ZCL_ATTR_ID_THERMOSTAT_UI_CONFIG_TEMP_DISP_MODE:
proto_tree_add_item(tree, hf_zbee_zcl_thermostat_ui_config_attr_temp_disp_mode, tvb, *offset, 1, ENC_NA);
*offset += 1;
break;
case ZBEE_ZCL_ATTR_ID_THERMOSTAT_UI_CONFIG_KEYPAD_LOCKOUT:
proto_tree_add_item(tree, hf_zbee_zcl_thermostat_ui_config_attr_keypad_lockout, tvb, *offset, 1, ENC_NA);
*offset += 1;
break;
default:
dissect_zcl_attr_data(tvb, tree, offset, data_type, client_attr);
break;
}
} /*dissect_zcl_thermostat_ui_config_attr_data*/
/**
*ZigBee ZCL Thermostat User Interface Configuration cluster protocol registration routine.
*
*/
void
proto_register_zbee_zcl_thermostat_ui_config(void)
{
/* Setup list of header fields */
static hf_register_info hf[] = {
{ &hf_zbee_zcl_thermostat_ui_config_attr_id,
{ "Attribute", "zbee_zcl_hvac.thermostat_ui_config.attr_id", FT_UINT16, BASE_HEX, VALS(zbee_zcl_thermostat_ui_config_attr_names),
0x00, NULL, HFILL } },
{ &hf_zbee_zcl_thermostat_ui_config_attr_temp_disp_mode,
{ "Temperature Display Mode", "zbee_zcl_hvac.thermostat_ui_config.attr.temp_disp_mode", FT_UINT8, BASE_HEX, VALS(zbee_zcl_thermostat_ui_config_temp_disp_mode_names),
0x00, NULL, HFILL } },
{ &hf_zbee_zcl_thermostat_ui_config_attr_keypad_lockout,
{ "Keypad Lockout", "zbee_zcl_hvac.thermostat_ui_config.attr.keypad_lockout", FT_UINT8, BASE_HEX, VALS(zbee_zcl_thermostat_ui_config_keypad_lockout_names),
0x00, NULL, HFILL } }
};
/* ZCL Thermostat User Interface Configuration subtrees */
static int *ett[ZBEE_ZCL_THERMOSTAT_UI_CONFIG_NUM_ETT];
ett[0] = &ett_zbee_zcl_thermostat_ui_config;
/* Register the ZigBee ZCL Thermostat User Interface Configuration cluster protocol name and description */
proto_zbee_zcl_thermostat_ui_config = proto_register_protocol("ZigBee ZCL Thermostat User Interface Configuration", "ZCL Thermostat User Interface Configuration", ZBEE_PROTOABBREV_ZCL_THERMOSTAT_UI_CONFIG);
proto_register_field_array(proto_zbee_zcl_thermostat_ui_config, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
/* Register the ZigBee ZCL Thermostat User Interface Configuration dissector. */
register_dissector(ZBEE_PROTOABBREV_ZCL_THERMOSTAT_UI_CONFIG, dissect_zbee_zcl_thermostat_ui_config, proto_zbee_zcl_thermostat_ui_config);
} /*proto_register_zbee_zcl_thermostat_ui_config*/
/**
*Hands off the ZCL Thermostat User Interface Configuration dissector.
*
*/
void
proto_reg_handoff_zbee_zcl_thermostat_ui_config(void)
{
zbee_zcl_init_cluster( ZBEE_PROTOABBREV_ZCL_THERMOSTAT_UI_CONFIG,
proto_zbee_zcl_thermostat_ui_config,
ett_zbee_zcl_thermostat_ui_config,
ZBEE_ZCL_CID_THERMOSTAT_UI_CONFIG,
ZBEE_MFG_CODE_NONE,
hf_zbee_zcl_thermostat_ui_config_attr_id,
hf_zbee_zcl_thermostat_ui_config_attr_id,
-1, -1,
(zbee_zcl_fn_attr_data)dissect_zcl_thermostat_ui_config_attr_data
);
} /*proto_reg_handoff_zbee_zcl_thermostat_ui_config*/
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 4
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* vi: set shiftwidth=4 tabstop=8 expandtab:
* :indentSize=4:tabSize=8:noTabs=true:
*/
|