1 /* packet-zbee-zcl-lighting.c
2 * Dissector routines for the ZigBee ZCL Lighting clusters
3 * Color Control, Ballast Configuration
4 * By Aditya Jain <aditya.jain@samsung.com>
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
10 * SPDX-License-Identifier: GPL-2.0-or-later
16 #include <epan/packet.h>
17 #include <epan/to_str.h>
19 #include "packet-zbee.h"
20 #include "packet-zbee-aps.h"
21 #include "packet-zbee-zcl.h"
23 /* ########################################################################## */
24 /* #### (0x0300) COLOR CONTROL CLUSTER ###################################### */
25 /* ########################################################################## */
27 /*************************/
29 /*************************/
31 #define ZBEE_ZCL_COLOR_CONTROL_NUM_ETT 3
33 #define ZBEE_ZCL_COLOR_CAPABILITIES_SUPPORT_HS_MASK 0x0001 /* bit 0 */
34 #define ZBEE_ZCL_COLOR_CAPABILITIES_SUPPORT_EHS_MASK 0x0002 /* bit 1 */
35 #define ZBEE_ZCL_COLOR_CAPABILITIES_SUPPORT_LOOP_MASK 0x0004 /* bit 2 */
36 #define ZBEE_ZCL_COLOR_CAPABILITIES_SUPPORT_XY_MASK 0x0008 /* bit 3 */
37 #define ZBEE_ZCL_COLOR_CAPABILITIES_SUPPORT_CT_MASK 0x0010 /* bit 4 */
38 #define ZBEE_ZCL_COLOR_LOOP_UPDATE_ACTION_MASK 0x01 /* bit 0 */
39 #define ZBEE_ZCL_COLOR_LOOP_UPDATE_DIRECTION_MASK 0x02 /* bit 1 */
40 #define ZBEE_ZCL_COLOR_LOOP_UPDATE_TIME_MASK 0x04 /* bit 2 */
41 #define ZBEE_ZCL_COLOR_LOOP_UPDATE_START_HUE_MASK 0x08 /* bit 3 */
44 #define ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_CURRENT_HUE 0x0000 /* Current Hue */
45 #define ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_CURRENT_SATURATION 0x0001 /* Current Saturation */
46 #define ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_REMAINING_TIME 0x0002 /* Remaining Time */
47 #define ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_CURRENT_X 0x0003 /* Current X */
48 #define ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_CURRENT_Y 0x0004 /* Current Y */
49 #define ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_DRIFT_COMPENSATION 0x0005 /* Drift Compensation */
50 #define ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COMPENSATION_TEXT 0x0006 /* Compensation Text */
51 #define ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_TEMP 0x0007 /* Color Temperature */
52 #define ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_MODE 0x0008 /* Color Mode */
53 #define ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_NO_OF_PRIMARIES 0x0010 /* Number of Primaries */
54 #define ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_1_X 0x0011 /* Primary 1X */
55 #define ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_1_Y 0x0012 /* Primary 1Y */
56 #define ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_1_INTENSITY 0x0013 /* Primary 1intensity */
57 #define ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_2_X 0x0015 /* Primary 2X */
58 #define ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_2_Y 0x0016 /* Primary 2Y */
59 #define ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_2_INTENSITY 0x0017 /* Primary 2intensity */
60 #define ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_3_X 0x0019 /* Primary 3X */
61 #define ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_3_Y 0x001a /* Primary 3Y */
62 #define ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_3_INTENSITY 0x001b /* Primary 3intensity */
63 #define ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_4_X 0x0020 /* Primary 4X */
64 #define ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_4_Y 0x0021 /* Primary 4Y */
65 #define ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_4_INTENSITY 0x0022 /* Primary 4intensity */
66 #define ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_5_X 0x0024 /* Primary 5X */
67 #define ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_5_Y 0x0025 /* Primary 5Y */
68 #define ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_5_INTENSITY 0x0026 /* Primary 5intensity */
69 #define ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_6_X 0x0028 /* Primary 6X */
70 #define ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_6_Y 0x0029 /* Primary 6Y */
71 #define ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_6_INTENSITY 0x002a /* Primary 6intensity */
72 #define ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_WHITE_POINT_X 0x0030 /* White Point X */
73 #define ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_WHITE_POINT_Y 0x0031 /* White Point Y */
74 #define ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_POINT_R_X 0x0032 /* Color Point RX */
75 #define ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_POINT_R_Y 0x0033 /* Color Point RY */
76 #define ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_POINT_R_INTENSITY 0x0034 /* Color Point Rintensity */
77 #define ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_POINT_G_X 0x0036 /* Color Point GX */
78 #define ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_POINT_G_Y 0x0037 /* Color Point GY */
79 #define ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_POINT_G_INTENSITY 0x0038 /* Color Point Gintensity */
80 #define ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_POINT_B_X 0x003a /* Color Point BX */
81 #define ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_POINT_B_Y 0x003b /* Color Point BY */
82 #define ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_POINT_B_INTENSITY 0x003c /* Color Point Bintensity */
83 #define ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_ENHANCED_CURRENT_HUE 0x4000 /* Enhanced Current Hue */
84 #define ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_ENHANCED_COLOR_MODE 0x4001 /* Enhanced Color Mode */
85 #define ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_LOOP_ACTIVE 0x4002 /* Color Loop Active */
86 #define ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_LOOP_DIRECTION 0x4003 /* Color Loop Direction */
87 #define ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_LOOP_TIME 0x4004 /* Color Loop Time */
88 #define ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_LOOP_START_ENH_HUE 0x4005 /* Color Loop Start Enhanced Hue */
89 #define ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_LOOP_STORED_ENH_HUE 0x4006 /* Color Loop Stored Enhanced Hue */
90 #define ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_CAPABILITIES 0x400a /* Color Capabilities */
91 #define ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_TEMPERATURE_PHYS_MIN 0x400b /* Color Temperature Physical Min */
92 #define ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_TEMPERATURE_PHYS_MAX 0x400c /* Color Temperature Physical Max */
93 #define ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_STARTUP_COLOR_TEMPERATURE 0x4010 /* Startup Color Temperature */
95 /* Server Commands Received */
96 #define ZBEE_ZCL_CMD_ID_COLOR_CONTROL_MOVE_TO_HUE 0x00 /* Move to Hue */
97 #define ZBEE_ZCL_CMD_ID_COLOR_CONTROL_MOVE_HUE 0x01 /* Move Hue */
98 #define ZBEE_ZCL_CMD_ID_COLOR_CONTROL_STEP_HUE 0x02 /* Step Hue */
99 #define ZBEE_ZCL_CMD_ID_COLOR_CONTROL_MOVE_TO_SATURATION 0x03 /* Move to Saturation */
100 #define ZBEE_ZCL_CMD_ID_COLOR_CONTROL_MOVE_SATURATION 0x04 /* Move Saturation */
101 #define ZBEE_ZCL_CMD_ID_COLOR_CONTROL_STEP_SATURATION 0x05 /* Step Saturation */
102 #define ZBEE_ZCL_CMD_ID_COLOR_CONTROL_MOVE_TO_HUE_AND_SATURATION 0x06 /* Move to Hue and Saturation */
103 #define ZBEE_ZCL_CMD_ID_COLOR_CONTROL_MOVE_TO_COLOR 0x07 /* Move to Color */
104 #define ZBEE_ZCL_CMD_ID_COLOR_CONTROL_MOVE_COLOR 0x08 /* Move Color */
105 #define ZBEE_ZCL_CMD_ID_COLOR_CONTROL_STEP_COLOR 0x09 /* Step Color */
106 #define ZBEE_ZCL_CMD_ID_COLOR_CONTROL_MOVE_TO_COLOR_TEMP 0x0a /* Move to Color Temperature */
107 #define ZBEE_ZCL_CMD_ID_COLOR_CONTROL_ENHANCED_MOVE_TO_HUE 0x40 /* Enhanced Move to Hue */
108 #define ZBEE_ZCL_CMD_ID_COLOR_CONTROL_ENHANCED_MOVE_HUE 0x41 /* Enhanced Move Hue */
109 #define ZBEE_ZCL_CMD_ID_COLOR_CONTROL_ENHANCED_STEP_HUE 0x42 /* Enhanced Step Hue */
110 #define ZBEE_ZCL_CMD_ID_COLOR_CONTROL_ENHANCED_MOVE_TO_HUE_AND_SATURATION 0x43 /* Enhanced Move to Hue and Saturation */
111 #define ZBEE_ZCL_CMD_ID_COLOR_CONTROL_COLOR_LOOP_SET 0x44 /* Color Loop Set */
112 #define ZBEE_ZCL_CMD_ID_COLOR_CONTROL_STOP_MOVE_STEP 0x47 /* Stop Move Step */
113 #define ZBEE_ZCL_CMD_ID_COLOR_CONTROL_MOVE_COLOR_TEMP 0x4b /* Move Color Temperature */
114 #define ZBEE_ZCL_CMD_ID_COLOR_CONTROL_STEP_COLOR_TEMP 0x4c /* Step Color Temperature */
116 #define ZBEE_ZCL_NORMAL_HUE false
117 #define ZBEE_ZCL_ENHANCED_HUE true
119 /* Server Commands Generated - None */
121 /*************************/
122 /* Function Declarations */
123 /*************************/
125 void proto_register_zbee_zcl_color_control(void);
126 void proto_reg_handoff_zbee_zcl_color_control(void);
128 /* Command Dissector Helpers */
129 static void dissect_zcl_color_control_move_to_hue (tvbuff_t
*tvb
, proto_tree
*tree
, unsigned *offset
, bool enhanced
);
130 static void dissect_zcl_color_control_move_hue_saturation (tvbuff_t
*tvb
, proto_tree
*tree
, unsigned *offset
, bool enhanced
);
131 static void dissect_zcl_color_control_step_hue_saturation (tvbuff_t
*tvb
, proto_tree
*tree
, unsigned *offset
, bool enhanced
);
132 static void dissect_zcl_color_control_move_to_saturation (tvbuff_t
*tvb
, proto_tree
*tree
, unsigned *offset
);
133 static void dissect_zcl_color_control_move_to_hue_and_saturation (tvbuff_t
*tvb
, proto_tree
*tree
, unsigned *offset
, bool enhanced
);
134 static void dissect_zcl_color_control_move_to_color (tvbuff_t
*tvb
, proto_tree
*tree
, unsigned *offset
);
135 static void dissect_zcl_color_control_move_color (tvbuff_t
*tvb
, proto_tree
*tree
, unsigned *offset
);
136 static void dissect_zcl_color_control_step_color (tvbuff_t
*tvb
, proto_tree
*tree
, unsigned *offset
);
137 static void dissect_zcl_color_control_move_to_color_temp (tvbuff_t
*tvb
, proto_tree
*tree
, unsigned *offset
);
138 static void dissect_zcl_color_control_color_loop_set (tvbuff_t
*tvb
, proto_tree
*tree
, unsigned *offset
);
139 static void dissect_zcl_color_control_move_color_temp (tvbuff_t
*tvb
, proto_tree
*tree
, unsigned *offset
);
140 static void dissect_zcl_color_control_step_color_temp (tvbuff_t
*tvb
, proto_tree
*tree
, unsigned *offset
);
142 static void dissect_zcl_color_control_attr_data (proto_tree
*tree
, tvbuff_t
*tvb
, unsigned *offset
, uint16_t attr_id
, unsigned data_type
, bool client_attr
);
144 /* Private functions prototype */
146 /*************************/
147 /* Global Variables */
148 /*************************/
149 /* Initialize the protocol and registered fields */
150 static int proto_zbee_zcl_color_control
;
152 static int hf_zbee_zcl_color_control_attr_id
;
153 static int hf_zbee_zcl_color_control_attr_current_hue
;
154 static int hf_zbee_zcl_color_control_attr_current_saturation
;
155 static int hf_zbee_zcl_color_control_attr_remaining_time
;
156 static int hf_zbee_zcl_color_control_attr_color_x
;
157 static int hf_zbee_zcl_color_control_attr_color_y
;
158 static int hf_zbee_zcl_color_control_attr_drift_compensation
;
159 static int hf_zbee_zcl_color_control_attr_color_temperature
;
160 static int hf_zbee_zcl_color_control_attr_color_mode
;
161 static int hf_zbee_zcl_color_control_attr_nr_of_primaries
;
162 static int hf_zbee_zcl_color_control_attr_primary_1_x
;
163 static int hf_zbee_zcl_color_control_attr_primary_1_y
;
164 static int hf_zbee_zcl_color_control_attr_primary_1_intensity
;
165 static int hf_zbee_zcl_color_control_attr_primary_2_x
;
166 static int hf_zbee_zcl_color_control_attr_primary_2_y
;
167 static int hf_zbee_zcl_color_control_attr_primary_2_intensity
;
168 static int hf_zbee_zcl_color_control_attr_primary_3_x
;
169 static int hf_zbee_zcl_color_control_attr_primary_3_y
;
170 static int hf_zbee_zcl_color_control_attr_primary_3_intensity
;
171 static int hf_zbee_zcl_color_control_attr_primary_4_x
;
172 static int hf_zbee_zcl_color_control_attr_primary_4_y
;
173 static int hf_zbee_zcl_color_control_attr_primary_4_intensity
;
174 static int hf_zbee_zcl_color_control_attr_primary_5_x
;
175 static int hf_zbee_zcl_color_control_attr_primary_5_y
;
176 static int hf_zbee_zcl_color_control_attr_primary_5_intensity
;
177 static int hf_zbee_zcl_color_control_attr_primary_6_x
;
178 static int hf_zbee_zcl_color_control_attr_primary_6_y
;
179 static int hf_zbee_zcl_color_control_attr_primary_6_intensity
;
180 static int hf_zbee_zcl_color_control_attr_white_point_x
;
181 static int hf_zbee_zcl_color_control_attr_white_point_y
;
182 static int hf_zbee_zcl_color_control_attr_red_x
;
183 static int hf_zbee_zcl_color_control_attr_red_y
;
184 static int hf_zbee_zcl_color_control_attr_red_intensity
;
185 static int hf_zbee_zcl_color_control_attr_green_x
;
186 static int hf_zbee_zcl_color_control_attr_green_y
;
187 static int hf_zbee_zcl_color_control_attr_green_intensity
;
188 static int hf_zbee_zcl_color_control_attr_blue_x
;
189 static int hf_zbee_zcl_color_control_attr_blue_y
;
190 static int hf_zbee_zcl_color_control_attr_blue_intensity
;
191 static int hf_zbee_zcl_color_control_attr_enhanced_current_hue
;
192 static int hf_zbee_zcl_color_control_attr_enhanced_color_mode
;
193 static int hf_zbee_zcl_color_control_attr_color_loop_active
;
194 static int hf_zbee_zcl_color_control_attr_color_loop_direction
;
195 static int hf_zbee_zcl_color_control_attr_color_loop_time
;
196 static int hf_zbee_zcl_color_control_attr_color_loop_start_enhanced_hue
;
197 static int hf_zbee_zcl_color_control_attr_color_loop_stored_enhanced_hue
;
198 static int hf_zbee_zcl_color_control_attr_color_capabilities
;
199 static int hf_zbee_zcl_color_control_attr_color_capabilities_hs
;
200 static int hf_zbee_zcl_color_control_attr_color_capabilities_ehs
;
201 static int hf_zbee_zcl_color_control_attr_color_capabilities_loop
;
202 static int hf_zbee_zcl_color_control_attr_color_capabilities_xy
;
203 static int hf_zbee_zcl_color_control_attr_color_capabilities_ct
;
204 static int hf_zbee_zcl_color_control_attr_color_temperature_phys_min
;
205 static int hf_zbee_zcl_color_control_attr_color_temperature_phys_max
;
206 static int hf_zbee_zcl_color_control_attr_startup_color_temperature
;
207 static int hf_zbee_zcl_color_control_hue
;
208 static int hf_zbee_zcl_color_control_direction
;
209 static int hf_zbee_zcl_color_control_transit_time
;
210 static int hf_zbee_zcl_color_control_move_mode
;
211 static int hf_zbee_zcl_color_control_rate
;
212 static int hf_zbee_zcl_color_control_step_mode
;
213 static int hf_zbee_zcl_color_control_step_size
;
214 static int hf_zbee_zcl_color_control_transit_time_8bit
;
215 static int hf_zbee_zcl_color_control_saturation
;
216 static int hf_zbee_zcl_color_control_color_X
;
217 static int hf_zbee_zcl_color_control_color_Y
;
218 static int hf_zbee_zcl_color_control_rate_X
;
219 static int hf_zbee_zcl_color_control_rate_Y
;
220 static int hf_zbee_zcl_color_control_step_X
;
221 static int hf_zbee_zcl_color_control_step_Y
;
222 static int hf_zbee_zcl_color_control_color_temp
;
223 static int hf_zbee_zcl_color_control_enhanced_hue
;
224 static int hf_zbee_zcl_color_control_enhanced_rate
;
225 static int hf_zbee_zcl_color_control_enhanced_step_size
;
226 static int hf_zbee_zcl_color_control_color_loop_update_flags
;
227 static int hf_zbee_zcl_color_control_color_loop_update_action
;
228 static int hf_zbee_zcl_color_control_color_loop_update_direction
;
229 static int hf_zbee_zcl_color_control_color_loop_update_time
;
230 static int hf_zbee_zcl_color_control_color_loop_update_start_hue
;
231 static int hf_zbee_zcl_color_control_color_loop_action
;
232 static int hf_zbee_zcl_color_control_color_loop_direction
;
233 static int hf_zbee_zcl_color_control_color_loop_time
;
234 static int hf_zbee_zcl_color_control_color_loop_start_hue
;
235 static int hf_zbee_zcl_color_control_color_temp_min
;
236 static int hf_zbee_zcl_color_control_color_temp_max
;
237 static int hf_zbee_zcl_color_control_srv_rx_cmd_id
;
239 /* Initialize the subtree pointers */
240 static int ett_zbee_zcl_color_control
;
241 static int ett_zbee_zcl_color_control_color_capabilities
;
242 static int ett_zbee_zcl_color_control_color_loop_settings
;
245 static const value_string zbee_zcl_color_control_attr_names
[] = {
246 { ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_CURRENT_HUE
, "Current Hue" },
247 { ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_CURRENT_SATURATION
, "Current Saturation" },
248 { ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_REMAINING_TIME
, "Remaining Time" },
249 { ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_CURRENT_X
, "Current X" },
250 { ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_CURRENT_Y
, "Current Y" },
251 { ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_DRIFT_COMPENSATION
, "Drift Compensation" },
252 { ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COMPENSATION_TEXT
, "Compensation Text" },
253 { ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_TEMP
, "Color Temperature" },
254 { ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_MODE
, "Color Mode" },
255 { ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_NO_OF_PRIMARIES
, "Number of Primaries" },
256 { ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_1_X
, "Primary 1 X" },
257 { ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_1_Y
, "Primary 1 Y" },
258 { ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_1_INTENSITY
, "Primary 1 Intensity" },
259 { ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_2_X
, "Primary 2 X" },
260 { ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_2_Y
, "Primary 2 Y" },
261 { ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_2_INTENSITY
, "Primary 2 Intensity" },
262 { ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_3_X
, "Primary 3 X" },
263 { ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_3_Y
, "Primary 3 Y" },
264 { ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_3_INTENSITY
, "Primary 3 Intensity" },
265 { ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_4_X
, "Primary 4 X" },
266 { ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_4_Y
, "Primary 4 Y" },
267 { ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_4_INTENSITY
, "Primary 4 Intensity" },
268 { ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_5_X
, "Primary 5 X" },
269 { ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_5_Y
, "Primary 5 Y" },
270 { ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_5_INTENSITY
, "Primary 5 Intensity" },
271 { ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_6_X
, "Primary 6 X" },
272 { ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_6_Y
, "Primary 6 Y" },
273 { ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_6_INTENSITY
, "Primary 6 Intensity" },
274 { ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_WHITE_POINT_X
, "White Point X" },
275 { ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_WHITE_POINT_Y
, "White Point Y" },
276 { ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_POINT_R_X
, "Color Point Red X" },
277 { ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_POINT_R_Y
, "Color Point Red Y" },
278 { ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_POINT_R_INTENSITY
, "Color Point Red Intensity" },
279 { ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_POINT_G_X
, "Color Point Green X" },
280 { ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_POINT_G_Y
, "Color Point Green Y" },
281 { ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_POINT_G_INTENSITY
, "Color Point Green Intensity" },
282 { ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_POINT_B_X
, "Color Point Blue X" },
283 { ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_POINT_B_Y
, "Color Point Blue Y" },
284 { ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_POINT_B_INTENSITY
, "Color Point Blue Intensity" },
285 { ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_ENHANCED_CURRENT_HUE
, "Enhanced Current Hue" },
286 { ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_ENHANCED_COLOR_MODE
, "Enhanced Color Mode" },
287 { ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_LOOP_ACTIVE
, "Color Loop Active" },
288 { ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_LOOP_DIRECTION
, "Color Loop Direction" },
289 { ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_LOOP_TIME
, "Color Loop Time" },
290 { ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_LOOP_START_ENH_HUE
, "Color Loop Start Enhanced Hue" },
291 { ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_LOOP_STORED_ENH_HUE
, "Color Loop Stored Enhanced Hue" },
292 { ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_CAPABILITIES
, "Color Capabilities" },
293 { ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_TEMPERATURE_PHYS_MIN
, "Color Temperature Physical Min" },
294 { ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_TEMPERATURE_PHYS_MAX
, "Color Temperature Physical Max" },
295 { ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_STARTUP_COLOR_TEMPERATURE
, "Startup Color Temperature" },
299 /* Server Commands Received */
300 static const value_string zbee_zcl_color_control_srv_rx_cmd_names
[] = {
301 { ZBEE_ZCL_CMD_ID_COLOR_CONTROL_MOVE_TO_HUE
, "Move to Hue" },
302 { ZBEE_ZCL_CMD_ID_COLOR_CONTROL_MOVE_HUE
, "Move Hue" },
303 { ZBEE_ZCL_CMD_ID_COLOR_CONTROL_STEP_HUE
, "Step Hue" },
304 { ZBEE_ZCL_CMD_ID_COLOR_CONTROL_MOVE_TO_SATURATION
, "Move to Saturation" },
305 { ZBEE_ZCL_CMD_ID_COLOR_CONTROL_MOVE_SATURATION
, "Move Saturation" },
306 { ZBEE_ZCL_CMD_ID_COLOR_CONTROL_STEP_SATURATION
, "Step Saturation" },
307 { ZBEE_ZCL_CMD_ID_COLOR_CONTROL_MOVE_TO_HUE_AND_SATURATION
, "Move to Hue and Saturation" },
308 { ZBEE_ZCL_CMD_ID_COLOR_CONTROL_MOVE_TO_COLOR
, "Move to Color" },
309 { ZBEE_ZCL_CMD_ID_COLOR_CONTROL_MOVE_COLOR
, "Move Color" },
310 { ZBEE_ZCL_CMD_ID_COLOR_CONTROL_STEP_COLOR
, "Step Color" },
311 { ZBEE_ZCL_CMD_ID_COLOR_CONTROL_MOVE_TO_COLOR_TEMP
, "Move to Color Temperature" },
312 { ZBEE_ZCL_CMD_ID_COLOR_CONTROL_ENHANCED_MOVE_TO_HUE
, "Enhanced Move to Hue" },
313 { ZBEE_ZCL_CMD_ID_COLOR_CONTROL_ENHANCED_MOVE_HUE
, "Enhanced Move Hue" },
314 { ZBEE_ZCL_CMD_ID_COLOR_CONTROL_ENHANCED_STEP_HUE
, "Enhanced Step Hue" },
315 { ZBEE_ZCL_CMD_ID_COLOR_CONTROL_ENHANCED_MOVE_TO_HUE_AND_SATURATION
, "Enhanced Move to Hue and Saturation" },
316 { ZBEE_ZCL_CMD_ID_COLOR_CONTROL_COLOR_LOOP_SET
, "Color Loop Set" },
317 { ZBEE_ZCL_CMD_ID_COLOR_CONTROL_STOP_MOVE_STEP
, "Stop Move Step" },
318 { ZBEE_ZCL_CMD_ID_COLOR_CONTROL_MOVE_COLOR_TEMP
, "Move Color Temperature" },
319 { ZBEE_ZCL_CMD_ID_COLOR_CONTROL_STEP_COLOR_TEMP
, "Step Color Temperature" },
323 /* Drift Compensation Values */
324 static const value_string zbee_zcl_color_control_drift_compensation_values
[] = {
326 { 0x01, "Other/Unknown" },
327 { 0x02, "Temperature monitoring" },
328 { 0x03, "Optical Luminance Monitoring and Feedback" },
329 { 0x04, "Optical Color Monitoring and Feedback" },
333 /* Color Mode Values */
334 static const value_string zbee_zcl_color_control_color_mode_values
[] = {
335 { 0x00, "Hue and Saturation" },
336 { 0x01, "Color X and Y" },
337 { 0x02, "Color Temperature" },
338 { 0x03, "Enhanced Hue and Saturation" },
342 /* Color Loop Directions */
343 static const value_string zbee_zcl_color_control_color_loop_direction_values
[] = {
344 { 0x00, "Hue is Decrementing" },
345 { 0x01, "Hue is Incrementing" },
349 /* Direction Values */
350 static const value_string zbee_zcl_color_control_direction_values
[] = {
351 { 0x00, "Shortest Distance" },
352 { 0x01, "Longest Distance" },
358 /* Move Mode Values */
359 static const value_string zbee_zcl_color_control_move_mode
[] = {
362 { 0x02, "Reserved" },
367 /* Step Mode Values */
368 static const value_string zbee_zcl_color_control_step_mode
[] = {
369 { 0x00, "Reserved" },
371 { 0x02, "Reserved" },
376 /* Move Mode Values */
377 static const value_string zbee_zcl_color_control_action
[] = {
378 { 0x00, "De-activate" },
379 { 0x01, "Activate from the value in the ColorLoopStartEnhancedHue field" },
380 { 0x02, "Activate from the value of the EnhancedCurrentHue attribute" },
384 /*************************/
385 /* Function Bodies */
386 /*************************/
389 *ZigBee ZCL Color Control cluster dissector for wireshark.
391 *@param tvb pointer to buffer containing raw packet.
392 *@param pinfo pointer to packet information fields
393 *@param tree pointer to data tree Wireshark uses to display packet.
396 dissect_zbee_zcl_color_control(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data
)
398 proto_tree
*payload_tree
;
399 zbee_zcl_packet
*zcl
;
404 /* Reject the packet if data is NULL */
407 zcl
= (zbee_zcl_packet
*)data
;
408 cmd_id
= zcl
->cmd_id
;
410 /* Create a subtree for the ZCL Command frame, and add the command ID to it. */
411 if (zcl
->direction
== ZBEE_ZCL_FCF_TO_SERVER
) {
412 /* Append the command name to the info column. */
413 col_append_fstr(pinfo
->cinfo
, COL_INFO
, "%s, Seq: %u",
414 val_to_str_const(cmd_id
, zbee_zcl_color_control_srv_rx_cmd_names
, "Unknown Command"),
417 /* Add the command ID. */
418 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_srv_rx_cmd_id
, tvb
, offset
, 1, ENC_LITTLE_ENDIAN
);
420 /* Check if this command has a payload, then add the payload tree */
421 rem_len
= tvb_reported_length_remaining(tvb
, ++offset
);
423 payload_tree
= proto_tree_add_subtree(tree
, tvb
, offset
, rem_len
, ett_zbee_zcl_color_control
, NULL
, "Payload");
425 /* Call the appropriate command dissector */
427 case ZBEE_ZCL_CMD_ID_COLOR_CONTROL_MOVE_TO_HUE
:
428 dissect_zcl_color_control_move_to_hue(tvb
, payload_tree
, &offset
, ZBEE_ZCL_NORMAL_HUE
);
431 case ZBEE_ZCL_CMD_ID_COLOR_CONTROL_MOVE_HUE
:
432 dissect_zcl_color_control_move_hue_saturation(tvb
, payload_tree
, &offset
, ZBEE_ZCL_NORMAL_HUE
);
435 case ZBEE_ZCL_CMD_ID_COLOR_CONTROL_STEP_HUE
:
436 dissect_zcl_color_control_step_hue_saturation(tvb
, payload_tree
, &offset
, ZBEE_ZCL_NORMAL_HUE
);
439 case ZBEE_ZCL_CMD_ID_COLOR_CONTROL_MOVE_TO_SATURATION
:
440 dissect_zcl_color_control_move_to_saturation(tvb
, payload_tree
, &offset
);
443 case ZBEE_ZCL_CMD_ID_COLOR_CONTROL_MOVE_SATURATION
:
444 dissect_zcl_color_control_move_hue_saturation(tvb
, payload_tree
, &offset
, ZBEE_ZCL_NORMAL_HUE
);
447 case ZBEE_ZCL_CMD_ID_COLOR_CONTROL_STEP_SATURATION
:
448 dissect_zcl_color_control_step_hue_saturation(tvb
, payload_tree
, &offset
, ZBEE_ZCL_NORMAL_HUE
);
451 case ZBEE_ZCL_CMD_ID_COLOR_CONTROL_MOVE_TO_HUE_AND_SATURATION
:
452 dissect_zcl_color_control_move_to_hue_and_saturation(tvb
, payload_tree
, &offset
, ZBEE_ZCL_NORMAL_HUE
);
455 case ZBEE_ZCL_CMD_ID_COLOR_CONTROL_MOVE_TO_COLOR
:
456 dissect_zcl_color_control_move_to_color(tvb
, payload_tree
, &offset
);
459 case ZBEE_ZCL_CMD_ID_COLOR_CONTROL_MOVE_COLOR
:
460 dissect_zcl_color_control_move_color(tvb
, payload_tree
, &offset
);
463 case ZBEE_ZCL_CMD_ID_COLOR_CONTROL_STEP_COLOR
:
464 dissect_zcl_color_control_step_color(tvb
, payload_tree
, &offset
);
467 case ZBEE_ZCL_CMD_ID_COLOR_CONTROL_MOVE_TO_COLOR_TEMP
:
468 dissect_zcl_color_control_move_to_color_temp(tvb
, payload_tree
, &offset
);
471 case ZBEE_ZCL_CMD_ID_COLOR_CONTROL_ENHANCED_MOVE_TO_HUE
:
472 dissect_zcl_color_control_move_to_hue(tvb
, payload_tree
, &offset
, ZBEE_ZCL_ENHANCED_HUE
);
475 case ZBEE_ZCL_CMD_ID_COLOR_CONTROL_ENHANCED_MOVE_HUE
:
476 dissect_zcl_color_control_move_hue_saturation(tvb
, payload_tree
, &offset
, ZBEE_ZCL_ENHANCED_HUE
);
479 case ZBEE_ZCL_CMD_ID_COLOR_CONTROL_ENHANCED_STEP_HUE
:
480 dissect_zcl_color_control_step_hue_saturation(tvb
, payload_tree
, &offset
, ZBEE_ZCL_ENHANCED_HUE
);
483 case ZBEE_ZCL_CMD_ID_COLOR_CONTROL_ENHANCED_MOVE_TO_HUE_AND_SATURATION
:
484 dissect_zcl_color_control_move_to_hue_and_saturation(tvb
, payload_tree
, &offset
, ZBEE_ZCL_ENHANCED_HUE
);
487 case ZBEE_ZCL_CMD_ID_COLOR_CONTROL_COLOR_LOOP_SET
:
488 dissect_zcl_color_control_color_loop_set(tvb
, payload_tree
, &offset
);
491 case ZBEE_ZCL_CMD_ID_COLOR_CONTROL_MOVE_COLOR_TEMP
:
492 dissect_zcl_color_control_move_color_temp(tvb
, payload_tree
, &offset
);
495 case ZBEE_ZCL_CMD_ID_COLOR_CONTROL_STEP_COLOR_TEMP
:
496 dissect_zcl_color_control_step_color_temp(tvb
, payload_tree
, &offset
);
499 case ZBEE_ZCL_CMD_ID_COLOR_CONTROL_STOP_MOVE_STEP
:
506 return tvb_captured_length(tvb
);
507 } /*dissect_zbee_zcl_color_control*/
511 *This function decodes the Add Group or Add Group If
513 *@param tvb the tv buffer of the current data_type
514 *@param tree the tree to append this item to
515 *@param offset offset of data in tvb
518 dissect_zcl_color_control_move_to_hue(tvbuff_t
*tvb
, proto_tree
*tree
, unsigned *offset
, bool enhanced
)
520 /* Retrieve "Hue" field */
523 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_enhanced_hue
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
);
528 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_hue
, tvb
, *offset
, 1, ENC_LITTLE_ENDIAN
);
532 /* Retrieve "Direction" field */
533 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_direction
, tvb
, *offset
, 1, ENC_LITTLE_ENDIAN
);
536 /* Retrieve "Transition Time" field */
537 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_transit_time
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
);
540 } /*dissect_zcl_color_control_move_to_hue*/
544 *This function decodes the Move Hue and Move Saturation payload.
546 *@param tvb the tv buffer of the current data_type
547 *@param tree the tree to append this item to
548 *@param offset offset of data in tvb
551 dissect_zcl_color_control_move_hue_saturation(tvbuff_t
*tvb
, proto_tree
*tree
, unsigned *offset
, bool enhanced
)
553 /* Retrieve "Move Mode" field */
554 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_move_mode
, tvb
, *offset
, 1, ENC_LITTLE_ENDIAN
);
557 /* Retrieve "Rate" field */
560 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_enhanced_rate
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
);
565 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_rate
, tvb
, *offset
, 1, ENC_LITTLE_ENDIAN
);
569 } /*dissect_zcl_color_control_move_hue_saturation*/
573 *This function decodes the Step Hue and Step Saturation payload
575 *@param tvb the tv buffer of the current data_type
576 *@param tree the tree to append this item to
577 *@param offset offset of data in tvb
580 dissect_zcl_color_control_step_hue_saturation(tvbuff_t
*tvb
, proto_tree
*tree
, unsigned *offset
, bool enhanced
)
582 /* Retrieve "Step Mode" field */
583 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_step_mode
, tvb
, *offset
, 1, ENC_LITTLE_ENDIAN
);
586 /* Retrieve "Step Size" field */
589 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_enhanced_step_size
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
);
594 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_step_size
, tvb
, *offset
, 1, ENC_LITTLE_ENDIAN
);
598 /* Retrieve "Transition Time" field */
599 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_transit_time_8bit
, tvb
, *offset
, 1, ENC_LITTLE_ENDIAN
);
602 } /*dissect_zcl_color_control_step_hue_saturation*/
606 *This function decodes the Move to Saturation payload.
608 *@param tvb the tv buffer of the current data_type
609 *@param tree the tree to append this item to
610 *@param offset offset of data in tvb
613 dissect_zcl_color_control_move_to_saturation(tvbuff_t
*tvb
, proto_tree
*tree
, unsigned *offset
)
615 /* Retrieve "Saturation" field */
616 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_saturation
, tvb
, *offset
, 1, ENC_LITTLE_ENDIAN
);
619 /* Retrieve "Transition Time" field */
620 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_transit_time
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
);
623 } /*dissect_zcl_color_control_move_to_saturation*/
627 *This function decodes the Move to Hue and Saturation payload.
629 *@param tvb the tv buffer of the current data_type
630 *@param tree the tree to append this item to
631 *@param offset offset of data in tvb
634 dissect_zcl_color_control_move_to_hue_and_saturation(tvbuff_t
*tvb
, proto_tree
*tree
, unsigned *offset
, bool enhanced
)
636 /* Retrieve "Hue" field */
639 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_enhanced_hue
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
);
644 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_hue
, tvb
, *offset
, 1, ENC_LITTLE_ENDIAN
);
648 /* Retrieve "Saturation" field */
649 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_saturation
, tvb
, *offset
, 1, ENC_LITTLE_ENDIAN
);
652 /* Retrieve "Transition Time" field */
653 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_transit_time
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
);
656 } /*dissect_zcl_color_control_move_to_hue_and_saturation*/
660 *This function decodes the Move to Color payload.
662 *@param tvb the tv buffer of the current data_type
663 *@param tree the tree to append this item to
664 *@param offset offset of data in tvb
667 dissect_zcl_color_control_move_to_color(tvbuff_t
*tvb
, proto_tree
*tree
, unsigned *offset
)
669 /* Retrieve "Color X" field */
670 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_color_X
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
);
673 /* Retrieve "Color Y" field */
674 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_color_Y
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
);
677 /* Retrieve "Transition Time" field */
678 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_transit_time
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
);
681 } /*dissect_zcl_color_control_move_to_color*/
684 *This function decodes the Move Color payload.
686 *@param tvb the tv buffer of the current data_type
687 *@param tree the tree to append this item to
688 *@param offset offset of data in tvb
691 dissect_zcl_color_control_move_color(tvbuff_t
*tvb
, proto_tree
*tree
, unsigned *offset
)
693 /* Retrieve "Rate X" field */
694 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_rate_X
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
);
697 /* Retrieve "Rate Y" field */
698 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_rate_Y
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
);
701 } /*dissect_zcl_color_control_move_color*/
705 *This function decodes the Step Color payload.
707 *@param tvb the tv buffer of the current data_type
708 *@param tree the tree to append this item to
709 *@param offset offset of data in tvb
712 dissect_zcl_color_control_step_color(tvbuff_t
*tvb
, proto_tree
*tree
, unsigned *offset
)
714 /* Retrieve "Step X" field */
715 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_step_X
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
);
718 /* Retrieve "Step Y" field */
719 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_step_Y
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
);
722 /* Retrieve "Transition Time" field */
723 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_transit_time
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
);
726 } /*dissect_zcl_color_control_step_color*/
729 *This function decodes the Move to Color Temperature payload.
731 *@param tvb the tv buffer of the current data_type
732 *@param tree the tree to append this item to
733 *@param offset offset of data in tvb
736 dissect_zcl_color_control_move_to_color_temp(tvbuff_t
*tvb
, proto_tree
*tree
, unsigned *offset
)
738 /* Retrieve "Color Temperature" field */
739 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_color_temp
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
);
742 /* Retrieve "Transition Time" field */
743 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_transit_time
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
);
746 } /*dissect_zcl_color_control_move_to_color_temp*/
749 *This function decodes the Color Loop Set payload.
751 *@param tvb the tv buffer of the current data_type
752 *@param tree the tree to append this item to
753 *@param offset offset of data in tvb
756 dissect_zcl_color_control_color_loop_set(tvbuff_t
*tvb
, proto_tree
*tree
, unsigned *offset
)
758 static int * const color_loop_update_fields
[] = {
759 &hf_zbee_zcl_color_control_color_loop_update_action
,
760 &hf_zbee_zcl_color_control_color_loop_update_direction
,
761 &hf_zbee_zcl_color_control_color_loop_update_time
,
762 &hf_zbee_zcl_color_control_color_loop_update_start_hue
,
766 /* Retrieve "Update Flags" field */
767 proto_tree_add_bitmask(tree
, tvb
, *offset
, hf_zbee_zcl_color_control_color_loop_update_flags
, ett_zbee_zcl_color_control_color_loop_settings
, color_loop_update_fields
, ENC_LITTLE_ENDIAN
);
770 /* Retrieve "Action" field */
771 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_color_loop_action
, tvb
, *offset
, 1, ENC_NA
);
774 /* Retrieve "Direction" field */
775 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_color_loop_direction
, tvb
, *offset
, 1, ENC_NA
);
778 /* Retrieve "Time" field */
779 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_color_loop_time
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
);
782 /* Retrieve "Start Hue" field */
783 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_color_loop_start_hue
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
);
786 } /*dissect_zcl_color_control_color_loop_set*/
789 *This function decodes the Move Color Temperature payload.
791 *@param tvb the tv buffer of the current data_type
792 *@param tree the tree to append this item to
793 *@param offset offset of data in tvb
796 dissect_zcl_color_control_move_color_temp(tvbuff_t
*tvb
, proto_tree
*tree
, unsigned *offset
)
798 /* Retrieve "Move Mode" field */
799 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_move_mode
, tvb
, *offset
, 1, ENC_LITTLE_ENDIAN
);
802 /* Retrieve "Rate" field */
803 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_enhanced_rate
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
);
806 /* Retrieve "Color Temperature Min" field */
807 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_color_temp_min
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
);
810 /* Retrieve "Color Temperature Max" field */
811 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_color_temp_max
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
);
814 } /*dissect_zcl_color_control_move_color_temp*/
817 *This function decodes the Step Color Temperature payload.
819 *@param tvb the tv buffer of the current data_type
820 *@param tree the tree to append this item to
821 *@param offset offset of data in tvb
824 dissect_zcl_color_control_step_color_temp(tvbuff_t
*tvb
, proto_tree
*tree
, unsigned *offset
)
826 /* Retrieve "Step Mode" field */
827 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_step_mode
, tvb
, *offset
, 1, ENC_LITTLE_ENDIAN
);
830 /* Retrieve "Step" field */
831 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_enhanced_step_size
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
);
834 /* Retrieve "Time" field */
835 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_transit_time
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
);
838 /* Retrieve "Color Temperature Min" field */
839 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_color_temp_min
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
);
842 /* Retrieve "Color Temperature Max" field */
843 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_color_temp_max
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
);
846 } /*dissect_zcl_color_control_step_color_temp*/
848 /*FUNCTION:------------------------------------------------------
852 * this function decodes color xy values
854 * unsigned *s - string to display
855 * uint16_t value - value to decode
858 *---------------------------------------------------------------
861 decode_color_xy(char *s
, uint16_t value
)
863 snprintf(s
, ITEM_LABEL_LENGTH
, "%.4lf", value
/65535.0);
865 } /*decode_power_conf_voltage*/
867 /*FUNCTION:------------------------------------------------------
869 * decode_color_temperature
871 * this function decodes color temperature values
873 * unsigned *s - string to display
874 * uint16_t value - value to decode
877 *---------------------------------------------------------------
880 decode_color_temperature(char *s
, uint16_t value
)
883 snprintf(s
, ITEM_LABEL_LENGTH
, "%u [Mired]", value
);
885 snprintf(s
, ITEM_LABEL_LENGTH
, "%u [Mired] (%u [K])", value
, 1000000/value
);
888 } /*decode_color_temperature*/
890 /*FUNCTION:------------------------------------------------------
892 * decode_startup_color_temperature
894 * this function decodes color temperature values
896 * unsigned *s - string to display
897 * uint16_t value - value to decode
900 *---------------------------------------------------------------
903 decode_startup_color_temperature(char *s
, uint16_t value
)
907 snprintf(s
, ITEM_LABEL_LENGTH
, "Set the Color Temperature attribute to its previous value");
911 decode_color_temperature(s
, value
);
914 } /*decode_startup_color_temperature*/
917 *This function is called by ZCL foundation dissector in order to decode
919 *@param tree pointer to data tree Wireshark uses to display packet.
920 *@param tvb pointer to buffer containing raw packet.
921 *@param offset pointer to buffer offset
922 *@param attr_id attribute identifier
923 *@param data_type attribute data type
924 *@param client_attr ZCL client
927 dissect_zcl_color_control_attr_data(proto_tree
*tree
, tvbuff_t
*tvb
, unsigned *offset
, uint16_t attr_id
, unsigned data_type
, bool client_attr
)
929 static int * const capabilities_fields
[] = {
930 &hf_zbee_zcl_color_control_attr_color_capabilities_hs
,
931 &hf_zbee_zcl_color_control_attr_color_capabilities_ehs
,
932 &hf_zbee_zcl_color_control_attr_color_capabilities_loop
,
933 &hf_zbee_zcl_color_control_attr_color_capabilities_xy
,
934 &hf_zbee_zcl_color_control_attr_color_capabilities_ct
,
938 /* Dissect attribute data type and data */
941 case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_CURRENT_HUE
:
942 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_attr_current_hue
, tvb
, *offset
, 1, ENC_NA
);
946 case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_CURRENT_SATURATION
:
947 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_attr_current_saturation
, tvb
, *offset
, 1, ENC_NA
);
951 case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_REMAINING_TIME
:
952 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_attr_remaining_time
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
);
956 case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_CURRENT_X
:
957 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_attr_color_x
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
);
961 case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_CURRENT_Y
:
962 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_attr_color_y
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
);
966 case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_DRIFT_COMPENSATION
:
967 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_attr_drift_compensation
, tvb
, *offset
, 1, ENC_NA
);
971 case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_TEMP
:
972 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_attr_color_temperature
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
);
976 case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_MODE
:
977 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_attr_color_mode
, tvb
, *offset
, 1, ENC_NA
);
981 case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_NO_OF_PRIMARIES
:
982 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_attr_nr_of_primaries
, tvb
, *offset
, 1, ENC_NA
);
986 case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_1_X
:
987 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_attr_primary_1_x
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
);
991 case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_1_Y
:
992 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_attr_primary_1_y
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
);
996 case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_1_INTENSITY
:
997 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_attr_primary_1_intensity
, tvb
, *offset
, 1, ENC_NA
);
1001 case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_2_X
:
1002 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_attr_primary_2_x
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
);
1006 case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_2_Y
:
1007 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_attr_primary_2_y
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
);
1011 case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_2_INTENSITY
:
1012 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_attr_primary_2_intensity
, tvb
, *offset
, 1, ENC_NA
);
1016 case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_3_X
:
1017 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_attr_primary_3_x
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
);
1021 case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_3_Y
:
1022 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_attr_primary_3_y
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
);
1026 case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_3_INTENSITY
:
1027 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_attr_primary_3_intensity
, tvb
, *offset
, 1, ENC_NA
);
1031 case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_4_X
:
1032 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_attr_primary_4_x
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
);
1036 case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_4_Y
:
1037 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_attr_primary_4_y
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
);
1041 case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_4_INTENSITY
:
1042 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_attr_primary_4_intensity
, tvb
, *offset
, 1, ENC_NA
);
1046 case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_5_X
:
1047 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_attr_primary_5_x
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
);
1051 case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_5_Y
:
1052 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_attr_primary_5_y
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
);
1056 case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_5_INTENSITY
:
1057 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_attr_primary_5_intensity
, tvb
, *offset
, 1, ENC_NA
);
1061 case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_6_X
:
1062 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_attr_primary_6_x
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
);
1066 case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_6_Y
:
1067 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_attr_primary_6_y
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
);
1071 case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_PRIMARY_6_INTENSITY
:
1072 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_attr_primary_6_intensity
, tvb
, *offset
, 1, ENC_NA
);
1076 case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_WHITE_POINT_X
:
1077 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_attr_white_point_x
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
);
1081 case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_WHITE_POINT_Y
:
1082 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_attr_white_point_y
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
);
1086 case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_POINT_R_X
:
1087 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_attr_red_x
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
);
1091 case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_POINT_R_Y
:
1092 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_attr_red_y
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
);
1096 case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_POINT_R_INTENSITY
:
1097 proto_tree_add_item(tree
,hf_zbee_zcl_color_control_attr_red_intensity
, tvb
, *offset
, 1, ENC_NA
);
1101 case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_POINT_G_X
:
1102 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_attr_green_x
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
);
1106 case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_POINT_G_Y
:
1107 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_attr_green_y
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
);
1111 case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_POINT_G_INTENSITY
:
1112 proto_tree_add_item(tree
,hf_zbee_zcl_color_control_attr_green_intensity
, tvb
, *offset
, 1, ENC_NA
);
1116 case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_POINT_B_X
:
1117 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_attr_blue_x
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
);
1121 case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_POINT_B_Y
:
1122 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_attr_blue_y
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
);
1126 case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_POINT_B_INTENSITY
:
1127 proto_tree_add_item(tree
,hf_zbee_zcl_color_control_attr_blue_intensity
, tvb
, *offset
, 1, ENC_NA
);
1131 case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_ENHANCED_CURRENT_HUE
:
1132 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_attr_enhanced_current_hue
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
);
1136 case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_ENHANCED_COLOR_MODE
:
1137 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_attr_enhanced_color_mode
, tvb
, *offset
, 1, ENC_NA
);
1141 case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_LOOP_ACTIVE
:
1142 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_attr_color_loop_active
, tvb
, *offset
, 1, ENC_NA
);
1146 case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_LOOP_DIRECTION
:
1147 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_attr_color_loop_direction
, tvb
, *offset
, 1, ENC_NA
);
1151 case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_LOOP_TIME
:
1152 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_attr_color_loop_time
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
);
1156 case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_LOOP_START_ENH_HUE
:
1157 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_attr_color_loop_start_enhanced_hue
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
);
1161 case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_LOOP_STORED_ENH_HUE
:
1162 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_attr_color_loop_stored_enhanced_hue
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
);
1166 case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_CAPABILITIES
:
1167 proto_tree_add_bitmask(tree
, tvb
, *offset
, hf_zbee_zcl_color_control_attr_color_capabilities
, ett_zbee_zcl_color_control_color_capabilities
, capabilities_fields
, ENC_LITTLE_ENDIAN
);
1171 case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_TEMPERATURE_PHYS_MIN
:
1172 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_attr_color_temperature_phys_min
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
);
1176 case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COLOR_TEMPERATURE_PHYS_MAX
:
1177 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_attr_color_temperature_phys_max
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
);
1181 case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_STARTUP_COLOR_TEMPERATURE
:
1182 proto_tree_add_item(tree
, hf_zbee_zcl_color_control_attr_startup_color_temperature
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
);
1186 case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COMPENSATION_TEXT
:
1188 dissect_zcl_attr_data(tvb
, tree
, offset
, data_type
, client_attr
);
1192 } /*dissect_zcl_color_control_attr_data*/
1196 *ZigBee ZCL Color Control cluster protocol registration routine.
1200 proto_register_zbee_zcl_color_control(void)
1202 /* Setup list of header fields */
1203 static hf_register_info hf
[] = {
1205 { &hf_zbee_zcl_color_control_attr_id
,
1206 { "Attribute", "zbee_zcl_lighting.color_control.attr_id", FT_UINT16
, BASE_HEX
, VALS(zbee_zcl_color_control_attr_names
),
1207 0x0, NULL
, HFILL
} },
1209 { &hf_zbee_zcl_color_control_attr_current_hue
,
1210 { "Hue", "zbee_zcl_lighting.color_control.attr.current_hue", FT_UINT8
, BASE_DEC
, NULL
,
1211 0x0, NULL
, HFILL
} },
1213 { &hf_zbee_zcl_color_control_attr_current_saturation
,
1214 { "Saturation", "zbee_zcl_lighting.color_control.attr.current_saturation", FT_UINT8
, BASE_DEC
, NULL
,
1215 0x0, NULL
, HFILL
} },
1217 { &hf_zbee_zcl_color_control_attr_remaining_time
,
1218 { "Time", "zbee_zcl_lighting.color_control.attr.remaining_time", FT_UINT16
, BASE_CUSTOM
, CF_FUNC(decode_zcl_time_in_100ms
),
1219 0x0, NULL
, HFILL
} },
1221 { &hf_zbee_zcl_color_control_attr_color_x
,
1222 { "X", "zbee_zcl_lighting.color_control.attr.color_x", FT_UINT16
, BASE_CUSTOM
, CF_FUNC(decode_color_xy
),
1223 0x0, NULL
, HFILL
} },
1225 { &hf_zbee_zcl_color_control_attr_color_y
,
1226 { "Y", "zbee_zcl_lighting.color_control.attr.color_y", FT_UINT16
, BASE_CUSTOM
, CF_FUNC(decode_color_xy
),
1227 0x0, NULL
, HFILL
} },
1229 { &hf_zbee_zcl_color_control_attr_drift_compensation
,
1230 { "Drift Compensation", "zbee_zcl_lighting.color_control.attr.drift_compensation", FT_UINT8
, BASE_HEX
, VALS(zbee_zcl_color_control_drift_compensation_values
),
1231 0x0, NULL
, HFILL
} },
1233 { &hf_zbee_zcl_color_control_attr_color_temperature
,
1234 { "Color Temperature", "zbee_zcl_lighting.color_control.attr.color_temperature", FT_UINT16
, BASE_CUSTOM
, CF_FUNC(decode_color_temperature
),
1235 0x0, NULL
, HFILL
} },
1237 { &hf_zbee_zcl_color_control_attr_color_mode
,
1238 { "Color Mode", "zbee_zcl_lighting.color_control.attr.color_mode", FT_UINT8
, BASE_HEX
, VALS(zbee_zcl_color_control_color_mode_values
),
1239 0x0, NULL
, HFILL
} },
1241 { &hf_zbee_zcl_color_control_attr_nr_of_primaries
,
1242 { "Number", "zbee_zcl_lighting.color_control.attr.nr_of_primaries", FT_UINT8
, BASE_DEC
, NULL
,
1243 0x0, NULL
, HFILL
} },
1245 { &hf_zbee_zcl_color_control_attr_primary_1_x
,
1246 { "X", "zbee_zcl_lighting.color_control.attr.primary_1_x", FT_UINT16
, BASE_CUSTOM
, CF_FUNC(decode_color_xy
),
1247 0x0, NULL
, HFILL
} },
1249 { &hf_zbee_zcl_color_control_attr_primary_1_y
,
1250 { "Y", "zbee_zcl_lighting.color_control.attr.primary_1_y", FT_UINT16
, BASE_CUSTOM
, CF_FUNC(decode_color_xy
),
1251 0x0, NULL
, HFILL
} },
1253 { &hf_zbee_zcl_color_control_attr_primary_1_intensity
,
1254 { "Intensity", "zbee_zcl_lighting.color_control.attr.primary_1_intensity", FT_UINT8
, BASE_DEC
, NULL
,
1255 0x0, NULL
, HFILL
} },
1257 { &hf_zbee_zcl_color_control_attr_primary_2_x
,
1258 { "X", "zbee_zcl_lighting.color_control.attr.primary_2_x", FT_UINT16
, BASE_CUSTOM
, CF_FUNC(decode_color_xy
),
1259 0x0, NULL
, HFILL
} },
1261 { &hf_zbee_zcl_color_control_attr_primary_2_y
,
1262 { "Y", "zbee_zcl_lighting.color_control.attr.primary_2_y", FT_UINT16
, BASE_CUSTOM
, CF_FUNC(decode_color_xy
),
1263 0x0, NULL
, HFILL
} },
1265 { &hf_zbee_zcl_color_control_attr_primary_2_intensity
,
1266 { "Intensity", "zbee_zcl_lighting.color_control.attr.primary_2_intensity", FT_UINT8
, BASE_DEC
, NULL
,
1267 0x0, NULL
, HFILL
} },
1269 { &hf_zbee_zcl_color_control_attr_primary_3_x
,
1270 { "X", "zbee_zcl_lighting.color_control.attr.primary_3_x", FT_UINT16
, BASE_CUSTOM
, CF_FUNC(decode_color_xy
),
1271 0x0, NULL
, HFILL
} },
1273 { &hf_zbee_zcl_color_control_attr_primary_3_y
,
1274 { "Y", "zbee_zcl_lighting.color_control.attr.primary_3_y", FT_UINT16
, BASE_CUSTOM
, CF_FUNC(decode_color_xy
),
1275 0x0, NULL
, HFILL
} },
1277 { &hf_zbee_zcl_color_control_attr_primary_3_intensity
,
1278 { "Intensity", "zbee_zcl_lighting.color_control.attr.primary_3_intensity", FT_UINT8
, BASE_DEC
, NULL
,
1279 0x0, NULL
, HFILL
} },
1281 { &hf_zbee_zcl_color_control_attr_primary_4_x
,
1282 { "X", "zbee_zcl_lighting.color_control.attr.primary_4_x", FT_UINT16
, BASE_CUSTOM
, CF_FUNC(decode_color_xy
),
1283 0x0, NULL
, HFILL
} },
1285 { &hf_zbee_zcl_color_control_attr_primary_4_y
,
1286 { "Y", "zbee_zcl_lighting.color_control.attr.primary_4_y", FT_UINT16
, BASE_CUSTOM
, CF_FUNC(decode_color_xy
),
1287 0x0, NULL
, HFILL
} },
1289 { &hf_zbee_zcl_color_control_attr_primary_4_intensity
,
1290 { "Intensity", "zbee_zcl_lighting.color_control.attr.primary_4_intensity", FT_UINT8
, BASE_DEC
, NULL
,
1291 0x0, NULL
, HFILL
} },
1293 { &hf_zbee_zcl_color_control_attr_primary_5_x
,
1294 { "X", "zbee_zcl_lighting.color_control.attr.primary_5_x", FT_UINT16
, BASE_CUSTOM
, CF_FUNC(decode_color_xy
),
1295 0x0, NULL
, HFILL
} },
1297 { &hf_zbee_zcl_color_control_attr_primary_5_y
,
1298 { "Y", "zbee_zcl_lighting.color_control.attr.primary_5_y", FT_UINT16
, BASE_CUSTOM
, CF_FUNC(decode_color_xy
),
1299 0x0, NULL
, HFILL
} },
1301 { &hf_zbee_zcl_color_control_attr_primary_5_intensity
,
1302 { "Intensity", "zbee_zcl_lighting.color_control.attr.primary_5_intensity", FT_UINT8
, BASE_DEC
, NULL
,
1303 0x0, NULL
, HFILL
} },
1305 { &hf_zbee_zcl_color_control_attr_primary_6_x
,
1306 { "X", "zbee_zcl_lighting.color_control.attr.primary_6_x", FT_UINT16
, BASE_CUSTOM
, CF_FUNC(decode_color_xy
),
1307 0x0, NULL
, HFILL
} },
1309 { &hf_zbee_zcl_color_control_attr_primary_6_y
,
1310 { "Y", "zbee_zcl_lighting.color_control.attr.primary_6_y", FT_UINT16
, BASE_CUSTOM
, CF_FUNC(decode_color_xy
),
1311 0x0, NULL
, HFILL
} },
1313 { &hf_zbee_zcl_color_control_attr_primary_6_intensity
,
1314 { "Intensity", "zbee_zcl_lighting.color_control.attr.primary_6_intensity", FT_UINT8
, BASE_DEC
, NULL
,
1315 0x0, NULL
, HFILL
} },
1317 { &hf_zbee_zcl_color_control_attr_white_point_x
,
1318 { "X", "zbee_zcl_lighting.color_control.attr.white_point_x", FT_UINT16
, BASE_CUSTOM
, CF_FUNC(decode_color_xy
),
1319 0x0, NULL
, HFILL
} },
1321 { &hf_zbee_zcl_color_control_attr_white_point_y
,
1322 { "Y", "zbee_zcl_lighting.color_control.attr.white_point_y", FT_UINT16
, BASE_CUSTOM
, CF_FUNC(decode_color_xy
),
1323 0x0, NULL
, HFILL
} },
1325 { &hf_zbee_zcl_color_control_attr_red_x
,
1326 { "X", "zbee_zcl_lighting.color_control.attr.red_x", FT_UINT16
, BASE_CUSTOM
, CF_FUNC(decode_color_xy
),
1327 0x0, NULL
, HFILL
} },
1329 { &hf_zbee_zcl_color_control_attr_red_y
,
1330 { "Y", "zbee_zcl_lighting.color_control.attr.red_y", FT_UINT16
, BASE_CUSTOM
, CF_FUNC(decode_color_xy
),
1331 0x0, NULL
, HFILL
} },
1333 { &hf_zbee_zcl_color_control_attr_red_intensity
,
1334 { "Intensity", "zbee_zcl_lighting.color_control.attr.red_intensity", FT_UINT8
, BASE_DEC
, NULL
,
1335 0x0, NULL
, HFILL
} },
1337 { &hf_zbee_zcl_color_control_attr_green_x
,
1338 { "X", "zbee_zcl_lighting.color_control.attr.green_x", FT_UINT16
, BASE_CUSTOM
, CF_FUNC(decode_color_xy
),
1339 0x0, NULL
, HFILL
} },
1341 { &hf_zbee_zcl_color_control_attr_green_y
,
1342 { "Y", "zbee_zcl_lighting.color_control.attr.green_y", FT_UINT16
, BASE_CUSTOM
, CF_FUNC(decode_color_xy
),
1343 0x0, NULL
, HFILL
} },
1345 { &hf_zbee_zcl_color_control_attr_green_intensity
,
1346 { "Intensity", "zbee_zcl_lighting.color_control.attr.green_intensity", FT_UINT8
, BASE_DEC
, NULL
,
1347 0x0, NULL
, HFILL
} },
1349 { &hf_zbee_zcl_color_control_attr_blue_x
,
1350 { "X", "zbee_zcl_lighting.color_control.attr.blue_x", FT_UINT16
, BASE_CUSTOM
, CF_FUNC(decode_color_xy
),
1351 0x0, NULL
, HFILL
} },
1353 { &hf_zbee_zcl_color_control_attr_blue_y
,
1354 { "Y", "zbee_zcl_lighting.color_control.attr.blue_y", FT_UINT16
, BASE_CUSTOM
, CF_FUNC(decode_color_xy
),
1355 0x0, NULL
, HFILL
} },
1357 { &hf_zbee_zcl_color_control_attr_blue_intensity
,
1358 { "Intensity", "zbee_zcl_lighting.color_control.attr.blue_intensity", FT_UINT8
, BASE_DEC
, NULL
,
1359 0x0, NULL
, HFILL
} },
1361 { &hf_zbee_zcl_color_control_attr_enhanced_current_hue
,
1362 { "Enhanced Hue", "zbee_zcl_lighting.color_control.attr.enhanced_current_hue", FT_UINT16
, BASE_DEC
, NULL
,
1363 0x0, NULL
, HFILL
} },
1365 { &hf_zbee_zcl_color_control_attr_enhanced_color_mode
,
1366 { "Enhanced Color Mode", "zbee_zcl_lighting.color_control.attr.enhanced_color_mode", FT_UINT8
, BASE_DEC
, VALS(zbee_zcl_color_control_color_mode_values
),
1367 0x0, NULL
, HFILL
} },
1369 { &hf_zbee_zcl_color_control_attr_color_loop_active
,
1370 { "Active", "zbee_zcl_lighting.color_control.attr.color_loop_active", FT_BOOLEAN
, BASE_NONE
, NULL
,
1371 0x0, NULL
, HFILL
} },
1373 { &hf_zbee_zcl_color_control_attr_color_loop_direction
,
1374 { "Direction", "zbee_zcl_lighting.color_control.attr.color_loop_direction", FT_UINT8
, BASE_DEC
, VALS(zbee_zcl_color_control_color_loop_direction_values
),
1375 0x0, NULL
, HFILL
} },
1377 { &hf_zbee_zcl_color_control_attr_color_loop_time
,
1378 { "Time", "zbee_zcl_lighting.color_control.attr.color_loop_time", FT_UINT16
, BASE_CUSTOM
, CF_FUNC(decode_zcl_time_in_seconds
),
1379 0x0, NULL
, HFILL
} },
1381 { &hf_zbee_zcl_color_control_attr_color_loop_start_enhanced_hue
,
1382 { "Enhanced Hue", "zbee_zcl_lighting.color_control.attr.color_loop_start_enhanced_hue", FT_UINT16
, BASE_DEC
, NULL
,
1383 0x0, NULL
, HFILL
} },
1385 { &hf_zbee_zcl_color_control_attr_color_loop_stored_enhanced_hue
,
1386 { "Enhanced Hue", "zbee_zcl_lighting.color_control.attr.color_loop_stored_enhanced_hue", FT_UINT16
, BASE_DEC
, NULL
,
1387 0x0, NULL
, HFILL
} },
1389 { &hf_zbee_zcl_color_control_attr_color_capabilities
,
1390 { "Capabilities", "zbee_zcl_lighting.color_control.attr.color_capabilities", FT_UINT16
, BASE_HEX
, NULL
,
1391 0x0, NULL
, HFILL
} },
1393 { &hf_zbee_zcl_color_control_attr_color_capabilities_hs
,
1394 { "Support Hue and Saturation", "zbee_zcl_lighting.color_control.attr.color_capabilities.hue_saturation", FT_UINT16
, BASE_DEC
, NULL
,
1395 ZBEE_ZCL_COLOR_CAPABILITIES_SUPPORT_HS_MASK
, NULL
, HFILL
} },
1397 { &hf_zbee_zcl_color_control_attr_color_capabilities_ehs
,
1398 { "Support Enhanced Hue and Saturation", "zbee_zcl_lighting.color_control.attr.color_capabilities.enhanced_hue_saturation", FT_UINT16
, BASE_DEC
, NULL
,
1399 ZBEE_ZCL_COLOR_CAPABILITIES_SUPPORT_EHS_MASK
, NULL
, HFILL
} },
1401 { &hf_zbee_zcl_color_control_attr_color_capabilities_loop
,
1402 { "Support Color Loop", "zbee_zcl_lighting.color_control.attr.color_capabilities.color_loop", FT_UINT16
, BASE_DEC
, NULL
,
1403 ZBEE_ZCL_COLOR_CAPABILITIES_SUPPORT_LOOP_MASK
, NULL
, HFILL
} },
1405 { &hf_zbee_zcl_color_control_attr_color_capabilities_xy
,
1406 { "Support Color XY", "zbee_zcl_lighting.color_control.attr.color_capabilities.color_xy", FT_UINT16
, BASE_DEC
, NULL
,
1407 ZBEE_ZCL_COLOR_CAPABILITIES_SUPPORT_XY_MASK
, NULL
, HFILL
} },
1409 { &hf_zbee_zcl_color_control_attr_color_capabilities_ct
,
1410 { "Support Color Temperature", "zbee_zcl_lighting.color_control.attr.color_capabilities.color_temperature", FT_UINT16
, BASE_DEC
, NULL
,
1411 ZBEE_ZCL_COLOR_CAPABILITIES_SUPPORT_CT_MASK
, NULL
, HFILL
} },
1413 { &hf_zbee_zcl_color_control_attr_color_temperature_phys_min
,
1414 { "Color Temperature", "zbee_zcl_lighting.color_control.attr.color_temperature_physical_min", FT_UINT16
, BASE_CUSTOM
, CF_FUNC(decode_color_temperature
),
1415 0x0, NULL
, HFILL
} },
1417 { &hf_zbee_zcl_color_control_attr_color_temperature_phys_max
,
1418 { "Color Temperature", "zbee_zcl_lighting.color_control.attr.color_temperature_physical_max", FT_UINT16
, BASE_CUSTOM
, CF_FUNC(decode_color_temperature
),
1419 0x0, NULL
, HFILL
} },
1421 { &hf_zbee_zcl_color_control_attr_startup_color_temperature
,
1422 { "Startup Color Temperature", "zbee_zcl_lighting.color_control.attr.startup_color_temperature", FT_UINT16
, BASE_CUSTOM
, CF_FUNC(decode_startup_color_temperature
),
1423 0x0, NULL
, HFILL
} },
1425 { &hf_zbee_zcl_color_control_hue
,
1426 { "Hue", "zbee_zcl_lighting.color_control.hue", FT_UINT8
, BASE_DEC
, NULL
,
1427 0x0, NULL
, HFILL
} },
1429 { &hf_zbee_zcl_color_control_direction
,
1430 { "Direction", "zbee_zcl_lighting.color_control.direction", FT_UINT8
, BASE_DEC
, VALS(zbee_zcl_color_control_direction_values
),
1431 0x0, NULL
, HFILL
} },
1433 { &hf_zbee_zcl_color_control_transit_time
,
1434 { "Transition Time", "zbee_zcl_lighting.color_control.transit_time", FT_UINT16
, BASE_CUSTOM
, CF_FUNC(decode_zcl_time_in_100ms
),
1435 0x0, NULL
, HFILL
} },
1437 { &hf_zbee_zcl_color_control_move_mode
,
1438 { "Move Mode", "zbee_zcl_lighting.color_control.move_mode", FT_UINT8
, BASE_DEC
, VALS(zbee_zcl_color_control_move_mode
),
1439 0x0, NULL
, HFILL
} },
1441 { &hf_zbee_zcl_color_control_rate
,
1442 { "Rate", "zbee_zcl_lighting.color_control.rate", FT_UINT8
, BASE_DEC
, NULL
,
1443 0x0, NULL
, HFILL
}},
1445 { &hf_zbee_zcl_color_control_step_mode
,
1446 { "Step Mode", "zbee_zcl_lighting.color_control.step_mode", FT_UINT8
, BASE_DEC
, VALS(zbee_zcl_color_control_step_mode
),
1447 0x0, NULL
, HFILL
}},
1449 { &hf_zbee_zcl_color_control_step_size
,
1450 { "Step Size", "zbee_zcl_lighting.color_control.step_size", FT_UINT8
, BASE_DEC
, NULL
,
1451 0x0, NULL
, HFILL
}},
1453 { &hf_zbee_zcl_color_control_transit_time_8bit
,
1454 { "Transition Time", "zbee_zcl_lighting.color_control.transition_time_8bit", FT_UINT8
, BASE_CUSTOM
, CF_FUNC(decode_zcl_time_in_100ms
),
1455 0x0, NULL
, HFILL
}},
1457 { &hf_zbee_zcl_color_control_saturation
,
1458 { "Saturation", "zbee_zcl_lighting.color_control.saturation", FT_UINT8
, BASE_DEC
, NULL
,
1459 0x0, NULL
, HFILL
}},
1461 { &hf_zbee_zcl_color_control_color_X
,
1462 { "Color X", "zbee_zcl_lighting.color_control.color_x", FT_UINT16
, BASE_CUSTOM
, CF_FUNC(decode_color_xy
),
1463 0x0, NULL
, HFILL
}},
1465 { &hf_zbee_zcl_color_control_color_Y
,
1466 { "Color Y", "zbee_zcl_lighting.color_control.color_y", FT_UINT16
, BASE_CUSTOM
, CF_FUNC(decode_color_xy
),
1467 0x0, NULL
, HFILL
}},
1469 { &hf_zbee_zcl_color_control_rate_X
,
1470 { "Rate X", "zbee_zcl_lighting.color_control.rate_x", FT_UINT16
, BASE_CUSTOM
, CF_FUNC(decode_color_xy
),
1471 0x0, NULL
, HFILL
}},
1473 { &hf_zbee_zcl_color_control_rate_Y
,
1474 { "Rate Y", "zbee_zcl_lighting.color_control.rate_y", FT_UINT16
, BASE_CUSTOM
, CF_FUNC(decode_color_xy
),
1475 0x0, NULL
, HFILL
}},
1477 { &hf_zbee_zcl_color_control_step_X
,
1478 { "Step X", "zbee_zcl_lighting.color_control.step_x", FT_UINT16
, BASE_CUSTOM
, CF_FUNC(decode_color_xy
),
1479 0x0, NULL
, HFILL
}},
1481 { &hf_zbee_zcl_color_control_step_Y
,
1482 { "Step Y", "zbee_zcl_lighting.color_control.step_y", FT_UINT16
, BASE_CUSTOM
, CF_FUNC(decode_color_xy
),
1483 0x0, NULL
, HFILL
}},
1485 { &hf_zbee_zcl_color_control_color_temp
,
1486 { "Color temperature", "zbee_zcl_lighting.color_control.color_temp", FT_UINT16
, BASE_CUSTOM
, CF_FUNC(decode_color_temperature
),
1487 0x0, NULL
, HFILL
}},
1489 { &hf_zbee_zcl_color_control_enhanced_hue
,
1490 { "Enhanced Hue", "zbee_zcl_lighting.color_control.enhanced_hue", FT_UINT16
, BASE_DEC
, NULL
,
1491 0x0, NULL
, HFILL
} },
1493 { &hf_zbee_zcl_color_control_enhanced_rate
,
1494 { "Enhanced Rate", "zbee_zcl_lighting.color_control.enhanced_rate", FT_UINT16
, BASE_DEC
, NULL
,
1495 0x0, NULL
, HFILL
}},
1497 { &hf_zbee_zcl_color_control_enhanced_step_size
,
1498 { "Enhanced Step Size", "zbee_zcl_lighting.color_control.enhanced_step_size", FT_UINT16
, BASE_DEC
, NULL
,
1499 0x0, NULL
, HFILL
}},
1501 { &hf_zbee_zcl_color_control_color_loop_update_flags
,
1502 { "Update Flags", "zbee_zcl_lighting.color_control.color_loop_update", FT_UINT8
, BASE_HEX
, NULL
,
1503 0x0, NULL
, HFILL
} },
1505 { &hf_zbee_zcl_color_control_color_loop_update_action
,
1506 { "Update Action", "zbee_zcl_lighting.color_control.color_loop_update.action", FT_UINT8
, BASE_DEC
, NULL
,
1507 ZBEE_ZCL_COLOR_LOOP_UPDATE_ACTION_MASK
, NULL
, HFILL
} },
1509 { &hf_zbee_zcl_color_control_color_loop_update_direction
,
1510 { "Update Direction", "zbee_zcl_lighting.color_control.color_loop_update.direction", FT_UINT8
, BASE_DEC
, NULL
,
1511 ZBEE_ZCL_COLOR_LOOP_UPDATE_DIRECTION_MASK
, NULL
, HFILL
} },
1513 { &hf_zbee_zcl_color_control_color_loop_update_time
,
1514 { "Update Time", "zbee_zcl_lighting.color_control.color_loop_update.time", FT_UINT8
, BASE_DEC
, NULL
,
1515 ZBEE_ZCL_COLOR_LOOP_UPDATE_TIME_MASK
, NULL
, HFILL
} },
1517 { &hf_zbee_zcl_color_control_color_loop_update_start_hue
,
1518 { "Update Start Hue", "zbee_zcl_lighting.color_control.color_loop_update.start_hue", FT_UINT8
, BASE_DEC
, NULL
,
1519 ZBEE_ZCL_COLOR_LOOP_UPDATE_START_HUE_MASK
, NULL
, HFILL
} },
1521 { &hf_zbee_zcl_color_control_color_loop_action
,
1522 { "Action", "zbee_zcl_lighting.color_control.color_loop_action", FT_UINT8
, BASE_DEC
, VALS(zbee_zcl_color_control_action
),
1523 0x0, NULL
, HFILL
}},
1525 { &hf_zbee_zcl_color_control_color_loop_direction
,
1526 { "Direction", "zbee_zcl_lighting.color_control.color_loop_direction", FT_UINT8
, BASE_DEC
, VALS(zbee_zcl_color_control_color_loop_direction_values
),
1527 0x0, NULL
, HFILL
}},
1529 { &hf_zbee_zcl_color_control_color_loop_time
,
1530 { "Time", "zbee_zcl_lighting.color_control.color_loop_time", FT_UINT16
, BASE_CUSTOM
, CF_FUNC(decode_zcl_time_in_seconds
),
1531 0x0, NULL
, HFILL
} },
1533 { &hf_zbee_zcl_color_control_color_loop_start_hue
,
1534 { "Enhanced Hue", "zbee_zcl_lighting.color_control.color_loop_start_hue", FT_UINT16
, BASE_DEC
, NULL
,
1535 0x0, NULL
, HFILL
} },
1537 { &hf_zbee_zcl_color_control_color_temp_min
,
1538 { "Color Temperature Minimum Mired", "zbee_zcl_lighting.color_control.color_temp_min", FT_UINT16
, BASE_CUSTOM
, CF_FUNC(decode_color_temperature
),
1539 0x0, NULL
, HFILL
}},
1541 { &hf_zbee_zcl_color_control_color_temp_max
,
1542 { "Color Temperature Maximum Mired", "zbee_zcl_lighting.color_control.color_temp_max", FT_UINT16
, BASE_CUSTOM
, CF_FUNC(decode_color_temperature
),
1543 0x0, NULL
, HFILL
}},
1545 { &hf_zbee_zcl_color_control_srv_rx_cmd_id
,
1546 { "Command", "zbee_zcl_lighting.color_control.cmd.srv_rx.id", FT_UINT8
, BASE_HEX
, VALS(zbee_zcl_color_control_srv_rx_cmd_names
),
1547 0x0, NULL
, HFILL
} }
1550 /* ZCL Color Control subtrees */
1551 static int *ett
[ZBEE_ZCL_COLOR_CONTROL_NUM_ETT
];
1552 ett
[0] = &ett_zbee_zcl_color_control
;
1553 ett
[1] = &ett_zbee_zcl_color_control_color_capabilities
;
1554 ett
[2] = &ett_zbee_zcl_color_control_color_loop_settings
;
1556 /* Register the ZigBee ZCL Color Control cluster protocol name and description */
1557 proto_zbee_zcl_color_control
= proto_register_protocol("ZigBee ZCL Color Control", "ZCL Color Control", ZBEE_PROTOABBREV_ZCL_COLOR_CONTROL
);
1558 proto_register_field_array(proto_zbee_zcl_color_control
, hf
, array_length(hf
));
1559 proto_register_subtree_array(ett
, array_length(ett
));
1561 /* Register the ZigBee ZCL Color Control dissector. */
1562 register_dissector(ZBEE_PROTOABBREV_ZCL_COLOR_CONTROL
, dissect_zbee_zcl_color_control
, proto_zbee_zcl_color_control
);
1564 } /*proto_register_zbee_zcl_color_control*/
1568 *Hands off the ZCL Color Control dissector.
1572 proto_reg_handoff_zbee_zcl_color_control(void)
1574 zbee_zcl_init_cluster( ZBEE_PROTOABBREV_ZCL_COLOR_CONTROL
,
1575 proto_zbee_zcl_color_control
,
1576 ett_zbee_zcl_color_control
,
1577 ZBEE_ZCL_CID_COLOR_CONTROL
,
1579 hf_zbee_zcl_color_control_attr_id
,
1580 hf_zbee_zcl_color_control_attr_id
,
1581 hf_zbee_zcl_color_control_srv_rx_cmd_id
,
1583 (zbee_zcl_fn_attr_data
)dissect_zcl_color_control_attr_data
1585 } /*proto_reg_handoff_zbee_zcl_color_control*/
1588 /* ########################################################################## */
1589 /* #### (0x0300) BALLAST CONFIGURATION CLUSTER ############################## */
1590 /* ########################################################################## */
1592 /*************************/
1594 /*************************/
1596 #define ZBEE_ZCL_BALLAST_CONFIGURATION_NUM_ETT 3
1599 #define ZBEE_ZCL_ATTR_ID_BALLAST_CONFIGURATION_PHYSICAL_MIN_LEVEL 0x0000 /* Physical Min Level */
1600 #define ZBEE_ZCL_ATTR_ID_BALLAST_CONFIGURATION_PHYSICAL_MAX_LEVEL 0x0001 /* Physical Max Level */
1601 #define ZBEE_ZCL_ATTR_ID_BALLAST_CONFIGURATION_BALLAST_STATUS 0x0002 /* Ballast Status */
1602 #define ZBEE_ZCL_ATTR_ID_BALLAST_CONFIGURATION_MIN_LEVEL 0x0010 /* Min Level */
1603 #define ZBEE_ZCL_ATTR_ID_BALLAST_CONFIGURATION_MAX_LEVEL 0x0011 /* Max Level */
1604 #define ZBEE_ZCL_ATTR_ID_BALLAST_CONFIGURATION_POWER_ON_LEVEL 0x0012 /* Power On Level */
1605 #define ZBEE_ZCL_ATTR_ID_BALLAST_CONFIGURATION_POWER_ON_FADE_TIME 0x0013 /* Power On Fade Time */
1606 #define ZBEE_ZCL_ATTR_ID_BALLAST_CONFIGURATION_INTRINSIC_BALLAST_FACTOR 0x0014 /* Intrinsic Ballast Factor */
1607 #define ZBEE_ZCL_ATTR_ID_BALLAST_CONFIGURATION_BALLAST_FACT_ADJ 0x0015 /* Ballast Factor Adjustment */
1608 #define ZBEE_ZCL_ATTR_ID_BALLAST_CONFIGURATION_LAMP_QUANTITY 0x0020 /* Lamp Quantity */
1609 #define ZBEE_ZCL_ATTR_ID_BALLAST_CONFIGURATION_LAMP_TYPE 0x0030 /* Lamp Type */
1610 #define ZBEE_ZCL_ATTR_ID_BALLAST_CONFIGURATION_LAMP_MANUFACTURER 0x0031 /* Lamp Manufacturer */
1611 #define ZBEE_ZCL_ATTR_ID_BALLAST_CONFIGURATION_LAMP_RATED_HOURS 0x0032 /* Lamp Rated Hours */
1612 #define ZBEE_ZCL_ATTR_ID_BALLAST_CONFIGURATION_LAMP_BURN_HOURS 0x0033 /* Lamp Burn Hours */
1613 #define ZBEE_ZCL_ATTR_ID_BALLAST_CONFIGURATION_LAMP_ALARM_MODE 0x0034 /* Lamp Alarm Mode */
1614 #define ZBEE_ZCL_ATTR_ID_BALLAST_CONFIGURATION_LAMP_BURN_HOURS_TRIP_POINT 0x0035 /* Lamp Burn Hours Trip Point */
1616 /*Server commands received - none*/
1618 /*Server commands generated - none*/
1620 /*Ballast Status Mask Values*/
1621 #define ZBEE_ZCL_BALLAST_CONFIGURATION_STATUS_NON_OPERATIONAL 0x01 /* Non-operational */
1622 #define ZBEE_ZCL_BALLAST_CONFIGURATION_STATUS_LAMP_NOT_IN_SOCKET 0x02 /* Lamp Not in Socket */
1624 /*Lamp Alarm Mode Mask Value*/
1625 #define ZBEE_ZCL_BALLAST_CONFIGURATION_LAMP_ALARM_MODE_LAMP_BURN_HOURS 0x01 /* Lamp Burn Hours */
1627 /*************************/
1628 /* Function Declarations */
1629 /*************************/
1631 void proto_register_zbee_zcl_ballast_configuration(void);
1632 void proto_reg_handoff_zbee_zcl_ballast_configuration(void);
1634 /* Command Dissector Helpers */
1635 static void dissect_zcl_ballast_configuration_attr_data (proto_tree
*tree
, tvbuff_t
*tvb
, unsigned *offset
, uint16_t attr_id
, unsigned data_type
, bool client_attr
);
1637 /* Private functions prototype */
1639 /*************************/
1640 /* Global Variables */
1641 /*************************/
1642 /* Initialize the protocol and registered fields */
1643 static int proto_zbee_zcl_ballast_configuration
;
1645 static int hf_zbee_zcl_ballast_configuration_attr_id
;
1646 static int hf_zbee_zcl_ballast_configuration_status
;
1647 static int hf_zbee_zcl_ballast_configuration_status_non_operational
;
1648 static int hf_zbee_zcl_ballast_configuration_status_lamp_not_in_socket
;
1649 static int hf_zbee_zcl_ballast_configuration_lamp_alarm_mode
;
1650 static int hf_zbee_zcl_ballast_configuration_lamp_alarm_mode_lamp_burn_hours
;
1652 /* Initialize the subtree pointers */
1653 static int ett_zbee_zcl_ballast_configuration
;
1654 static int ett_zbee_zcl_ballast_configuration_status
;
1655 static int ett_zbee_zcl_ballast_configuration_lamp_alarm_mode
;
1658 static const value_string zbee_zcl_ballast_configuration_attr_names
[] = {
1659 { ZBEE_ZCL_ATTR_ID_BALLAST_CONFIGURATION_PHYSICAL_MIN_LEVEL
, "Physical Min Level" },
1660 { ZBEE_ZCL_ATTR_ID_BALLAST_CONFIGURATION_PHYSICAL_MAX_LEVEL
, "Physical Max Level" },
1661 { ZBEE_ZCL_ATTR_ID_BALLAST_CONFIGURATION_BALLAST_STATUS
, "Ballast Status" },
1662 { ZBEE_ZCL_ATTR_ID_BALLAST_CONFIGURATION_MIN_LEVEL
, "Min Level" },
1663 { ZBEE_ZCL_ATTR_ID_BALLAST_CONFIGURATION_MAX_LEVEL
, "Max Level" },
1664 { ZBEE_ZCL_ATTR_ID_BALLAST_CONFIGURATION_POWER_ON_LEVEL
, "Power On Level" },
1665 { ZBEE_ZCL_ATTR_ID_BALLAST_CONFIGURATION_POWER_ON_FADE_TIME
, "Power On Fade Time" },
1666 { ZBEE_ZCL_ATTR_ID_BALLAST_CONFIGURATION_INTRINSIC_BALLAST_FACTOR
, "Intrinsic Ballast Factor" },
1667 { ZBEE_ZCL_ATTR_ID_BALLAST_CONFIGURATION_BALLAST_FACT_ADJ
, "Ballast Factor Adjustment" },
1668 { ZBEE_ZCL_ATTR_ID_BALLAST_CONFIGURATION_LAMP_QUANTITY
, "Lamp Quantity" },
1669 { ZBEE_ZCL_ATTR_ID_BALLAST_CONFIGURATION_LAMP_TYPE
, "Lamp Type" },
1670 { ZBEE_ZCL_ATTR_ID_BALLAST_CONFIGURATION_LAMP_MANUFACTURER
, "Lamp Manufacturer" },
1671 { ZBEE_ZCL_ATTR_ID_BALLAST_CONFIGURATION_LAMP_RATED_HOURS
, "Lamp Rated Hours" },
1672 { ZBEE_ZCL_ATTR_ID_BALLAST_CONFIGURATION_LAMP_BURN_HOURS
, "Lamp Burn Hours" },
1673 { ZBEE_ZCL_ATTR_ID_BALLAST_CONFIGURATION_LAMP_ALARM_MODE
, "Lamp Alarm Mode" },
1674 { ZBEE_ZCL_ATTR_ID_BALLAST_CONFIGURATION_LAMP_BURN_HOURS_TRIP_POINT
, "Lamp Burn Hours Trip Point" },
1678 /*Non-operational Values*/
1679 static const value_string zbee_zcl_ballast_configuration_status_non_operational_names
[] = {
1680 {0, "Fully Operational"},
1681 {1, "Not Fully Operational"},
1685 /*Not in Socket Values*/
1686 static const value_string zbee_zcl_ballast_configuration_status_lamp_not_in_socket_names
[] = {
1687 {0, "All lamps in Socket"},
1688 {1, "At least one lamp not in Socket"},
1693 /*************************/
1694 /* Function Bodies */
1695 /*************************/
1698 *ZigBee ZCL Ballast Configuration cluster dissector for wireshark.
1700 *@param tvb pointer to buffer containing raw packet.
1701 *@param pinfo pointer to packet information fields
1702 *@param tree pointer to data tree Wireshark uses to display packet.
1706 dissect_zbee_zcl_ballast_configuration(tvbuff_t
*tvb _U_
, packet_info
*pinfo _U_
, proto_tree
*tree _U_
, void* data _U_
)
1708 return tvb_captured_length(tvb
);
1709 } /*dissect_zbee_zcl_ballast_configuration*/
1713 *This function is called by ZCL foundation dissector in order to decode
1715 *@param tree pointer to data tree Wireshark uses to display packet.
1716 *@param tvb pointer to buffer containing raw packet.
1717 *@param offset pointer to buffer offset
1718 *@param attr_id attribute identifier
1719 *@param data_type attribute data type
1720 *@param client_attr ZCL client
1723 dissect_zcl_ballast_configuration_attr_data(proto_tree
*tree
, tvbuff_t
*tvb
, unsigned *offset
, uint16_t attr_id
, unsigned data_type
, bool client_attr
)
1725 static int * const ballast_status
[] = {
1726 &hf_zbee_zcl_ballast_configuration_status_non_operational
,
1727 &hf_zbee_zcl_ballast_configuration_status_lamp_not_in_socket
,
1731 static int * const lamp_alarm_mode
[] = {
1732 &hf_zbee_zcl_ballast_configuration_lamp_alarm_mode_lamp_burn_hours
,
1736 /* Dissect attribute data type and data */
1739 case ZBEE_ZCL_ATTR_ID_BALLAST_CONFIGURATION_BALLAST_STATUS
:
1740 proto_tree_add_bitmask(tree
, tvb
, *offset
, hf_zbee_zcl_ballast_configuration_status
, ett_zbee_zcl_ballast_configuration_status
, ballast_status
, ENC_LITTLE_ENDIAN
);
1744 case ZBEE_ZCL_ATTR_ID_BALLAST_CONFIGURATION_LAMP_ALARM_MODE
:
1745 proto_tree_add_bitmask(tree
, tvb
, *offset
, hf_zbee_zcl_ballast_configuration_lamp_alarm_mode
, ett_zbee_zcl_ballast_configuration_lamp_alarm_mode
, lamp_alarm_mode
, ENC_LITTLE_ENDIAN
);
1749 case ZBEE_ZCL_ATTR_ID_BALLAST_CONFIGURATION_PHYSICAL_MIN_LEVEL
:
1750 case ZBEE_ZCL_ATTR_ID_BALLAST_CONFIGURATION_PHYSICAL_MAX_LEVEL
:
1751 case ZBEE_ZCL_ATTR_ID_BALLAST_CONFIGURATION_MIN_LEVEL
:
1752 case ZBEE_ZCL_ATTR_ID_BALLAST_CONFIGURATION_MAX_LEVEL
:
1753 case ZBEE_ZCL_ATTR_ID_BALLAST_CONFIGURATION_POWER_ON_LEVEL
:
1754 case ZBEE_ZCL_ATTR_ID_BALLAST_CONFIGURATION_POWER_ON_FADE_TIME
:
1755 case ZBEE_ZCL_ATTR_ID_BALLAST_CONFIGURATION_INTRINSIC_BALLAST_FACTOR
:
1756 case ZBEE_ZCL_ATTR_ID_BALLAST_CONFIGURATION_BALLAST_FACT_ADJ
:
1757 case ZBEE_ZCL_ATTR_ID_BALLAST_CONFIGURATION_LAMP_QUANTITY
:
1758 case ZBEE_ZCL_ATTR_ID_BALLAST_CONFIGURATION_LAMP_TYPE
:
1759 case ZBEE_ZCL_ATTR_ID_BALLAST_CONFIGURATION_LAMP_MANUFACTURER
:
1760 case ZBEE_ZCL_ATTR_ID_BALLAST_CONFIGURATION_LAMP_RATED_HOURS
:
1761 case ZBEE_ZCL_ATTR_ID_BALLAST_CONFIGURATION_LAMP_BURN_HOURS
:
1762 case ZBEE_ZCL_ATTR_ID_BALLAST_CONFIGURATION_LAMP_BURN_HOURS_TRIP_POINT
:
1764 dissect_zcl_attr_data(tvb
, tree
, offset
, data_type
, client_attr
);
1768 } /*dissect_zcl_ballast_configuration_attr_data*/
1772 *ZigBee ZCL Ballast Configuration cluster protocol registration routine.
1776 proto_register_zbee_zcl_ballast_configuration(void)
1778 /* Setup list of header fields */
1779 static hf_register_info hf
[] = {
1781 { &hf_zbee_zcl_ballast_configuration_attr_id
,
1782 { "Attribute", "zbee_zcl_lighting.ballast_configuration.attr_id", FT_UINT16
, BASE_HEX
, VALS(zbee_zcl_ballast_configuration_attr_names
),
1783 0x0, NULL
, HFILL
} },
1785 /* start Ballast Status fields */
1786 { &hf_zbee_zcl_ballast_configuration_status
,
1787 { "Status", "zbee_zcl_lighting.ballast_configuration.attr.status", FT_UINT8
, BASE_HEX
, NULL
,
1788 0x0, NULL
, HFILL
} },
1790 { &hf_zbee_zcl_ballast_configuration_status_non_operational
,
1791 { "Non-operational", "zbee_zcl_lighting.ballast_configuration.attr.status.non_operational", FT_UINT8
, BASE_HEX
, VALS(zbee_zcl_ballast_configuration_status_non_operational_names
),
1792 ZBEE_ZCL_BALLAST_CONFIGURATION_STATUS_NON_OPERATIONAL
, NULL
, HFILL
} },
1794 { &hf_zbee_zcl_ballast_configuration_status_lamp_not_in_socket
,
1795 { "Not in Socket", "zbee_zcl_lighting.ballast_configuration.attr.status.not_in_socket", FT_UINT8
, BASE_HEX
, VALS(zbee_zcl_ballast_configuration_status_lamp_not_in_socket_names
),
1796 ZBEE_ZCL_BALLAST_CONFIGURATION_STATUS_LAMP_NOT_IN_SOCKET
, NULL
, HFILL
} },
1797 /* end Ballast Status fields */
1799 /*stat Lamp Alarm Mode fields*/
1800 { &hf_zbee_zcl_ballast_configuration_lamp_alarm_mode
,
1801 { "Lamp Alarm Mode", "zbee_zcl_lighting.ballast_configuration.attr.lamp_alarm_mode", FT_UINT8
, BASE_HEX
, NULL
,
1802 0x0, NULL
, HFILL
} },
1804 { &hf_zbee_zcl_ballast_configuration_lamp_alarm_mode_lamp_burn_hours
,
1805 { "Lamp Burn Hours", "zbee_zcl_lighting.ballast_configuration.attr.lamp_alarm_mode.lamp_burn_hours", FT_BOOLEAN
, 8, NULL
,
1806 ZBEE_ZCL_BALLAST_CONFIGURATION_LAMP_ALARM_MODE_LAMP_BURN_HOURS
, NULL
, HFILL
} }
1807 /* end Lamp Alarm Mode fields */
1810 /* ZCL Ballast Configuration subtrees */
1811 static int *ett
[ZBEE_ZCL_BALLAST_CONFIGURATION_NUM_ETT
];
1813 ett
[0] = &ett_zbee_zcl_ballast_configuration
;
1814 ett
[1] = &ett_zbee_zcl_ballast_configuration_status
;
1815 ett
[2] = &ett_zbee_zcl_ballast_configuration_lamp_alarm_mode
;
1817 /* Register the ZigBee ZCL Ballast Configuration cluster protocol name and description */
1818 proto_zbee_zcl_ballast_configuration
= proto_register_protocol("ZigBee ZCL Ballast Configuration", "ZCL Ballast Configuration", ZBEE_PROTOABBREV_ZCL_BALLAST_CONFIG
);
1819 proto_register_field_array(proto_zbee_zcl_ballast_configuration
, hf
, array_length(hf
));
1820 proto_register_subtree_array(ett
, array_length(ett
));
1822 /* Register the ZigBee ZCL Ballast Configuration dissector. */
1823 register_dissector(ZBEE_PROTOABBREV_ZCL_BALLAST_CONFIG
, dissect_zbee_zcl_ballast_configuration
, proto_zbee_zcl_ballast_configuration
);
1824 } /*proto_register_zbee_zcl_ballast_configuration*/
1827 *Hands off the ZCL Ballast Configuration dissector.
1831 proto_reg_handoff_zbee_zcl_ballast_configuration(void)
1833 zbee_zcl_init_cluster( ZBEE_PROTOABBREV_ZCL_BALLAST_CONFIG
,
1834 proto_zbee_zcl_ballast_configuration
,
1835 ett_zbee_zcl_ballast_configuration
,
1836 ZBEE_ZCL_CID_BALLAST_CONFIG
,
1838 hf_zbee_zcl_ballast_configuration_attr_id
,
1839 hf_zbee_zcl_ballast_configuration_attr_id
,
1841 (zbee_zcl_fn_attr_data
)dissect_zcl_ballast_configuration_attr_data
1843 } /*proto_reg_handoff_zbee_zcl_ballast_configuration*/
1846 * Editor modelines - https://www.wireshark.org/tools/modelines.html
1851 * indent-tabs-mode: nil
1854 * vi: set shiftwidth=4 tabstop=8 expandtab:
1855 * :indentSize=4:tabSize=8:noTabs=true: