Fixup: tvb_get_string(z) -> tvb_get_string(z)_enc
[metze/wireshark/wip.git] / epan / dissectors / packet-rdm.c
1 /* packet-rdm.c
2  * RDM (Remote Device Management) packet disassembly.
3  *
4  * This dissector is written by
5  *
6  *  Erwin Rol <erwin@erwinrol.com>
7  *  Copyright 2003, 2011, 2012 Erwin Rol
8  *
9  *  Shaun Jackman <sjackman@gmail.com>
10  *  Copyright 2006 Pathway Connectivity
11  *
12  *  Wireshark - Network traffic analyzer
13  *  Gerald Combs <gerald@wireshark.org>
14  *  Copyright 1999 Gerald Combs
15  *
16  * This program is free software; you can redistribute it and/or
17  * modify it under the terms of the GNU General Public License
18  * as published by the Free Software Foundation; either version 2
19  * of the License, or (at your option) any later version.
20  *
21  * This program is distributed in the hope that it will be useful,
22  * but WITHOUT ANY WARRANTY; without even the implied warranty of
23  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
24  * GNU General Public License for more details.
25  *
26  * You should have received a copy of the GNU General Public License
27  * along with this program; if not, write to the Free Software
28  * Foundation, Inc., 51 Franklin Street, Fifth Floor
29  * Boston, MA  02110-1301, USA.
30  */
31 /*
32  * ANSI E1.20-2006, Entertainment Technology
33  * Remote Device Management over USITT DMX512, describes a method of
34  * bi-directional communications over a USITT DMX512/1990 data link
35  * between an entertainment lighting controller and one or more
36  * remotely controlled lighting devices. The protocol also is intended
37  * to work with the ANSI E1.11-2004 control protocol. It allows
38  * discovery of devices on a DMX512/E1.11 network and the remote
39  * setting of DMX starting addresses, as well as status and fault
40  * reporting back to the control console.
41  */
42
43 #include "config.h"
44
45 #include <glib.h>
46 #include <epan/packet.h>
47
48 void proto_register_rdm(void);
49
50 #define RDM_SC_RDM                              0xCC
51 #define RDM_SC_SUB_MESSAGE                      0x01
52
53 #define RDM_CC_DISCOVERY_COMMAND                0x10
54 #define RDM_CC_DISCOVERY_COMMAND_RESPONSE       0x11
55 #define RDM_CC_GET_COMMAND                      0x20
56 #define RDM_CC_GET_COMMAND_RESPONSE             0x21
57 #define RDM_CC_SET_COMMAND                      0x30
58 #define RDM_CC_SET_COMMAND_RESPONSE             0x31
59
60 static const value_string rdm_cc_vals[] = {
61         { RDM_CC_DISCOVERY_COMMAND,             "Discovery Command" },
62         { RDM_CC_DISCOVERY_COMMAND_RESPONSE,    "Discovery Command Response" },
63         { RDM_CC_GET_COMMAND,                   "Get Command" },
64         { RDM_CC_GET_COMMAND_RESPONSE,          "Get Command Response" },
65         { RDM_CC_SET_COMMAND,                   "Set Command" },
66         { RDM_CC_SET_COMMAND_RESPONSE,          "Set Command Response" },
67         { 0, NULL },
68 };
69
70 #define RDM_RESPONSE_TYPE_ACK                   0x00
71 #define RDM_RESPONSE_TYPE_ACK_TIMER             0x01
72 #define RDM_RESPONSE_TYPE_NACK_REASON           0x02
73 #define RDM_RESPONSE_TYPE_ACK_OVERFLOW          0x03
74
75 static const value_string rdm_rt_vals[] = {
76         { RDM_RESPONSE_TYPE_ACK,                "Ack" },
77         { RDM_RESPONSE_TYPE_ACK_TIMER,          "Ack Timer" },
78         { RDM_RESPONSE_TYPE_NACK_REASON,        "Nack Reason" },
79         { RDM_RESPONSE_TYPE_ACK_OVERFLOW,       "Ack Overflow" },
80         { 0, NULL },
81 };
82
83 #define RDM_PARAM_ID_DISC_UNIQUE_BRANCH                 0x0001
84 #define RDM_PARAM_ID_DISC_MUTE                          0x0002
85 #define RDM_PARAM_ID_DISC_UN_MUTE                       0x0003
86 #define RDM_PARAM_ID_PROXIED_DEVICES                    0x0010
87 #define RDM_PARAM_ID_PROXIED_DEVICE_COUNT               0x0011
88 #define RDM_PARAM_ID_COMMS_STATUS                       0x0015
89 #define RDM_PARAM_ID_QUEUED_MESSAGE                     0x0020
90 #define RDM_PARAM_ID_STATUS_MESSAGES                    0x0030
91 #define RDM_PARAM_ID_STATUS_ID_DESCRIPTION              0x0031
92 #define RDM_PARAM_ID_CLEAR_STATUS_ID                    0x0032
93 #define RDM_PARAM_ID_SUB_DEVICE_STATUS_REPORT_THRESHOLD 0x0033
94 #define RDM_PARAM_ID_SUPPORTED_PARAMETERS               0x0050
95 #define RDM_PARAM_ID_PARAMETER_DESCRIPTION              0x0051
96 #define RDM_PARAM_ID_DEVICE_INFO                        0x0060
97 #define RDM_PARAM_ID_PRODUCT_DETAIL_ID_LIST             0x0070
98 #define RDM_PARAM_ID_DEVICE_MODEL_DESCRIPTION           0x0080
99 #define RDM_PARAM_ID_MANUFACTURER_LABEL                 0x0081
100 #define RDM_PARAM_ID_DEVICE_LABEL                       0x0082
101 #define RDM_PARAM_ID_FACTORY_DEFAULTS                   0x0090
102 #define RDM_PARAM_ID_LANGUAGE_CAPABILITIES              0x00A0
103 #define RDM_PARAM_ID_LANGUAGE                           0x00B0
104 #define RDM_PARAM_ID_SOFTWARE_VERSION_LABEL             0x00C0
105 #define RDM_PARAM_ID_BOOT_SOFTWARE_VERSION_ID           0x00C1
106 #define RDM_PARAM_ID_BOOT_SOFTWARE_VERSION_LABEL        0x00C2
107 #define RDM_PARAM_ID_DMX_PERSONALITY                    0x00E0
108 #define RDM_PARAM_ID_DMX_PERSONALITY_DESCRIPTION        0x00E1
109 #define RDM_PARAM_ID_DMX_START_ADDRESS                  0x00F0
110 #define RDM_PARAM_ID_SLOT_INFO                          0x0120
111 #define RDM_PARAM_ID_SLOT_DESCRIPTION                   0x0121
112 #define RDM_PARAM_ID_DEFAULT_SLOT_VALUE                 0x0122
113 #define RDM_PARAM_ID_SENSOR_DEFINITION                  0x0200
114 #define RDM_PARAM_ID_SENSOR_VALUE                       0x0201
115 #define RDM_PARAM_ID_RECORD_SENSORS                     0x0202
116 #define RDM_PARAM_ID_DEVICE_HOURS                       0x0400
117 #define RDM_PARAM_ID_LAMP_HOURS                         0x0401
118 #define RDM_PARAM_ID_LAMP_STRIKES                       0x0402
119 #define RDM_PARAM_ID_LAMP_STATE                         0x0403
120 #define RDM_PARAM_ID_LAMP_ON_MODE                       0x0404
121 #define RDM_PARAM_ID_DEVICE_POWER_CYCLES                0x0405
122 #define RDM_PARAM_ID_DISPLAY_INVERT                     0x0500
123 #define RDM_PARAM_ID_DISPLAY_LEVEL                      0x0501
124 #define RDM_PARAM_ID_PAN_INVERT                         0x0600
125 #define RDM_PARAM_ID_TILT_INVERT                        0x0601
126 #define RDM_PARAM_ID_PAN_TILT_SWAP                      0x0602
127 #define RDM_PARAM_ID_REAL_TIME_CLOCK                    0x0603
128 #define RDM_PARAM_ID_IDENTIFY_DEVICE                    0x1000
129 #define RDM_PARAM_ID_RESET_DEVICE                       0x1001
130 #define RDM_PARAM_ID_POWER_STATE                        0x1010
131 #define RDM_PARAM_ID_PERFORM_SELFTEST                   0x1020
132 #define RDM_PARAM_ID_SELF_TEST_DESCRIPTION              0x1021
133 #define RDM_PARAM_ID_CAPTURE_PRESET                     0x1030
134 #define RDM_PARAM_ID_PRESET_PLAYBACK                    0x1031
135
136 static const value_string rdm_param_id_vals[] = {
137         { RDM_PARAM_ID_DISC_UNIQUE_BRANCH,                 "DISC_UNIQUE_BRANCH" },
138         { RDM_PARAM_ID_DISC_MUTE,                          "DISC_MUTE" },
139         { RDM_PARAM_ID_DISC_UN_MUTE,                       "DISC_UN_MUTE" },
140         { RDM_PARAM_ID_PROXIED_DEVICES,                    "PROXIED_DEVICES" },
141         { RDM_PARAM_ID_PROXIED_DEVICE_COUNT,               "PROXIED_DEVICE_COUNT" },
142         { RDM_PARAM_ID_COMMS_STATUS,                       "COMMS_STATUS" },
143         { RDM_PARAM_ID_QUEUED_MESSAGE,                     "QUEUED_MESSAGE" },
144         { RDM_PARAM_ID_STATUS_MESSAGES,                    "STATUS_MESSAGES" },
145         { RDM_PARAM_ID_STATUS_ID_DESCRIPTION,              "STATUS_ID_DESCRIPTION" },
146         { RDM_PARAM_ID_CLEAR_STATUS_ID,                    "CLEAR_STATUS_ID" },
147         { RDM_PARAM_ID_SUB_DEVICE_STATUS_REPORT_THRESHOLD, "DEVICE_STATUS_REPORT_THRESHOLD" },
148         { RDM_PARAM_ID_SUPPORTED_PARAMETERS,               "SUPPORTED_PARAMETERS" },
149         { RDM_PARAM_ID_PARAMETER_DESCRIPTION,              "PARAMETER_DESCRIPTION" },
150         { RDM_PARAM_ID_DEVICE_INFO,                        "DEVICE_INFO" },
151         { RDM_PARAM_ID_PRODUCT_DETAIL_ID_LIST,             "PRODUCT_DETAIL_ID_LIST" },
152         { RDM_PARAM_ID_DEVICE_MODEL_DESCRIPTION,           "DEVICE_MODEL_DESCRIPTION" },
153         { RDM_PARAM_ID_MANUFACTURER_LABEL,                 "MANUFACTURER_LABEL" },
154         { RDM_PARAM_ID_DEVICE_LABEL,                       "DEVICE_LABEL" },
155         { RDM_PARAM_ID_FACTORY_DEFAULTS,                   "FACTORY_DEFAULTS" },
156         { RDM_PARAM_ID_LANGUAGE_CAPABILITIES,              "LANGUAGE_CAPABILITIES" },
157         { RDM_PARAM_ID_LANGUAGE,                           "LANGUAGE" },
158         { RDM_PARAM_ID_SOFTWARE_VERSION_LABEL,             "SOFTWARE_VERSION_LABEL" },
159         { RDM_PARAM_ID_BOOT_SOFTWARE_VERSION_ID,           "BOOT_SOFTWARE_VERSION_ID" },
160         { RDM_PARAM_ID_BOOT_SOFTWARE_VERSION_LABEL,        "BOOT_SOFTWARE_VERSION_LABEL" },
161         { RDM_PARAM_ID_DMX_PERSONALITY,                    "DMX_PERSONALITY" },
162         { RDM_PARAM_ID_DMX_PERSONALITY_DESCRIPTION,        "DMX_PERSONALITY_DESCRIPTION" },
163         { RDM_PARAM_ID_DMX_START_ADDRESS,                  "DMX_START_ADDRESS" },
164         { RDM_PARAM_ID_SLOT_INFO,                          "SLOT_INFO" },
165         { RDM_PARAM_ID_SLOT_DESCRIPTION,                   "SLOT_DESCRIPTION" },
166         { RDM_PARAM_ID_DEFAULT_SLOT_VALUE,                 "DEFAULT_SLOT_VALUE" },
167         { RDM_PARAM_ID_SENSOR_DEFINITION,                  "SENSOR_DEFINITION" },
168         { RDM_PARAM_ID_SENSOR_VALUE,                       "SENSOR_VALUE" },
169         { RDM_PARAM_ID_RECORD_SENSORS,                     "RECORD_SENSORS" },
170         { RDM_PARAM_ID_DEVICE_HOURS,                       "DEVICE_HOURS" },
171         { RDM_PARAM_ID_LAMP_HOURS,                         "LAMP_HOURS" },
172         { RDM_PARAM_ID_LAMP_STRIKES,                       "LAMP_STRIKES" },
173         { RDM_PARAM_ID_LAMP_STATE,                         "LAMP_STATE" },
174         { RDM_PARAM_ID_LAMP_ON_MODE,                       "LAMP_ON_MODE" },
175         { RDM_PARAM_ID_DEVICE_POWER_CYCLES,                "DEVICE_POWER_CYCLES" },
176         { RDM_PARAM_ID_DISPLAY_INVERT,                     "DISPLAY_INVERT" },
177         { RDM_PARAM_ID_DISPLAY_LEVEL,                      "DISPLAY_LEVEL" },
178         { RDM_PARAM_ID_PAN_INVERT,                         "PAN_INVERT" },
179         { RDM_PARAM_ID_TILT_INVERT,                        "TILT_INVERT" },
180         { RDM_PARAM_ID_PAN_TILT_SWAP,                      "PAN_TILT_SWAP" },
181         { RDM_PARAM_ID_REAL_TIME_CLOCK,                    "REAL_TIME_CLOCK" },
182         { RDM_PARAM_ID_IDENTIFY_DEVICE,                    "IDENTIFY_DEVICE" },
183         { RDM_PARAM_ID_RESET_DEVICE,                       "RESET_DEVICE" },
184         { RDM_PARAM_ID_POWER_STATE,                        "POWER_STATE" },
185         { RDM_PARAM_ID_PERFORM_SELFTEST,                   "PERFORM_SELFTEST" },
186         { RDM_PARAM_ID_SELF_TEST_DESCRIPTION,              "SELF_TEST_DESCRIPTION" },
187         { RDM_PARAM_ID_CAPTURE_PRESET,                     "CAPTURE_PRESET" },
188         { RDM_PARAM_ID_PRESET_PLAYBACK,                    "PRESET_PLAYBACK" },
189         { 0, NULL },
190 };
191 static value_string_ext rdm_param_id_vals_ext = VALUE_STRING_EXT_INIT(rdm_param_id_vals);
192
193 #define RDM_STATUS_NONE                         0x00
194 #define RMD_STATUS_GET_LAST_MESSAGE             0x01
195 #define RDM_STATUS_ADVISORY                     0x02
196 #define RDM_STATUS_WARNING                      0x03
197 #define RDM_STATUS_ERROR                        0x04
198
199 static const value_string rdm_status_vals[] = {
200         { RDM_STATUS_NONE,              "None" },
201         { RMD_STATUS_GET_LAST_MESSAGE,  "Get Last Message" },
202         { RDM_STATUS_ADVISORY,          "Advisory" },
203         { RDM_STATUS_WARNING,           "Warning" },
204         { RDM_STATUS_ERROR,             "Error" },
205         { 0, NULL },
206 };
207
208 #define RDM_PREFIX_NONE         0x00
209 #define RDM_PREFIX_DECI         0x01
210 #define RDM_PREFIX_CENTI        0x02
211 #define RDM_PREFIX_MILLI        0x03
212 #define RDM_PREFIX_MICRO        0x04
213 #define RDM_PREFIX_NANO         0x05
214 #define RDM_PREFIX_PICO         0x06
215 #define RDM_PREFIX_FEMPTO       0x07
216 #define RDM_PREFIX_ATTO         0x08
217 #define RDM_PREFIX_ZEPTO        0x09
218 #define RDM_PREFIX_YOCTO        0x0A
219 #define RDM_PREFIX_DECA         0x11
220 #define RDM_PREFIX_HECTO        0x12
221 #define RDM_PREFIX_KILO         0x13
222 #define RDM_PREFIX_MEGA         0x14
223 #define RDM_PREFIX_GIGA         0x15
224 #define RDM_PREFIX_TERRA        0x16
225 #define RDM_PREFIX_PETA         0x17
226 #define RDM_PREFIX_EXA          0x18
227 #define RDM_PREFIX_ZETTA        0x19
228 #define RDM_PREFIX_YOTTA        0x1A
229
230 static const value_string rdm_prefix_vals[] = {
231         { RDM_PREFIX_NONE,      "NONE (x1)" },
232         { RDM_PREFIX_DECI,      "deci (x10^-1)" },
233         { RDM_PREFIX_CENTI,     "centi (x10^-2)" },
234         { RDM_PREFIX_MILLI,     "milli (x10^-3)" },
235         { RDM_PREFIX_MICRO,     "micro (x10^-6)" },
236         { RDM_PREFIX_NANO,      "nano (x10^-9)" },
237         { RDM_PREFIX_PICO,      "pico (x10^-12)" },
238         { RDM_PREFIX_FEMPTO,    "fempto (x10^-15)" },
239         { RDM_PREFIX_ATTO,      "atto (x10^-18)" },
240         { RDM_PREFIX_ZEPTO,     "zepto (x10^-21)" },
241         { RDM_PREFIX_YOCTO,     "yocto (x10^-24)" },
242         { RDM_PREFIX_DECA,      "deca (x10^1)" },
243         { RDM_PREFIX_HECTO,     "hecto (x10^2)" },
244         { RDM_PREFIX_KILO,      "kilo (x10^3)" },
245         { RDM_PREFIX_MEGA,      "mega (x10^6)" },
246         { RDM_PREFIX_GIGA,      "giga (x10^9)" },
247         { RDM_PREFIX_TERRA,     "terra (x10^12)" },
248         { RDM_PREFIX_PETA,      "peta (x10^15)" },
249         { RDM_PREFIX_EXA,       "exa (x10^18)" },
250         { RDM_PREFIX_ZETTA,     "zetta (x10^21)" },
251         { RDM_PREFIX_YOTTA,     "yotta (x10^24)" },
252         { 0, NULL },
253 };
254 static value_string_ext rdm_prefix_vals_ext = VALUE_STRING_EXT_INIT(rdm_prefix_vals);
255
256 #define RDM_UNITS_NONE                        0x00
257 #define RDM_UNITS_CENTIGRADE                  0x01
258 #define RDM_UNITS_VOLTS_DC                    0x02
259 #define RDM_UNITS_VOLTS_AC_PEAK               0x03
260 #define RDM_UNITS_VOLTS_AC_RMS                0x04
261 #define RDM_UNITS_AMPERE_DC                   0x05
262 #define RDM_UNITS_AMPERE_AC_PEAK              0x06
263 #define RDM_UNITS_AMPERE_AC_RMS               0x07
264 #define RDM_UNITS_HERTZ                       0x08
265 #define RDM_UNITS_OHM                         0x09
266 #define RDM_UNITS_WATT                        0x0A
267 #define RDM_UNITS_KILOGRAM                    0x0B
268 #define RDM_UNITS_METERS                      0x0C
269 #define RDM_UNITS_METERS_SQUARED              0x0D
270 #define RDM_UNITS_METERS_CUBED                0x0E
271 #define RDM_UNITS_KILOGRAMMES_PER_METER_CUBED 0x0F
272 #define RDM_UNITS_METERS_PER_SECOND           0x10
273 #define RDM_UNITS_METERS_PER_SECOND_SQUARED   0x11
274 #define RDM_UNITS_NEWTON                      0x12
275 #define RDM_UNITS_JOULE                       0x13
276 #define RDM_UNITS_PASCAL                      0x14
277 #define RDM_UNITS_SECOND                      0x15
278 #define RDM_UNITS_DEGREE                      0x16
279 #define RDM_UNITS_STERADIAN                   0x17
280 #define RDM_UNITS_CANDELA                     0x18
281 #define RDM_UNITS_LUMEN                       0x19
282 #define RDM_UNITS_LUX                         0x1A
283 #define RDM_UNITS_IRE                         0x1B
284 #define RDM_UNITS_BYTE                        0x1C
285
286 static const value_string rdm_unit_vals[] = {
287         { RDM_UNITS_NONE,                        "NONE" },
288         { RDM_UNITS_CENTIGRADE,                  "Centigrade" },
289         { RDM_UNITS_VOLTS_DC,                    "Volts DC" },
290         { RDM_UNITS_VOLTS_AC_PEAK,               "Volts AC Peak" },
291         { RDM_UNITS_VOLTS_AC_RMS,                "Volts AC RMS" },
292         { RDM_UNITS_AMPERE_DC,                   "Ampere DC" },
293         { RDM_UNITS_AMPERE_AC_PEAK,              "Ampere AC Peak" },
294         { RDM_UNITS_AMPERE_AC_RMS,               "Ampere AC RMS" },
295         { RDM_UNITS_HERTZ,                       "Hertz" },
296         { RDM_UNITS_OHM,                         "Ohm" },
297         { RDM_UNITS_WATT,                        "Watt" },
298         { RDM_UNITS_KILOGRAM,                    "Kilogram" },
299         { RDM_UNITS_METERS,                      "Meters" },
300         { RDM_UNITS_METERS_SQUARED,              "Meters Squared" },
301         { RDM_UNITS_METERS_CUBED,                "Meters Cubed" },
302         { RDM_UNITS_KILOGRAMMES_PER_METER_CUBED, "Kilogrammes per Meter Cubed" },
303         { RDM_UNITS_METERS_PER_SECOND,           "Meters per Second" },
304         { RDM_UNITS_METERS_PER_SECOND_SQUARED,   "Meters per Second Squared" },
305         { RDM_UNITS_NEWTON,                      "Newton" },
306         { RDM_UNITS_JOULE,                       "Joule" },
307         { RDM_UNITS_PASCAL,                      "Pascal" },
308         { RDM_UNITS_SECOND,                      "Second" },
309         { RDM_UNITS_DEGREE,                      "Degree" },
310         { RDM_UNITS_STERADIAN,                   "Steradian" },
311         { RDM_UNITS_CANDELA,                     "Candela" },
312         { RDM_UNITS_LUMEN,                       "Lumen" },
313         { RDM_UNITS_LUX,                         "Lux" },
314         { RDM_UNITS_IRE,                         "Ire" },
315         { RDM_UNITS_BYTE,                        "Byte" },
316         { 0, NULL },
317 };
318 static value_string_ext rdm_unit_vals_ext = VALUE_STRING_EXT_INIT(rdm_unit_vals);
319
320 #define RDM_SENS_TEMPERATURE        0x00
321 #define RDM_SENS_VOLTAGE            0x01
322 #define RDM_SENS_CURRENT            0x02
323 #define RDM_SENS_FREQUENCY          0x03
324 #define RDM_SENS_RESISTANCE         0x04
325 #define RDM_SENS_POWER              0x05
326 #define RDM_SENS_MASS               0x06
327 #define RDM_SENS_LENGTH             0x07
328 #define RDM_SENS_AREA               0x08
329 #define RDM_SENS_VOLUME             0x09
330 #define RDM_SENS_DENSITY            0x0A
331 #define RDM_SENS_VELOCITY           0x0B
332 #define RDM_SENS_ACCELERATION       0x0C
333 #define RDM_SENS_FORCE              0x0D
334 #define RDM_SENS_ENERGY             0x0E
335 #define RDM_SENS_PRESSURE           0x0F
336 #define RDM_SENS_TIME               0x10
337 #define RDM_SENS_ANGLE              0x11
338 #define RDM_SENS_POSITION_X         0x12
339 #define RDM_SENS_POSITION_Y         0x13
340 #define RDM_SENS_POSITION_Z         0x14
341 #define RDM_SENS_ANGULAR_VELOCITY   0x15
342 #define RDM_SENS_LUMINOUS_INTENSITY 0x16
343 #define RDM_SENS_LUMINOUS_FLUX      0x17
344 #define RDM_SENS_ILLUMINANCE        0x18
345 #define RDM_SENS_CHROMINANCE_RED    0x19
346 #define RDM_SENS_CHROMINANCE_GREEN  0x1A
347 #define RDM_SENS_CHROMINANCE_BLUE   0x1B
348 #define RDM_SENS_CONTACTS           0x1C
349 #define RDM_SENS_MEMORY             0x1D
350 #define RDM_SENS_ITEMS              0x1E
351 #define RDM_SENS_HUMIDITY           0x1F
352 #define RDM_SENS_COUNTER_16BIT      0x20
353 #define RDM_SENS_OTHER              0x7F
354
355 static const value_string rdm_sensor_type_vals[] = {
356         { RDM_SENS_TEMPERATURE,         "Temperature" },
357         { RDM_SENS_VOLTAGE,             "Voltage" },
358         { RDM_SENS_CURRENT,             "Current" },
359         { RDM_SENS_FREQUENCY,           "Frequency" },
360         { RDM_SENS_RESISTANCE,          "Resistance" },
361         { RDM_SENS_POWER,               "Power" },
362         { RDM_SENS_MASS,                "Mass" },
363         { RDM_SENS_LENGTH,              "Lenght" },
364         { RDM_SENS_AREA,                "Area" },
365         { RDM_SENS_VOLUME,              "Volume" },
366         { RDM_SENS_DENSITY,             "Density" },
367         { RDM_SENS_VELOCITY,            "Velocity" },
368         { RDM_SENS_ACCELERATION,        "Acceleration" },
369         { RDM_SENS_FORCE,               "Force" },
370         { RDM_SENS_ENERGY,              "Energy" },
371         { RDM_SENS_PRESSURE,            "Pressure" },
372         { RDM_SENS_TIME,                "Time" },
373         { RDM_SENS_ANGLE,               "Angle" },
374         { RDM_SENS_POSITION_X,          "Position X" },
375         { RDM_SENS_POSITION_Y,          "Position Y" },
376         { RDM_SENS_POSITION_Z,          "Position Z" },
377         { RDM_SENS_ANGULAR_VELOCITY,    "Angular Velocity" },
378         { RDM_SENS_LUMINOUS_INTENSITY,  "Luminous Intensity" },
379         { RDM_SENS_LUMINOUS_FLUX,       "Luminous Flux" },
380         { RDM_SENS_ILLUMINANCE,         "Illuminance" },
381         { RDM_SENS_CHROMINANCE_RED,     "Chrominance Red" },
382         { RDM_SENS_CHROMINANCE_GREEN,   "Chrominance Green" },
383         { RDM_SENS_CHROMINANCE_BLUE,    "Chrominance Blue" },
384         { RDM_SENS_CONTACTS,            "Contacts" },
385         { RDM_SENS_MEMORY,              "Memory" },
386         { RDM_SENS_ITEMS,               "Items" },
387         { RDM_SENS_HUMIDITY,            "Humidity" },
388         { RDM_SENS_COUNTER_16BIT,       "Counter 16bit" },
389         { RDM_SENS_OTHER,               "Other" },
390         { 0, NULL} ,
391 };
392 static value_string_ext rdm_sensor_type_vals_ext = VALUE_STRING_EXT_INIT(rdm_sensor_type_vals);
393
394 #define RDM_PRODUCT_CATEGORY_NOT_DECLARED               0x0000
395 #define RDM_PRODUCT_CATEGORY_FIXTURE                    0x0100
396 #define RDM_PRODUCT_CATEGORY_FIXTURE_FIXED              0x0101
397 #define RDM_PRODUCT_CATEGORY_FIXTURE_MOVING_YOKE        0x0102
398 #define RDM_PRODUCT_CATEGORY_FIXTURE_MOVING_MIRROR      0x0103
399 #define RDM_PRODUCT_CATEGORY_FIXTURE_OTHER              0x01FF
400 #define RDM_PRODUCT_CATEGORY_FIXTURE_ACCESSORY          0x0200
401 #define RDM_PRODUCT_CATEGORY_FIXTURE_ACCESSORY_COLOR    0x0201
402 #define RDM_PRODUCT_CATEGORY_FIXTURE_ACCESSORY_YOKE     0x0202
403 #define RDM_PRODUCT_CATEGORY_FIXTURE_ACCESSORY_MIRROR   0x0203
404 #define RDM_PRODUCT_CATEGORY_FIXTURE_ACCESSORY_EFFECT   0x0204
405 #define RDM_PRODUCT_CATEGORY_FIXTURE_ACCESSORY_BEAM     0x0205
406 #define RDM_PRODUCT_CATEGORY_FIXTURE_ACCESSORY_OTHER    0x02FF
407 #define RDM_PRODUCT_CATEGORY_PROJECTOR                  0x0300
408 #define RDM_PRODUCT_CATEGORY_PROJECTOR_FIXED            0x0301
409 #define RDM_PRODUCT_CATEGORY_PROJECTOR_MOVING_YOKE      0x0302
410 #define RDM_PRODUCT_CATEGORY_PROJECTOR_MOVING_MIRROR    0x0303
411 #define RDM_PRODUCT_CATEGORY_PROJECTOR_OTHER            0x03FF
412 #define RDM_PRODUCT_CATEGORY_ATMOSPHERIC                0x0400
413 #define RDM_PRODUCT_CATEGORY_ATMOSPHERIC_EFFECT         0x0401
414 #define RDM_PRODUCT_CATEGORY_ATMOSPHERIC_PYRO           0x0402
415 #define RDM_PRODUCT_CATEGORY_ATMOSPHERIC_OTHER          0x04FF
416 #define RDM_PRODUCT_CATEGORY_DIMMER                     0x0500
417 #define RDM_PRODUCT_CATEGORY_DIMMER_AC_INCANDESCENT     0x0501
418 #define RDM_PRODUCT_CATEGORY_DIMMER_AC_FLUORESCENT      0x0502
419 #define RDM_PRODUCT_CATEGORY_DIMMER_AC_COLDCATHODE      0x0503
420 #define RDM_PRODUCT_CATEGORY_DIMMER_AC_NONDIM           0x0504
421 #define RDM_PRODUCT_CATEGORY_DIMMER_AC_ELV              0x0505
422 #define RDM_PRODUCT_CATEGORY_DIMMER_AC_OTHER            0x0506
423 #define RDM_PRODUCT_CATEGORY_DIMMER_DC_LEVEL            0x0507
424 #define RDM_PRODUCT_CATEGORY_DIMMER_DC_PWM              0x0508
425 #define RDM_PRODUCT_CATEGORY_DIMMER_CS_LED              0x0509
426 #define RDM_PRODUCT_CATEGORY_DIMMER_OTHER               0x05FF
427 #define RDM_PRODUCT_CATEGORY_POWER                      0x0600
428 #define RDM_PRODUCT_CATEGORY_POWER_CONTROL              0x0601
429 #define RDM_PRODUCT_CATEGORY_POWER_SOURCE               0x0602
430 #define RDM_PRODUCT_CATEGORY_POWER_OTHER                0x06FF
431 #define RDM_PRODUCT_CATEGORY_SCENIC                     0x0700
432 #define RDM_PRODUCT_CATEGORY_SCENIC_DRIVE               0x0701
433 #define RDM_PRODUCT_CATEGORY_SCENIC_OTHER               0x07FF
434 #define RDM_PRODUCT_CATEGORY_DATA                       0x0800
435 #define RDM_PRODUCT_CATEGORY_DATA_DISTRIBUTION          0x0801
436 #define RDM_PRODUCT_CATEGORY_DATA_CONVERSION            0x0802
437 #define RDM_PRODUCT_CATEGORY_DATA_OTHER                 0x08FF
438 #define RDM_PRODUCT_CATEGORY_AV                         0x0900
439 #define RDM_PRODUCT_CATEGORY_AV_AUDIO                   0x0901
440 #define RDM_PRODUCT_CATEGORY_AV_VIDEO                   0x0902
441 #define RDM_PRODUCT_CATEGORY_AV_OTHER                   0x09FF
442 #define RDM_PRODUCT_CATEGORY_MONITOR                    0x0A00
443 #define RDM_PRODUCT_CATEGORY_MONITOR_ACLINEPOWER        0x0A01
444 #define RDM_PRODUCT_CATEGORY_MONITOR_DCPOWER            0x0A02
445 #define RDM_PRODUCT_CATEGORY_MONITOR_ENVIRONMENTAL      0x0A03
446 #define RDM_PRODUCT_CATEGORY_MONITOR_OTHER              0x0AFF
447 #define RDM_PRODUCT_CATEGORY_CONTROL                    0x7000
448 #define RDM_PRODUCT_CATEGORY_CONTROL_CONTROLLER         0x7001
449 #define RDM_PRODUCT_CATEGORY_CONTROL_BACKUPDEVICE       0x7002
450 #define RDM_PRODUCT_CATEGORY_CONTROL_OTHER              0x70FF
451 #define RDM_PRODUCT_CATEGORY_TEST                       0x7100
452 #define RDM_PRODUCT_CATEGORY_TEST_EQUIPMENT             0x7101
453 #define RDM_PRODUCT_CATEGORY_TEST_EQUIPMENT_OTHER       0x71FF
454 #define RDM_PRODUCT_CATEGORY_OTHER                      0x7FFF
455
456 static const value_string rdm_product_cat_vals[] = {
457         { RDM_PRODUCT_CATEGORY_NOT_DECLARED,             "Not Declared" },
458         { RDM_PRODUCT_CATEGORY_FIXTURE,                  "Fixture" },
459         { RDM_PRODUCT_CATEGORY_FIXTURE_FIXED,            "Fixture Fixed" },
460         { RDM_PRODUCT_CATEGORY_FIXTURE_MOVING_YOKE,      "Fixture Moving Yoke" },
461         { RDM_PRODUCT_CATEGORY_FIXTURE_MOVING_MIRROR,    "Fixture Moving Mirror" },
462         { RDM_PRODUCT_CATEGORY_FIXTURE_OTHER,            "Fixture Other" },
463         { RDM_PRODUCT_CATEGORY_FIXTURE_ACCESSORY,        "Fixture Accessory" },
464         { RDM_PRODUCT_CATEGORY_FIXTURE_ACCESSORY_COLOR,  "Fixture Accessory Color" },
465         { RDM_PRODUCT_CATEGORY_FIXTURE_ACCESSORY_YOKE,   "Fixture Accessory Yoke" },
466         { RDM_PRODUCT_CATEGORY_FIXTURE_ACCESSORY_MIRROR, "Fixture Accessory Mirror" },
467         { RDM_PRODUCT_CATEGORY_FIXTURE_ACCESSORY_EFFECT, "Fixture Accessory Effect" },
468         { RDM_PRODUCT_CATEGORY_FIXTURE_ACCESSORY_BEAM,   "Fixture Accessory Beam" },
469         { RDM_PRODUCT_CATEGORY_FIXTURE_ACCESSORY_OTHER,  "Fixture Accessory Other" },
470         { RDM_PRODUCT_CATEGORY_PROJECTOR,                "Projector" },
471         { RDM_PRODUCT_CATEGORY_PROJECTOR_FIXED,          "Projector Fixed" },
472         { RDM_PRODUCT_CATEGORY_PROJECTOR_MOVING_YOKE,    "Projector Moving Yoke" },
473         { RDM_PRODUCT_CATEGORY_PROJECTOR_MOVING_MIRROR,  "Projector Moving Mirror" },
474         { RDM_PRODUCT_CATEGORY_PROJECTOR_OTHER,          "Projector Other" },
475         { RDM_PRODUCT_CATEGORY_ATMOSPHERIC,              "Atmospheric" },
476         { RDM_PRODUCT_CATEGORY_ATMOSPHERIC_EFFECT,       "Atmospheric Effect" },
477         { RDM_PRODUCT_CATEGORY_ATMOSPHERIC_PYRO,         "Atmospheric Pyro" },
478         { RDM_PRODUCT_CATEGORY_ATMOSPHERIC_OTHER,        "Atmospheric Other" },
479         { RDM_PRODUCT_CATEGORY_DIMMER,                   "Dimmer" },
480         { RDM_PRODUCT_CATEGORY_DIMMER_AC_INCANDESCENT,   "Dimmer AC Incandescent" },
481         { RDM_PRODUCT_CATEGORY_DIMMER_AC_FLUORESCENT,    "Dimmer AC Fluorescent" },
482         { RDM_PRODUCT_CATEGORY_DIMMER_AC_COLDCATHODE,    "Dimmer AC Coldcathode" },
483         { RDM_PRODUCT_CATEGORY_DIMMER_AC_NONDIM,         "Dimmer AC Nondim" },
484         { RDM_PRODUCT_CATEGORY_DIMMER_AC_ELV,            "Dimmer AC ELV" },
485         { RDM_PRODUCT_CATEGORY_DIMMER_AC_OTHER,          "Dimmer AC Other" },
486         { RDM_PRODUCT_CATEGORY_DIMMER_DC_LEVEL,          "Dimmer DC Level" },
487         { RDM_PRODUCT_CATEGORY_DIMMER_DC_PWM,            "Dimmer DC PWM" },
488         { RDM_PRODUCT_CATEGORY_DIMMER_CS_LED,            "Dimmer CS LED" },
489         { RDM_PRODUCT_CATEGORY_DIMMER_OTHER,             "Dimmer Other" },
490         { RDM_PRODUCT_CATEGORY_POWER,                    "Power" },
491         { RDM_PRODUCT_CATEGORY_POWER_CONTROL,            "Power Control" },
492         { RDM_PRODUCT_CATEGORY_POWER_SOURCE,             "Power Source" },
493         { RDM_PRODUCT_CATEGORY_POWER_OTHER,              "Power Other" },
494         { RDM_PRODUCT_CATEGORY_SCENIC,                   "Scenic" },
495         { RDM_PRODUCT_CATEGORY_SCENIC_DRIVE,             "Scenic Drive" },
496         { RDM_PRODUCT_CATEGORY_SCENIC_OTHER,             "Scenic Other" },
497         { RDM_PRODUCT_CATEGORY_DATA,                     "Data" },
498         { RDM_PRODUCT_CATEGORY_DATA_DISTRIBUTION,        "Data Distribution" },
499         { RDM_PRODUCT_CATEGORY_DATA_CONVERSION,          "Data Conversion" },
500         { RDM_PRODUCT_CATEGORY_DATA_OTHER,               "Data Other" },
501         { RDM_PRODUCT_CATEGORY_AV,                       "AV" },
502         { RDM_PRODUCT_CATEGORY_AV_AUDIO,                 "AV Audio" },
503         { RDM_PRODUCT_CATEGORY_AV_VIDEO,                 "AV Video" },
504         { RDM_PRODUCT_CATEGORY_AV_OTHER,                 "AV Other" },
505         { RDM_PRODUCT_CATEGORY_MONITOR,                  "Monitor" },
506         { RDM_PRODUCT_CATEGORY_MONITOR_ACLINEPOWER,      "Monitor AC Line Power" },
507         { RDM_PRODUCT_CATEGORY_MONITOR_DCPOWER,          "Monitor DC Power" },
508         { RDM_PRODUCT_CATEGORY_MONITOR_ENVIRONMENTAL,    "Monitor Environmental" },
509         { RDM_PRODUCT_CATEGORY_MONITOR_OTHER,            "Monitor Other" },
510         { RDM_PRODUCT_CATEGORY_CONTROL,                  "Control" },
511         { RDM_PRODUCT_CATEGORY_CONTROL_CONTROLLER,       "Control Controller" },
512         { RDM_PRODUCT_CATEGORY_CONTROL_BACKUPDEVICE,     "Control Backup Device" },
513         { RDM_PRODUCT_CATEGORY_CONTROL_OTHER,            "Control Other" },
514         { RDM_PRODUCT_CATEGORY_TEST,                     "Test" },
515         { RDM_PRODUCT_CATEGORY_TEST_EQUIPMENT,           "Test Equipment" },
516         { RDM_PRODUCT_CATEGORY_TEST_EQUIPMENT_OTHER,     "Test Equipment Other" },
517         { RDM_PRODUCT_CATEGORY_OTHER,                    "Other" },
518         { 0, NULL },
519 };
520 static value_string_ext rdm_product_cat_vals_ext = VALUE_STRING_EXT_INIT(rdm_product_cat_vals);
521
522 static int proto_rdm = -1;
523
524 static int hf_rdm_sub_start_code = -1;
525 static int hf_rdm_message_length = -1;
526 static int hf_rdm_dest_uid = -1;
527 static int hf_rdm_src_uid = -1;
528 static int hf_rdm_transaction_number = -1;
529 static int hf_rdm_port_id = -1;
530 static int hf_rdm_response_type = -1;
531 static int hf_rdm_message_count = -1;
532 static int hf_rdm_sub_device = -1;
533 static int hf_rdm_mdb = -1;
534 static int hf_rdm_command_class = -1;
535 static int hf_rdm_parameter_id = -1;
536 static int hf_rdm_parameter_data_length = -1;
537 static int hf_rdm_parameter_data = -1;
538 static int hf_rdm_parameter_data_raw = -1;
539 static int hf_rdm_intron = -1;
540 static int hf_rdm_checksum = -1;
541 static int hf_rdm_checksum_good = -1;
542 static int hf_rdm_checksum_bad = -1;
543 static int hf_rdm_trailer = -1;
544
545 static int hf_rdm_pd_device_label = -1;
546
547 static int hf_rdm_pd_manu_label = -1;
548
549 static int hf_rdm_pd_dmx_start_address = -1;
550
551 static int hf_rdm_pd_queued_message_status = -1;
552
553 static int hf_rdm_pd_sensor_nr = -1;
554 static int hf_rdm_pd_sensor_type = -1;
555 static int hf_rdm_pd_sensor_unit = -1;
556 static int hf_rdm_pd_sensor_prefix = -1;
557 static int hf_rdm_pd_sensor_value_pres = -1;
558 static int hf_rdm_pd_sensor_value_low = -1;
559 static int hf_rdm_pd_sensor_value_high = -1;
560 static int hf_rdm_pd_sensor_value_rec = -1;
561
562 static int hf_rdm_pd_sensor_range_min_value = -1;
563 static int hf_rdm_pd_sensor_range_max_value = -1;
564 static int hf_rdm_pd_sensor_normal_min_value = -1;
565 static int hf_rdm_pd_sensor_normal_max_value = -1;
566 static int hf_rdm_pd_sensor_recorded_value_support = -1;
567 static int hf_rdm_pd_sensor_description = -1;
568
569 static int hf_rdm_pd_device_hours = -1;
570 static int hf_rdm_pd_lamp_hours = -1;
571 static int hf_rdm_pd_lamp_strikes = -1;
572
573
574 static int hf_rdm_pd_proto_vers = -1;
575 static int hf_rdm_pd_device_model_id = -1;
576 static int hf_rdm_pd_product_cat = -1;
577 static int hf_rdm_pd_software_vers_id = -1;
578 static int hf_rdm_pd_dmx_footprint = -1;
579 static int hf_rdm_pd_dmx_pers_current = -1;
580 static int hf_rdm_pd_dmx_pers_total = -1;
581 static int hf_rdm_pd_sub_device_count = -1;
582 static int hf_rdm_pd_sensor_count = -1;
583
584 static int hf_rdm_pd_device_model_description = -1;
585
586 static int hf_rdm_pd_disc_unique_branch_lb_uid = -1;
587 static int hf_rdm_pd_disc_unique_branch_ub_uid = -1;
588 static int hf_rdm_pd_disc_mute_control_field = -1;
589 static int hf_rdm_pd_disc_mute_binding_uid = -1;
590 static int hf_rdm_pd_disc_unmute_control_field = -1;
591 static int hf_rdm_pd_disc_unmute_binding_uid = -1;
592 static int hf_rdm_pd_proxied_devices_uid = -1;
593 static int hf_rdm_pd_proxied_device_count = -1;
594 static int hf_rdm_pd_proxied_device_list_change = -1;
595 static int hf_rdm_pd_real_time_clock_year = -1;
596 static int hf_rdm_pd_real_time_clock_month = -1;
597 static int hf_rdm_pd_real_time_clock_day = -1;
598 static int hf_rdm_pd_real_time_clock_hour = -1;
599 static int hf_rdm_pd_real_time_clock_minute = -1;
600 static int hf_rdm_pd_real_time_clock_second = -1;
601 static int hf_rdm_pd_lamp_state = -1;
602 static int hf_rdm_pd_lamp_on_mode = -1;
603 static int hf_rdm_pd_device_power_cycles = -1;
604 static int hf_rdm_pd_display_invert = -1;
605 static int hf_rdm_pd_display_level = -1;
606 static int hf_rdm_pd_pan_invert = -1;
607 static int hf_rdm_pd_tilt_invert = -1;
608 static int hf_rdm_pd_tilt_swap = -1;
609 static int hf_rdm_pd_selftest_nr = -1;
610 static int hf_rdm_pd_selftest_state = -1;
611 static int hf_rdm_pd_selftest_description = -1;
612 static int hf_rdm_pd_language_code = -1;
613 static int hf_rdm_pd_identify_device = -1;
614 static int hf_rdm_pd_identify_device_state = -1;
615 static int hf_rdm_pd_reset_device = -1;
616 static int hf_rdm_pd_power_state = -1;
617 static int hf_rdm_pd_capture_preset_scene_nr = -1;
618 static int hf_rdm_pd_capture_preset_up_fade_time = -1;
619 static int hf_rdm_pd_capture_preset_down_fade_time = -1;
620 static int hf_rdm_pd_capture_preset_wait_time = -1;
621 static int hf_rdm_pd_preset_playback_mode = -1;
622 static int hf_rdm_pd_preset_playback_level = -1;
623 static int hf_rdm_pd_parameter_id = -1;
624 static int hf_rdm_pd_parameter_pdl_size = -1;
625 static int hf_rdm_pd_parameter_data_type = -1;
626 static int hf_rdm_pd_parameter_cmd_class = -1;
627 static int hf_rdm_pd_parameter_type = -1;
628 static int hf_rdm_pd_parameter_unit = -1;
629 static int hf_rdm_pd_parameter_prefix = -1;
630 static int hf_rdm_pd_parameter_min_value = -1;
631 static int hf_rdm_pd_parameter_max_value = -1;
632 static int hf_rdm_pd_parameter_default_value = -1;
633 static int hf_rdm_pd_parameter_description = -1;
634 static int hf_rdm_pd_software_version_label = -1;
635 static int hf_rdm_pd_boot_software_version_id = -1;
636 static int hf_rdm_pd_boot_software_version_label = -1;
637 static int hf_rdm_pd_comms_status_short_msg = -1;
638 static int hf_rdm_pd_comms_status_len_mismatch = -1;
639 static int hf_rdm_pd_comms_status_csum_fail = -1;
640 static int hf_rdm_pd_status_messages_type = -1;
641 static int hf_rdm_pd_status_messages_sub_device_id = -1;
642 static int hf_rdm_pd_status_messages_id = -1;
643 static int hf_rdm_pd_status_messages_data_value_1 = -1;
644 static int hf_rdm_pd_status_messages_data_value_2 = -1;
645 static int hf_rdm_pd_status_id = -1;
646 static int hf_rdm_pd_status_id_description = -1;
647 static int hf_rdm_pd_sub_device_status_report_threshold_status_type = -1;
648 static int hf_rdm_pd_product_detail_id_list = -1;
649 static int hf_rdm_pd_factory_defaults = -1;
650 static int hf_rdm_pd_dmx_pers_nr = -1;
651 static int hf_rdm_pd_dmx_pers_count = -1;
652 static int hf_rdm_pd_dmx_pers_description = -1;
653 static int hf_rdm_pd_dmx_pers_slots = -1;
654 static int hf_rdm_pd_dmx_pers_text = -1;
655 static int hf_rdm_pd_slot_offset = -1;
656 static int hf_rdm_pd_slot_type = -1;
657 static int hf_rdm_pd_slot_label_id = -1;
658 static int hf_rdm_pd_slot_nr = -1;
659 static int hf_rdm_pd_slot_description = -1;
660 static int hf_rdm_pd_slot_value = -1;
661 static int hf_rdm_pd_rec_value_support = -1;
662
663 static int ett_rdm = -1;
664
665 static guint16
666 rdm_checksum(tvbuff_t *tvb, guint length)
667 {
668         guint16 sum = RDM_SC_RDM;
669         guint   i;
670         for (i = 0; i < length; i++)
671                 sum += tvb_get_guint8(tvb, i);
672         return sum;
673 }
674
675 static guint
676 dissect_rdm_pd_queued_message(tvbuff_t *tvb, guint offset, proto_tree *tree, guint8 cc, guint8 len _U_)
677 {
678         switch(cc) {
679         case RDM_CC_GET_COMMAND:
680                 proto_tree_add_item(tree, hf_rdm_pd_queued_message_status, tvb,
681                         offset, 1, ENC_BIG_ENDIAN);
682                 offset += 1;
683                 break;
684         }
685
686         return offset;
687 }
688
689 static guint
690 dissect_rdm_pd_dmx_start_address(tvbuff_t *tvb, guint offset, proto_tree *tree, guint8 cc, guint8 len _U_)
691 {
692         switch(cc) {
693         case RDM_CC_SET_COMMAND:
694         case RDM_CC_GET_COMMAND_RESPONSE:
695                 proto_tree_add_item(tree, hf_rdm_pd_dmx_start_address, tvb,
696                         offset, 2, ENC_BIG_ENDIAN);
697                 offset +=  2;
698                 break;
699         }
700
701         return offset;
702 }
703
704 static guint
705 dissect_rdm_pd_device_info(tvbuff_t *tvb _U_, guint offset, proto_tree *tree _U_, guint8 cc, guint8 len _U_)
706 {
707         switch(cc) {
708         case RDM_CC_GET_COMMAND_RESPONSE:
709                 proto_tree_add_item(tree, hf_rdm_pd_proto_vers, tvb,
710                         offset, 2, ENC_BIG_ENDIAN);
711                 offset +=  2;
712
713                 proto_tree_add_item(tree, hf_rdm_pd_device_model_id, tvb,
714                         offset, 2, ENC_BIG_ENDIAN);
715                 offset +=  2;
716
717                 proto_tree_add_item(tree, hf_rdm_pd_product_cat, tvb,
718                         offset, 2, ENC_BIG_ENDIAN);
719                 offset +=  2;
720
721                 proto_tree_add_item(tree, hf_rdm_pd_software_vers_id, tvb,
722                         offset, 4, ENC_BIG_ENDIAN);
723                 offset +=  4;
724
725                 proto_tree_add_item(tree, hf_rdm_pd_dmx_footprint, tvb,
726                         offset, 2, ENC_BIG_ENDIAN);
727                 offset +=  2;
728
729                 proto_tree_add_item(tree, hf_rdm_pd_dmx_pers_current, tvb,
730                         offset, 1, ENC_BIG_ENDIAN);
731                 offset += 1;
732
733                 proto_tree_add_item(tree, hf_rdm_pd_dmx_pers_total, tvb,
734                         offset, 1, ENC_BIG_ENDIAN);
735                 offset += 1;
736
737                 proto_tree_add_item(tree, hf_rdm_pd_dmx_start_address, tvb,
738                         offset, 2, ENC_BIG_ENDIAN);
739                 offset +=  2;
740
741                 proto_tree_add_item(tree, hf_rdm_pd_sub_device_count, tvb,
742                         offset, 2, ENC_BIG_ENDIAN);
743                 offset +=  2;
744
745                 proto_tree_add_item(tree, hf_rdm_pd_sensor_count, tvb,
746                         offset, 1, ENC_BIG_ENDIAN);
747                 offset += 1;
748
749                 break;
750         }
751
752         return offset;
753 }
754
755
756 static guint
757 dissect_rdm_pd_device_model_description(tvbuff_t *tvb, guint offset, proto_tree *tree, guint8 cc, guint8 len)
758 {
759         switch(cc) {
760         case RDM_CC_GET_COMMAND_RESPONSE:
761                 proto_tree_add_item(tree, hf_rdm_pd_device_model_description, tvb,
762                         offset, len, ENC_ASCII|ENC_NA);
763                 offset +=  len;
764                 break;
765         }
766
767         return offset;
768 }
769
770
771 static guint
772 dissect_rdm_pd_device_label(tvbuff_t *tvb, guint offset, proto_tree *tree, guint8 cc, guint8 len)
773 {
774         switch(cc) {
775         case RDM_CC_SET_COMMAND:
776         case RDM_CC_GET_COMMAND_RESPONSE:
777                 proto_tree_add_item(tree, hf_rdm_pd_device_label, tvb,
778                         offset, len, ENC_ASCII|ENC_NA);
779                 offset +=  len;
780                 break;
781         }
782
783         return offset;
784 }
785
786
787 static guint
788 dissect_rdm_pd_device_hours(tvbuff_t *tvb, guint offset, proto_tree *tree, guint8 cc, guint8 len _U_)
789 {
790         switch(cc) {
791         case RDM_CC_SET_COMMAND:
792         case RDM_CC_GET_COMMAND_RESPONSE:
793                 proto_tree_add_item(tree, hf_rdm_pd_device_hours, tvb,
794                         offset, 4, ENC_BIG_ENDIAN);
795                 offset +=  4;
796                 break;
797         }
798
799         return offset;
800 }
801
802
803 static guint
804 dissect_rdm_pd_lamp_hours(tvbuff_t *tvb, guint offset, proto_tree *tree, guint8 cc, guint8 len _U_)
805 {
806         switch(cc) {
807         case RDM_CC_SET_COMMAND:
808         case RDM_CC_GET_COMMAND_RESPONSE:
809                 proto_tree_add_item(tree, hf_rdm_pd_lamp_hours, tvb,
810                         offset, 4, ENC_BIG_ENDIAN);
811                 offset +=  4;
812                 break;
813         }
814
815         return offset;
816 }
817
818
819 static guint
820 dissect_rdm_pd_lamp_strikes(tvbuff_t *tvb, guint offset, proto_tree *tree, guint8 cc, guint8 len _U_)
821 {
822         switch(cc) {
823         case RDM_CC_SET_COMMAND:
824         case RDM_CC_GET_COMMAND_RESPONSE:
825                 proto_tree_add_item(tree, hf_rdm_pd_lamp_strikes, tvb,
826                         offset, 4, ENC_BIG_ENDIAN);
827                 offset +=  4;
828                 break;
829         }
830
831         return offset;
832 }
833
834
835 static guint
836 dissect_rdm_pd_sensor_definition(tvbuff_t *tvb, guint offset, proto_tree *tree, guint8 cc, guint8 len)
837 {
838         switch(cc) {
839         case RDM_CC_GET_COMMAND:
840                 proto_tree_add_item(tree, hf_rdm_pd_sensor_nr, tvb,
841                         offset, 1, ENC_BIG_ENDIAN);
842                 offset += 1;
843                 break;
844
845         case RDM_CC_GET_COMMAND_RESPONSE:
846                 proto_tree_add_item(tree, hf_rdm_pd_sensor_nr, tvb,
847                         offset, 1, ENC_BIG_ENDIAN);
848                 offset += 1;
849
850                 proto_tree_add_item(tree, hf_rdm_pd_sensor_type, tvb,
851                         offset, 1, ENC_BIG_ENDIAN);
852                 offset += 1;
853
854                 proto_tree_add_item(tree, hf_rdm_pd_sensor_unit, tvb,
855                         offset, 1, ENC_BIG_ENDIAN);
856                 offset += 1;
857
858                 proto_tree_add_item(tree, hf_rdm_pd_sensor_prefix, tvb,
859                         offset, 1, ENC_BIG_ENDIAN);
860                 offset += 1;
861
862                 proto_tree_add_item(tree, hf_rdm_pd_sensor_range_min_value, tvb,
863                         offset, 2, ENC_BIG_ENDIAN);
864                 offset +=  2;
865
866                 proto_tree_add_item(tree, hf_rdm_pd_sensor_range_max_value, tvb,
867                         offset, 2, ENC_BIG_ENDIAN);
868                 offset +=  2;
869
870                 proto_tree_add_item(tree, hf_rdm_pd_sensor_normal_min_value, tvb,
871                         offset, 2, ENC_BIG_ENDIAN);
872                 offset +=  2;
873
874                 proto_tree_add_item(tree, hf_rdm_pd_sensor_normal_max_value, tvb,
875                         offset, 2, ENC_BIG_ENDIAN);
876                 offset +=  2;
877
878                 proto_tree_add_item(tree, hf_rdm_pd_sensor_recorded_value_support, tvb,
879                         offset, 1, ENC_BIG_ENDIAN);
880                 offset += 1;
881
882                 proto_tree_add_item(tree, hf_rdm_pd_sensor_description, tvb,
883                         offset, len - 13, ENC_ASCII|ENC_NA);
884                 offset += (len - 13);
885                 break;
886         }
887
888         return offset;
889 }
890
891 static guint
892 dissect_rdm_pd_sensor_value(tvbuff_t *tvb, guint offset, proto_tree *tree, guint8 cc, guint8 len)
893 {
894         switch(cc) {
895         case RDM_CC_GET_COMMAND:
896         case RDM_CC_SET_COMMAND:
897                 proto_tree_add_item(tree, hf_rdm_pd_sensor_nr, tvb,
898                         offset, 1, ENC_BIG_ENDIAN);
899                 offset += 1;
900                 break;
901
902         case RDM_CC_GET_COMMAND_RESPONSE:
903         case RDM_CC_SET_COMMAND_RESPONSE:
904                 proto_tree_add_item(tree, hf_rdm_pd_sensor_nr, tvb,
905                         offset, 1, ENC_BIG_ENDIAN);
906                 offset += 1;
907                 proto_tree_add_item(tree, hf_rdm_pd_sensor_value_pres, tvb,
908                         offset, 2, ENC_BIG_ENDIAN);
909                 offset +=  2;
910
911                 if (len == 7 || len == 9) {
912                         proto_tree_add_item(tree, hf_rdm_pd_sensor_value_low, tvb,
913                                 offset, 2, ENC_BIG_ENDIAN);
914                         offset +=  2;
915                         proto_tree_add_item(tree, hf_rdm_pd_sensor_value_high, tvb,
916                                 offset, 2, ENC_BIG_ENDIAN);
917                         offset +=  2;
918                 }
919
920                 if (len == 5 || len == 9) {
921                         proto_tree_add_item(tree, hf_rdm_pd_sensor_value_rec, tvb,
922                                 offset, 2, ENC_BIG_ENDIAN);
923                         offset +=  2;
924                 }
925
926                 break;
927         }
928
929         return offset;
930 }
931
932 static guint
933 dissect_rdm_pd_manufacturer_label(tvbuff_t *tvb, guint offset, proto_tree *tree, guint8 cc, guint8 len)
934 {
935         switch(cc) {
936         case RDM_CC_GET_COMMAND_RESPONSE:
937                 proto_tree_add_item(tree, hf_rdm_pd_manu_label, tvb,
938                         offset, len, ENC_ASCII|ENC_NA);
939                 offset +=  len;
940                 break;
941         }
942
943         return offset;
944 }
945
946 static guint
947 dissect_rdm_pd_disc_unique_branch(tvbuff_t *tvb, guint offset, proto_tree *tree, guint8 cc, guint8 len _U_)
948 {
949         switch(cc) {
950         case RDM_CC_DISCOVERY_COMMAND:
951                 proto_tree_add_item(tree, hf_rdm_pd_disc_unique_branch_lb_uid, tvb,
952                         offset, 6, ENC_NA);
953                 offset += 6;
954
955                 proto_tree_add_item(tree, hf_rdm_pd_disc_unique_branch_ub_uid, tvb,
956                         offset, 6, ENC_NA);
957                 offset += 6;
958                 break;
959         }
960
961         return offset;
962 }
963
964 static guint
965 dissect_rdm_pd_disc_mute(tvbuff_t *tvb, guint offset, proto_tree *tree, guint8 cc, guint8 len)
966 {
967         switch(cc) {
968         case RDM_CC_DISCOVERY_COMMAND_RESPONSE:
969                 proto_tree_add_item(tree, hf_rdm_pd_disc_mute_control_field, tvb,
970                         offset, 2, ENC_BIG_ENDIAN);
971                 offset += 2;
972                 if (len > 2) {
973                         proto_tree_add_item(tree, hf_rdm_pd_disc_mute_binding_uid, tvb,
974                                 offset, 6, ENC_NA);
975                         offset += 6;
976                 }
977                 break;
978         }
979
980         return offset;
981 }
982
983 static guint
984 dissect_rdm_pd_disc_un_mute(tvbuff_t *tvb, guint offset, proto_tree *tree, guint8 cc, guint8 len)
985 {
986         switch(cc) {
987         case RDM_CC_DISCOVERY_COMMAND_RESPONSE:
988                 proto_tree_add_item(tree, hf_rdm_pd_disc_unmute_control_field, tvb,
989                         offset, 2, ENC_BIG_ENDIAN);
990                 offset += 2;
991                 if (len > 2) {
992                         proto_tree_add_item(tree, hf_rdm_pd_disc_unmute_binding_uid, tvb,
993                                 offset, 6, ENC_NA);
994                         offset += 6;
995                 }
996                 break;
997         }
998
999         return offset;
1000 }
1001
1002 static guint
1003 dissect_rdm_pd_proxied_devices(tvbuff_t *tvb, guint offset, proto_tree *tree, guint8 cc, guint8 len)
1004 {
1005         switch(cc) {
1006         case RDM_CC_GET_COMMAND_RESPONSE:
1007                 while (len >= 6) {
1008                         proto_tree_add_item(tree, hf_rdm_pd_proxied_devices_uid, tvb,
1009                                 offset, 6, ENC_NA);
1010                         offset += 6;
1011                         len    -= 6;
1012                 }
1013                 break;
1014         }
1015
1016         return offset;
1017 }
1018
1019 static guint
1020 dissect_rdm_pd_proxied_device_count(tvbuff_t *tvb, guint offset, proto_tree *tree, guint8 cc, guint8 len _U_)
1021 {
1022         switch(cc) {
1023         case RDM_CC_GET_COMMAND_RESPONSE:
1024                 proto_tree_add_item(tree, hf_rdm_pd_proxied_device_count, tvb,
1025                         offset, 2, ENC_BIG_ENDIAN);
1026                 offset += 2;
1027                 proto_tree_add_item(tree, hf_rdm_pd_proxied_device_list_change, tvb,
1028                         offset, 1, ENC_BIG_ENDIAN);
1029                 offset += 1;
1030                 break;
1031         }
1032
1033         return offset;
1034 }
1035
1036 static guint
1037 dissect_rdm_pd_comms_status(tvbuff_t *tvb, guint offset, proto_tree *tree, guint8 cc, guint8 len _U_)
1038 {
1039         switch(cc) {
1040         case RDM_CC_GET_COMMAND_RESPONSE:
1041                 proto_tree_add_item(tree, hf_rdm_pd_comms_status_short_msg, tvb,
1042                         offset, 2, ENC_BIG_ENDIAN);
1043                 offset += 2;
1044                 proto_tree_add_item(tree, hf_rdm_pd_comms_status_len_mismatch, tvb,
1045                         offset, 2, ENC_BIG_ENDIAN);
1046                 offset += 2;
1047                 proto_tree_add_item(tree, hf_rdm_pd_comms_status_csum_fail, tvb,
1048                         offset, 2, ENC_BIG_ENDIAN);
1049                 offset += 2;
1050                 break;
1051         }
1052
1053         return offset;
1054 }
1055
1056 static guint
1057 dissect_rdm_pd_status_messages(tvbuff_t *tvb, guint offset, proto_tree *tree, guint8 cc, guint8 len)
1058 {
1059         switch(cc) {
1060         case RDM_CC_GET_COMMAND:
1061                 proto_tree_add_item(tree, hf_rdm_pd_status_messages_type, tvb,
1062                         offset, 1, ENC_BIG_ENDIAN);
1063                 offset += 1;
1064                 break;
1065
1066         case RDM_CC_GET_COMMAND_RESPONSE:
1067                 while (len >= 9) {
1068                         proto_tree_add_item(tree, hf_rdm_pd_status_messages_sub_device_id, tvb,
1069                                 offset, 2, ENC_BIG_ENDIAN);
1070                         offset += 2;
1071                         len    -= 2;
1072                         proto_tree_add_item(tree, hf_rdm_pd_status_messages_type, tvb,
1073                                 offset, 1, ENC_BIG_ENDIAN);
1074                         offset += 1;
1075                         len    -= 1;
1076                         proto_tree_add_item(tree, hf_rdm_pd_status_messages_id, tvb,
1077                                 offset, 2, ENC_BIG_ENDIAN);
1078                         offset += 2;
1079                         len    -= 2;
1080                         proto_tree_add_item(tree, hf_rdm_pd_status_messages_data_value_1, tvb,
1081                                 offset, 2, ENC_BIG_ENDIAN);
1082                         offset += 2;
1083                         len    -= 2;
1084                         proto_tree_add_item(tree, hf_rdm_pd_status_messages_data_value_2, tvb,
1085                                 offset, 2, ENC_BIG_ENDIAN);
1086                         offset += 2;
1087                         len    -= 2;
1088                 }
1089                 break;
1090         }
1091
1092         return offset;
1093 }
1094
1095 static guint
1096 dissect_rdm_pd_status_id_description(tvbuff_t *tvb, guint offset, proto_tree *tree, guint8 cc, guint8 len)
1097 {
1098         switch(cc) {
1099         case RDM_CC_GET_COMMAND:
1100                 proto_tree_add_item(tree, hf_rdm_pd_status_id, tvb,
1101                         offset, 2, ENC_BIG_ENDIAN);
1102                 offset += 2;
1103                 break;
1104
1105         case RDM_CC_GET_COMMAND_RESPONSE:
1106                 proto_tree_add_item(tree, hf_rdm_pd_status_id_description, tvb,
1107                         offset, len, ENC_ASCII|ENC_NA);
1108                 offset += len;
1109                 break;
1110         }
1111
1112         return offset;
1113 }
1114
1115 static guint
1116 dissect_rdm_pd_clear_status_id(tvbuff_t *tvb _U_, guint offset, proto_tree *tree _U_, guint8 cc _U_, guint8 len _U_)
1117 {
1118         return offset;
1119 }
1120
1121 static guint
1122 dissect_rdm_pd_sub_device_status_report_threshold(tvbuff_t *tvb, guint offset, proto_tree *tree, guint8 cc, guint8 len _U_)
1123 {
1124         switch(cc) {
1125         case RDM_CC_SET_COMMAND:
1126         case RDM_CC_GET_COMMAND_RESPONSE:
1127                 proto_tree_add_item(tree, hf_rdm_pd_sub_device_status_report_threshold_status_type, tvb,
1128                         offset, 1, ENC_BIG_ENDIAN);
1129                 offset += 1;
1130                 break;
1131         }
1132
1133         return offset;
1134 }
1135
1136 static guint
1137 dissect_rdm_pd_supported_parameters(tvbuff_t *tvb, guint offset, proto_tree *tree, guint8 cc, guint8 len)
1138 {
1139         switch(cc) {
1140         case RDM_CC_GET_COMMAND_RESPONSE:
1141                 while (len >= 2) {
1142                         proto_tree_add_item(tree, hf_rdm_pd_parameter_id, tvb,
1143                                 offset, 2, ENC_BIG_ENDIAN);
1144                         offset += 2;
1145                         len    -= 2;
1146                 }
1147                 break;
1148         }
1149
1150         return offset;
1151 }
1152
1153 static guint
1154 dissect_rdm_pd_parameter_description(tvbuff_t *tvb, guint offset, proto_tree *tree, guint8 cc, guint8 len)
1155 {
1156         switch(cc) {
1157         case RDM_CC_GET_COMMAND:
1158                 proto_tree_add_item(tree, hf_rdm_pd_parameter_id, tvb,
1159                         offset, 2, ENC_BIG_ENDIAN);
1160                 offset += 2;
1161                 break;
1162
1163         case RDM_CC_GET_COMMAND_RESPONSE:
1164                 proto_tree_add_item(tree, hf_rdm_pd_parameter_id, tvb,
1165                         offset, 2, ENC_BIG_ENDIAN);
1166                 offset += 2;
1167                 proto_tree_add_item(tree, hf_rdm_pd_parameter_pdl_size, tvb,
1168                         offset, 1, ENC_BIG_ENDIAN);
1169                 offset += 1;
1170                 proto_tree_add_item(tree, hf_rdm_pd_parameter_data_type, tvb,
1171                         offset, 1, ENC_BIG_ENDIAN);
1172                 offset += 1;
1173                 proto_tree_add_item(tree, hf_rdm_pd_parameter_cmd_class, tvb,
1174                         offset, 1, ENC_BIG_ENDIAN);
1175                 offset += 1;
1176                 proto_tree_add_item(tree, hf_rdm_pd_parameter_type, tvb,
1177                         offset, 1, ENC_BIG_ENDIAN);
1178                 offset += 1;
1179                 proto_tree_add_item(tree, hf_rdm_pd_parameter_unit, tvb,
1180                         offset, 1, ENC_BIG_ENDIAN);
1181                 offset += 1;
1182                 proto_tree_add_item(tree, hf_rdm_pd_parameter_prefix, tvb,
1183                         offset, 1, ENC_BIG_ENDIAN);
1184                 offset += 1;
1185                 proto_tree_add_item(tree, hf_rdm_pd_parameter_min_value, tvb,
1186                         offset, 4, ENC_BIG_ENDIAN);
1187                 offset += 4;
1188                 proto_tree_add_item(tree, hf_rdm_pd_parameter_max_value, tvb,
1189                         offset, 4, ENC_BIG_ENDIAN);
1190                 offset += 4;
1191                 proto_tree_add_item(tree, hf_rdm_pd_parameter_default_value, tvb,
1192                         offset, 4, ENC_BIG_ENDIAN);
1193                 offset += 4;
1194                 proto_tree_add_item(tree, hf_rdm_pd_parameter_description, tvb,
1195                         offset, len - 0x14, ENC_ASCII|ENC_NA);
1196                 offset += (len - 0x14);
1197                 break;
1198         }
1199
1200         return offset;
1201 }
1202
1203 static guint
1204 dissect_rdm_pd_product_detail_id_list(tvbuff_t *tvb, guint offset, proto_tree *tree, guint8 cc, guint8 len)
1205 {
1206         switch(cc) {
1207         case RDM_CC_GET_COMMAND_RESPONSE:
1208                 while (len >= 2) {
1209                         proto_tree_add_item(tree, hf_rdm_pd_product_detail_id_list, tvb,
1210                                 offset, 2, ENC_BIG_ENDIAN);
1211                         offset += 2;
1212                         len    -= 2;
1213                 }
1214                 break;
1215         }
1216
1217         return offset;
1218 }
1219
1220 static guint
1221 dissect_rdm_pd_factory_defaults(tvbuff_t *tvb, guint offset, proto_tree *tree, guint8 cc, guint8 len _U_)
1222 {
1223         switch(cc) {
1224         case RDM_CC_GET_COMMAND_RESPONSE:
1225                 proto_tree_add_item(tree, hf_rdm_pd_factory_defaults, tvb,
1226                         offset, 1, ENC_BIG_ENDIAN);
1227                 offset += 1;
1228                 break;
1229         }
1230
1231         return offset;
1232 }
1233
1234 static guint
1235 dissect_rdm_pd_language_capabilities(tvbuff_t *tvb, guint offset, proto_tree *tree, guint8 cc, guint8 len)
1236 {
1237         switch(cc) {
1238         case RDM_CC_GET_COMMAND_RESPONSE:
1239                 while (len >= 2) {
1240                         proto_tree_add_item(tree, hf_rdm_pd_language_code, tvb,
1241                                 offset, 2, ENC_ASCII|ENC_NA);
1242                         offset += 2;
1243                         len    -= 2;
1244                 }
1245                 break;
1246         }
1247
1248         return offset;
1249 }
1250
1251 static guint
1252 dissect_rdm_pd_language(tvbuff_t *tvb, guint offset, proto_tree *tree, guint8 cc, guint8 len _U_)
1253 {
1254         switch(cc) {
1255         case RDM_CC_SET_COMMAND:
1256         case RDM_CC_GET_COMMAND_RESPONSE:
1257                 proto_tree_add_item(tree, hf_rdm_pd_language_code, tvb,
1258                         offset, 2, ENC_ASCII|ENC_NA);
1259                 offset += 2;
1260                 break;
1261         }
1262
1263         return offset;
1264 }
1265
1266 static guint
1267 dissect_rdm_pd_software_version_label(tvbuff_t *tvb, guint offset, proto_tree *tree, guint8 cc, guint8 len)
1268 {
1269         switch(cc) {
1270         case RDM_CC_GET_COMMAND_RESPONSE:
1271                 proto_tree_add_item(tree, hf_rdm_pd_software_version_label, tvb,
1272                         offset, len, ENC_ASCII|ENC_NA);
1273                 offset += len;
1274
1275                 break;
1276         }
1277
1278         return offset;
1279 }
1280
1281 static guint
1282 dissect_rdm_pd_boot_software_version_id(tvbuff_t *tvb, guint offset, proto_tree *tree, guint8 cc, guint8 len _U_)
1283 {
1284         switch(cc) {
1285         case RDM_CC_GET_COMMAND_RESPONSE:
1286                 proto_tree_add_item(tree, hf_rdm_pd_boot_software_version_id, tvb,
1287                         offset, 4, ENC_BIG_ENDIAN);
1288                 offset += 4;
1289
1290                 break;
1291         }
1292
1293         return offset;
1294 }
1295
1296 static guint
1297 dissect_rdm_pd_boot_software_version_label(tvbuff_t *tvb, guint offset, proto_tree *tree, guint8 cc, guint8 len)
1298 {
1299         switch(cc) {
1300         case RDM_CC_GET_COMMAND_RESPONSE:
1301                 proto_tree_add_item(tree, hf_rdm_pd_boot_software_version_label, tvb,
1302                         offset, len, ENC_ASCII|ENC_NA);
1303                 offset += len;
1304
1305                 break;
1306         }
1307
1308         return offset;
1309 }
1310
1311 static guint
1312 dissect_rdm_pd_dmx_personality(tvbuff_t *tvb, guint offset, proto_tree *tree, guint8 cc, guint8 len _U_)
1313 {
1314         switch(cc) {
1315         case RDM_CC_SET_COMMAND:
1316                 proto_tree_add_item(tree, hf_rdm_pd_dmx_pers_nr, tvb,
1317                         offset, 1, ENC_BIG_ENDIAN);
1318                 offset += 1;
1319                 break;
1320
1321         case RDM_CC_GET_COMMAND_RESPONSE:
1322                 proto_tree_add_item(tree, hf_rdm_pd_dmx_pers_current, tvb,
1323                         offset, 1, ENC_BIG_ENDIAN);
1324                 offset += 1;
1325                 proto_tree_add_item(tree, hf_rdm_pd_dmx_pers_count, tvb,
1326                         offset, 1, ENC_BIG_ENDIAN);
1327                 offset += 1;
1328                 break;
1329         }
1330
1331         return offset;
1332 }
1333
1334 static guint
1335 dissect_rdm_pd_dmx_personality_description(tvbuff_t *tvb, guint offset, proto_tree *tree, guint8 cc, guint8 len)
1336 {
1337         switch(cc) {
1338         case RDM_CC_GET_COMMAND:
1339                 proto_tree_add_item(tree, hf_rdm_pd_dmx_pers_description, tvb,
1340                         offset, 1, ENC_ASCII|ENC_NA);
1341                 offset += 1;
1342                 break;
1343
1344         case RDM_CC_GET_COMMAND_RESPONSE:
1345                 proto_tree_add_item(tree, hf_rdm_pd_dmx_pers_description, tvb,
1346                         offset, 1, ENC_ASCII|ENC_NA);
1347                 offset += 1;
1348                 proto_tree_add_item(tree, hf_rdm_pd_dmx_pers_slots, tvb,
1349                         offset, 1, ENC_BIG_ENDIAN);
1350                 offset += 1;
1351                 proto_tree_add_item(tree, hf_rdm_pd_dmx_pers_text, tvb,
1352                         offset, (len - 3), ENC_ASCII|ENC_NA);
1353                 offset += (len - 3);
1354                 break;
1355         }
1356
1357         return offset;
1358 }
1359
1360 static guint
1361 dissect_rdm_pd_slot_info(tvbuff_t *tvb, guint offset, proto_tree *tree, guint8 cc, guint8 len)
1362 {
1363         switch(cc) {
1364         case RDM_CC_GET_COMMAND_RESPONSE:
1365                 while (len >= 5) {
1366                         proto_tree_add_item(tree, hf_rdm_pd_slot_offset, tvb,
1367                                 offset, 2, ENC_BIG_ENDIAN);
1368                         offset += 2;
1369                         len    -= 2;
1370                         proto_tree_add_item(tree, hf_rdm_pd_slot_type, tvb,
1371                                 offset, 1, ENC_BIG_ENDIAN);
1372                         offset += 1;
1373                         len    -= 1;
1374                         proto_tree_add_item(tree, hf_rdm_pd_slot_label_id, tvb,
1375                                 offset, 2, ENC_BIG_ENDIAN);
1376                         offset += 2;
1377                         len    -= 2;
1378                 }
1379                 break;
1380         }
1381
1382         return offset;
1383 }
1384
1385 static guint
1386 dissect_rdm_pd_slot_description(tvbuff_t *tvb, guint offset, proto_tree *tree, guint8 cc, guint8 len)
1387 {
1388         switch(cc) {
1389         case RDM_CC_GET_COMMAND:
1390                 proto_tree_add_item(tree, hf_rdm_pd_slot_nr, tvb,
1391                         offset, 2, ENC_BIG_ENDIAN);
1392                 offset += 2;
1393                 break;
1394
1395         case RDM_CC_GET_COMMAND_RESPONSE:
1396                 proto_tree_add_item(tree, hf_rdm_pd_slot_nr, tvb,
1397                         offset, 2, ENC_BIG_ENDIAN);
1398                 offset += 2;
1399                 proto_tree_add_item(tree, hf_rdm_pd_slot_description, tvb,
1400                         offset, (len - 2), ENC_ASCII|ENC_NA);
1401                 offset += (len - 2);
1402                 break;
1403         }
1404
1405         return offset;
1406 }
1407
1408 static guint
1409 dissect_rdm_pd_slot_value(tvbuff_t *tvb, guint offset, proto_tree *tree, guint8 cc, guint8 len)
1410 {
1411         switch(cc) {
1412         case RDM_CC_GET_COMMAND_RESPONSE:
1413                 while (len >= 3) {
1414                         proto_tree_add_item(tree, hf_rdm_pd_slot_offset, tvb,
1415                                 offset, 2, ENC_BIG_ENDIAN);
1416                         offset += 2;
1417                         len    -= 2;
1418                         proto_tree_add_item(tree, hf_rdm_pd_slot_value, tvb,
1419                                 offset, 1, ENC_BIG_ENDIAN);
1420                         offset += 1;
1421                         len    -= 1;
1422                 }
1423                 break;
1424         }
1425
1426         return offset;
1427 }
1428
1429 static guint
1430 dissect_rdm_pd_record_sensors(tvbuff_t *tvb, guint offset, proto_tree *tree, guint8 cc, guint8 len)
1431 {
1432         switch(cc) {
1433         case RDM_CC_GET_COMMAND:
1434                 proto_tree_add_item(tree, hf_rdm_pd_sensor_nr, tvb,
1435                         offset, 1, ENC_BIG_ENDIAN);
1436                 offset += 1;
1437                 break;
1438
1439         case RDM_CC_GET_COMMAND_RESPONSE:
1440                 proto_tree_add_item(tree, hf_rdm_pd_sensor_nr, tvb,
1441                         offset, 1, ENC_BIG_ENDIAN);
1442                 offset += 1;
1443                 proto_tree_add_item(tree, hf_rdm_pd_sensor_type, tvb,
1444                         offset, 1, ENC_BIG_ENDIAN);
1445                 offset += 1;
1446                 proto_tree_add_item(tree, hf_rdm_pd_sensor_unit, tvb,
1447                         offset, 1, ENC_BIG_ENDIAN);
1448                 offset += 1;
1449                 proto_tree_add_item(tree, hf_rdm_pd_sensor_prefix, tvb,
1450                         offset, 1, ENC_BIG_ENDIAN);
1451                 offset += 1;
1452                 proto_tree_add_item(tree, hf_rdm_pd_sensor_range_min_value, tvb,
1453                         offset, 2, ENC_BIG_ENDIAN);
1454                 offset += 2;
1455                 proto_tree_add_item(tree, hf_rdm_pd_sensor_range_max_value, tvb,
1456                         offset, 2, ENC_BIG_ENDIAN);
1457                 offset += 2;
1458                 proto_tree_add_item(tree, hf_rdm_pd_sensor_normal_min_value, tvb,
1459                         offset, 2, ENC_BIG_ENDIAN);
1460                 offset += 2;
1461                 proto_tree_add_item(tree, hf_rdm_pd_sensor_normal_max_value, tvb,
1462                         offset, 2, ENC_BIG_ENDIAN);
1463                 offset += 2;
1464                 proto_tree_add_item(tree, hf_rdm_pd_rec_value_support, tvb,
1465                         offset, 1, ENC_BIG_ENDIAN);
1466                 offset += 1;
1467                 proto_tree_add_item(tree, hf_rdm_pd_sensor_description, tvb,
1468                         offset, (len - 13), ENC_ASCII|ENC_NA);
1469                 offset += (len - 13);
1470
1471                 break;
1472         }
1473
1474         return offset;
1475 }
1476
1477 static guint
1478 dissect_rdm_pd_lamp_state(tvbuff_t *tvb, guint offset, proto_tree *tree, guint8 cc, guint8 len _U_)
1479 {
1480         switch(cc) {
1481         case RDM_CC_SET_COMMAND:
1482         case RDM_CC_GET_COMMAND_RESPONSE:
1483                 proto_tree_add_item(tree, hf_rdm_pd_lamp_state, tvb,
1484                         offset, 1, ENC_BIG_ENDIAN);
1485                 offset += 1;
1486                 break;
1487         }
1488
1489         return offset;
1490 }
1491
1492 static guint
1493 dissect_rdm_pd_lamp_on_mode(tvbuff_t *tvb, guint offset, proto_tree *tree, guint8 cc, guint8 len _U_)
1494 {
1495         switch(cc) {
1496         case RDM_CC_SET_COMMAND:
1497         case RDM_CC_GET_COMMAND_RESPONSE:
1498                 proto_tree_add_item(tree, hf_rdm_pd_lamp_on_mode, tvb,
1499                         offset, 1, ENC_BIG_ENDIAN);
1500                 offset += 1;
1501                 break;
1502         }
1503
1504         return offset;
1505 }
1506
1507 static guint
1508 dissect_rdm_pd_device_power_cycles(tvbuff_t *tvb, guint offset, proto_tree *tree, guint8 cc, guint8 len _U_)
1509 {
1510         switch(cc) {
1511         case RDM_CC_SET_COMMAND:
1512         case RDM_CC_GET_COMMAND_RESPONSE:
1513                 proto_tree_add_item(tree, hf_rdm_pd_device_power_cycles, tvb,
1514                         offset, 4, ENC_BIG_ENDIAN);
1515                 offset += 4;
1516                 break;
1517         }
1518
1519         return offset;
1520 }
1521
1522 static guint
1523 dissect_rdm_pd_display_invert(tvbuff_t *tvb, guint offset, proto_tree *tree, guint8 cc, guint8 len _U_)
1524 {
1525         switch(cc) {
1526         case RDM_CC_SET_COMMAND:
1527         case RDM_CC_GET_COMMAND_RESPONSE:
1528                 proto_tree_add_item(tree, hf_rdm_pd_display_invert, tvb,
1529                         offset, 1, ENC_BIG_ENDIAN);
1530                 offset += 1;
1531                 break;
1532         }
1533
1534         return offset;
1535 }
1536
1537 static guint
1538 dissect_rdm_pd_display_level(tvbuff_t *tvb, guint offset, proto_tree *tree, guint8 cc, guint8 len _U_)
1539 {
1540         switch(cc) {
1541         case RDM_CC_SET_COMMAND:
1542         case RDM_CC_GET_COMMAND_RESPONSE:
1543                 proto_tree_add_item(tree, hf_rdm_pd_display_level, tvb,
1544                         offset, 1, ENC_BIG_ENDIAN);
1545                 offset += 1;
1546                 break;
1547         }
1548
1549         return offset;
1550 }
1551
1552 static guint
1553 dissect_rdm_pd_pan_invert(tvbuff_t *tvb, guint offset, proto_tree *tree, guint8 cc, guint8 len _U_)
1554 {
1555         switch(cc) {
1556         case RDM_CC_SET_COMMAND:
1557         case RDM_CC_GET_COMMAND_RESPONSE:
1558                 proto_tree_add_item(tree, hf_rdm_pd_pan_invert, tvb,
1559                         offset, 1, ENC_BIG_ENDIAN);
1560                 offset += 1;
1561                 break;
1562         }
1563
1564         return offset;
1565 }
1566
1567 static guint
1568 dissect_rdm_pd_tilt_invert(tvbuff_t *tvb, guint offset, proto_tree *tree, guint8 cc, guint8 len _U_)
1569 {
1570         switch(cc) {
1571         case RDM_CC_SET_COMMAND:
1572         case RDM_CC_GET_COMMAND_RESPONSE:
1573                 proto_tree_add_item(tree, hf_rdm_pd_tilt_invert, tvb,
1574                         offset, 1, ENC_BIG_ENDIAN);
1575                 offset += 1;
1576                 break;
1577         }
1578
1579         return offset;
1580 }
1581
1582 static guint
1583 dissect_rdm_pd_pan_tilt_swap(tvbuff_t *tvb, guint offset, proto_tree *tree, guint8 cc, guint8 len _U_)
1584 {
1585         switch(cc) {
1586         case RDM_CC_SET_COMMAND:
1587         case RDM_CC_GET_COMMAND_RESPONSE:
1588                 proto_tree_add_item(tree, hf_rdm_pd_tilt_swap, tvb,
1589                         offset, 1, ENC_BIG_ENDIAN);
1590                 offset += 1;
1591                 break;
1592         }
1593
1594         return offset;
1595 }
1596
1597 static guint
1598 dissect_rdm_pd_real_time_clock(tvbuff_t *tvb, guint offset, proto_tree *tree, guint8 cc, guint8 len _U_)
1599 {
1600         switch(cc) {
1601         case RDM_CC_SET_COMMAND:
1602         case RDM_CC_GET_COMMAND_RESPONSE:
1603                 proto_tree_add_item(tree, hf_rdm_pd_real_time_clock_year, tvb,
1604                         offset, 2, ENC_BIG_ENDIAN);
1605                 offset += 2;
1606                 proto_tree_add_item(tree, hf_rdm_pd_real_time_clock_month, tvb,
1607                         offset, 1, ENC_BIG_ENDIAN);
1608                 offset += 1;
1609                 proto_tree_add_item(tree, hf_rdm_pd_real_time_clock_day, tvb,
1610                         offset, 1, ENC_BIG_ENDIAN);
1611                 offset += 1;
1612                 proto_tree_add_item(tree, hf_rdm_pd_real_time_clock_hour, tvb,
1613                         offset, 1, ENC_BIG_ENDIAN);
1614                 offset += 1;
1615                 proto_tree_add_item(tree, hf_rdm_pd_real_time_clock_minute, tvb,
1616                         offset, 1, ENC_BIG_ENDIAN);
1617                 offset += 1;
1618                 proto_tree_add_item(tree, hf_rdm_pd_real_time_clock_second, tvb,
1619                         offset, 1, ENC_BIG_ENDIAN);
1620                 offset += 1;
1621                 break;
1622         }
1623
1624         return offset;
1625 }
1626
1627 static guint
1628 dissect_rdm_pd_identify_device(tvbuff_t *tvb, guint offset, proto_tree *tree, guint8 cc, guint8 len _U_)
1629 {
1630         switch(cc) {
1631         case RDM_CC_SET_COMMAND:
1632                 proto_tree_add_item(tree, hf_rdm_pd_identify_device, tvb,
1633                         offset, 1, ENC_BIG_ENDIAN);
1634                 offset += 1;
1635                 break;
1636
1637         case RDM_CC_GET_COMMAND_RESPONSE:
1638                 proto_tree_add_item(tree, hf_rdm_pd_identify_device_state, tvb,
1639                         offset, 1, ENC_BIG_ENDIAN);
1640                 offset += 1;
1641                 break;
1642         }
1643
1644         return offset;
1645 }
1646
1647 static guint
1648 dissect_rdm_pd_reset_device(tvbuff_t *tvb, guint offset, proto_tree *tree, guint8 cc, guint8 len _U_)
1649 {
1650         switch(cc) {
1651         case RDM_CC_SET_COMMAND:
1652                 proto_tree_add_item(tree, hf_rdm_pd_reset_device, tvb,
1653                         offset, 1, ENC_BIG_ENDIAN);
1654                 offset += 1;
1655                 break;
1656         }
1657
1658         return offset;
1659 }
1660
1661 static guint
1662 dissect_rdm_pd_power_state(tvbuff_t *tvb, guint offset, proto_tree *tree, guint8 cc, guint8 len _U_)
1663 {
1664         switch(cc) {
1665         case RDM_CC_SET_COMMAND:
1666         case RDM_CC_GET_COMMAND_RESPONSE:
1667                 proto_tree_add_item(tree, hf_rdm_pd_power_state, tvb,
1668                         offset, 1, ENC_BIG_ENDIAN);
1669                 offset += 1;
1670                 break;
1671         }
1672
1673         return offset;
1674 }
1675
1676 static guint
1677 dissect_rdm_pd_perform_selftest(tvbuff_t *tvb, guint offset, proto_tree *tree, guint8 cc, guint8 len _U_)
1678 {
1679         switch(cc) {
1680         case RDM_CC_SET_COMMAND:
1681                 proto_tree_add_item(tree, hf_rdm_pd_selftest_nr, tvb,
1682                         offset, 1, ENC_BIG_ENDIAN);
1683                 offset += 1;
1684                 break;
1685
1686         case RDM_CC_GET_COMMAND_RESPONSE:
1687                 proto_tree_add_item(tree, hf_rdm_pd_selftest_state, tvb,
1688                         offset, 1, ENC_BIG_ENDIAN);
1689                 offset += 1;
1690                 break;
1691         }
1692
1693         return offset;
1694 }
1695
1696 static guint
1697 dissect_rdm_pd_self_test_description(tvbuff_t *tvb, guint offset, proto_tree *tree, guint8 cc, guint8 len)
1698 {
1699         switch(cc) {
1700         case RDM_CC_GET_COMMAND:
1701                 proto_tree_add_item(tree, hf_rdm_pd_selftest_nr, tvb,
1702                         offset, 1, ENC_BIG_ENDIAN);
1703                 offset += 1;
1704                 break;
1705
1706         case RDM_CC_GET_COMMAND_RESPONSE:
1707                 proto_tree_add_item(tree, hf_rdm_pd_selftest_nr, tvb,
1708                         offset, 1, ENC_BIG_ENDIAN);
1709                 offset += 1;
1710                 proto_tree_add_item(tree, hf_rdm_pd_selftest_description, tvb,
1711                         offset, (len - 1), ENC_ASCII|ENC_NA);
1712                 offset += (len - 1);
1713                 break;
1714         }
1715
1716         return offset;
1717 }
1718
1719 static guint
1720 dissect_rdm_pd_capture_preset(tvbuff_t *tvb, guint offset, proto_tree *tree, guint8 cc, guint8 len _U_)
1721 {
1722         switch(cc) {
1723         case RDM_CC_SET_COMMAND:
1724                 proto_tree_add_item(tree, hf_rdm_pd_capture_preset_scene_nr, tvb,
1725                         offset, 2, ENC_BIG_ENDIAN);
1726                 offset += 2;
1727                 proto_tree_add_item(tree, hf_rdm_pd_capture_preset_up_fade_time, tvb,
1728                         offset, 2, ENC_BIG_ENDIAN);
1729                 offset += 2;
1730                 proto_tree_add_item(tree, hf_rdm_pd_capture_preset_down_fade_time, tvb,
1731                         offset, 2, ENC_BIG_ENDIAN);
1732                 offset += 2;
1733                 proto_tree_add_item(tree, hf_rdm_pd_capture_preset_wait_time, tvb,
1734                         offset, 2, ENC_BIG_ENDIAN);
1735                 offset += 2;
1736
1737                 break;
1738         }
1739
1740         return offset;
1741 }
1742
1743 static guint
1744 dissect_rdm_pd_preset_playback(tvbuff_t *tvb, guint offset, proto_tree *tree, guint8 cc, guint8 len _U_)
1745 {
1746         switch(cc) {
1747         case RDM_CC_SET_COMMAND:
1748         case RDM_CC_GET_COMMAND_RESPONSE:
1749                 proto_tree_add_item(tree, hf_rdm_pd_preset_playback_mode, tvb,
1750                         offset, 2, ENC_BIG_ENDIAN);
1751                 offset += 2;
1752                 proto_tree_add_item(tree, hf_rdm_pd_preset_playback_level, tvb,
1753                         offset, 1, ENC_BIG_ENDIAN);
1754                 offset += 1;
1755                 break;
1756         }
1757
1758         return offset;
1759 }
1760
1761 static guint
1762 dissect_rdm_mdb(tvbuff_t *tvb, guint offset, proto_tree *tree)
1763 {
1764         guint8      cc;
1765         guint16     param_id;
1766         guint8      parameter_data_length;
1767         proto_tree *hi,*si, *mdb_tree;
1768
1769         cc = tvb_get_guint8(tvb, offset + 4);
1770
1771         switch (cc) {
1772         case RDM_CC_DISCOVERY_COMMAND:
1773         case RDM_CC_GET_COMMAND:
1774         case RDM_CC_SET_COMMAND:
1775                 proto_tree_add_item(tree, hf_rdm_port_id, tvb,
1776                         offset, 1, ENC_BIG_ENDIAN);
1777                 offset += 1;
1778                 break;
1779
1780         case RDM_CC_DISCOVERY_COMMAND_RESPONSE:
1781         case RDM_CC_GET_COMMAND_RESPONSE:
1782         case RDM_CC_SET_COMMAND_RESPONSE:
1783                 proto_tree_add_item(tree, hf_rdm_response_type, tvb,
1784                         offset, 1, ENC_BIG_ENDIAN);
1785                 offset += 1;
1786                 break;
1787         }
1788
1789         proto_tree_add_item(tree, hf_rdm_message_count, tvb,
1790                         offset, 1, ENC_BIG_ENDIAN);
1791         offset += 1;
1792
1793         proto_tree_add_item(tree, hf_rdm_sub_device, tvb,
1794                         offset, 2, ENC_BIG_ENDIAN);
1795         offset += 2;
1796
1797         hi = proto_tree_add_item(tree, hf_rdm_mdb, tvb,
1798                         offset, -1, ENC_NA);
1799         mdb_tree = proto_item_add_subtree(hi,ett_rdm);
1800
1801
1802         proto_tree_add_item(mdb_tree, hf_rdm_command_class, tvb,
1803                         offset, 1, ENC_BIG_ENDIAN);
1804         offset += 1;
1805
1806         param_id = tvb_get_ntohs(tvb, offset);
1807         proto_tree_add_item(mdb_tree, hf_rdm_parameter_id, tvb,
1808                         offset, 2, ENC_BIG_ENDIAN);
1809         offset += 2;
1810
1811         parameter_data_length = tvb_get_guint8(tvb, offset);
1812         proto_tree_add_item(mdb_tree, hf_rdm_parameter_data_length, tvb,
1813                         offset, 1, ENC_BIG_ENDIAN);
1814         offset += 1;
1815         proto_item_set_len( mdb_tree,  parameter_data_length + 4);
1816
1817         if (parameter_data_length > 0) {
1818                 hi = proto_tree_add_item(mdb_tree, hf_rdm_parameter_data, tvb,
1819                                 offset, parameter_data_length, ENC_NA);
1820                 si = proto_item_add_subtree(hi,ett_rdm);
1821
1822                 switch(param_id) {
1823                 case RDM_PARAM_ID_SENSOR_VALUE:
1824                         offset = dissect_rdm_pd_sensor_value(tvb, offset, si, cc, parameter_data_length);
1825                         break;
1826
1827                 case RDM_PARAM_ID_QUEUED_MESSAGE:
1828                         offset = dissect_rdm_pd_queued_message(tvb, offset, si, cc, parameter_data_length);
1829                         break;
1830
1831                 case RDM_PARAM_ID_DMX_START_ADDRESS:
1832                         offset = dissect_rdm_pd_dmx_start_address(tvb, offset, si, cc, parameter_data_length);
1833                         break;
1834
1835                 case RDM_PARAM_ID_DEVICE_INFO:
1836                         offset = dissect_rdm_pd_device_info(tvb, offset, si, cc, parameter_data_length);
1837                         break;
1838
1839                 case RDM_PARAM_ID_DEVICE_MODEL_DESCRIPTION:
1840                         offset = dissect_rdm_pd_device_model_description(tvb, offset, si, cc, parameter_data_length);
1841                         break;
1842
1843                 case RDM_PARAM_ID_DEVICE_LABEL:
1844                         offset = dissect_rdm_pd_device_label(tvb, offset, si, cc, parameter_data_length);
1845                         break;
1846
1847                 case RDM_PARAM_ID_DEVICE_HOURS:
1848                         offset = dissect_rdm_pd_device_hours(tvb, offset, si, cc, parameter_data_length);
1849                         break;
1850
1851                 case RDM_PARAM_ID_LAMP_HOURS:
1852                         offset = dissect_rdm_pd_lamp_hours(tvb, offset, si, cc, parameter_data_length);
1853                         break;
1854
1855                 case RDM_PARAM_ID_LAMP_STRIKES:
1856                         offset = dissect_rdm_pd_lamp_strikes(tvb, offset, si, cc, parameter_data_length);
1857                         break;
1858
1859                 case RDM_PARAM_ID_SENSOR_DEFINITION:
1860                         offset = dissect_rdm_pd_sensor_definition(tvb, offset, si, cc, parameter_data_length);
1861                         break;
1862
1863                 case RDM_PARAM_ID_MANUFACTURER_LABEL:
1864                         offset = dissect_rdm_pd_manufacturer_label(tvb, offset, si, cc, parameter_data_length);
1865                         break;
1866
1867                 case RDM_PARAM_ID_DISC_UNIQUE_BRANCH:
1868                         offset = dissect_rdm_pd_disc_unique_branch(tvb, offset, si, cc, parameter_data_length);
1869                         break;
1870
1871                 case RDM_PARAM_ID_DISC_MUTE:
1872                         offset = dissect_rdm_pd_disc_mute(tvb, offset, si, cc, parameter_data_length);
1873                         break;
1874
1875                 case RDM_PARAM_ID_DISC_UN_MUTE:
1876                         offset = dissect_rdm_pd_disc_un_mute(tvb, offset, si, cc, parameter_data_length);
1877                         break;
1878
1879                 case RDM_PARAM_ID_PROXIED_DEVICES:
1880                         offset = dissect_rdm_pd_proxied_devices(tvb, offset, si, cc, parameter_data_length);
1881                         break;
1882
1883                 case RDM_PARAM_ID_PROXIED_DEVICE_COUNT:
1884                         offset = dissect_rdm_pd_proxied_device_count(tvb, offset, si, cc, parameter_data_length);
1885                         break;
1886
1887                 case RDM_PARAM_ID_COMMS_STATUS:
1888                         offset = dissect_rdm_pd_comms_status(tvb, offset, si, cc, parameter_data_length);
1889                         break;
1890
1891                 case RDM_PARAM_ID_STATUS_MESSAGES:
1892                         offset = dissect_rdm_pd_status_messages(tvb, offset, si, cc, parameter_data_length);
1893                         break;
1894
1895                 case RDM_PARAM_ID_STATUS_ID_DESCRIPTION:
1896                         offset = dissect_rdm_pd_status_id_description(tvb, offset, si, cc, parameter_data_length);
1897                         break;
1898
1899                 case RDM_PARAM_ID_CLEAR_STATUS_ID:
1900                         offset = dissect_rdm_pd_clear_status_id(tvb, offset, si, cc, parameter_data_length);
1901                         break;
1902
1903                 case RDM_PARAM_ID_SUB_DEVICE_STATUS_REPORT_THRESHOLD:
1904                         offset = dissect_rdm_pd_sub_device_status_report_threshold(tvb, offset, si, cc, parameter_data_length);
1905                         break;
1906
1907                 case RDM_PARAM_ID_SUPPORTED_PARAMETERS:
1908                         offset = dissect_rdm_pd_supported_parameters(tvb, offset, si, cc, parameter_data_length);
1909                         break;
1910
1911                 case RDM_PARAM_ID_PARAMETER_DESCRIPTION:
1912                         offset = dissect_rdm_pd_parameter_description(tvb, offset, si, cc, parameter_data_length);
1913                         break;
1914
1915                 case RDM_PARAM_ID_PRODUCT_DETAIL_ID_LIST:
1916                         offset = dissect_rdm_pd_product_detail_id_list(tvb, offset, si, cc, parameter_data_length);
1917                         break;
1918
1919                 case RDM_PARAM_ID_FACTORY_DEFAULTS:
1920                         offset = dissect_rdm_pd_factory_defaults(tvb, offset, si, cc, parameter_data_length);
1921                         break;
1922
1923                 case RDM_PARAM_ID_LANGUAGE_CAPABILITIES:
1924                         offset = dissect_rdm_pd_language_capabilities(tvb, offset, si, cc, parameter_data_length);
1925                         break;
1926
1927                 case RDM_PARAM_ID_LANGUAGE:
1928                         offset = dissect_rdm_pd_language(tvb, offset, si, cc, parameter_data_length);
1929                         break;
1930
1931                 case RDM_PARAM_ID_SOFTWARE_VERSION_LABEL:
1932                         offset = dissect_rdm_pd_software_version_label(tvb, offset, si, cc, parameter_data_length);
1933                         break;
1934
1935                 case RDM_PARAM_ID_BOOT_SOFTWARE_VERSION_ID:
1936                         offset = dissect_rdm_pd_boot_software_version_id(tvb, offset, si, cc, parameter_data_length);
1937                         break;
1938
1939                 case RDM_PARAM_ID_BOOT_SOFTWARE_VERSION_LABEL:
1940                         offset = dissect_rdm_pd_boot_software_version_label(tvb, offset, si, cc, parameter_data_length);
1941                         break;
1942
1943                 case RDM_PARAM_ID_DMX_PERSONALITY:
1944                         offset = dissect_rdm_pd_dmx_personality(tvb, offset, si, cc, parameter_data_length);
1945                         break;
1946
1947                 case RDM_PARAM_ID_DMX_PERSONALITY_DESCRIPTION:
1948                         offset = dissect_rdm_pd_dmx_personality_description(tvb, offset, si, cc, parameter_data_length);
1949                         break;
1950
1951                 case RDM_PARAM_ID_SLOT_INFO:
1952                         offset = dissect_rdm_pd_slot_info(tvb, offset, si, cc, parameter_data_length);
1953                         break;
1954
1955                 case RDM_PARAM_ID_SLOT_DESCRIPTION:
1956                         offset = dissect_rdm_pd_slot_description(tvb, offset, si, cc, parameter_data_length);
1957                         break;
1958
1959                 case RDM_PARAM_ID_DEFAULT_SLOT_VALUE:
1960                         offset = dissect_rdm_pd_slot_value(tvb, offset, si, cc, parameter_data_length);
1961                         break;
1962
1963                 case RDM_PARAM_ID_RECORD_SENSORS:
1964                         offset = dissect_rdm_pd_record_sensors(tvb, offset, si, cc, parameter_data_length);
1965                         break;
1966
1967                 case RDM_PARAM_ID_LAMP_STATE:
1968                         offset = dissect_rdm_pd_lamp_state(tvb, offset, si, cc, parameter_data_length);
1969                         break;
1970
1971                 case RDM_PARAM_ID_LAMP_ON_MODE:
1972                         offset = dissect_rdm_pd_lamp_on_mode(tvb, offset, si, cc, parameter_data_length);
1973                         break;
1974
1975                 case RDM_PARAM_ID_DEVICE_POWER_CYCLES:
1976                         offset = dissect_rdm_pd_device_power_cycles(tvb, offset, si, cc, parameter_data_length);
1977                         break;
1978
1979                 case RDM_PARAM_ID_DISPLAY_INVERT:
1980                         offset = dissect_rdm_pd_display_invert(tvb, offset, si, cc, parameter_data_length);
1981                         break;
1982
1983                 case RDM_PARAM_ID_DISPLAY_LEVEL:
1984                         offset = dissect_rdm_pd_display_level(tvb, offset, si, cc, parameter_data_length);
1985                         break;
1986
1987                 case RDM_PARAM_ID_PAN_INVERT:
1988                         offset = dissect_rdm_pd_pan_invert(tvb, offset, si, cc, parameter_data_length);
1989                         break;
1990
1991                 case RDM_PARAM_ID_TILT_INVERT:
1992                         offset = dissect_rdm_pd_tilt_invert(tvb, offset, si, cc, parameter_data_length);
1993                         break;
1994
1995                 case RDM_PARAM_ID_PAN_TILT_SWAP:
1996                         offset = dissect_rdm_pd_pan_tilt_swap(tvb, offset, si, cc, parameter_data_length);
1997                         break;
1998
1999                 case RDM_PARAM_ID_REAL_TIME_CLOCK:
2000                         offset = dissect_rdm_pd_real_time_clock(tvb, offset, si, cc, parameter_data_length);
2001                         break;
2002
2003                 case RDM_PARAM_ID_IDENTIFY_DEVICE:
2004                         offset = dissect_rdm_pd_identify_device(tvb, offset, si, cc, parameter_data_length);
2005                         break;
2006
2007                 case RDM_PARAM_ID_RESET_DEVICE:
2008                         offset = dissect_rdm_pd_reset_device(tvb, offset, si, cc, parameter_data_length);
2009                         break;
2010
2011                 case RDM_PARAM_ID_POWER_STATE:
2012                         offset = dissect_rdm_pd_power_state(tvb, offset, si, cc, parameter_data_length);
2013                         break;
2014
2015                 case RDM_PARAM_ID_PERFORM_SELFTEST:
2016                         offset = dissect_rdm_pd_perform_selftest(tvb, offset, si, cc, parameter_data_length);
2017                         break;
2018
2019                 case RDM_PARAM_ID_SELF_TEST_DESCRIPTION:
2020                         offset = dissect_rdm_pd_self_test_description(tvb, offset, si, cc, parameter_data_length);
2021                         break;
2022
2023                 case RDM_PARAM_ID_CAPTURE_PRESET:
2024                         offset = dissect_rdm_pd_capture_preset(tvb, offset, si, cc, parameter_data_length);
2025                         break;
2026
2027                 case RDM_PARAM_ID_PRESET_PLAYBACK:
2028                         offset = dissect_rdm_pd_preset_playback(tvb, offset, si, cc, parameter_data_length);
2029                         break;
2030
2031                 default:
2032                         proto_tree_add_item(si, hf_rdm_parameter_data_raw, tvb,
2033                                 offset, parameter_data_length, ENC_NA);
2034                         offset += parameter_data_length;
2035                         break;
2036                 }
2037         }
2038
2039         return offset;
2040 }
2041
2042 static void
2043 dissect_rdm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
2044 {
2045         col_set_str(pinfo->cinfo, COL_PROTOCOL, "RDM");
2046         col_clear(pinfo->cinfo, COL_INFO);
2047
2048         if (tree) {
2049                 gint        padding_size;
2050                 guint16     man_id;
2051                 guint32     dev_id;
2052                 guint       message_length, checksum, checksum_shouldbe, offset = 0;
2053                 proto_item *item;
2054                 proto_tree *checksum_tree;
2055
2056                 proto_tree *ti = proto_tree_add_item(tree, proto_rdm, tvb,
2057                                 offset, -1, ENC_NA);
2058                 proto_tree *rdm_tree = proto_item_add_subtree(ti, ett_rdm);
2059
2060                 proto_tree_add_item(rdm_tree, hf_rdm_sub_start_code, tvb,
2061                                 offset, 1, ENC_BIG_ENDIAN);
2062                 offset += 1;
2063
2064                 message_length = tvb_get_guint8(tvb, offset);
2065                 proto_tree_add_item(rdm_tree, hf_rdm_message_length, tvb,
2066                                 offset, 1, ENC_BIG_ENDIAN);
2067                 offset += 1;
2068
2069                 man_id = tvb_get_ntohs(tvb, offset);
2070                 dev_id = tvb_get_ntohl(tvb, offset + 2);
2071                 proto_item_append_text(ti, ", Dst UID: %04x:%08x", man_id, dev_id);
2072                 proto_tree_add_item(rdm_tree, hf_rdm_dest_uid, tvb,
2073                                 offset, 6, ENC_NA);
2074                 offset += 6;
2075
2076
2077                 man_id = tvb_get_ntohs(tvb, offset);
2078                 dev_id = tvb_get_ntohl(tvb, offset + 2);
2079                 proto_item_append_text(ti, ", Src UID: %04x:%08x", man_id, dev_id);
2080                 proto_tree_add_item(rdm_tree, hf_rdm_src_uid, tvb,
2081                                 offset, 6, ENC_NA);
2082                 offset += 6;
2083
2084                 proto_tree_add_item(rdm_tree, hf_rdm_transaction_number, tvb,
2085                                 offset, 1, ENC_BIG_ENDIAN);
2086                 offset += 1;
2087
2088                 offset = dissect_rdm_mdb(tvb, offset, rdm_tree);
2089
2090                 padding_size = offset - (message_length - 1);
2091                 if (padding_size > 0) {
2092                         proto_tree_add_item(rdm_tree, hf_rdm_intron, tvb,
2093                                         offset, padding_size, ENC_NA);
2094                         offset += padding_size;
2095                 }
2096
2097                 checksum_shouldbe = rdm_checksum(tvb, offset);
2098                 checksum = tvb_get_ntohs(tvb, offset);
2099                 item = proto_tree_add_item(rdm_tree, hf_rdm_checksum, tvb,
2100                                 offset, 2, ENC_BIG_ENDIAN);
2101                 if (checksum == checksum_shouldbe) {
2102                         proto_item_append_text(item, " [correct]");
2103
2104                         checksum_tree = proto_item_add_subtree(item, ett_rdm);
2105                         item = proto_tree_add_boolean(checksum_tree, hf_rdm_checksum_good, tvb,
2106                                                 offset, 2, TRUE);
2107                         PROTO_ITEM_SET_GENERATED(item);
2108                         item = proto_tree_add_boolean(checksum_tree, hf_rdm_checksum_bad, tvb,
2109                                                 offset, 2, FALSE);
2110                         PROTO_ITEM_SET_GENERATED(item);
2111                 } else {
2112                         proto_item_append_text(item, " [incorrect, should be 0x%04x]", checksum_shouldbe);
2113
2114                         checksum_tree = proto_item_add_subtree(item, ett_rdm);
2115                         item = proto_tree_add_boolean(checksum_tree, hf_rdm_checksum_good, tvb,
2116                                                 offset, 2, FALSE);
2117                         PROTO_ITEM_SET_GENERATED(item);
2118                         item = proto_tree_add_boolean(checksum_tree, hf_rdm_checksum_bad, tvb,
2119                                                 offset, 2, TRUE);
2120                         PROTO_ITEM_SET_GENERATED(item);
2121                 }
2122
2123                 offset += 2;
2124
2125                 if (offset < tvb_length(tvb))
2126                         proto_tree_add_item(rdm_tree, hf_rdm_trailer, tvb,
2127                                         offset, -1, ENC_NA);
2128         }
2129 }
2130
2131 void
2132 proto_register_rdm(void)
2133 {
2134         static hf_register_info hf[] = {
2135                 { &hf_rdm_sub_start_code,
2136                         { "Sub-start code", "rdm.ssc",
2137                                 FT_UINT8, BASE_HEX, NULL, 0x0,
2138                                 NULL, HFILL }},
2139
2140                 { &hf_rdm_message_length,
2141                         { "Message length", "rdm.len",
2142                                 FT_UINT8, BASE_DEC, NULL, 0x0,
2143                                 NULL, HFILL }},
2144
2145                 { &hf_rdm_dest_uid,
2146                         { "Destination UID", "rdm.dst",
2147                                 FT_BYTES, BASE_NONE, NULL, 0x0,
2148                                 NULL, HFILL }},
2149
2150                 { &hf_rdm_src_uid,
2151                         { "Source UID", "rdm.src",
2152                                 FT_BYTES, BASE_NONE, NULL, 0x0,
2153                                 NULL, HFILL }},
2154
2155                 { &hf_rdm_transaction_number,
2156                         { "Transaction number", "rdm.tn",
2157                                 FT_UINT8, BASE_DEC, NULL, 0x0,
2158                                 NULL, HFILL }},
2159
2160                 { &hf_rdm_port_id,
2161                         { "Port ID", "rdm.port_id",
2162                                 FT_UINT8, BASE_DEC, NULL, 0x0,
2163                                 NULL, HFILL }},
2164
2165                 { &hf_rdm_response_type,
2166                         { "Response type", "rdm.rt",
2167                                 FT_UINT8, BASE_HEX, VALS(rdm_rt_vals), 0x0,
2168                                 NULL, HFILL }},
2169
2170                 { &hf_rdm_message_count,
2171                         { "Message count", "rdm.mc",
2172                                 FT_UINT8, BASE_DEC, NULL, 0x0,
2173                                 NULL, HFILL }},
2174
2175                 { &hf_rdm_sub_device,
2176                         { "Sub-device", "rdm.sd",
2177                                 FT_UINT16, BASE_DEC, NULL, 0x0,
2178                                 NULL, HFILL }},
2179
2180                 { &hf_rdm_mdb,
2181                         { "Message Data Block", "rdm.mdb",
2182                                 FT_NONE, BASE_NONE, NULL, 0x0,
2183                                 NULL, HFILL }},
2184
2185                 { &hf_rdm_command_class,
2186                         { "Command class", "rdm.cc",
2187                                 FT_UINT8, BASE_HEX, VALS(rdm_cc_vals), 0x0,
2188                                 NULL, HFILL }},
2189
2190                 { &hf_rdm_parameter_id,
2191                         { "Parameter ID", "rdm.pid",
2192                                 FT_UINT16, BASE_HEX | BASE_EXT_STRING, &rdm_param_id_vals_ext, 0x0,
2193                                 NULL, HFILL }},
2194
2195                 { &hf_rdm_parameter_data_length,
2196                         { "Parameter data length", "rdm.pdl",
2197                                 FT_UINT8, BASE_DEC, NULL, 0x0,
2198                                 NULL, HFILL }},
2199
2200                 { &hf_rdm_parameter_data,
2201                         { "Parameter data", "rdm.pd",
2202                                 FT_NONE, BASE_NONE, NULL, 0x0,
2203                                 NULL, HFILL }},
2204
2205                 { &hf_rdm_parameter_data_raw,
2206                         { "Raw Data", "rdm.pd.raw",
2207                                 FT_BYTES, BASE_NONE, NULL, 0x0,
2208                                 NULL, HFILL }},
2209
2210                 { &hf_rdm_intron,
2211                         { "Intron", "rdm.intron",
2212                                 FT_BYTES, BASE_NONE, NULL, 0x0,
2213                                 NULL, HFILL }},
2214
2215                 { &hf_rdm_checksum,
2216                         { "Checksum", "rdm.checksum",
2217                                 FT_UINT16, BASE_HEX, NULL, 0x0,
2218                                 NULL, HFILL }},
2219
2220                 { &hf_rdm_checksum_good,
2221                         { "Good Checksum", "rdm.checksum_good",
2222                                 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
2223                                 "True: checksum matches packet content; False: doesn't match content", HFILL }},
2224
2225                 { &hf_rdm_checksum_bad,
2226                         { "Bad Checksum", "rdm.checksum_bad",
2227                                 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
2228                                 "True: checksum doesn't match packet content; False: matches content", HFILL }},
2229
2230                 { &hf_rdm_trailer,
2231                         { "Trailer", "rdm.trailer",
2232                                 FT_BYTES, BASE_NONE, NULL, 0x0,
2233                                 NULL, HFILL }},
2234
2235                 { &hf_rdm_pd_queued_message_status,
2236                         { "Status", "rdm.pd.queued_message.status",
2237                                 FT_UINT8, BASE_HEX, VALS(rdm_status_vals), 0x0,
2238                                 NULL, HFILL }},
2239
2240                 { &hf_rdm_pd_sensor_nr,
2241                         { "Sensor Nr.", "rdm.pd.sensor.nr",
2242                                 FT_UINT8, BASE_DEC, NULL, 0x0,
2243                                 NULL, HFILL }},
2244
2245                 { &hf_rdm_pd_sensor_value_pres,
2246                         { "Sensor Present Value", "rdm.pd.sensor.value.present",
2247                                 FT_INT16, BASE_DEC, NULL, 0x0,
2248                                 NULL, HFILL }},
2249
2250                 { &hf_rdm_pd_sensor_value_low,
2251                         { "Sensor Lowest Value", "rdm.pd.sensor.value.lowest",
2252                                 FT_INT16, BASE_DEC, NULL, 0x0,
2253                                 NULL, HFILL }},
2254
2255                 { &hf_rdm_pd_sensor_value_high,
2256                         { "Sensor Highest Value", "rdm.pd.sensor.value.highest",
2257                                 FT_INT16, BASE_DEC, NULL, 0x0,
2258                                 NULL, HFILL }},
2259
2260                 { &hf_rdm_pd_sensor_value_rec,
2261                         { "Sensor Recorded Value", "rdm.pd.sensor.value.recorded",
2262                                 FT_INT16, BASE_DEC, NULL, 0x0,
2263                                 NULL, HFILL }},
2264
2265                 { &hf_rdm_pd_sensor_range_min_value,
2266                         { "Sensor Range Min. Value", "rdm.pd.sensor.range.min_value",
2267                                 FT_INT16, BASE_DEC, NULL, 0x0,
2268                                 NULL, HFILL }},
2269
2270                 { &hf_rdm_pd_sensor_range_max_value,
2271                         { "Sensor Range Max. Value", "rdm.pd.sensor.range.max_value",
2272                                 FT_INT16, BASE_DEC, NULL, 0x0,
2273                                 NULL, HFILL }},
2274
2275                 { &hf_rdm_pd_sensor_normal_min_value,
2276                         { "Sensor Normal Min. Value", "rdm.pd.sensor.normal.min_value",
2277                                 FT_INT16, BASE_DEC, NULL, 0x0,
2278                                 NULL, HFILL }},
2279
2280                 { &hf_rdm_pd_sensor_normal_max_value,
2281                         { "Sensor Normal Max. Value", "rdm.pd.sensor.normal.max_value",
2282                                 FT_INT16, BASE_DEC, NULL, 0x0,
2283                                 NULL, HFILL }},
2284
2285                 { &hf_rdm_pd_sensor_recorded_value_support,
2286                         { "Sensor Recorded Value Support", "rdm.pd.sensor.recorded_value_support",
2287                                 FT_UINT8, BASE_HEX, NULL, 0x0,
2288                                 NULL, HFILL }},
2289
2290                 { &hf_rdm_pd_sensor_type,
2291                         { "Sensor Type", "rdm.pd.sensor_type",
2292                                 FT_UINT8, BASE_HEX | BASE_EXT_STRING, &rdm_sensor_type_vals_ext, 0x0,
2293                                 NULL, HFILL }},
2294
2295                 { &hf_rdm_pd_sensor_unit,
2296                         { "Sensor Unit", "rdm.pd.sensor_unit",
2297                                 FT_UINT8, BASE_HEX | BASE_EXT_STRING, &rdm_unit_vals_ext, 0x0,
2298                                 NULL, HFILL }},
2299
2300                 { &hf_rdm_pd_sensor_prefix,
2301                         { "Sensor Prefix", "rdm.pd.sensor_prefix",
2302                                 FT_UINT8, BASE_HEX | BASE_EXT_STRING, &rdm_prefix_vals_ext, 0x0,
2303                                 NULL, HFILL }},
2304
2305                 { &hf_rdm_pd_sensor_description,
2306                         { "Sensor Description", "rdm.pd.sensor.description",
2307                                 FT_STRING, BASE_NONE, NULL, 0x0,
2308                                 NULL, HFILL }},
2309
2310                 { &hf_rdm_pd_manu_label,
2311                         { "Manufacturur Label", "rdm.pd.manu_label",
2312                                 FT_STRING, BASE_NONE, NULL, 0x0,
2313                                 NULL, HFILL }},
2314
2315
2316                 { &hf_rdm_pd_device_label,
2317                         { "Device Label", "rdm.pd.device_label",
2318                                 FT_STRING, BASE_NONE, NULL, 0x0,
2319                                 NULL, HFILL }},
2320
2321                 { &hf_rdm_pd_dmx_start_address,
2322                         { "DMX Start Address", "rdm.pd.dmx_start_address",
2323                                 FT_UINT16, BASE_DEC, NULL, 0x0,
2324                                 NULL, HFILL }},
2325
2326                 { &hf_rdm_pd_device_hours,
2327                         { "Device Hours", "rdm.pd.device_hours",
2328                                 FT_UINT32, BASE_DEC, NULL, 0x0,
2329                                 NULL, HFILL }},
2330
2331                 { &hf_rdm_pd_lamp_hours,
2332                         { "Lamp Hours", "rdm.pd.lamp_hours",
2333                                 FT_UINT32, BASE_DEC, NULL, 0x0,
2334                                 NULL, HFILL }},
2335
2336                 { &hf_rdm_pd_lamp_strikes,
2337                         { "Lamp Strikes", "rdm.pd.lamp_strikes",
2338                                 FT_UINT32, BASE_DEC, NULL, 0x0,
2339                                 NULL, HFILL }},
2340
2341                 { &hf_rdm_pd_proto_vers,
2342                         { "RDM Protocol Version", "rdm.pd.proto_vers",
2343                                 FT_UINT16, BASE_HEX, NULL, 0x0,
2344                                 NULL, HFILL }},
2345
2346                 { &hf_rdm_pd_device_model_id,
2347                         { "Device Model ID", "rdm.pd.device_model_id",
2348                                 FT_UINT16, BASE_HEX, NULL, 0x0,
2349                                 NULL, HFILL }},
2350
2351                 { &hf_rdm_pd_product_cat,
2352                         { "Product Category", "rdm.pd.product_cat",
2353                                 FT_UINT16, BASE_HEX | BASE_EXT_STRING, &rdm_product_cat_vals_ext, 0x0,
2354                                 NULL, HFILL }},
2355
2356                 { &hf_rdm_pd_software_vers_id,
2357                         { "Software Version ID", "rdm.pd.software_version_id",
2358                                 FT_UINT32, BASE_HEX, NULL, 0x0,
2359                                 NULL, HFILL }},
2360
2361                 { &hf_rdm_pd_dmx_footprint,
2362                         { "DMX Footprint", "rdm.pd.dmx_footprint",
2363                                 FT_UINT16, BASE_DEC, NULL, 0x0,
2364                                 NULL, HFILL }},
2365
2366                 { &hf_rdm_pd_dmx_pers_current,
2367                         { "Current DMX Personallity", "rdm.pd.dmx_pers_current",
2368                                 FT_UINT8, BASE_DEC, NULL, 0x0,
2369                                 NULL, HFILL }},
2370
2371                 { &hf_rdm_pd_dmx_pers_total,
2372                         { "Total nr. DMX Personallities", "rdm.pd.dmx_pers_total",
2373                                 FT_UINT8, BASE_DEC, NULL, 0x0,
2374                                 NULL, HFILL }},
2375
2376                 { &hf_rdm_pd_sub_device_count,
2377                         { "Sub-Device Count", "rdm.pd.sub_device_count",
2378                                 FT_UINT16, BASE_DEC, NULL, 0x0,
2379                                 NULL, HFILL }},
2380
2381                 { &hf_rdm_pd_sensor_count,
2382                         { "Sensor Count", "rdm.pd.sensor_count",
2383                                 FT_UINT8, BASE_DEC, NULL, 0x0,
2384                                 NULL, HFILL }},
2385
2386                 { &hf_rdm_pd_device_model_description,
2387                         { "Device Model Description", "rdm.pd.device_model_description",
2388                                 FT_STRING, BASE_NONE, NULL, 0x0,
2389                                 NULL, HFILL }},
2390
2391                 { &hf_rdm_pd_disc_unique_branch_lb_uid,
2392                         { "Lower Bound UID", "rdm.pd.disc_unique_branch.lb_uid",
2393                                 FT_BYTES, BASE_NONE, NULL, 0x0,
2394                                 NULL, HFILL }},
2395
2396                 { &hf_rdm_pd_disc_unique_branch_ub_uid,
2397                         { "Upper Bound UID", "rdm.pd.disc_unique_branch.ub_uid",
2398                                 FT_BYTES, BASE_NONE, NULL, 0x0,
2399                                 NULL, HFILL }},
2400
2401                 { &hf_rdm_pd_disc_mute_control_field,
2402                         { "Control Field", "rdm.pd.disc_mute.control_field",
2403                                 FT_UINT8, BASE_HEX, NULL, 0x0,
2404                                 NULL, HFILL }},
2405
2406                 { &hf_rdm_pd_disc_mute_binding_uid,
2407                         { "Binding UID", "rdm.pd.disc_mute.binding_uid",
2408                                 FT_BYTES, BASE_NONE, NULL, 0x0,
2409                                 NULL, HFILL }},
2410
2411                 { &hf_rdm_pd_disc_unmute_control_field,
2412                         { "Control Field", "rdm.pd.disc_unmute.control_field",
2413                                 FT_UINT8, BASE_HEX, NULL, 0x0,
2414                                 NULL, HFILL }},
2415
2416                 { &hf_rdm_pd_disc_unmute_binding_uid,
2417                         { "Binding UID", "rdm.pd.disc_unmute.binding_uid",
2418                                 FT_BYTES, BASE_NONE, NULL, 0x0,
2419                                 NULL, HFILL }},
2420
2421                 { &hf_rdm_pd_proxied_devices_uid,
2422                         { "UID", "rdm.pd.proxied_devices.uid",
2423                                 FT_BYTES, BASE_NONE, NULL, 0x0,
2424                                 NULL, HFILL }},
2425
2426                 { &hf_rdm_pd_proxied_device_count,
2427                         { "Device Count", "rdm.pd.device_count",
2428                                 FT_UINT16, BASE_DEC, NULL, 0x0,
2429                                 NULL, HFILL }},
2430
2431                 { &hf_rdm_pd_proxied_device_list_change,
2432                         { "List Change", "rdm.pd.list_change",
2433                                 FT_UINT8, BASE_DEC, NULL, 0x0,
2434                                 NULL, HFILL }},
2435
2436                 { &hf_rdm_pd_real_time_clock_year,
2437                         { "Year", "rdm.pd.real_time_clock.year",
2438                                 FT_UINT16, BASE_DEC, NULL, 0x0,
2439                                 NULL, HFILL }},
2440
2441                 { &hf_rdm_pd_real_time_clock_month,
2442                         { "Month", "rdm.pd.real_time_clock.month",
2443                                 FT_UINT8, BASE_DEC, NULL, 0x0,
2444                                 NULL, HFILL }},
2445
2446                 { &hf_rdm_pd_real_time_clock_day,
2447                         { "Day", "rdm.pd.real_time_clock.day",
2448                                 FT_UINT8, BASE_DEC, NULL, 0x0,
2449                                 NULL, HFILL }},
2450
2451                 { &hf_rdm_pd_real_time_clock_hour,
2452                         { "Hour", "rdm.pd.real_time_clock.hour",
2453                                 FT_UINT8, BASE_DEC, NULL, 0x0,
2454                                 NULL, HFILL }},
2455
2456                 { &hf_rdm_pd_real_time_clock_minute,
2457                         { "Minute", "rdm.pd.real_time_clock.minute",
2458                                 FT_UINT8, BASE_DEC, NULL, 0x0,
2459                                 NULL, HFILL }},
2460
2461                 { &hf_rdm_pd_real_time_clock_second,
2462                         { "Second", "rdm.pd.real_time_clock.second",
2463                                 FT_UINT8, BASE_DEC, NULL, 0x0,
2464                                 NULL, HFILL }},
2465
2466                 { &hf_rdm_pd_lamp_state,
2467                         { "Lamp State", "rdm.pd.lamp_state",
2468                                 FT_UINT8, BASE_HEX, NULL, 0x0,
2469                                 NULL, HFILL }},
2470
2471                 { &hf_rdm_pd_lamp_on_mode,
2472                         { "Lamp On Mode", "rdm.pd.lamp_on_mode",
2473                                 FT_UINT8, BASE_HEX, NULL, 0x0,
2474                                 NULL, HFILL }},
2475
2476                 { &hf_rdm_pd_device_power_cycles,
2477                         { "Device Power Cycles", "rdm.pd.device_power_cycles",
2478                                 FT_UINT32, BASE_DEC, NULL, 0x0,
2479                                 NULL, HFILL }},
2480
2481                 { &hf_rdm_pd_display_invert,
2482                         { "Display Invert", "rdm.pd.display_invert",
2483                                 FT_UINT8, BASE_HEX, NULL, 0x0,
2484                                 NULL, HFILL }},
2485
2486                 { &hf_rdm_pd_display_level,
2487                         { "Display Level", "rdm.pd.display_level",
2488                                 FT_UINT8, BASE_DEC, NULL, 0x0,
2489                                 NULL, HFILL }},
2490
2491                 { &hf_rdm_pd_pan_invert,
2492                         { "Pan Invert", "rdm.pd.pan_invert",
2493                                 FT_UINT8, BASE_HEX, NULL, 0x0,
2494                                 NULL, HFILL }},
2495
2496                 { &hf_rdm_pd_tilt_invert,
2497                         { "Tilt Invert", "rdm.pd.tilt_invert",
2498                                 FT_UINT8, BASE_HEX, NULL, 0x0,
2499                                 NULL, HFILL }},
2500
2501                 { &hf_rdm_pd_tilt_swap,
2502                         { "Tilt Swap", "rdm.pd.tilt_swap",
2503                                 FT_UINT8, BASE_HEX, NULL, 0x0,
2504                                 NULL, HFILL }},
2505
2506                 { &hf_rdm_pd_selftest_nr,
2507                         { "Selftest Nr.", "rdm.pd.selftest.nr",
2508                                 FT_UINT8, BASE_DEC, NULL, 0x0,
2509                                 NULL, HFILL }},
2510
2511                 { &hf_rdm_pd_selftest_state,
2512                         { "Selftest State", "rdm.pd.selftest.state",
2513                                 FT_UINT8, BASE_HEX, NULL, 0x0,
2514                                 NULL, HFILL }},
2515
2516                 { &hf_rdm_pd_selftest_description,
2517                         { "Selftest Description", "rdm.pd.selftest.description",
2518                                 FT_STRING, BASE_NONE, NULL, 0x0,
2519                                 NULL, HFILL }},
2520
2521                 { &hf_rdm_pd_language_code,
2522                         { "Language Code", "rdm.pd.language_code",
2523                                 FT_STRING, BASE_NONE, NULL, 0x0,
2524                                 NULL, HFILL }},
2525
2526                 { &hf_rdm_pd_identify_device,
2527                         { "Identify Device", "rdm.pd.identify_device",
2528                                 FT_UINT8, BASE_HEX, NULL, 0x0,
2529                                 NULL, HFILL }},
2530
2531                 { &hf_rdm_pd_identify_device_state,
2532                         { "Identify Device State", "rdm.pd.identify_device.state",
2533                                 FT_UINT8, BASE_HEX, NULL, 0x0,
2534                                 NULL, HFILL }},
2535
2536                 { &hf_rdm_pd_reset_device,
2537                         { "Reset Device", "rdm.pd.reset_device",
2538                                 FT_UINT8, BASE_HEX, NULL, 0x0,
2539                                 NULL, HFILL }},
2540
2541                 { &hf_rdm_pd_power_state,
2542                         { "Power State", "rdm.pd.power_state",
2543                                 FT_UINT8, BASE_HEX, NULL, 0x0,
2544                                 NULL, HFILL }},
2545
2546                 { &hf_rdm_pd_capture_preset_scene_nr,
2547                         { "Scene Nr.", "rdm.pd.capture_preset.scene_nr",
2548                                 FT_UINT16, BASE_DEC, NULL, 0x0,
2549                                 NULL, HFILL }},
2550
2551                 { &hf_rdm_pd_capture_preset_up_fade_time,
2552                         { "Up Fade Time", "rdm.pd.capture_preset.up_fade_time",
2553                                 FT_UINT16, BASE_DEC, NULL, 0x0,
2554                                 NULL, HFILL }},
2555
2556                 { &hf_rdm_pd_capture_preset_down_fade_time,
2557                         { "Down Fade Time", "rdm.pd.capture_preset.down_fade_time",
2558                                 FT_UINT16, BASE_DEC, NULL, 0x0,
2559                                 NULL, HFILL }},
2560
2561                 { &hf_rdm_pd_capture_preset_wait_time,
2562                         { "Wait Time", "rdm.pd.capture_preset.wait_time",
2563                                 FT_UINT16, BASE_DEC, NULL, 0x0,
2564                                 NULL, HFILL }},
2565
2566                 { &hf_rdm_pd_preset_playback_mode,
2567                         { "Mode", "rdm.pd.preset_playback.mode",
2568                                 FT_UINT16, BASE_DEC, NULL, 0x0,
2569                                 NULL, HFILL }},
2570
2571                 { &hf_rdm_pd_preset_playback_level,
2572                         { "Level", "rdm.pd.preset_playback.level",
2573                                 FT_UINT8, BASE_DEC, NULL, 0x0,
2574                                 NULL, HFILL }},
2575
2576                 { &hf_rdm_pd_parameter_id,
2577                         { "ID", "rdm.pd.parameter.id",
2578                                 FT_UINT8, BASE_DEC, NULL, 0x0,
2579                                 NULL, HFILL }},
2580
2581                 { &hf_rdm_pd_parameter_pdl_size,
2582                         { "PDL Size", "rdm.pd.parameter.pdl_size",
2583                                 FT_UINT8, BASE_DEC, NULL, 0x0,
2584                                 NULL, HFILL }},
2585
2586                 { &hf_rdm_pd_parameter_data_type,
2587                         { "Data Type", "rdm.pd.parameter.data_type",
2588                                 FT_UINT8, BASE_DEC, NULL, 0x0,
2589                                 NULL, HFILL }},
2590
2591                 { &hf_rdm_pd_parameter_cmd_class,
2592                         { "Command Class", "rdm.pd.parameter.cmd_class",
2593                                 FT_UINT8, BASE_DEC, NULL, 0x0,
2594                                 NULL, HFILL }},
2595
2596                 { &hf_rdm_pd_parameter_type,
2597                         { "Type", "rdm.pd.parameter.type",
2598                                 FT_UINT8, BASE_DEC, NULL, 0x0,
2599                                 NULL, HFILL }},
2600
2601                 { &hf_rdm_pd_parameter_unit,
2602                         { "Unit", "rdm.pd.parameter.unit",
2603                                 FT_UINT8, BASE_DEC, NULL, 0x0,
2604                                 NULL, HFILL }},
2605
2606                 { &hf_rdm_pd_parameter_prefix,
2607                         { "Prefix", "rdm.pd.parameter.prefix",
2608                                 FT_UINT8, BASE_DEC, NULL, 0x0,
2609                                 NULL, HFILL }},
2610
2611                 { &hf_rdm_pd_parameter_min_value,
2612                         { "Min. Value", "rdm.pd.parameter.min_value",
2613                                 FT_UINT32, BASE_DEC, NULL, 0x0,
2614                                 NULL, HFILL }},
2615
2616                 { &hf_rdm_pd_parameter_max_value,
2617                         { "Max. Value", "rdm.pd.parameter.max_value",
2618                                 FT_UINT32, BASE_DEC, NULL, 0x0,
2619                                 NULL, HFILL }},
2620
2621                 { &hf_rdm_pd_parameter_default_value,
2622                         { "Delauft Value", "rdm.pd.parameter.default_value",
2623                                 FT_UINT32, BASE_DEC, NULL, 0x0,
2624                                 NULL, HFILL }},
2625
2626                 { &hf_rdm_pd_parameter_description,
2627                         { "Description", "rdm.pd.parameter.description",
2628                                 FT_STRING, BASE_NONE, NULL, 0x0,
2629                                 NULL, HFILL }},
2630
2631                 { &hf_rdm_pd_software_version_label,
2632                         { "Version Label", "rdm.pd.software_version.label",
2633                                 FT_STRING, BASE_NONE, NULL, 0x0,
2634                                 NULL, HFILL }},
2635
2636                 { &hf_rdm_pd_boot_software_version_id,
2637                         { "Version ID", "rdm.pd.boot_software_version.id",
2638                                 FT_UINT32, BASE_HEX, NULL, 0x0,
2639                                 NULL, HFILL }},
2640
2641                 { &hf_rdm_pd_boot_software_version_label,
2642                         { "Version Label", "rdm.pd.boot_software_version.label",
2643                                 FT_STRING, BASE_NONE, NULL, 0x0,
2644                                 NULL, HFILL }},
2645
2646                 { &hf_rdm_pd_comms_status_short_msg,
2647                         { "Short Msg", "rdm.pd.comms_status.short_msg",
2648                                 FT_UINT16, BASE_DEC, NULL, 0x0,
2649                                 NULL, HFILL }},
2650
2651                 { &hf_rdm_pd_comms_status_len_mismatch,
2652                         { "Len Mismatch", "rdm.pd.comms_status.len_mismatch",
2653                                 FT_UINT16, BASE_DEC, NULL, 0x0,
2654                                 NULL, HFILL }},
2655
2656                 { &hf_rdm_pd_comms_status_csum_fail,
2657                         { "Checksum Fail", "rdm.pd.comms_status.csum_fail",
2658                                 FT_UINT16, BASE_DEC, NULL, 0x0,
2659                                 NULL, HFILL }},
2660
2661                 { &hf_rdm_pd_status_messages_type,
2662                         { "Type", "rdm.pd.status_messages.type",
2663                                 FT_UINT8, BASE_HEX, NULL, 0x0,
2664                                 NULL, HFILL }},
2665
2666                 { &hf_rdm_pd_status_messages_sub_device_id,
2667                         { "Sub. Device ID", "rdm.pd.status_messages.sub_devices_id",
2668                                 FT_UINT16, BASE_HEX, NULL, 0x0,
2669                                 NULL, HFILL }},
2670
2671                 { &hf_rdm_pd_status_messages_id,
2672                         { "ID", "rdm.pd.status_messages.id",
2673                                 FT_UINT16, BASE_HEX, NULL, 0x0,
2674                                 NULL, HFILL }},
2675
2676                 { &hf_rdm_pd_status_messages_data_value_1,
2677                         { "Data Value 1", "rdm.pd.status_messages.data_value_1",
2678                                 FT_UINT16, BASE_HEX, NULL, 0x0,
2679                                 NULL, HFILL }},
2680
2681                 { &hf_rdm_pd_status_messages_data_value_2,
2682                         { "Data Value 2", "rdm.pd.status_messages.data_value_2",
2683                                 FT_UINT16, BASE_HEX, NULL, 0x0,
2684                                 NULL, HFILL }},
2685
2686                 { &hf_rdm_pd_status_id,
2687                         { "ID", "rdm.pd.status_id",
2688                                 FT_UINT16, BASE_DEC, NULL, 0x0,
2689                                 NULL, HFILL }},
2690
2691                 { &hf_rdm_pd_status_id_description,
2692                         { "Description", "rdm.pd.status_id.description",
2693                                 FT_STRING, BASE_NONE, NULL, 0x0,
2694                                 NULL, HFILL }},
2695
2696                 { &hf_rdm_pd_sub_device_status_report_threshold_status_type,
2697                         { "Status Type", "rdm.pd.sub_device_status_report_threshold.status_type",
2698                                 FT_UINT8, BASE_HEX, NULL, 0x0,
2699                                 NULL, HFILL }},
2700
2701                 { &hf_rdm_pd_product_detail_id_list,
2702                         { "Sensor Count", "rdm.pd.product_detail_id_list",
2703                                 FT_UINT16, BASE_HEX, NULL, 0x0,
2704                                 NULL, HFILL }},
2705
2706                 { &hf_rdm_pd_factory_defaults,
2707                         { "Factory Defaults", "rdm.pd.factory_defaults",
2708                                 FT_UINT8, BASE_DEC, NULL, 0x0,
2709                                 NULL, HFILL }},
2710
2711                 { &hf_rdm_pd_dmx_pers_nr,
2712                         { "DMX Pers. Nr.", "rdm.pd.dmx_pers.nr",
2713                                 FT_UINT8, BASE_DEC, NULL, 0x0,
2714                                 NULL, HFILL }},
2715
2716                 { &hf_rdm_pd_dmx_pers_count,
2717                         { "DMX Pers. Count", "rdm.pd.dmx_pers.count",
2718                                 FT_UINT8, BASE_DEC, NULL, 0x0,
2719                                 NULL, HFILL }},
2720
2721                 { &hf_rdm_pd_dmx_pers_description,
2722                         { "DMX Pers. Description", "rdm.pd.dmx_pers.description",
2723                                 FT_STRING, BASE_NONE, NULL, 0x0,
2724                                 NULL, HFILL }},
2725
2726                 { &hf_rdm_pd_dmx_pers_slots,
2727                         { "DMX Pers. Slots", "rdm.pd.dmx_pers.slots",
2728                                 FT_UINT16, BASE_DEC, NULL, 0x0,
2729                                 NULL, HFILL }},
2730
2731                 { &hf_rdm_pd_dmx_pers_text,
2732                         { "DMX Pers. Text", "rdm.pd.dmx_pers.text",
2733                                 FT_STRING, BASE_NONE, NULL, 0x0,
2734                                 NULL, HFILL }},
2735
2736                 { &hf_rdm_pd_slot_offset,
2737                         { "Slot Offset", "rdm.pd.slot_offset",
2738                                 FT_UINT16, BASE_DEC, NULL, 0x0,
2739                                 NULL, HFILL }},
2740
2741                 { &hf_rdm_pd_slot_type,
2742                         { "Slot Type", "rdm.pd.slot_type",
2743                                 FT_UINT8, BASE_DEC, NULL, 0x0,
2744                                 NULL, HFILL }},
2745
2746                 { &hf_rdm_pd_slot_label_id,
2747                         { "Slot Label ID", "rdm.pd.slot_label_id",
2748                                 FT_UINT16, BASE_HEX, NULL, 0x0,
2749                                 NULL, HFILL }},
2750
2751                 { &hf_rdm_pd_slot_nr,
2752                         { "Slot Nr.", "rdm.pd.slot_nr",
2753                                 FT_UINT16, BASE_DEC, NULL, 0x0,
2754                                 NULL, HFILL }},
2755
2756                 { &hf_rdm_pd_slot_description,
2757                         { "Slot Description", "rdm.pd.slot_description",
2758                                 FT_STRING, BASE_NONE, NULL, 0x0,
2759                                 NULL, HFILL }},
2760
2761                 { &hf_rdm_pd_slot_value,
2762                         { "Slot Value", "rdm.pd.slot_value",
2763                                 FT_UINT8, BASE_DEC, NULL, 0x0,
2764                                 NULL, HFILL }},
2765
2766                 { &hf_rdm_pd_rec_value_support,
2767                         { "Rec. Value Support", "rdm.pd.rec_value_support",
2768                                 FT_UINT8, BASE_HEX, NULL, 0x0,
2769                                 NULL, HFILL }}
2770         };
2771
2772         static gint *ett[] = {
2773                 &ett_rdm
2774         };
2775
2776         proto_rdm = proto_register_protocol("Remote Device Management",
2777                         "RDM", "rdm");
2778         proto_register_field_array(proto_rdm, hf, array_length(hf));
2779         proto_register_subtree_array(ett, array_length(ett));
2780         register_dissector("rdm", dissect_rdm, proto_rdm);
2781 }
2782