/src/wireshark/epan/dissectors/packet-zbee-zcl-hvac.c
Line | Count | Source |
1 | | /* packet-zbee-zcl-hvac.c |
2 | | * Dissector routines for the ZigBee ZCL HVAC clusters |
3 | | * By Aditya Jain <aditya.jain@samsung.com> |
4 | | * |
5 | | * Wireshark - Network traffic analyzer |
6 | | * By Gerald Combs <gerald@wireshark.org> |
7 | | * Copyright 1998 Gerald Combs |
8 | | * |
9 | | * SPDX-License-Identifier: GPL-2.0-or-later |
10 | | */ |
11 | | |
12 | | /* Include Files */ |
13 | | #include "config.h" |
14 | | |
15 | | #include <epan/packet.h> |
16 | | #include <epan/tfs.h> |
17 | | #include <wsutil/array.h> |
18 | | |
19 | | #include "packet-zbee.h" |
20 | | #include "packet-zbee-aps.h" |
21 | | #include "packet-zbee-zcl.h" |
22 | | |
23 | | /* ########################################################################## */ |
24 | | /* #### (0x0200) PUMP CONFIGURATION AND CONTROL CLUSTER ##################### */ |
25 | | /* ########################################################################## */ |
26 | | |
27 | | /*************************/ |
28 | | /* Defines */ |
29 | | /*************************/ |
30 | | |
31 | | #define ZBEE_ZCL_PUMP_CONFIG_CONTROL_NUM_ETT 3 |
32 | | |
33 | | /*Attributes*/ |
34 | 35 | #define ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MAX_PRESSURE 0x0000 /* Maximum Pressure */ |
35 | 36 | #define ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MAX_SPEED 0x0001 /* Maximum Speed */ |
36 | 38 | #define ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MAX_FLOW 0x0002 /* Maximum Flow */ |
37 | 39 | #define ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MIN_CONST_PRESSURE 0x0003 /* Minimum Constant Pressure */ |
38 | 39 | #define ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MAX_CONST_PRESSURE 0x0004 /* Maximum Constant Pressure */ |
39 | 41 | #define ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MIN_COMP_PRESSURE 0x0005 /* Minimum Compensated Pressure */ |
40 | 41 | #define ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_POWER_MAX_COMP_PRESSURE 0x0006 /* Maximum Compensated Pressure */ |
41 | 42 | #define ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MIN_CONST_SPEED 0x0007 /* Minimum Constant Speed */ |
42 | 43 | #define ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MAX_CONST_SPEED 0x0008 /* Maximum Constant Speed */ |
43 | 43 | #define ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MIN_CONST_FLOW 0x0009 /* Minimum Constant Flow */ |
44 | 43 | #define ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MAX_CONST_FLOW 0x000a /* Maximum Constant Flow */ |
45 | 43 | #define ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MIN_CONST_TEMP 0x000b /* Minimum Constant Temperature */ |
46 | 43 | #define ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MAX_CONST_TEMP 0x000c /* Maximum Constant Temperature */ |
47 | 1 | #define ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_PUMP_STATUS 0x0010 /* Pump Status */ |
48 | 3 | #define ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_EFFECTIVE_OPR_MODE 0x0011 /* Effective Operation Mode */ |
49 | 0 | #define ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_EFFECTIVE_CTRL_MODE 0x0012 /* Effective Control Mode */ |
50 | 43 | #define ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_CAPACITY 0x0013 /* Capacity */ |
51 | 43 | #define ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_SPEED 0x0014 /* Speed */ |
52 | 43 | #define ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_LIFETIME_RUNNING_HOURS 0x0015 /* Lifetime Running Hours */ |
53 | 43 | #define ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_POWER 0x0016 /* Power */ |
54 | 43 | #define ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_LIFETIME_ENERGY_CONS 0x0017 /* Lifetime Energy Consumed */ |
55 | 9 | #define ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_OPR_MODE 0x0020 /* Operation Mode */ |
56 | 1 | #define ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_CTRL_MODE 0x0021 /* Control Mode */ |
57 | 0 | #define ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_ALARM_MASK 0x0022 /* Alarm Mask */ |
58 | | |
59 | | /*Server commands received - none*/ |
60 | | |
61 | | /*Server commands generated - none*/ |
62 | | |
63 | | /*Pump Status Mask Values*/ |
64 | 16 | #define ZBEE_ZCL_PUMP_CONFIG_CONTROL_STATUS_DEVICE_FAULT 0x0001 /* Device Fault */ |
65 | 16 | #define ZBEE_ZCL_PUMP_CONFIG_CONTROL_STATUS_SUPPLY_FAULT 0x0002 /* Supply Fault */ |
66 | 16 | #define ZBEE_ZCL_PUMP_CONFIG_CONTROL_STATUS_SPEED_LOW 0x0004 /* Speed Low */ |
67 | 16 | #define ZBEE_ZCL_PUMP_CONFIG_CONTROL_STATUS_SPEED_HIGH 0x0008 /* Speed High */ |
68 | 16 | #define ZBEE_ZCL_PUMP_CONFIG_CONTROL_STATUS_LOCAL_OVERRIDE 0x0010 /* Local Override */ |
69 | 16 | #define ZBEE_ZCL_PUMP_CONFIG_CONTROL_STATUS_RUNNING 0x0020 /* Running */ |
70 | 16 | #define ZBEE_ZCL_PUMP_CONFIG_CONTROL_STATUS_REMOTE_PRESSURE 0x0040 /* Remote Pressure */ |
71 | 16 | #define ZBEE_ZCL_PUMP_CONFIG_CONTROL_STATUS_REMOTE_FLOW 0x0080 /* Remote Flow */ |
72 | 16 | #define ZBEE_ZCL_PUMP_CONFIG_CONTROL_STATUS_REMOTE_TEMP 0x0100 /* Remote Temperature */ |
73 | | |
74 | | /*Alarm Mask Values*/ |
75 | 16 | #define ZBEE_ZCL_PUMP_CONFIG_CONTROL_ALARM_VOLTAGE_TOO_LOW 0x0001 /* Supply voltage too low */ |
76 | 16 | #define ZBEE_ZCL_PUMP_CONFIG_CONTROL_ALARM_VOLTAGE_TOO_HIGH 0x0002 /* Supply voltage too high */ |
77 | 16 | #define ZBEE_ZCL_PUMP_CONFIG_CONTROL_ALARM_PWR_MISSING_PHASE 0x0004 /* Power missing phase */ |
78 | 16 | #define ZBEE_ZCL_PUMP_CONFIG_CONTROL_ALARM_PRESSURE_TOO_LOW 0x0008 /* System pressure too low */ |
79 | 16 | #define ZBEE_ZCL_PUMP_CONFIG_CONTROL_ALARM_PRESSURE_TOO_HIGH 0x0010 /* System pressure too high */ |
80 | 16 | #define ZBEE_ZCL_PUMP_CONFIG_CONTROL_ALARM_DRY_RUNNING 0x0020 /* Dry running */ |
81 | 16 | #define ZBEE_ZCL_PUMP_CONFIG_CONTROL_ALARM_MTR_TEMP_TOO_HIGH 0x0040 /* Motor temperature too high */ |
82 | 16 | #define ZBEE_ZCL_PUMP_CONFIG_CONTROL_ALARM_PUMP_MTR_FATAL_FAILURE 0x0080 /* Pump motor has fatal failure */ |
83 | 16 | #define ZBEE_ZCL_PUMP_CONFIG_CONTROL_ALARM_ELEC_TEMP_TOO_HIGH 0x0100 /* Electronic temperature too high */ |
84 | 16 | #define ZBEE_ZCL_PUMP_CONFIG_CONTROL_ALARM_PUMP_BLOCK 0x0200 /* Pump blocked */ |
85 | 16 | #define ZBEE_ZCL_PUMP_CONFIG_CONTROL_ALARM_SENSOR_FAILURE 0x0400 /* Sensor failure */ |
86 | 16 | #define ZBEE_ZCL_PUMP_CONFIG_CONTROL_ALARM_ELEC_NON_FATAL_FAILURE 0x0800 /* Electronic non-fatal failure */ |
87 | 16 | #define ZBEE_ZCL_PUMP_CONFIG_CONTROL_ALARM_ELEC_FATAL_FAILURE 0x1000 /* Electronic fatal failure */ |
88 | 16 | #define ZBEE_ZCL_PUMP_CONFIG_CONTROL_ALARM_GENERAL_FAULT 0x2000 /* General fault */ |
89 | | |
90 | | /*************************/ |
91 | | /* Function Declarations */ |
92 | | /*************************/ |
93 | | |
94 | | void proto_register_zbee_zcl_pump_config_control(void); |
95 | | void proto_reg_handoff_zbee_zcl_pump_config_control(void); |
96 | | |
97 | | /* Private functions prototype */ |
98 | | |
99 | | /*************************/ |
100 | | /* Global Variables */ |
101 | | /*************************/ |
102 | | /* Initialize the protocol and registered fields */ |
103 | | static int proto_zbee_zcl_pump_config_control; |
104 | | |
105 | | static int hf_zbee_zcl_pump_config_control_attr_id; |
106 | | static int hf_zbee_zcl_pump_config_control_attr_eff_opr_mode; |
107 | | static int hf_zbee_zcl_pump_config_control_attr_opr_mode; |
108 | | static int hf_zbee_zcl_pump_config_control_attr_eff_ctrl_mode; |
109 | | static int hf_zbee_zcl_pump_config_control_attr_ctrl_mode; |
110 | | static int hf_zbee_zcl_pump_config_control_status; |
111 | | static int hf_zbee_zcl_pump_config_control_status_device_fault; |
112 | | static int hf_zbee_zcl_pump_config_control_status_supply_fault; |
113 | | static int hf_zbee_zcl_pump_config_control_status_speed_low; |
114 | | static int hf_zbee_zcl_pump_config_control_status_speed_high; |
115 | | static int hf_zbee_zcl_pump_config_control_status_local_override; |
116 | | static int hf_zbee_zcl_pump_config_control_status_running; |
117 | | static int hf_zbee_zcl_pump_config_control_status_rem_pressure; |
118 | | static int hf_zbee_zcl_pump_config_control_status_rem_flow; |
119 | | static int hf_zbee_zcl_pump_config_control_status_rem_temp; |
120 | | static int hf_zbee_zcl_pump_config_control_alarm; |
121 | | static int hf_zbee_zcl_pump_config_control_alarm_volt_too_low; |
122 | | static int hf_zbee_zcl_pump_config_control_alarm_volt_too_high; |
123 | | static int hf_zbee_zcl_pump_config_control_alarm_pwr_missing_phase; |
124 | | static int hf_zbee_zcl_pump_config_control_alarm_press_too_low; |
125 | | static int hf_zbee_zcl_pump_config_control_alarm_press_too_high; |
126 | | static int hf_zbee_zcl_pump_config_control_alarm_dry_running; |
127 | | static int hf_zbee_zcl_pump_config_control_alarm_mtr_temp_too_high; |
128 | | static int hf_zbee_zcl_pump_config_control_alarm_pump_mtr_fatal_fail; |
129 | | static int hf_zbee_zcl_pump_config_control_alarm_elec_temp_too_high; |
130 | | static int hf_zbee_zcl_pump_config_control_alarm_pump_block; |
131 | | static int hf_zbee_zcl_pump_config_control_alarm_sensor_fail; |
132 | | static int hf_zbee_zcl_pump_config_control_alarm_elec_non_fatal_fail; |
133 | | static int hf_zbee_zcl_pump_config_control_alarm_fatal_fail; |
134 | | static int hf_zbee_zcl_pump_config_control_alarm_gen_fault; |
135 | | |
136 | | /* Initialize the subtree pointers */ |
137 | | static int ett_zbee_zcl_pump_config_control; |
138 | | static int ett_zbee_zcl_pump_config_control_status; |
139 | | static int ett_zbee_zcl_pump_config_control_alarm; |
140 | | |
141 | | /* Attributes */ |
142 | | static const value_string zbee_zcl_pump_config_control_attr_names[] = { |
143 | | { ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MAX_PRESSURE, "Maximum Pressure" }, |
144 | | { ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MAX_SPEED, "Maximum Speed" }, |
145 | | { ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MAX_FLOW, "Maximum Flow" }, |
146 | | { ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MIN_CONST_PRESSURE, "Minimum Constant Pressure" }, |
147 | | { ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MAX_CONST_PRESSURE, "Maximum Constant Pressure" }, |
148 | | { ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MIN_COMP_PRESSURE, "Minimum Compensated Pressure" }, |
149 | | { ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_POWER_MAX_COMP_PRESSURE, "Maximum Compensated Pressure" }, |
150 | | { ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MIN_CONST_SPEED, "Minimum Constant Speed" }, |
151 | | { ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MAX_CONST_SPEED, "Maximum Constant Speed" }, |
152 | | { ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MIN_CONST_FLOW, "Minimum Constant Flow" }, |
153 | | { ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MAX_CONST_FLOW, "Maximum Constant Flow" }, |
154 | | { ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MIN_CONST_TEMP, "Minimum Constant Temperature" }, |
155 | | { ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MAX_CONST_TEMP, "Maximum Constant Temperature" }, |
156 | | { ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_PUMP_STATUS, "Pump Status" }, |
157 | | { ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_EFFECTIVE_OPR_MODE, "Effective Operation Mode" }, |
158 | | { ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_EFFECTIVE_CTRL_MODE, "Effective Control Mode" }, |
159 | | { ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_CAPACITY, "Capacity" }, |
160 | | { ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_SPEED, "Speed" }, |
161 | | { ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_LIFETIME_RUNNING_HOURS, "Lifetime Running Hours" }, |
162 | | { ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_POWER, "Power" }, |
163 | | { ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_LIFETIME_ENERGY_CONS, "Lifetime Energy Consumed" }, |
164 | | { ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_OPR_MODE, "Operation Mode" }, |
165 | | { ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_CTRL_MODE, "Control Mode" }, |
166 | | { ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_ALARM_MASK, "Alarm Mask" }, |
167 | | { 0, NULL } |
168 | | }; |
169 | | |
170 | | /*Operation Mode Values*/ |
171 | | static const value_string zbee_zcl_pump_config_control_operation_mode_names[] = { |
172 | | {0, "Normal"}, |
173 | | {1, "Minimum"}, |
174 | | {2, "Maximum"}, |
175 | | {3, "Local"}, |
176 | | {0, NULL} |
177 | | }; |
178 | | |
179 | | /*Control Mode Values*/ |
180 | | static const value_string zbee_zcl_pump_config_control_control_mode_names[] = { |
181 | | {0, "Constant Speed"}, |
182 | | {1, "Constant Pressure"}, |
183 | | {2, "Proportional Pressure"}, |
184 | | {3, "Constant Flow"}, |
185 | | {4, "Reserved"}, |
186 | | {5, "Constant Temperature"}, |
187 | | {6, "Reserved"}, |
188 | | {7, "Automatic"}, |
189 | | {0, NULL} |
190 | | }; |
191 | | |
192 | | /*************************/ |
193 | | /* Function Bodies */ |
194 | | /*************************/ |
195 | | |
196 | | /** |
197 | | *ZigBee ZCL Pump Configuration and Control cluster dissector for wireshark. |
198 | | * |
199 | | *@param tvb pointer to buffer containing raw packet. |
200 | | *@param pinfo pointer to packet information fields |
201 | | *@param tree pointer to data tree Wireshark uses to display packet. |
202 | | */ |
203 | | |
204 | | static int |
205 | | dissect_zbee_zcl_pump_config_control(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void* data _U_) |
206 | 1 | { |
207 | 1 | return tvb_captured_length(tvb); |
208 | 1 | } /*dissect_zbee_zcl_pump_config_control*/ |
209 | | |
210 | | |
211 | | /** |
212 | | *This function is called by ZCL foundation dissector in order to decode |
213 | | * |
214 | | *@param tree pointer to data tree Wireshark uses to display packet. |
215 | | *@param tvb pointer to buffer containing raw packet. |
216 | | *@param offset pointer to buffer offset |
217 | | *@param attr_id attribute identifier |
218 | | *@param data_type attribute data type |
219 | | *@param client_attr ZCL client |
220 | | */ |
221 | | static void |
222 | | dissect_zcl_pump_config_control_attr_data(proto_tree *tree, packet_info* pinfo, tvbuff_t *tvb, unsigned *offset, uint16_t attr_id, unsigned data_type, bool client_attr) |
223 | 227 | { |
224 | 227 | static int * const pump_status[] = { |
225 | 227 | &hf_zbee_zcl_pump_config_control_status_device_fault, |
226 | 227 | &hf_zbee_zcl_pump_config_control_status_supply_fault, |
227 | 227 | &hf_zbee_zcl_pump_config_control_status_speed_low, |
228 | 227 | &hf_zbee_zcl_pump_config_control_status_speed_high, |
229 | 227 | &hf_zbee_zcl_pump_config_control_status_local_override, |
230 | 227 | &hf_zbee_zcl_pump_config_control_status_running, |
231 | 227 | &hf_zbee_zcl_pump_config_control_status_rem_pressure, |
232 | 227 | &hf_zbee_zcl_pump_config_control_status_rem_flow, |
233 | 227 | &hf_zbee_zcl_pump_config_control_status_rem_temp, |
234 | 227 | NULL |
235 | 227 | }; |
236 | | |
237 | 227 | static int * const alarm_mask[] = { |
238 | 227 | &hf_zbee_zcl_pump_config_control_alarm_volt_too_low, |
239 | 227 | &hf_zbee_zcl_pump_config_control_alarm_volt_too_high, |
240 | 227 | &hf_zbee_zcl_pump_config_control_alarm_pwr_missing_phase, |
241 | 227 | &hf_zbee_zcl_pump_config_control_alarm_press_too_low, |
242 | 227 | &hf_zbee_zcl_pump_config_control_alarm_press_too_high, |
243 | 227 | &hf_zbee_zcl_pump_config_control_alarm_dry_running, |
244 | 227 | &hf_zbee_zcl_pump_config_control_alarm_mtr_temp_too_high, |
245 | 227 | &hf_zbee_zcl_pump_config_control_alarm_pump_mtr_fatal_fail, |
246 | 227 | &hf_zbee_zcl_pump_config_control_alarm_elec_temp_too_high, |
247 | 227 | &hf_zbee_zcl_pump_config_control_alarm_pump_block, |
248 | 227 | &hf_zbee_zcl_pump_config_control_alarm_sensor_fail, |
249 | 227 | &hf_zbee_zcl_pump_config_control_alarm_elec_non_fatal_fail, |
250 | 227 | &hf_zbee_zcl_pump_config_control_alarm_fatal_fail, |
251 | 227 | &hf_zbee_zcl_pump_config_control_alarm_gen_fault, |
252 | 227 | NULL |
253 | 227 | }; |
254 | | |
255 | | /* Dissect attribute data type and data */ |
256 | 227 | switch (attr_id) { |
257 | | |
258 | 3 | case ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_EFFECTIVE_OPR_MODE: |
259 | 3 | proto_tree_add_item(tree, hf_zbee_zcl_pump_config_control_attr_eff_opr_mode, tvb, *offset, 1, ENC_NA); |
260 | 3 | *offset += 1; |
261 | 3 | break; |
262 | | |
263 | 9 | case ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_OPR_MODE: |
264 | 9 | proto_tree_add_item(tree, hf_zbee_zcl_pump_config_control_attr_opr_mode, tvb, *offset, 1, ENC_NA); |
265 | 9 | *offset += 1; |
266 | 9 | break; |
267 | | |
268 | 0 | case ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_EFFECTIVE_CTRL_MODE: |
269 | 0 | proto_tree_add_item(tree, hf_zbee_zcl_pump_config_control_attr_eff_ctrl_mode, tvb, *offset, 1, ENC_NA); |
270 | 0 | *offset += 1; |
271 | 0 | break; |
272 | | |
273 | 1 | case ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_CTRL_MODE: |
274 | 1 | proto_tree_add_item(tree, hf_zbee_zcl_pump_config_control_attr_ctrl_mode, tvb, *offset, 1, ENC_NA); |
275 | 1 | *offset += 1; |
276 | 1 | break; |
277 | | |
278 | 1 | case ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_PUMP_STATUS: |
279 | 1 | 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); |
280 | 1 | *offset += 2; |
281 | 1 | break; |
282 | | |
283 | 0 | case ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_ALARM_MASK: |
284 | 0 | 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); |
285 | 0 | *offset += 2; |
286 | 0 | break; |
287 | | |
288 | 35 | case ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MAX_PRESSURE: |
289 | 36 | case ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MAX_SPEED: |
290 | 38 | case ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MAX_FLOW: |
291 | 39 | case ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MIN_CONST_PRESSURE: |
292 | 39 | case ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MAX_CONST_PRESSURE: |
293 | 41 | case ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MIN_COMP_PRESSURE: |
294 | 41 | case ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_POWER_MAX_COMP_PRESSURE: |
295 | 42 | case ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MIN_CONST_SPEED: |
296 | 43 | case ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MAX_CONST_SPEED: |
297 | 43 | case ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MIN_CONST_FLOW: |
298 | 43 | case ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MAX_CONST_FLOW: |
299 | 43 | case ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MIN_CONST_TEMP: |
300 | 43 | case ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_MAX_CONST_TEMP: |
301 | 43 | case ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_CAPACITY: |
302 | 43 | case ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_SPEED: |
303 | 43 | case ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_LIFETIME_RUNNING_HOURS: |
304 | 43 | case ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_POWER: |
305 | 43 | case ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_LIFETIME_ENERGY_CONS: |
306 | 213 | default: |
307 | 213 | dissect_zcl_attr_data(tvb, pinfo, tree, offset, data_type, client_attr); |
308 | 213 | break; |
309 | 227 | } |
310 | | |
311 | 227 | } /*dissect_zcl_pump_config_control_attr_data*/ |
312 | | |
313 | | |
314 | | /** |
315 | | *ZigBee ZCL Pump Configuration and Control cluster protocol registration routine. |
316 | | * |
317 | | */ |
318 | | void |
319 | | proto_register_zbee_zcl_pump_config_control(void) |
320 | 16 | { |
321 | | /* Setup list of header fields */ |
322 | 16 | static hf_register_info hf[] = { |
323 | | |
324 | 16 | { &hf_zbee_zcl_pump_config_control_attr_id, |
325 | 16 | { "Attribute", "zbee_zcl_hvac.pump_config_control.attr_id", FT_UINT16, BASE_HEX, VALS(zbee_zcl_pump_config_control_attr_names), |
326 | 16 | 0x00, NULL, HFILL } }, |
327 | | |
328 | 16 | { &hf_zbee_zcl_pump_config_control_attr_eff_opr_mode, |
329 | 16 | { "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), |
330 | 16 | 0x00, NULL, HFILL } }, |
331 | | |
332 | 16 | { &hf_zbee_zcl_pump_config_control_attr_opr_mode, |
333 | 16 | { "Operation Mode", "zbee_zcl_hvac.pump_config_control.attr.opr_mode", FT_UINT8, BASE_DEC, VALS(zbee_zcl_pump_config_control_operation_mode_names), |
334 | 16 | 0x00, NULL, HFILL } }, |
335 | | |
336 | 16 | { &hf_zbee_zcl_pump_config_control_attr_eff_ctrl_mode, |
337 | 16 | { "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), |
338 | 16 | 0x00, NULL, HFILL } }, |
339 | | |
340 | 16 | { &hf_zbee_zcl_pump_config_control_attr_ctrl_mode, |
341 | 16 | { "Control Mode", "zbee_zcl_hvac.pump_config_control.attr.ctrl_mode", FT_UINT8, BASE_DEC, VALS(zbee_zcl_pump_config_control_control_mode_names), |
342 | 16 | 0x00, NULL, HFILL } }, |
343 | | |
344 | | /* start Pump Status fields */ |
345 | 16 | { &hf_zbee_zcl_pump_config_control_status, |
346 | 16 | { "Pump Status", "zbee_zcl_hvac.pump_config_control.attr.status", FT_UINT16, BASE_HEX, NULL, |
347 | 16 | 0x00, NULL, HFILL } }, |
348 | | |
349 | 16 | { &hf_zbee_zcl_pump_config_control_status_device_fault, |
350 | 16 | { "Device Fault", "zbee_zcl_hvac.pump_config_control.attr.status.device_fault", FT_BOOLEAN, 16, TFS(&tfs_no_yes), |
351 | 16 | ZBEE_ZCL_PUMP_CONFIG_CONTROL_STATUS_DEVICE_FAULT, NULL, HFILL } }, |
352 | | |
353 | 16 | { &hf_zbee_zcl_pump_config_control_status_supply_fault, |
354 | 16 | { "Supply Fault", "zbee_zcl_hvac.pump_config_control.attr.status.supply_fault", FT_BOOLEAN, 16, TFS(&tfs_no_yes), |
355 | 16 | ZBEE_ZCL_PUMP_CONFIG_CONTROL_STATUS_SUPPLY_FAULT, NULL, HFILL } }, |
356 | | |
357 | 16 | { &hf_zbee_zcl_pump_config_control_status_speed_low, |
358 | 16 | { "Speed Low", "zbee_zcl_hvac.pump_config_control.attr.status.speed_low", FT_BOOLEAN, 16, TFS(&tfs_no_yes), |
359 | 16 | ZBEE_ZCL_PUMP_CONFIG_CONTROL_STATUS_SPEED_LOW, NULL, HFILL } }, |
360 | | |
361 | 16 | { &hf_zbee_zcl_pump_config_control_status_speed_high, |
362 | 16 | { "Speed High", "zbee_zcl_hvac.pump_config_control.attr.status.speed_high", FT_BOOLEAN, 16, TFS(&tfs_no_yes), |
363 | 16 | ZBEE_ZCL_PUMP_CONFIG_CONTROL_STATUS_SPEED_HIGH, NULL, HFILL } }, |
364 | | |
365 | 16 | { &hf_zbee_zcl_pump_config_control_status_local_override, |
366 | 16 | { "Local Override", "zbee_zcl_hvac.pump_config_control.attr.status.local_override", FT_BOOLEAN, 16, TFS(&tfs_no_yes), |
367 | 16 | ZBEE_ZCL_PUMP_CONFIG_CONTROL_STATUS_LOCAL_OVERRIDE, NULL, HFILL } }, |
368 | | |
369 | 16 | { &hf_zbee_zcl_pump_config_control_status_running, |
370 | 16 | { "Running", "zbee_zcl_hvac.pump_config_control.attr.status.running", FT_BOOLEAN, 16, TFS(&tfs_no_yes), |
371 | 16 | ZBEE_ZCL_PUMP_CONFIG_CONTROL_STATUS_RUNNING, NULL, HFILL } }, |
372 | | |
373 | 16 | { &hf_zbee_zcl_pump_config_control_status_rem_pressure, |
374 | 16 | { "Remote Pressure", "zbee_zcl_hvac.pump_config_control.attr.status.rem_pressure", FT_BOOLEAN, 16, TFS(&tfs_no_yes), |
375 | 16 | ZBEE_ZCL_PUMP_CONFIG_CONTROL_STATUS_REMOTE_PRESSURE, NULL, HFILL } }, |
376 | | |
377 | 16 | { &hf_zbee_zcl_pump_config_control_status_rem_flow, |
378 | 16 | { "Remote Flow", "zbee_zcl_hvac.pump_config_control.attr.status.rem_flow", FT_BOOLEAN, 16, TFS(&tfs_no_yes), |
379 | 16 | ZBEE_ZCL_PUMP_CONFIG_CONTROL_STATUS_REMOTE_FLOW, NULL, HFILL } }, |
380 | | |
381 | 16 | { &hf_zbee_zcl_pump_config_control_status_rem_temp, |
382 | 16 | { "Remote Temperature", "zbee_zcl_hvac.pump_config_control.attr.status.rem_temp", FT_BOOLEAN, 16, TFS(&tfs_no_yes), |
383 | 16 | ZBEE_ZCL_PUMP_CONFIG_CONTROL_STATUS_REMOTE_TEMP, NULL, HFILL } }, |
384 | | /* end Pump Status fields */ |
385 | | |
386 | | /*start Alarm Mask fields*/ |
387 | 16 | { &hf_zbee_zcl_pump_config_control_alarm, |
388 | 16 | { "Alarm Mask", "zbee_zcl_hvac.pump_config_control.attr.alarm", FT_UINT16, BASE_HEX, NULL, |
389 | 16 | 0x00, NULL, HFILL } }, |
390 | | |
391 | 16 | { &hf_zbee_zcl_pump_config_control_alarm_volt_too_low, |
392 | 16 | { "Supply voltage too low", "zbee_zcl_hvac.pump_config_control.attr.alarm.volt_too_low", FT_BOOLEAN, 16, TFS(&tfs_disabled_enabled), |
393 | 16 | ZBEE_ZCL_PUMP_CONFIG_CONTROL_ALARM_VOLTAGE_TOO_LOW, NULL, HFILL } }, |
394 | | |
395 | 16 | { &hf_zbee_zcl_pump_config_control_alarm_volt_too_high, |
396 | 16 | { "Supply voltage too high", "zbee_zcl_hvac.pump_config_control.attr.alarm.volt_too_high", FT_BOOLEAN, 16, TFS(&tfs_disabled_enabled), |
397 | 16 | ZBEE_ZCL_PUMP_CONFIG_CONTROL_ALARM_VOLTAGE_TOO_HIGH, NULL, HFILL } }, |
398 | | |
399 | 16 | { &hf_zbee_zcl_pump_config_control_alarm_pwr_missing_phase, |
400 | 16 | { "Power missing phase", "zbee_zcl_hvac.pump_config_control.attr.alarm.pwr_missing_phase", FT_BOOLEAN, 16, TFS(&tfs_disabled_enabled), |
401 | 16 | ZBEE_ZCL_PUMP_CONFIG_CONTROL_ALARM_PWR_MISSING_PHASE, NULL, HFILL } }, |
402 | | |
403 | 16 | { &hf_zbee_zcl_pump_config_control_alarm_press_too_low, |
404 | 16 | { "System pressure too low", "zbee_zcl_hvac.pump_config_control.attr.alarm.press_too_low", FT_BOOLEAN, 16, TFS(&tfs_disabled_enabled), |
405 | 16 | ZBEE_ZCL_PUMP_CONFIG_CONTROL_ALARM_PRESSURE_TOO_LOW, NULL, HFILL } }, |
406 | | |
407 | 16 | { &hf_zbee_zcl_pump_config_control_alarm_press_too_high, |
408 | 16 | { "System pressure too high", "zbee_zcl_hvac.pump_config_control.attr.alarm.press_too_high", FT_BOOLEAN, 16, TFS(&tfs_disabled_enabled), |
409 | 16 | ZBEE_ZCL_PUMP_CONFIG_CONTROL_ALARM_PRESSURE_TOO_HIGH, NULL, HFILL } }, |
410 | | |
411 | 16 | { &hf_zbee_zcl_pump_config_control_alarm_dry_running, |
412 | 16 | { "Dry running", "zbee_zcl_hvac.pump_config_control.attr.alarm.dry_running", FT_BOOLEAN, 16, TFS(&tfs_disabled_enabled), |
413 | 16 | ZBEE_ZCL_PUMP_CONFIG_CONTROL_ALARM_DRY_RUNNING, NULL, HFILL } }, |
414 | | |
415 | 16 | { &hf_zbee_zcl_pump_config_control_alarm_mtr_temp_too_high, |
416 | 16 | { "Motor temperature too high", "zbee_zcl_hvac.pump_config_control.attr.alarm.mtr_temp_too_high", FT_BOOLEAN, 16, TFS(&tfs_disabled_enabled), |
417 | 16 | ZBEE_ZCL_PUMP_CONFIG_CONTROL_ALARM_MTR_TEMP_TOO_HIGH, NULL, HFILL } }, |
418 | | |
419 | 16 | { &hf_zbee_zcl_pump_config_control_alarm_pump_mtr_fatal_fail, |
420 | 16 | { "Pump motor has fatal failure", "zbee_zcl_hvac.pump_config_control.attr.alarm.mtr_fatal_fail", FT_BOOLEAN, 16, TFS(&tfs_disabled_enabled), |
421 | 16 | ZBEE_ZCL_PUMP_CONFIG_CONTROL_ALARM_PUMP_MTR_FATAL_FAILURE, NULL, HFILL } }, |
422 | | |
423 | 16 | { &hf_zbee_zcl_pump_config_control_alarm_elec_temp_too_high, |
424 | 16 | { "Electronic temperature too high", "zbee_zcl_hvac.pump_config_control.attr.alarm.elec_temp_too_high", FT_BOOLEAN, 16, TFS(&tfs_disabled_enabled), |
425 | 16 | ZBEE_ZCL_PUMP_CONFIG_CONTROL_ALARM_ELEC_TEMP_TOO_HIGH, NULL, HFILL } }, |
426 | | |
427 | 16 | { &hf_zbee_zcl_pump_config_control_alarm_pump_block, |
428 | 16 | { "Pump blocked", "zbee_zcl_hvac.pump_config_control.attr.alarm.pump_block", FT_BOOLEAN, 16, TFS(&tfs_disabled_enabled), |
429 | 16 | ZBEE_ZCL_PUMP_CONFIG_CONTROL_ALARM_PUMP_BLOCK, NULL, HFILL } }, |
430 | | |
431 | 16 | { &hf_zbee_zcl_pump_config_control_alarm_sensor_fail, |
432 | 16 | { "Sensor failure", "zbee_zcl_hvac.pump_config_control.attr.alarm.sensor_fail", FT_BOOLEAN, 16, TFS(&tfs_disabled_enabled), |
433 | 16 | ZBEE_ZCL_PUMP_CONFIG_CONTROL_ALARM_SENSOR_FAILURE, NULL, HFILL } }, |
434 | | |
435 | 16 | { &hf_zbee_zcl_pump_config_control_alarm_elec_non_fatal_fail, |
436 | 16 | { "Electronic non-fatal failure", "zbee_zcl_hvac.pump_config_control.attr.alarm.elec_non_fatal_fail", FT_BOOLEAN, 16, TFS(&tfs_disabled_enabled), |
437 | 16 | ZBEE_ZCL_PUMP_CONFIG_CONTROL_ALARM_ELEC_NON_FATAL_FAILURE, NULL, HFILL } }, |
438 | | |
439 | 16 | { &hf_zbee_zcl_pump_config_control_alarm_fatal_fail, |
440 | 16 | { "Electronic fatal failure", "zbee_zcl_hvac.pump_config_control.attr.alarm.elec_fatal_fail", FT_BOOLEAN, 16, TFS(&tfs_disabled_enabled), |
441 | 16 | ZBEE_ZCL_PUMP_CONFIG_CONTROL_ALARM_ELEC_FATAL_FAILURE, NULL, HFILL } }, |
442 | | |
443 | 16 | { &hf_zbee_zcl_pump_config_control_alarm_gen_fault, |
444 | 16 | { "General fault", "zbee_zcl_hvac.pump_config_control.attr.alarm.gen_fault", FT_BOOLEAN, 16, TFS(&tfs_disabled_enabled), |
445 | 16 | ZBEE_ZCL_PUMP_CONFIG_CONTROL_ALARM_GENERAL_FAULT, NULL, HFILL } } |
446 | | /* end Alarm Mask fields */ |
447 | 16 | }; |
448 | | |
449 | | /* ZCL Pump Configuration and Control subtrees */ |
450 | 16 | static int *ett[ZBEE_ZCL_PUMP_CONFIG_CONTROL_NUM_ETT]; |
451 | | |
452 | 16 | ett[0] = &ett_zbee_zcl_pump_config_control; |
453 | 16 | ett[1] = &ett_zbee_zcl_pump_config_control_status; |
454 | 16 | ett[2] = &ett_zbee_zcl_pump_config_control_alarm; |
455 | | |
456 | | /* Register the ZigBee ZCL Pump Configuration and Control cluster protocol name and description */ |
457 | 16 | 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); |
458 | 16 | proto_register_field_array(proto_zbee_zcl_pump_config_control, hf, array_length(hf)); |
459 | 16 | proto_register_subtree_array(ett, array_length(ett)); |
460 | | |
461 | | /* Register the ZigBee ZCL Pump Configuration and Control dissector. */ |
462 | 16 | register_dissector(ZBEE_PROTOABBREV_ZCL_PUMP_CONFIG_CTRL, dissect_zbee_zcl_pump_config_control, proto_zbee_zcl_pump_config_control); |
463 | 16 | } /*proto_register_zbee_zcl_pump_config_control*/ |
464 | | |
465 | | /** |
466 | | *Hands off the ZCL Pump Configuration and Control dissector. |
467 | | * |
468 | | */ |
469 | | void |
470 | | proto_reg_handoff_zbee_zcl_pump_config_control(void) |
471 | 16 | { |
472 | 16 | zbee_zcl_init_cluster( ZBEE_PROTOABBREV_ZCL_PUMP_CONFIG_CTRL, |
473 | 16 | proto_zbee_zcl_pump_config_control, |
474 | 16 | ett_zbee_zcl_pump_config_control, |
475 | 16 | ZBEE_ZCL_CID_PUMP_CONFIG_CONTROL, |
476 | 16 | ZBEE_MFG_CODE_NONE, |
477 | 16 | hf_zbee_zcl_pump_config_control_attr_id, |
478 | 16 | hf_zbee_zcl_pump_config_control_attr_id, |
479 | 16 | -1, -1, |
480 | 16 | dissect_zcl_pump_config_control_attr_data |
481 | 16 | ); |
482 | 16 | } /*proto_reg_handoff_zbee_zcl_pump_config_control*/ |
483 | | |
484 | | |
485 | | /* ########################################################################## */ |
486 | | /* #### (0x0202) FAN CONTROL CLUSTER ######################################## */ |
487 | | /* ########################################################################## */ |
488 | | |
489 | | /*************************/ |
490 | | /* Defines */ |
491 | | /*************************/ |
492 | | |
493 | | #define ZBEE_ZCL_FAN_CONTROL_NUM_ETT 1 |
494 | | |
495 | | /*Attributes*/ |
496 | 22 | #define ZBEE_ZCL_ATTR_ID_FAN_CONTROL_FAN_MODE 0x0000 /* Fan Mode */ |
497 | 1 | #define ZBEE_ZCL_ATTR_ID_FAN_CONTROL_FAN_MODE_SEQUENCE 0x0001 /* Fan Mode Sequence */ |
498 | | |
499 | | /*Server commands received - none*/ |
500 | | |
501 | | /*Server commands generated - none*/ |
502 | | |
503 | | /*************************/ |
504 | | /* Function Declarations */ |
505 | | /*************************/ |
506 | | |
507 | | void proto_register_zbee_zcl_fan_control(void); |
508 | | void proto_reg_handoff_zbee_zcl_fan_control(void); |
509 | | |
510 | | /* Private functions prototype */ |
511 | | |
512 | | /*************************/ |
513 | | /* Global Variables */ |
514 | | /*************************/ |
515 | | /* Initialize the protocol and registered fields */ |
516 | | static int proto_zbee_zcl_fan_control; |
517 | | |
518 | | static int hf_zbee_zcl_fan_control_attr_id; |
519 | | static int hf_zbee_zcl_fan_control_attr_fan_mode; |
520 | | static int hf_zbee_zcl_fan_control_attr_fan_mode_seq; |
521 | | |
522 | | /* Initialize the subtree pointers */ |
523 | | static int ett_zbee_zcl_fan_control; |
524 | | |
525 | | /* Attributes */ |
526 | | static const value_string zbee_zcl_fan_control_attr_names[] = { |
527 | | { ZBEE_ZCL_ATTR_ID_FAN_CONTROL_FAN_MODE, "Fan Mode" }, |
528 | | { ZBEE_ZCL_ATTR_ID_FAN_CONTROL_FAN_MODE_SEQUENCE, "Fan Mode Sequence" }, |
529 | | { 0, NULL } |
530 | | }; |
531 | | |
532 | | /*Fan Mode Sequence Values*/ |
533 | | static const value_string zbee_zcl_fan_control_fan_mode_seq_names[] = { |
534 | | { 0x00, "Low/Med/High" }, |
535 | | { 0x01, "Low/High" }, |
536 | | { 0x02, "Low/Med/High/Auto" }, |
537 | | { 0x03, "Low/High/Auto" }, |
538 | | { 0x04, "On/Auto" }, |
539 | | { 0, NULL} |
540 | | }; |
541 | | |
542 | | /*Fan Mode Values*/ |
543 | | static const value_string zbee_zcl_fan_control_fan_mode_names[] = { |
544 | | { 0x00, "Off" }, |
545 | | { 0x01, "Low" }, |
546 | | { 0x02, "Medium" }, |
547 | | { 0x03, "High" }, |
548 | | { 0x04, "On" }, |
549 | | { 0x05, "Auto" }, |
550 | | { 0x06, "Smart" }, |
551 | | { 0, NULL} |
552 | | }; |
553 | | |
554 | | /*************************/ |
555 | | /* Function Bodies */ |
556 | | /*************************/ |
557 | | |
558 | | /** |
559 | | *ZigBee ZCL Fan Control cluster dissector for wireshark. |
560 | | * |
561 | | *@param tvb pointer to buffer containing raw packet. |
562 | | *@param pinfo pointer to packet information fields |
563 | | *@param tree pointer to data tree Wireshark uses to display packet. |
564 | | */ |
565 | | |
566 | | static int |
567 | | dissect_zbee_zcl_fan_control(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void* data _U_) |
568 | 0 | { |
569 | 0 | return tvb_captured_length(tvb); |
570 | 0 | } /*dissect_zbee_zcl_fan_control*/ |
571 | | |
572 | | |
573 | | /** |
574 | | *This function is called by ZCL foundation dissector in order to decode |
575 | | * |
576 | | *@param tree pointer to data tree Wireshark uses to display packet. |
577 | | *@param tvb pointer to buffer containing raw packet. |
578 | | *@param offset pointer to buffer offset |
579 | | *@param attr_id attribute identifier |
580 | | *@param data_type attribute data type |
581 | | *@param client_attr ZCL client |
582 | | */ |
583 | | static void |
584 | | dissect_zcl_fan_control_attr_data(proto_tree *tree, packet_info* pinfo, tvbuff_t *tvb, unsigned *offset, uint16_t attr_id, unsigned data_type, bool client_attr) |
585 | 118 | { |
586 | | /* Dissect attribute data type and data */ |
587 | 118 | switch (attr_id) { |
588 | | |
589 | 22 | case ZBEE_ZCL_ATTR_ID_FAN_CONTROL_FAN_MODE: |
590 | 22 | proto_tree_add_item(tree, hf_zbee_zcl_fan_control_attr_fan_mode, tvb, *offset, 1, ENC_NA); |
591 | 22 | *offset += 1; |
592 | 22 | break; |
593 | | |
594 | 1 | case ZBEE_ZCL_ATTR_ID_FAN_CONTROL_FAN_MODE_SEQUENCE: |
595 | 1 | proto_tree_add_item(tree, hf_zbee_zcl_fan_control_attr_fan_mode_seq, tvb, *offset, 1, ENC_NA); |
596 | 1 | *offset += 1; |
597 | 1 | break; |
598 | | |
599 | 95 | default: |
600 | 95 | dissect_zcl_attr_data(tvb, pinfo, tree, offset, data_type, client_attr); |
601 | 95 | break; |
602 | 118 | } |
603 | | |
604 | 118 | } /*dissect_zcl_fan_control_attr_data*/ |
605 | | |
606 | | |
607 | | /** |
608 | | *ZigBee ZCL Fan Control cluster protocol registration routine. |
609 | | * |
610 | | */ |
611 | | void |
612 | | proto_register_zbee_zcl_fan_control(void) |
613 | 16 | { |
614 | | /* Setup list of header fields */ |
615 | 16 | static hf_register_info hf[] = { |
616 | | |
617 | 16 | { &hf_zbee_zcl_fan_control_attr_id, |
618 | 16 | { "Attribute", "zbee_zcl_hvac.fan_control.attr_id", FT_UINT16, BASE_HEX, VALS(zbee_zcl_fan_control_attr_names), |
619 | 16 | 0x00, NULL, HFILL } }, |
620 | | |
621 | 16 | { &hf_zbee_zcl_fan_control_attr_fan_mode, |
622 | 16 | { "Fan Mode", "zbee_zcl_hvac.fan_control.attr.fan_mode", FT_UINT8, BASE_HEX, VALS(zbee_zcl_fan_control_fan_mode_names), |
623 | 16 | 0x00, NULL, HFILL } }, |
624 | | |
625 | 16 | { &hf_zbee_zcl_fan_control_attr_fan_mode_seq, |
626 | 16 | { "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), |
627 | 16 | 0x00, NULL, HFILL } } |
628 | 16 | }; |
629 | | |
630 | | /* ZCL Fan Control subtrees */ |
631 | 16 | static int *ett[ZBEE_ZCL_FAN_CONTROL_NUM_ETT]; |
632 | | |
633 | 16 | ett[0] = &ett_zbee_zcl_fan_control; |
634 | | |
635 | | /* Register the ZigBee ZCL Fan Control cluster protocol name and description */ |
636 | 16 | proto_zbee_zcl_fan_control = proto_register_protocol("ZigBee ZCL Fan Control", "ZCL Fan Control", ZBEE_PROTOABBREV_ZCL_FAN_CONTROL); |
637 | 16 | proto_register_field_array(proto_zbee_zcl_fan_control, hf, array_length(hf)); |
638 | 16 | proto_register_subtree_array(ett, array_length(ett)); |
639 | | |
640 | | /* Register the ZigBee ZCL Fan Control dissector. */ |
641 | 16 | register_dissector(ZBEE_PROTOABBREV_ZCL_FAN_CONTROL, dissect_zbee_zcl_fan_control, proto_zbee_zcl_fan_control); |
642 | 16 | } /*proto_register_zbee_zcl_fan_control*/ |
643 | | |
644 | | /** |
645 | | *Hands off the ZCL Fan Control dissector. |
646 | | * |
647 | | */ |
648 | | void |
649 | | proto_reg_handoff_zbee_zcl_fan_control(void) |
650 | 16 | { |
651 | 16 | zbee_zcl_init_cluster( ZBEE_PROTOABBREV_ZCL_FAN_CONTROL, |
652 | 16 | proto_zbee_zcl_fan_control, |
653 | 16 | ett_zbee_zcl_fan_control, |
654 | 16 | ZBEE_ZCL_CID_FAN_CONTROL, |
655 | 16 | ZBEE_MFG_CODE_NONE, |
656 | 16 | hf_zbee_zcl_fan_control_attr_id, |
657 | 16 | hf_zbee_zcl_fan_control_attr_id, |
658 | 16 | -1, -1, |
659 | 16 | dissect_zcl_fan_control_attr_data |
660 | 16 | ); |
661 | 16 | } /*proto_reg_handoff_zbee_zcl_fan_control*/ |
662 | | |
663 | | |
664 | | /* ########################################################################## */ |
665 | | /* #### (0x0203) DEHUMIDIFICATION CONTROL CLUSTER ########################### */ |
666 | | /* ########################################################################## */ |
667 | | |
668 | | /*************************/ |
669 | | /* Defines */ |
670 | | /*************************/ |
671 | | |
672 | | #define ZBEE_ZCL_DEHUMIDIFICATION_CONTROL_NUM_ETT 1 |
673 | | |
674 | | /*Attributes*/ |
675 | 5 | #define ZBEE_ZCL_ATTR_ID_DEHUMIDIFICATION_CONTROL_RELATIVE_HUMIDITY 0x0000 /* Relative Humidity */ |
676 | 6 | #define ZBEE_ZCL_ATTR_ID_DEHUMIDIFICATION_CONTROL_DEHUM_COOLING 0x0001 /* Dehumidification Cooling */ |
677 | 7 | #define ZBEE_ZCL_ATTR_ID_DEHUMIDIFICATION_CONTROL_RH_DEHUM_SETPOINT 0x0010 /* Relative Humidity Dehumidification Setpoint */ |
678 | 0 | #define ZBEE_ZCL_ATTR_ID_DEHUMIDIFICATION_CONTROL_RELATIVE_HUMIDITY_MODE 0x0011 /* Relative Humidity Mode */ |
679 | 1 | #define ZBEE_ZCL_ATTR_ID_DEHUMIDIFICATION_CONTROL_DEHUM_LOCKOUT 0x0012 /* Dehumidification Lockout */ |
680 | 7 | #define ZBEE_ZCL_ATTR_ID_DEHUMIDIFICATION_CONTROL_DEHUM_HYSTERESIS 0x0013 /* Dehumidification Hysteresis */ |
681 | 7 | #define ZBEE_ZCL_ATTR_ID_DEHUMIDIFICATION_CONTROL_DEHUM_MAX_COOL 0x0014 /* Dehumidification Max Cool */ |
682 | 0 | #define ZBEE_ZCL_ATTR_ID_DEHUMIDIFICATION_CONTROL_RELATIVE_HUMIDITY_DISPLAY 0x0015 /* Relative Humidity Display */ |
683 | | |
684 | | /*Server commands received - none*/ |
685 | | |
686 | | /*Server commands generated - none*/ |
687 | | |
688 | | /*************************/ |
689 | | /* Function Declarations */ |
690 | | /*************************/ |
691 | | |
692 | | void proto_register_zbee_zcl_dehumidification_control(void); |
693 | | void proto_reg_handoff_zbee_zcl_dehumidification_control(void); |
694 | | |
695 | | /* Private functions prototype */ |
696 | | |
697 | | /*************************/ |
698 | | /* Global Variables */ |
699 | | /*************************/ |
700 | | /* Initialize the protocol and registered fields */ |
701 | | static int proto_zbee_zcl_dehumidification_control; |
702 | | |
703 | | static int hf_zbee_zcl_dehumidification_control_attr_id; |
704 | | static int hf_zbee_zcl_dehumidification_control_attr_rel_hum_mode; |
705 | | static int hf_zbee_zcl_dehumidification_control_attr_dehum_lockout; |
706 | | static int hf_zbee_zcl_dehumidification_control_attr_rel_hum_display; |
707 | | |
708 | | /* Initialize the subtree pointers */ |
709 | | static int ett_zbee_zcl_dehumidification_control; |
710 | | |
711 | | /* Attributes */ |
712 | | static const value_string zbee_zcl_dehumidification_control_attr_names[] = { |
713 | | { ZBEE_ZCL_ATTR_ID_DEHUMIDIFICATION_CONTROL_RELATIVE_HUMIDITY, "Relative Humidity" }, |
714 | | { ZBEE_ZCL_ATTR_ID_DEHUMIDIFICATION_CONTROL_DEHUM_COOLING, "Dehumidification Cooling" }, |
715 | | { ZBEE_ZCL_ATTR_ID_DEHUMIDIFICATION_CONTROL_RH_DEHUM_SETPOINT, "Relative Humidity Dehumidification Setpoint" }, |
716 | | { ZBEE_ZCL_ATTR_ID_DEHUMIDIFICATION_CONTROL_RELATIVE_HUMIDITY_MODE, "Relative Humidity Mode" }, |
717 | | { ZBEE_ZCL_ATTR_ID_DEHUMIDIFICATION_CONTROL_DEHUM_LOCKOUT, "Dehumidification Lockout" }, |
718 | | { ZBEE_ZCL_ATTR_ID_DEHUMIDIFICATION_CONTROL_DEHUM_HYSTERESIS, "Dehumidification Hysteresis" }, |
719 | | { ZBEE_ZCL_ATTR_ID_DEHUMIDIFICATION_CONTROL_DEHUM_MAX_COOL, "Dehumidification Max Cool" }, |
720 | | { ZBEE_ZCL_ATTR_ID_DEHUMIDIFICATION_CONTROL_RELATIVE_HUMIDITY_DISPLAY, "Relative Humidity Display" }, |
721 | | { 0, NULL } |
722 | | }; |
723 | | |
724 | | /*Relative Humidity Mode Values*/ |
725 | | static const value_string zbee_zcl_dehumidification_control_rel_hum_mode_names[] = { |
726 | | { 0x00, "Relative Humidity measured locally" }, |
727 | | { 0x01, "Relative Humidity updated over network" }, |
728 | | { 0, NULL} |
729 | | }; |
730 | | |
731 | | /*Dehumidification Lockout Values*/ |
732 | | static const value_string zbee_zcl_dehumidification_control_dehum_lockout_names[] = { |
733 | | { 0x00, "Dehumidification is not allowed" }, |
734 | | { 0x01, "Dehumidification is allowed" }, |
735 | | { 0, NULL} |
736 | | }; |
737 | | |
738 | | /*Relative Humidity Display Values*/ |
739 | | static const value_string zbee_zcl_dehumidification_control_rel_hum_display_names[] = { |
740 | | { 0x00, "Relative Humidity is not displayed" }, |
741 | | { 0x01, "Relative Humidity is displayed" }, |
742 | | { 0, NULL} |
743 | | }; |
744 | | |
745 | | /*************************/ |
746 | | /* Function Bodies */ |
747 | | /*************************/ |
748 | | |
749 | | /** |
750 | | *ZigBee ZCL Dehumidification Control cluster dissector for wireshark. |
751 | | * |
752 | | *@param tvb pointer to buffer containing raw packet. |
753 | | *@param pinfo pointer to packet information fields |
754 | | *@param tree pointer to data tree Wireshark uses to display packet. |
755 | | */ |
756 | | |
757 | | static int |
758 | | dissect_zbee_zcl_dehumidification_control(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void* data _U_) |
759 | 1 | { |
760 | 1 | return tvb_captured_length(tvb); |
761 | 1 | } /*dissect_zbee_zcl_dehumidification_control*/ |
762 | | |
763 | | |
764 | | /** |
765 | | *This function is called by ZCL foundation dissector in order to decode |
766 | | * |
767 | | *@param tree pointer to data tree Wireshark uses to display packet. |
768 | | *@param tvb pointer to buffer containing raw packet. |
769 | | *@param offset pointer to buffer offset |
770 | | *@param attr_id attribute identifier |
771 | | *@param data_type attribute data type |
772 | | *@param client_attr ZCL client |
773 | | */ |
774 | | static void |
775 | | dissect_zcl_dehumidification_control_attr_data(proto_tree *tree, packet_info* pinfo, tvbuff_t *tvb, unsigned *offset, uint16_t attr_id, unsigned data_type, bool client_attr) |
776 | 19 | { |
777 | | /* Dissect attribute data type and data */ |
778 | 19 | switch (attr_id) { |
779 | | |
780 | 0 | case ZBEE_ZCL_ATTR_ID_DEHUMIDIFICATION_CONTROL_RELATIVE_HUMIDITY_MODE: |
781 | 0 | proto_tree_add_item(tree, hf_zbee_zcl_dehumidification_control_attr_rel_hum_mode, tvb, *offset, 1, ENC_NA); |
782 | 0 | *offset += 1; |
783 | 0 | break; |
784 | | |
785 | 1 | case ZBEE_ZCL_ATTR_ID_DEHUMIDIFICATION_CONTROL_DEHUM_LOCKOUT: |
786 | 1 | proto_tree_add_item(tree, hf_zbee_zcl_dehumidification_control_attr_dehum_lockout, tvb, *offset, 1, ENC_NA); |
787 | 1 | *offset += 1; |
788 | 1 | break; |
789 | | |
790 | 0 | case ZBEE_ZCL_ATTR_ID_DEHUMIDIFICATION_CONTROL_RELATIVE_HUMIDITY_DISPLAY: |
791 | 0 | proto_tree_add_item(tree, hf_zbee_zcl_dehumidification_control_attr_rel_hum_display, tvb, *offset, 1, ENC_NA); |
792 | 0 | *offset += 1; |
793 | 0 | break; |
794 | | |
795 | 5 | case ZBEE_ZCL_ATTR_ID_DEHUMIDIFICATION_CONTROL_RELATIVE_HUMIDITY: |
796 | 6 | case ZBEE_ZCL_ATTR_ID_DEHUMIDIFICATION_CONTROL_DEHUM_COOLING: |
797 | 7 | case ZBEE_ZCL_ATTR_ID_DEHUMIDIFICATION_CONTROL_RH_DEHUM_SETPOINT: |
798 | 7 | case ZBEE_ZCL_ATTR_ID_DEHUMIDIFICATION_CONTROL_DEHUM_HYSTERESIS: |
799 | 7 | case ZBEE_ZCL_ATTR_ID_DEHUMIDIFICATION_CONTROL_DEHUM_MAX_COOL: |
800 | 18 | default: |
801 | 18 | dissect_zcl_attr_data(tvb, pinfo, tree, offset, data_type, client_attr); |
802 | 18 | break; |
803 | 19 | } |
804 | | |
805 | 19 | } /*dissect_zcl_dehumidification_control_attr_data*/ |
806 | | |
807 | | |
808 | | /** |
809 | | *ZigBee ZCL Dehumidification Control cluster protocol registration routine. |
810 | | * |
811 | | */ |
812 | | void |
813 | | proto_register_zbee_zcl_dehumidification_control(void) |
814 | 16 | { |
815 | | /* Setup list of header fields */ |
816 | 16 | static hf_register_info hf[] = { |
817 | | |
818 | 16 | { &hf_zbee_zcl_dehumidification_control_attr_id, |
819 | 16 | { "Attribute", "zbee_zcl_hvac.dehumidification_control.attr_id", FT_UINT16, BASE_HEX, VALS(zbee_zcl_dehumidification_control_attr_names), |
820 | 16 | 0x00, NULL, HFILL } }, |
821 | | |
822 | 16 | { &hf_zbee_zcl_dehumidification_control_attr_rel_hum_mode, |
823 | 16 | { "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), |
824 | 16 | 0x00, NULL, HFILL } }, |
825 | | |
826 | 16 | { &hf_zbee_zcl_dehumidification_control_attr_dehum_lockout, |
827 | 16 | { "Dehumidification Lockout", "zbee_zcl_hvac.dehumidification_control.attr.dehumidification_lockout", FT_UINT8, BASE_HEX, VALS(zbee_zcl_dehumidification_control_dehum_lockout_names), |
828 | 16 | 0x00, NULL, HFILL } }, |
829 | | |
830 | 16 | { &hf_zbee_zcl_dehumidification_control_attr_rel_hum_display, |
831 | 16 | { "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), |
832 | 16 | 0x00, NULL, HFILL } } |
833 | 16 | }; |
834 | | |
835 | | /* ZCL Dehumidification Control subtrees */ |
836 | 16 | static int *ett[ZBEE_ZCL_DEHUMIDIFICATION_CONTROL_NUM_ETT]; |
837 | | |
838 | 16 | ett[0] = &ett_zbee_zcl_dehumidification_control; |
839 | | |
840 | | /* Register the ZigBee ZCL Dehumidification Control cluster protocol name and description */ |
841 | 16 | proto_zbee_zcl_dehumidification_control = proto_register_protocol("ZigBee ZCL Dehumidification Control", "ZCL Dehumidification Control", ZBEE_PROTOABBREV_ZCL_DEHUMIDIFICATION_CONTROL); |
842 | 16 | proto_register_field_array(proto_zbee_zcl_dehumidification_control, hf, array_length(hf)); |
843 | 16 | proto_register_subtree_array(ett, array_length(ett)); |
844 | | |
845 | | /* Register the ZigBee ZCL Dehumidification Control dissector. */ |
846 | 16 | register_dissector(ZBEE_PROTOABBREV_ZCL_DEHUMIDIFICATION_CONTROL, dissect_zbee_zcl_dehumidification_control, proto_zbee_zcl_dehumidification_control); |
847 | 16 | } /*proto_register_zbee_zcl_dehumidification_control*/ |
848 | | |
849 | | /** |
850 | | *Hands off the ZCL Dehumidification Control dissector. |
851 | | * |
852 | | */ |
853 | | void |
854 | | proto_reg_handoff_zbee_zcl_dehumidification_control(void) |
855 | 16 | { |
856 | 16 | zbee_zcl_init_cluster( ZBEE_PROTOABBREV_ZCL_DEHUMIDIFICATION_CONTROL, |
857 | 16 | proto_zbee_zcl_dehumidification_control, |
858 | 16 | ett_zbee_zcl_dehumidification_control, |
859 | 16 | ZBEE_ZCL_CID_DEHUMIDIFICATION_CONTROL, |
860 | 16 | ZBEE_MFG_CODE_NONE, |
861 | 16 | hf_zbee_zcl_dehumidification_control_attr_id, |
862 | 16 | hf_zbee_zcl_dehumidification_control_attr_id, |
863 | 16 | -1, -1, |
864 | 16 | dissect_zcl_dehumidification_control_attr_data |
865 | 16 | ); |
866 | 16 | } /*proto_reg_handoff_zbee_zcl_dehumidification_control*/ |
867 | | |
868 | | |
869 | | /* ########################################################################## */ |
870 | | /* #### (0x0204) THERMOSTAT USER INTERFACE CONFIGURATION CLUSTER ############ */ |
871 | | /* ########################################################################## */ |
872 | | |
873 | | /*************************/ |
874 | | /* Defines */ |
875 | | /*************************/ |
876 | | |
877 | | #define ZBEE_ZCL_THERMOSTAT_UI_CONFIG_NUM_ETT 1 |
878 | | |
879 | | /*Attributes*/ |
880 | 149 | #define ZBEE_ZCL_ATTR_ID_THERMOSTAT_UI_CONFIG_TEMP_DISP_MODE 0x0000 /* Temperature Display Mode */ |
881 | 11 | #define ZBEE_ZCL_ATTR_ID_THERMOSTAT_UI_CONFIG_KEYPAD_LOCKOUT 0x0001 /* Keypad Lockout */ |
882 | | |
883 | | /*Server commands received - none*/ |
884 | | |
885 | | /*Server commands generated - none*/ |
886 | | |
887 | | /*************************/ |
888 | | /* Function Declarations */ |
889 | | /*************************/ |
890 | | |
891 | | void proto_register_zbee_zcl_thermostat_ui_config(void); |
892 | | void proto_reg_handoff_zbee_zcl_thermostat_ui_config(void); |
893 | | |
894 | | /* Private functions prototype */ |
895 | | |
896 | | /*************************/ |
897 | | /* Global Variables */ |
898 | | /*************************/ |
899 | | /* Initialize the protocol and registered fields */ |
900 | | static int proto_zbee_zcl_thermostat_ui_config; |
901 | | |
902 | | static int hf_zbee_zcl_thermostat_ui_config_attr_id; |
903 | | static int hf_zbee_zcl_thermostat_ui_config_attr_temp_disp_mode; |
904 | | static int hf_zbee_zcl_thermostat_ui_config_attr_keypad_lockout; |
905 | | |
906 | | /* Initialize the subtree pointers */ |
907 | | static int ett_zbee_zcl_thermostat_ui_config; |
908 | | |
909 | | /* Attributes */ |
910 | | static const value_string zbee_zcl_thermostat_ui_config_attr_names[] = { |
911 | | { ZBEE_ZCL_ATTR_ID_THERMOSTAT_UI_CONFIG_TEMP_DISP_MODE, "Temperature Display Mode" }, |
912 | | { ZBEE_ZCL_ATTR_ID_THERMOSTAT_UI_CONFIG_KEYPAD_LOCKOUT, "Keypad Lockout" }, |
913 | | { 0, NULL } |
914 | | }; |
915 | | |
916 | | /*Temp Display Mode Values*/ |
917 | | static const value_string zbee_zcl_thermostat_ui_config_temp_disp_mode_names[] = { |
918 | | { 0x00, "Temperature in degree Celsius" }, |
919 | | { 0x01, "Temperature in degree Fahrenheit" }, |
920 | | { 0, NULL} |
921 | | }; |
922 | | |
923 | | /*Keypad Lockout Values*/ |
924 | | static const value_string zbee_zcl_thermostat_ui_config_keypad_lockout_names[] = { |
925 | | { 0x00, "No lockout" }, |
926 | | { 0x01, "Level 1 lockout" }, |
927 | | { 0x02, "Level 2 lockout" }, |
928 | | { 0x03, "Level 3 lockout" }, |
929 | | { 0x04, "Level 4 lockout" }, |
930 | | { 0x05, "Level 5 lockout" }, |
931 | | { 0, NULL} |
932 | | }; |
933 | | |
934 | | /*************************/ |
935 | | /* Function Bodies */ |
936 | | /*************************/ |
937 | | |
938 | | /** |
939 | | *ZigBee ZCL Thermostat User Interface Configuration cluster dissector for wireshark. |
940 | | * |
941 | | *@param tvb pointer to buffer containing raw packet. |
942 | | *@param pinfo pointer to packet information fields |
943 | | *@param tree pointer to data tree Wireshark uses to display packet. |
944 | | */ |
945 | | |
946 | | static int |
947 | | dissect_zbee_zcl_thermostat_ui_config(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void* data _U_) |
948 | 1 | { |
949 | 1 | return tvb_captured_length(tvb); |
950 | 1 | } /*dissect_zbee_zcl_thermostat_ui_config*/ |
951 | | |
952 | | |
953 | | /** |
954 | | *This function is called by ZCL foundation dissector in order to decode |
955 | | * |
956 | | *@param tree pointer to data tree Wireshark uses to display packet. |
957 | | *@param tvb pointer to buffer containing raw packet. |
958 | | *@param offset pointer to buffer offset |
959 | | *@param attr_id attribute identifier |
960 | | *@param data_type attribute data type |
961 | | *@param client_attr ZCL client |
962 | | */ |
963 | | static void |
964 | | dissect_zcl_thermostat_ui_config_attr_data(proto_tree *tree, packet_info* pinfo, tvbuff_t *tvb, unsigned *offset, uint16_t attr_id, unsigned data_type, bool client_attr) |
965 | 740 | { |
966 | | /* Dissect attribute data type and data */ |
967 | 740 | switch (attr_id) { |
968 | | |
969 | 149 | case ZBEE_ZCL_ATTR_ID_THERMOSTAT_UI_CONFIG_TEMP_DISP_MODE: |
970 | 149 | proto_tree_add_item(tree, hf_zbee_zcl_thermostat_ui_config_attr_temp_disp_mode, tvb, *offset, 1, ENC_NA); |
971 | 149 | *offset += 1; |
972 | 149 | break; |
973 | | |
974 | 11 | case ZBEE_ZCL_ATTR_ID_THERMOSTAT_UI_CONFIG_KEYPAD_LOCKOUT: |
975 | 11 | proto_tree_add_item(tree, hf_zbee_zcl_thermostat_ui_config_attr_keypad_lockout, tvb, *offset, 1, ENC_NA); |
976 | 11 | *offset += 1; |
977 | 11 | break; |
978 | | |
979 | 580 | default: |
980 | 580 | dissect_zcl_attr_data(tvb, pinfo, tree, offset, data_type, client_attr); |
981 | 580 | break; |
982 | 740 | } |
983 | | |
984 | 740 | } /*dissect_zcl_thermostat_ui_config_attr_data*/ |
985 | | |
986 | | |
987 | | /** |
988 | | *ZigBee ZCL Thermostat User Interface Configuration cluster protocol registration routine. |
989 | | * |
990 | | */ |
991 | | void |
992 | | proto_register_zbee_zcl_thermostat_ui_config(void) |
993 | 16 | { |
994 | | /* Setup list of header fields */ |
995 | 16 | static hf_register_info hf[] = { |
996 | | |
997 | 16 | { &hf_zbee_zcl_thermostat_ui_config_attr_id, |
998 | 16 | { "Attribute", "zbee_zcl_hvac.thermostat_ui_config.attr_id", FT_UINT16, BASE_HEX, VALS(zbee_zcl_thermostat_ui_config_attr_names), |
999 | 16 | 0x00, NULL, HFILL } }, |
1000 | | |
1001 | 16 | { &hf_zbee_zcl_thermostat_ui_config_attr_temp_disp_mode, |
1002 | 16 | { "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), |
1003 | 16 | 0x00, NULL, HFILL } }, |
1004 | | |
1005 | 16 | { &hf_zbee_zcl_thermostat_ui_config_attr_keypad_lockout, |
1006 | 16 | { "Keypad Lockout", "zbee_zcl_hvac.thermostat_ui_config.attr.keypad_lockout", FT_UINT8, BASE_HEX, VALS(zbee_zcl_thermostat_ui_config_keypad_lockout_names), |
1007 | 16 | 0x00, NULL, HFILL } } |
1008 | 16 | }; |
1009 | | |
1010 | | /* ZCL Thermostat User Interface Configuration subtrees */ |
1011 | 16 | static int *ett[ZBEE_ZCL_THERMOSTAT_UI_CONFIG_NUM_ETT]; |
1012 | 16 | ett[0] = &ett_zbee_zcl_thermostat_ui_config; |
1013 | | |
1014 | | /* Register the ZigBee ZCL Thermostat User Interface Configuration cluster protocol name and description */ |
1015 | 16 | 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); |
1016 | 16 | proto_register_field_array(proto_zbee_zcl_thermostat_ui_config, hf, array_length(hf)); |
1017 | 16 | proto_register_subtree_array(ett, array_length(ett)); |
1018 | | |
1019 | | /* Register the ZigBee ZCL Thermostat User Interface Configuration dissector. */ |
1020 | 16 | register_dissector(ZBEE_PROTOABBREV_ZCL_THERMOSTAT_UI_CONFIG, dissect_zbee_zcl_thermostat_ui_config, proto_zbee_zcl_thermostat_ui_config); |
1021 | 16 | } /*proto_register_zbee_zcl_thermostat_ui_config*/ |
1022 | | |
1023 | | /** |
1024 | | *Hands off the ZCL Thermostat User Interface Configuration dissector. |
1025 | | * |
1026 | | */ |
1027 | | void |
1028 | | proto_reg_handoff_zbee_zcl_thermostat_ui_config(void) |
1029 | 16 | { |
1030 | 16 | zbee_zcl_init_cluster( ZBEE_PROTOABBREV_ZCL_THERMOSTAT_UI_CONFIG, |
1031 | 16 | proto_zbee_zcl_thermostat_ui_config, |
1032 | 16 | ett_zbee_zcl_thermostat_ui_config, |
1033 | 16 | ZBEE_ZCL_CID_THERMOSTAT_UI_CONFIG, |
1034 | 16 | ZBEE_MFG_CODE_NONE, |
1035 | 16 | hf_zbee_zcl_thermostat_ui_config_attr_id, |
1036 | 16 | hf_zbee_zcl_thermostat_ui_config_attr_id, |
1037 | 16 | -1, -1, |
1038 | 16 | dissect_zcl_thermostat_ui_config_attr_data |
1039 | 16 | ); |
1040 | 16 | } /*proto_reg_handoff_zbee_zcl_thermostat_ui_config*/ |
1041 | | |
1042 | | /* |
1043 | | * Editor modelines - https://www.wireshark.org/tools/modelines.html |
1044 | | * |
1045 | | * Local variables: |
1046 | | * c-basic-offset: 4 |
1047 | | * tab-width: 8 |
1048 | | * indent-tabs-mode: nil |
1049 | | * End: |
1050 | | * |
1051 | | * vi: set shiftwidth=4 tabstop=8 expandtab: |
1052 | | * :indentSize=4:tabSize=8:noTabs=true: |
1053 | | */ |