1 /* packet-rf4ce-profile.c
2 * Profile layer related functions and objects for RF4CE dissector
3 * Copyright (C) Atmosic 2023
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
9 * SPDX-License-Identifier: GPL-2.0-or-later
16 #include <epan/packet.h>
18 #include <wsutil/array.h>
19 #include "packet-rf4ce-secur.h"
21 /* TLV Node-elements */
22 static int proto_rf4ce_profile
;
24 static int ett_rf4ce_profile
;
25 static int ett_rf4ce_profile_cmd_frame
;
26 static int ett_rf4ce_profile_attrs
;
27 static int ett_rf4ce_profile_attrs_sub
;
28 static int ett_rf4ce_profile_zrc20_ident_cap
;
29 static int ett_rf4ce_profile_zrc20_mappable_actions_entry
;
30 static int ett_rf4ce_profile_zrc20_action_control
;
31 static int ett_rf4ce_profile_zrc20_action_mappings_flags
;
32 static int ett_rf4ce_profile_zrc20_action_mappings_rf_descr
;
33 static int ett_rf4ce_profile_zrc20_action_mappings_rf_descr_rf_conf
;
34 static int ett_rf4ce_profile_zrc20_action_mappings_rf_descr_tx_opts
;
35 static int ett_rf4ce_profile_zrc20_action_mappings_ir_descr
;
36 static int ett_rf4ce_profile_zrc20_action_mappings_ir_descr_ir_conf
;
37 static int ett_rf4ce_profile_gdp_poll_constraints_polling_rec
;
38 static int ett_rf4ce_profile_gdp_poll_constraints_polling_rec_polling_trig_cap
;
39 static int ett_rf4ce_profile_gdp_poll_configuration_polling_trig_conf
;
40 static int ett_rf4ce_profile_action_records
;
41 static int ett_rf4ce_profile_action_records_sub
;
42 static int ett_rf4ce_profile_zrc10_supported_commands
;
43 static int ett_rf4ce_profile_zrc10_supported_commands_sub
;
45 static dissector_table_t rf4ce_profile_dissector_table
;
47 static dissector_handle_t rf4ce_profile_handle
;
49 /* RF4CE Profile header */
50 static int hf_rf4ce_profile_fcf
;
51 static int hf_rf4ce_profile_fcf_cmd_id
;
52 static int hf_rf4ce_zrc20_fcf_cmd_id
;
53 static int hf_rf4ce_profile_fcf_reserved
;
54 static int hf_rf4ce_profile_fcf_cmd_frame
;
55 static int hf_rf4ce_profile_fcf_data_pending
;
57 /* RF4CE Profile command - Generic Response */
58 static int hf_rf4ce_profile_cmd_generic_resp_status
;
60 /* RF4CE Profile command - Configuration Complete */
61 static int hf_rf4ce_profile_cmd_configuration_complete_status
;
63 /* RF4CE Profile command - Heartbeat */
64 static int hf_rf4ce_profile_cmd_heartbeat_trigger
;
66 /* RF4CE Profile Attributes - general */
67 static int hf_rf4ce_profile_gdp_attr_id
;
68 static int hf_rf4ce_profile_zrc20_attr_id
;
69 static int hf_rf4ce_profile_attr_entry_id
;
70 static int hf_rf4ce_profile_attr_status
;
71 static int hf_rf4ce_profile_attr_length
;
72 static int hf_rf4ce_profile_attr_value
;
74 /* RF4CE Profile command - Check Validation */
75 static int hf_rf4ce_profile_cmd_check_validation_sub_type
;
76 static int hf_rf4ce_profile_cmd_check_validation_control
;
77 static int hf_rf4ce_profile_cmd_check_validation_status
;
79 /* RF4CE Profile command - Client Notification */
80 static int hf_rf4ce_profile_cmd_client_notification_sub_type
;
82 static int hf_rf4ce_profile_cmd_client_notification_identify_flags
;
83 static int hf_rf4ce_profile_cmd_client_notification_identify_flags_stop_on_action
;
84 static int hf_rf4ce_profile_cmd_client_notification_identify_flags_flash_light
;
85 static int hf_rf4ce_profile_cmd_client_notification_identify_flags_make_sound
;
86 static int hf_rf4ce_profile_cmd_client_notification_identify_flags_vibrate
;
87 static int hf_rf4ce_profile_cmd_client_notification_identify_flags_reserved
;
89 static int hf_rf4ce_profile_cmd_client_notification_identify_time
;
91 /* RF4CE Profile command - Key Exchange */
92 static int hf_rf4ce_profile_cmd_key_exchange_sub_type
;
94 static int hf_rf4ce_profile_cmd_key_exchange_flags
;
95 static int hf_rf4ce_profile_cmd_key_exchange_flags_default_secret
;
96 static int hf_rf4ce_profile_cmd_key_exchange_flags_initiator_vendor_specific_secret
;
97 static int hf_rf4ce_profile_cmd_key_exchange_flags_responder_vendor_specific_secret
;
98 static int hf_rf4ce_profile_cmd_key_exchange_flags_reserved
;
99 static int hf_rf4ce_profile_cmd_key_exchange_flags_vendor_specific_parameter
;
101 static int hf_rf4ce_profile_cmd_key_exchange_rand_a
;
102 static int hf_rf4ce_profile_cmd_key_exchange_rand_b
;
103 static int hf_rf4ce_profile_cmd_key_exchange_tag_b
;
104 static int hf_rf4ce_profile_cmd_key_exchange_tag_a
;
107 /* RF4CE ZRC 2.0 Profile command - Actions */
108 static int hf_rf4ce_zrc20_cmd_actions
;
111 static int hf_rf4ce_zrc20_cmd_actions_action_control
;
112 static int hf_rf4ce_zrc20_cmd_actions_action_control_action_type
;
113 static int hf_rf4ce_zrc20_cmd_actions_action_control_reserved
;
114 static int hf_rf4ce_zrc20_cmd_actions_action_control_modifier_bits_gui
;
115 static int hf_rf4ce_zrc20_cmd_actions_action_control_modifier_bits_alt
;
116 static int hf_rf4ce_zrc20_cmd_actions_action_control_modifier_bits_shift
;
117 static int hf_rf4ce_zrc20_cmd_actions_action_control_modifier_bits_ctrl
;
119 static int hf_rf4ce_zrc20_cmd_actions_action_data_payload_length
;
120 static int hf_rf4ce_zrc20_cmd_actions_action_data_action_bank
;
121 static int hf_rf4ce_zrc20_cmd_actions_action_data_action_code
;
122 static int hf_rf4ce_zrc20_cmd_actions_action_data_action_vendor
;
123 static int hf_rf4ce_zrc20_cmd_actions_action_data_action_payload
;
125 /* RF4CE ZRC 1.0 profile header */
126 static int hf_rf4ce_zrc10_fcf
;
127 static int hf_rf4ce_zrc10_fcf_cmd_id
;
128 static int hf_rf4ce_zrc10_fcf_reserved
;
130 #define RF4CE_ZRC10_FCF_CMD_ID_RESERVED 0b00000000
131 #define RF4CE_ZRC10_FCF_CMD_ID_USER_CONTROL_PRESSED 0b00000001
132 #define RF4CE_ZRC10_FCF_CMD_ID_USER_CONTROL_REPEATED 0b00000010
133 #define RF4CE_ZRC10_FCF_CMD_ID_USER_CONTROL_RELEASED 0b00000011
134 #define RF4CE_ZRC10_FCF_CMD_ID_USER_CONTROL_CMD_DISCOVERY_REQ 0b00000100
135 #define RF4CE_ZRC10_FCF_CMD_ID_USER_CONTROL_CMD_DISCOVERY_RSP 0b00000101
137 #define RF4CE_ZRC10_FCF_CMD_ID_MASK 0b00001111
138 #define RF4CE_ZRC10_FCF_RESERVED_MASK 0b11110000
140 static const value_string rf4ce_zrc10_fcf_cmd_id_vals
[] = {
141 { RF4CE_ZRC10_FCF_CMD_ID_RESERVED
, "Reserved" },
142 { RF4CE_ZRC10_FCF_CMD_ID_USER_CONTROL_PRESSED
, "User Control Pressed" },
143 { RF4CE_ZRC10_FCF_CMD_ID_USER_CONTROL_REPEATED
, "User Control Repeated" },
144 { RF4CE_ZRC10_FCF_CMD_ID_USER_CONTROL_RELEASED
, "User Control Released" },
145 { RF4CE_ZRC10_FCF_CMD_ID_USER_CONTROL_CMD_DISCOVERY_REQ
, "Command Discovery Request" },
146 { RF4CE_ZRC10_FCF_CMD_ID_USER_CONTROL_CMD_DISCOVERY_RSP
, "Command Discovery Response" },
150 static int hf_rf4ce_zrc10_cmd_common_rc_command_code
;
151 static int hf_rf4ce_zrc10_cmd_common_rc_command_payload
;
152 static int hf_rf4ce_zrc10_cmd_disc_reserved
;
153 static int hf_rf4ce_zrc10_cmd_disc_rsp_supported_commands
;
155 static int hf_rf4ce_profile_unparsed_payload
;
157 #define RF4CE_ZRC20_CMD_ACTIONS_ACTION_CONTROL_ACTION_TYPE_RESERVED 0b00000000
158 #define RF4CE_ZRC20_CMD_ACTIONS_ACTION_CONTROL_ACTION_TYPE_START 0b00000001
159 #define RF4CE_ZRC20_CMD_ACTIONS_ACTION_CONTROL_ACTION_TYPE_REPEAT 0b00000010
160 #define RF4CE_ZRC20_CMD_ACTIONS_ACTION_CONTROL_ACTION_TYPE_ATOMIC 0b00000011
161 #define RF4CE_ZRC20_CMD_ACTIONS_ACTION_CONTROL_RESERVED 0b00001100
162 #define RF4CE_ZRC20_CMD_ACTIONS_ACTION_CONTROL_MODIFIER_BITS_GUI 0b00010000
163 #define RF4CE_ZRC20_CMD_ACTIONS_ACTION_CONTROL_MODIFIER_BITS_ALT 0b00100000
164 #define RF4CE_ZRC20_CMD_ACTIONS_ACTION_CONTROL_MODIFIER_BITS_SHIFT 0b01000000
165 #define RF4CE_ZRC20_CMD_ACTIONS_ACTION_CONTROL_MODIFIER_BITS_CTRL 0b10000000
167 #define RF4CE_ZRC20_CMD_ACTIONS_ACTION_CONTROL_ACTION_TYPE_MASK \
168 (RF4CE_ZRC20_CMD_ACTIONS_ACTION_CONTROL_ACTION_TYPE_RESERVED \
169 | RF4CE_ZRC20_CMD_ACTIONS_ACTION_CONTROL_ACTION_TYPE_START \
170 | RF4CE_ZRC20_CMD_ACTIONS_ACTION_CONTROL_ACTION_TYPE_REPEAT \
171 | RF4CE_ZRC20_CMD_ACTIONS_ACTION_CONTROL_ACTION_TYPE_ATOMIC)
173 static const value_string rf4ce_zrc20_cmd_actions_action_control_action_type_vals
[] = {
174 { RF4CE_ZRC20_CMD_ACTIONS_ACTION_CONTROL_ACTION_TYPE_RESERVED
, "Reserved" },
175 { RF4CE_ZRC20_CMD_ACTIONS_ACTION_CONTROL_ACTION_TYPE_START
, "Start" },
176 { RF4CE_ZRC20_CMD_ACTIONS_ACTION_CONTROL_ACTION_TYPE_REPEAT
, "Repeat" },
177 { RF4CE_ZRC20_CMD_ACTIONS_ACTION_CONTROL_ACTION_TYPE_ATOMIC
, "Atomic" },
181 /* RF4CE Profile frame control field */
182 #define RF4CE_PROFILE_FCF_CMD_ID_MASK 0b00001111
183 #define RF4CE_PROFILE_FCF_RESERVED_MASK 0b00110000
184 #define RF4CE_PROFILE_FCF_CMD_FRAME_MASK 0b01000000
185 #define RF4CE_PROFILE_FCF_DATA_PENDING_MASK 0b10000000
187 /* RF4CE Profile commands */
188 #define RF4CE_PROFILE_CMD_GENERIC_RESPONSE 0x00
189 #define RF4CE_PROFILE_CMD_CONFIGURATION_COMPLETE 0x01
190 #define RF4CE_PROFILE_CMD_HEARTBEAT 0x02
191 #define RF4CE_PROFILE_CMD_GET_ATTRIBUTES 0x03
192 #define RF4CE_PROFILE_CMD_GET_ATTRIBUTES_RESPONSE 0x04
193 #define RF4CE_PROFILE_CMD_PUSH_ATTRIBUTES 0x05
194 #define RF4CE_PROFILE_CMD_SET_ATTRIBUTES 0x06
195 #define RF4CE_PROFILE_CMD_PULL_ATTRIBUTES 0x07
196 #define RF4CE_PROFILE_CMD_PULL_ATTRIBUTES_RESPONSE 0x08
197 #define RF4CE_PROFILE_CMD_CHECK_VALIDATION 0x09
198 #define RF4CE_PROFILE_CMD_CLIENT_NOTIFICATION 0x0a
199 #define RF4CE_PROFILE_CMD_KEY_EXCHANGE 0x0b
201 static const value_string rf4ce_profile_fcf_cmd_id_vals
[] = {
202 { RF4CE_PROFILE_CMD_GENERIC_RESPONSE
, "Generic Response" },
203 { RF4CE_PROFILE_CMD_CONFIGURATION_COMPLETE
, "Configuration Complete" },
204 { RF4CE_PROFILE_CMD_HEARTBEAT
, "Heartbeat" },
205 { RF4CE_PROFILE_CMD_GET_ATTRIBUTES
, "Get Attributes" },
206 { RF4CE_PROFILE_CMD_GET_ATTRIBUTES_RESPONSE
, "Get Attributes Response" },
207 { RF4CE_PROFILE_CMD_PUSH_ATTRIBUTES
, "Push Attributes" },
208 { RF4CE_PROFILE_CMD_SET_ATTRIBUTES
, "Set Attributes" },
209 { RF4CE_PROFILE_CMD_PULL_ATTRIBUTES
, "Pull Attributes" },
210 { RF4CE_PROFILE_CMD_PULL_ATTRIBUTES_RESPONSE
, "Pull Attributes Response" },
211 { RF4CE_PROFILE_CMD_CHECK_VALIDATION
, "Check Validation" },
212 { RF4CE_PROFILE_CMD_CLIENT_NOTIFICATION
, "Client Notification" },
213 { RF4CE_PROFILE_CMD_KEY_EXCHANGE
, "Key Exchange" },
217 #define RF4CE_PROFILE_FCF_CMD_PROFILE_SPECIFIC_COMMAND 0
218 #define RF4CE_PROFILE_FCF_CMD_GDP_COMMAND 1
220 static const value_string rf4ce_profile_fcf_cmd_frame_vals
[] = {
221 { RF4CE_PROFILE_FCF_CMD_PROFILE_SPECIFIC_COMMAND
, "Profile Specific Command" },
222 { RF4CE_PROFILE_FCF_CMD_GDP_COMMAND
, "GDP Command" },
226 /* RF4CE ZRC 2.0 Profile commands */
227 /* 0x00 - 0x05 - Reserved */
228 #define RF4CE_ZRC20_CMD_ACTIONS 0x06
229 /* 0x07 - 0x0f - Reserved */
231 static const value_string rf4ce_zrc20_fcf_cmd_id_vals
[] = {
232 { RF4CE_ZRC20_CMD_ACTIONS
, "Actions" }, { 0, NULL
}
235 /* RF4CE Profile command - Generic Response */
236 #define RF4CE_PROFILE_CMD_GENERIC_RESP_STATUS_SUCCESS 0x00
237 #define RF4CE_PROFILE_CMD_GENERIC_RESP_STATUS_UNSUPPORTED_REQUEST 0x01
238 #define RF4CE_PROFILE_CMD_GENERIC_RESP_STATUS_INVALID_PARAMETER 0x02
239 #define RF4CE_PROFILE_CMD_GENERIC_RESP_STATUS_CONFIGURATION_FAILURE 0x03
240 /* 0x04 – 0x3f Reserved error codes */
241 /* 0x40 – 0xff Profile specific error codes */
243 static const value_string hf_rf4ce_profile_cmd_generic_resp_status_vals
[] = {
244 { RF4CE_PROFILE_CMD_GENERIC_RESP_STATUS_SUCCESS
, "Success" },
245 { RF4CE_PROFILE_CMD_GENERIC_RESP_STATUS_UNSUPPORTED_REQUEST
, "Unsupported Request" },
246 { RF4CE_PROFILE_CMD_GENERIC_RESP_STATUS_INVALID_PARAMETER
, "Invalid Parameter" },
247 { RF4CE_PROFILE_CMD_GENERIC_RESP_STATUS_CONFIGURATION_FAILURE
, "Configuration Failure" },
251 /* RF4CE Profile command - Configuration Complete */
252 #define RF4CE_PROFILE_CMD_CONFIGURATION_COMPLETE_STATUS_SUCCESS 0x00
253 /* 0x01 – 0x02 Reserved error codes */
254 #define RF4CE_PROFILE_CMD_CONFIGURATION_COMPLETE_STATUS_CONFIGURATION_FAILURE 0x03
255 /* 0x04 – 0x3f Reserved error codes */
256 /* 0x40 – 0xff Profile specific error codes */
258 static const value_string hf_rf4ce_profile_cmd_configuration_complete_status_vals
[] = {
259 { RF4CE_PROFILE_CMD_CONFIGURATION_COMPLETE_STATUS_SUCCESS
, "Success" },
260 { RF4CE_PROFILE_CMD_CONFIGURATION_COMPLETE_STATUS_CONFIGURATION_FAILURE
, "Configuration Failure" },
264 /* RF4CE Profile command - Heartbeat */
265 #define RF4CE_PROFILE_CMD_HEARTBEAT_TRIGGER_GENERIC_ACTIVITY 0x00
266 #define RF4CE_PROFILE_CMD_HEARTBEAT_TRIGGER_TIME_BASED_POLLING 0x01
267 #define RF4CE_PROFILE_CMD_HEARTBEAT_TRIGGER_POLLING_ON_KEY_PRESS 0x02
268 #define RF4CE_PROFILE_CMD_HEARTBEAT_TRIGGER_POLLING_ON_PICKUP 0x03
269 #define RF4CE_PROFILE_CMD_HEARTBEAT_TRIGGER_POLLING_ON_RESET 0x04
270 #define RF4CE_PROFILE_CMD_HEARTBEAT_TRIGGER_POLLING_ON_MICROPHONE_ACTIVITY 0x05
271 #define RF4CE_PROFILE_CMD_HEARTBEAT_TRIGGER_POLLING_ON_OTHER_USER_ACTIVITY 0x06
272 /* 0x07 – 0xff Reserved */
274 static const value_string hf_rf4ce_profile_cmd_heartbeat_trigger_vals
[] = {
275 { RF4CE_PROFILE_CMD_HEARTBEAT_TRIGGER_GENERIC_ACTIVITY
, "Generic Activity" },
276 { RF4CE_PROFILE_CMD_HEARTBEAT_TRIGGER_TIME_BASED_POLLING
, "Time Based Polling" },
277 { RF4CE_PROFILE_CMD_HEARTBEAT_TRIGGER_POLLING_ON_KEY_PRESS
, "Polling on Key Press" },
278 { RF4CE_PROFILE_CMD_HEARTBEAT_TRIGGER_POLLING_ON_PICKUP
, "Polling on Pickup" },
279 { RF4CE_PROFILE_CMD_HEARTBEAT_TRIGGER_POLLING_ON_RESET
, "Polling on Reset" },
280 { RF4CE_PROFILE_CMD_HEARTBEAT_TRIGGER_POLLING_ON_MICROPHONE_ACTIVITY
, "Polling on Microphone Activity" },
281 { RF4CE_PROFILE_CMD_HEARTBEAT_TRIGGER_POLLING_ON_OTHER_USER_ACTIVITY
, "Polling on other User Activity" },
285 /* RF4CE Profile Attributes common */
286 #define RF4CE_PROFILE_ATTR_DISSECT_NOT_SET 0b00000000
287 #define RF4CE_PROFILE_ATTR_DISSECT_ATTR_ID_MASK 0b00000001
288 #define RF4CE_PROFILE_ATTR_DISSECT_ENTRY_ID_MASK 0b00000010
289 #define RF4CE_PROFILE_ATTR_DISSECT_ATTR_STATUS_MASK 0b00000100
290 #define RF4CE_PROFILE_ATTR_DISSECT_ATTR_LENGTH_MASK 0b00001000
291 #define RF4CE_PROFILE_ATTR_DISSECT_ATTR_VALUE_MASK 0b00010000
293 #define RF4CE_PROFILE_ATTR_DISSECT_GET_ATTRS_MASK \
294 (RF4CE_PROFILE_ATTR_DISSECT_ATTR_ID_MASK \
295 | RF4CE_PROFILE_ATTR_DISSECT_ENTRY_ID_MASK)
297 #define RF4CE_PROFILE_ATTR_DISSECT_GET_ATTRS_RESP_MASK \
298 (RF4CE_PROFILE_ATTR_DISSECT_ATTR_ID_MASK \
299 | RF4CE_PROFILE_ATTR_DISSECT_ENTRY_ID_MASK \
300 | RF4CE_PROFILE_ATTR_DISSECT_ATTR_STATUS_MASK \
301 | RF4CE_PROFILE_ATTR_DISSECT_ATTR_LENGTH_MASK \
302 | RF4CE_PROFILE_ATTR_DISSECT_ATTR_VALUE_MASK) \
304 #define RF4CE_PROFILE_ATTR_DISSECT_PUSH_ATTRS_MASK \
305 (RF4CE_PROFILE_ATTR_DISSECT_ATTR_ID_MASK \
306 | RF4CE_PROFILE_ATTR_DISSECT_ENTRY_ID_MASK \
307 | RF4CE_PROFILE_ATTR_DISSECT_ATTR_LENGTH_MASK \
308 | RF4CE_PROFILE_ATTR_DISSECT_ATTR_VALUE_MASK)
310 #define RF4CE_PROFILE_ATTR_DISSECT_SET_ATTRS_MASK \
311 (RF4CE_PROFILE_ATTR_DISSECT_ATTR_ID_MASK \
312 | RF4CE_PROFILE_ATTR_DISSECT_ENTRY_ID_MASK \
313 | RF4CE_PROFILE_ATTR_DISSECT_ATTR_LENGTH_MASK \
314 | RF4CE_PROFILE_ATTR_DISSECT_ATTR_VALUE_MASK)
316 #define RF4CE_PROFILE_ATTR_DISSECT_PULL_ATTRS_MASK \
317 (RF4CE_PROFILE_ATTR_DISSECT_ATTR_ID_MASK \
318 | RF4CE_PROFILE_ATTR_DISSECT_ENTRY_ID_MASK)
320 #define RF4CE_PROFILE_ATTR_DISSECT_PULL_ATTRS_RESP_MASK \
321 (RF4CE_PROFILE_ATTR_DISSECT_ATTR_ID_MASK \
322 | RF4CE_PROFILE_ATTR_DISSECT_ENTRY_ID_MASK \
323 | RF4CE_PROFILE_ATTR_DISSECT_ATTR_STATUS_MASK \
324 | RF4CE_PROFILE_ATTR_DISSECT_ATTR_LENGTH_MASK \
325 | RF4CE_PROFILE_ATTR_DISSECT_ATTR_VALUE_MASK)
327 /* RF4CE GDP Attributes */
329 /* GDP Attribute - Identification Capabilities */
330 static int hf_rf4ce_profile_gdp_ident_cap
;
331 static int hf_rf4ce_profile_gdp_ident_cap_reserved
;
332 static int hf_rf4ce_profile_gdp_ident_cap_support_flash_light
;
333 static int hf_rf4ce_profile_gdp_ident_cap_support_make_short_sound
;
334 static int hf_rf4ce_profile_gdp_ident_cap_support_vibrate
;
335 static int hf_rf4ce_profile_gdp_ident_cap_reserved2
;
337 #define RF4CE_PROFILE_GDP_IDENT_CAP_RESERVED_MASK 0b00000001
338 #define RF4CE_PROFILE_GDP_IDENT_CAP_SUPPORT_FLASH_LIGHT_MASK 0b00000010
339 #define RF4CE_PROFILE_GDP_IDENT_CAP_SUPPORT_MAKE_SHORT_SOUND_MASK 0b00000100
340 #define RF4CE_PROFILE_GDP_IDENT_CAP_SUPPORT_VIBRATE_MASK 0b00001000
341 #define RF4CE_PROFILE_GDP_IDENT_CAP_RESERVED2_MASK 0b11110000
343 #define RF4CE_PROFILE_GDP_IDENT_CAP_MASK \
344 (RF4CE_PROFILE_GDP_IDENT_CAP_SUPPORT_FLASH_LIGHT_MASK \
345 | RF4CE_PROFILE_GDP_IDENT_CAP_SUPPORT_MAKE_SHORT_SOUND_MASK \
346 | RF4CE_PROFILE_GDP_IDENT_CAP_SUPPORT_VIBRATE_MASK \
347 | RF4CE_PROFILE_GDP_IDENT_CAP_RESERVED2_MASK)
349 /* GDP Attribute - Poll Constraints */
350 static int hf_rf4ce_profile_gdp_poll_constraints_methods_num
;
352 /* Polling constraint record - Polling method ID */
353 static int hf_rf4ce_profile_gdp_poll_constraints_polling_rec_method_id
;
355 #define RF4CE_PROFILE_GDP_POLL_CONSTRAINTS_POLLING_REC_METHOD_ID_DIS 0x00
356 #define RF4CE_PROFILE_GDP_POLL_CONSTRAINTS_POLLING_REC_METHOD_ID_GDP_HEARTBEAT 0x01
358 static const value_string rf4ce_profile_gdp_poll_constraints_polling_rec_method_id_vals
[] = {
359 { RF4CE_PROFILE_GDP_POLL_CONSTRAINTS_POLLING_REC_METHOD_ID_DIS
, "Disabled" },
360 { RF4CE_PROFILE_GDP_POLL_CONSTRAINTS_POLLING_REC_METHOD_ID_GDP_HEARTBEAT
, "GDP heartbeat based polling" },
364 /* Polling constraint record - Polling trigger capabilities */
365 static int hf_rf4ce_profile_gdp_poll_constraints_polling_rec_polling_trig_cap
;
366 static int hf_rf4ce_profile_gdp_poll_constraints_polling_rec_polling_trig_cap_tbased
;
367 static int hf_rf4ce_profile_gdp_poll_constraints_polling_rec_polling_trig_cap_on_k_press
;
368 static int hf_rf4ce_profile_gdp_poll_constraints_polling_rec_polling_trig_cap_on_pick_up
;
369 static int hf_rf4ce_profile_gdp_poll_constraints_polling_rec_polling_trig_cap_on_reset
;
370 static int hf_rf4ce_profile_gdp_poll_constraints_polling_rec_polling_trig_cap_on_micro_act
;
371 static int hf_rf4ce_profile_gdp_poll_constraints_polling_rec_polling_trig_cap_on_user_act
;
372 static int hf_rf4ce_profile_gdp_poll_constraints_polling_rec_polling_trig_cap_reserved
;
374 #define RF4CE_PROFILE_GDP_POLL_CONSTRAINTS_POLLING_REC_POLLING_TRIG_CAP_TBASED_MASK (0b0000000000000001)
375 #define RF4CE_PROFILE_GDP_POLL_CONSTRAINTS_POLLING_REC_POLLING_TRIG_CAP_ON_K_PRESS_MASK (0b0000000000000010)
376 #define RF4CE_PROFILE_GDP_POLL_CONSTRAINTS_POLLING_REC_POLLING_TRIG_CAP_ON_PICK_UP_MASK (0b0000000000000100)
377 #define RF4CE_PROFILE_GDP_POLL_CONSTRAINTS_POLLING_REC_POLLING_TRIG_CAP_ON_RESET_MASK (0b0000000000001000)
378 #define RF4CE_PROFILE_GDP_POLL_CONSTRAINTS_POLLING_REC_POLLING_TRIG_CAP_ON_MICRO_ACT_MASK (0b0000000000010000)
379 #define RF4CE_PROFILE_GDP_POLL_CONSTRAINTS_POLLING_REC_POLLING_TRIG_CAP_ON_USER_ACT_MASK (0b0000000000100000)
380 #define RF4CE_PROFILE_GDP_POLL_CONSTRAINTS_POLLING_REC_POLLING_TRIG_CAP_RESERVED_MASK (0b1111111111000000)
382 #define RF4CE_PROFILE_GDP_POLL_CONSTRAINTS_POLLING_REC_POLLING_TRIG_CAP_MASK \
383 (RF4CE_PROFILE_GDP_POLL_CONSTRAINTS_POLLING_REC_POLLING_TRIG_CAP_TBASED_MASK \
384 | RF4CE_PROFILE_GDP_POLL_CONSTRAINTS_POLLING_REC_POLLING_TRIG_CAP_ON_K_PRESS_MASK \
385 | RF4CE_PROFILE_GDP_POLL_CONSTRAINTS_POLLING_REC_POLLING_TRIG_CAP_ON_PICK_UP_MASK \
386 | RF4CE_PROFILE_GDP_POLL_CONSTRAINTS_POLLING_REC_POLLING_TRIG_CAP_ON_RESET_MASK \
387 | RF4CE_PROFILE_GDP_POLL_CONSTRAINTS_POLLING_REC_POLLING_TRIG_CAP_ON_MICRO_ACT_MASK \
388 | RF4CE_PROFILE_GDP_POLL_CONSTRAINTS_POLLING_REC_POLLING_TRIG_CAP_ON_USER_ACT_MASK \
389 | RF4CE_PROFILE_GDP_POLL_CONSTRAINTS_POLLING_REC_POLLING_TRIG_CAP_RESERVED_MASK)
391 /* Polling constraint record - other fields */
392 static int hf_rf4ce_profile_gdp_poll_constraints_polling_rec_min_polling_key_press_cnt
;
393 static int hf_rf4ce_profile_gdp_poll_constraints_polling_rec_max_polling_key_press_cnt
;
395 static int hf_rf4ce_profile_gdp_poll_constraints_polling_rec_min_polling_time_interval
;
396 static int hf_rf4ce_profile_gdp_poll_constraints_polling_rec_max_polling_time_interval
;
398 /* GDP Attribute - Poll Configuration */
399 static int hf_rf4ce_profile_gdp_poll_configuration_method_id
;
401 /* GDP Attribute - Poll Configuration - Polling Trigger Configuration */
402 static int hf_rf4ce_profile_gdp_poll_configuration_polling_trig_conf
;
403 static int hf_rf4ce_profile_gdp_poll_configuration_polling_trig_conf_tbased
;
404 static int hf_rf4ce_profile_gdp_poll_configuration_polling_trig_conf_on_k_press
;
405 static int hf_rf4ce_profile_gdp_poll_configuration_polling_trig_conf_on_pick_up
;
406 static int hf_rf4ce_profile_gdp_poll_configuration_polling_trig_conf_on_reset
;
407 static int hf_rf4ce_profile_gdp_poll_configuration_polling_trig_conf_on_micro_act
;
408 static int hf_rf4ce_profile_gdp_poll_configuration_polling_trig_conf_on_user_act
;
409 static int hf_rf4ce_profile_gdp_poll_configuration_polling_trig_conf_reserved
;
411 #define RF4CE_PROFILE_GDP_POLL_CONFIGURATION_POLLING_TRIG_CONF_TBASED_MASK (0b0000000000000001)
412 #define RF4CE_PROFILE_GDP_POLL_CONFIGURATION_POLLING_TRIG_CONF_ON_K_PRESS_MASK (0b0000000000000010)
413 #define RF4CE_PROFILE_GDP_POLL_CONFIGURATION_POLLING_TRIG_CONF_ON_PICK_UP_MASK (0b0000000000000100)
414 #define RF4CE_PROFILE_GDP_POLL_CONFIGURATION_POLLING_TRIG_CONF_ON_RESET_MASK (0b0000000000001000)
415 #define RF4CE_PROFILE_GDP_POLL_CONFIGURATION_POLLING_TRIG_CONF_ON_MICRO_ACT_MASK (0b0000000000010000)
416 #define RF4CE_PROFILE_GDP_POLL_CONFIGURATION_POLLING_TRIG_CONF_ON_USER_ACT_MASK (0b0000000000100000)
417 #define RF4CE_PROFILE_GDP_POLL_CONFIGURATION_POLLING_TRIG_CONF_RESERVED_MASK (0b1111111111000000)
419 #define RF4CE_PROFILE_GDP_POLL_CONFIGURATION_POLLING_TRIG_CONF_MASK \
420 (RF4CE_PROFILE_GDP_POLL_CONFIGURATION_POLLING_TRIG_CONF_TBASED_MASK \
421 | RF4CE_PROFILE_GDP_POLL_CONFIGURATION_POLLING_TRIG_CONF_ON_K_PRESS_MASK \
422 | RF4CE_PROFILE_GDP_POLL_CONFIGURATION_POLLING_TRIG_CONF_ON_PICK_UP_MASK \
423 | RF4CE_PROFILE_GDP_POLL_CONFIGURATION_POLLING_TRIG_CONF_ON_RESET_MASK \
424 | RF4CE_PROFILE_GDP_POLL_CONFIGURATION_POLLING_TRIG_CONF_ON_MICRO_ACT_MASK \
425 | RF4CE_PROFILE_GDP_POLL_CONFIGURATION_POLLING_TRIG_CONF_ON_USER_ACT_MASK \
426 | RF4CE_PROFILE_GDP_POLL_CONFIGURATION_POLLING_TRIG_CONF_RESERVED_MASK)
428 static int hf_rf4ce_profile_gdp_poll_configuration_polling_key_press_cnt
;
429 static int hf_rf4ce_profile_gdp_poll_configuration_polling_time_interval
;
430 static int hf_rf4ce_profile_gdp_poll_configuration_polling_timeout
;
432 /* 0x00 - 0x7f - Reserved */
433 #define RF4CE_GDP_ATTR_GDP_PROFILE_VERSION 0x80
434 #define RF4CE_GDP_ATTR_GDP_PROFILE_CAPABILITIES 0x81
435 #define RF4CE_GDP_ATTR_KEY_EXCHANGE_TRANSFER_COUNT 0x82
436 #define RF4CE_GDP_ATTR_POWER_STATUS 0x83
437 #define RF4CE_GDP_ATTR_POLL_CONSTRAINTS 0x84
438 #define RF4CE_GDP_ATTR_POLL_CONFIGURATION 0x85
439 #define RF4CE_GDP_ATTR_MAX_BINDING_CANDIDATES 0x86
440 #define RF4CE_GDP_ATTR_AUTO_CHECK_VALID_PERIOD 0x87
441 #define RF4CE_GDP_ATTR_BINDING_RECIPIENT_VALIDATION_WAIT_TIME 0x88
442 #define RF4CE_GDP_ATTR_BINDING_ORIGINATOR_VALIDATION_WAIT_TIME 0x89
443 #define RF4CE_GDP_ATTR_LINK_LOST_WAIT_TIME 0x8a
444 #define RF4CE_GDP_ATTR_IDENTIFICATION_CAPABILITIES 0x8b
446 /* Reserved for scalar Profile attributes */
447 #define RF4CE_GDP_ATTR_SCALAR1_RESERVED_MIN 0x8c
448 #define RF4CE_GDP_ATTR_SCALAR1_RESERVED_MAX 0x8f
450 /* Reserved for arrayed Profile attributes */
451 #define RF4CE_GDP_ATTR_ARRAYED1_RESERVED_MIN 0x90
452 #define RF4CE_GDP_ATTR_ARRAYED1_RESERVED_MAX 0x90
454 /* Reserved for scalar Profile attributes */
455 #define RF4CE_GDP_ATTR_SCALAR2_RESERVED_MIN 0xa0
456 #define RF4CE_GDP_ATTR_SCALAR2_RESERVED_MAX 0xbf
458 /* Reserved for arrayed Profile attributes */
459 #define RF4CE_GDP_ATTR_ARRAYED2_RESERVED_MIN 0xc0
460 #define RF4CE_GDP_ATTR_ARRAYED2_RESERVED_MAX 0xdf
462 /* Reserved for scalar Profile attributes */
463 #define RF4CE_GDP_ATTR_SCALAR3_RESERVED_MIN 0xe0
464 #define RF4CE_GDP_ATTR_SCALAR3_RESERVED_MAX 0xff
466 static const value_string rf4ce_profile_gdp_attr_vals
[] = {
467 { RF4CE_GDP_ATTR_GDP_PROFILE_VERSION
, "Profile Version" },
468 { RF4CE_GDP_ATTR_GDP_PROFILE_CAPABILITIES
, "Profile Capabilities" },
469 { RF4CE_GDP_ATTR_KEY_EXCHANGE_TRANSFER_COUNT
, "KEY Exchange Transfer Count" },
470 { RF4CE_GDP_ATTR_POWER_STATUS
, "Power Status" },
471 { RF4CE_GDP_ATTR_POLL_CONSTRAINTS
, "Poll Constraints" },
472 { RF4CE_GDP_ATTR_POLL_CONFIGURATION
, "Poll Configuration" },
473 { RF4CE_GDP_ATTR_MAX_BINDING_CANDIDATES
, "Max Binding Candidates" },
474 { RF4CE_GDP_ATTR_AUTO_CHECK_VALID_PERIOD
, "Auto Check Valid Period" },
475 { RF4CE_GDP_ATTR_BINDING_RECIPIENT_VALIDATION_WAIT_TIME
, "Binding Recipient Validation Wait Time" },
476 { RF4CE_GDP_ATTR_BINDING_ORIGINATOR_VALIDATION_WAIT_TIME
, "Binding Originator Validation Wait Time" },
477 { RF4CE_GDP_ATTR_LINK_LOST_WAIT_TIME
, "Link Lost Wait Time" },
478 { RF4CE_GDP_ATTR_IDENTIFICATION_CAPABILITIES
, "Identification Capabilities" },
482 /* RF4CE ZRC 2.0 Attributes */
483 #define RF4CE_ZRC20_ATTR_ZRC_PROFILE_VERSION 0xA0
484 #define RF4CE_ZRC20_ATTR_ZRC_PROFILE_CAPABILITIES 0xA1
485 #define RF4CE_ZRC20_ATTR_ACTION_REPEAT_TRIGGER_INTERVAL 0xA2
486 #define RF4CE_ZRC20_ATTR_ACTION_REPEAT_WAIT_TIME 0xA3
487 #define RF4CE_ZRC20_ATTR_ACTION_BANKS_SUPPORTED_RX 0xA4
488 #define RF4CE_ZRC20_ATTR_ACTION_BANKS_SUPPORTED_TX 0xA5
489 #define RF4CE_ZRC20_ATTR_IRDB_VENDOR_SUPPORT 0xA6
490 #define RF4CE_ZRC20_ATTR_ZRC_ACTION_BANKS_VERSION 0xA7
492 /* Reserved for scalar profile attributes */
493 #define RF4CE_ZRC20_ATTR_SCALAR1_MIN 0xA8
494 #define RF4CE_ZRC20_ATTR_SCALAR1_MAX 0xBF
496 #define RF4CE_ZRC20_ATTR_ACTION_CODES_SUPPORTED_RX 0xC0
497 #define RF4CE_ZRC20_ATTR_ACTION_CODES_SUPPORTED_TX 0xC1
498 #define RF4CE_ZRC20_ATTR_MAPPABLE_ACTIONS 0xC2
499 #define RF4CE_ZRC20_ATTR_ACTION_MAPPINGS 0xC3
500 #define RF4CE_ZRC20_ATTR_HOME_AUTOMATION 0xC4
501 #define RF4CE_ZRC20_ATTR_HOME_AUTOMATION_SUPPORTED 0xC5
503 /* Reserved for arrayed profile attributes */
504 #define RF4CE_ZRC20_ATTR_ARRAYED1_MIN 0xC6
505 #define RF4CE_ZRC20_ATTR_ARRAYED2_MAX 0xDF
507 /* Reserved for scalar profile attributes */
508 #define RF4CE_ZRC20_ATTR_SCALAR2_MIN 0xE0
509 #define RF4CE_ZRC20_ATTR_SCALAR2_MAX 0xFF
511 static const value_string rf4ce_profile_zrc20_attr_vals
[] = {
512 { RF4CE_ZRC20_ATTR_ZRC_PROFILE_VERSION
, "ZRC Profile Version" },
513 { RF4CE_ZRC20_ATTR_ZRC_PROFILE_CAPABILITIES
, "ZRC Profile Capabilities" },
514 { RF4CE_ZRC20_ATTR_ACTION_REPEAT_TRIGGER_INTERVAL
, "Action Repeat Trigger Interval" },
515 { RF4CE_ZRC20_ATTR_ACTION_REPEAT_WAIT_TIME
, "Action Repeat Wait Time" },
516 { RF4CE_ZRC20_ATTR_ACTION_BANKS_SUPPORTED_RX
, "Action Banks Supported RX" },
517 { RF4CE_ZRC20_ATTR_ACTION_BANKS_SUPPORTED_TX
, "Action Banks Supported TX" },
518 { RF4CE_ZRC20_ATTR_IRDB_VENDOR_SUPPORT
, "IRDB Vendor Support" },
519 { RF4CE_ZRC20_ATTR_ZRC_ACTION_BANKS_VERSION
, "ZRC Action Banks Version" },
520 { RF4CE_ZRC20_ATTR_ACTION_CODES_SUPPORTED_RX
, "Action Codes Supported RX" },
521 { RF4CE_ZRC20_ATTR_ACTION_CODES_SUPPORTED_TX
, "Action Codes Supported TX" },
522 { RF4CE_ZRC20_ATTR_MAPPABLE_ACTIONS
, "Mappable Actions" },
523 { RF4CE_ZRC20_ATTR_ACTION_MAPPINGS
, "Action Mappings" },
524 { RF4CE_ZRC20_ATTR_HOME_AUTOMATION
, "Home Automation" },
525 { RF4CE_ZRC20_ATTR_HOME_AUTOMATION_SUPPORTED
, "Home Automation Supported" },
529 #define RF4CE_PROFILE_ATTR_STATUS_ATTRIBUTE_SUCCESSFULLY_READ_AND_INCLUDED 0x00
530 #define RF4CE_PROFILE_ATTR_STATUS_UNSUPPORTED_ATTRIBUTE 0x01
531 #define RF4CE_PROFILE_ATTR_STATUS_ILLEGAL_REQUEST 0x02
532 #define RF4CE_PROFILE_ATTR_STATUS_INVALID_ENTRY 0x03
533 /* 0x04 - 0xff Reserved error codes */
535 static const value_string hf_rf4ce_profile_attr_status_vals
[] = {
536 { RF4CE_PROFILE_ATTR_STATUS_ATTRIBUTE_SUCCESSFULLY_READ_AND_INCLUDED
, "Attribute Successfully Read and Included" },
537 { RF4CE_PROFILE_ATTR_STATUS_UNSUPPORTED_ATTRIBUTE
, "Unsupported Attribute" },
538 { RF4CE_PROFILE_ATTR_STATUS_ILLEGAL_REQUEST
, "Illegal Request" },
539 { RF4CE_PROFILE_ATTR_STATUS_INVALID_ENTRY
, "Invalid Entry" },
543 /* RF4CE ZRC 2.0 Profile - Mappable Actions attribute */
544 static int hf_rf4ce_profile_zrc20_mappable_actions_action_dev_type
;
545 static int hf_rf4ce_profile_zrc20_mappable_actions_action_bank
;
546 static int hf_rf4ce_profile_zrc20_mappable_actions_action_code
;
548 #define RF4CE_PROFILE_DEV_TYPE_RESERVED 0x00
549 #define RF4CE_PROFILE_DEV_TYPE_REMOTE_CONTROL 0x01
550 #define RF4CE_PROFILE_DEV_TYPE_TELEVISION 0x02
551 #define RF4CE_PROFILE_DEV_TYPE_PROJECTOR 0x03
552 #define RF4CE_PROFILE_DEV_TYPE_PLAYER 0x04
553 #define RF4CE_PROFILE_DEV_TYPE_RECORDER 0x05
554 #define RF4CE_PROFILE_DEV_TYPE_VIDEO_PLAYER_OR_RECORDER 0x06 /* (VCR, DVR, DVD, Blu-ray, portable) */
555 #define RF4CE_PROFILE_DEV_TYPE_AUDIO_PLAYER_OR_RECORDER 0x07 /* (CD, portable) */
556 #define RF4CE_PROFILE_DEV_TYPE_AUDIO_VIDEO_RECORDER 0x08
557 #define RF4CE_PROFILE_DEV_TYPE_SET_TOP_BOX 0x09
558 #define RF4CE_PROFILE_DEV_TYPE_HOME_THEATER_SYSTEM 0x0a
559 #define RF4CE_PROFILE_DEV_TYPE_MEDIA_CENTER_OR_PC 0x0b
560 #define RF4CE_PROFILE_DEV_TYPE_GAME_CONSOLE 0x0c
561 #define RF4CE_PROFILE_DEV_TYPE_SATELLITE_RADIO_RECEIVER 0x0d
562 #define RF4CE_PROFILE_DEV_TYPE_IR_EXTENDER 0x0e
563 #define RF4CE_PROFILE_DEV_TYPE_MONITOR 0x0f
564 /* 0x10 – 0xcf Reserved */
565 /* 0xd0 – 0xef Vendor-specific device */
566 /* 0xf0 – 0xfb Reserved */
567 #define RF4CE_PROFILE_DEV_TYPE_VENDOR_SPECIFIC_WILDCARD_DEV 0xfc
568 #define RF4CE_PROFILE_DEV_TYPE_NON_VENDOR_SPECIFIC_WILDCARD_DEV 0xfd
569 #define RF4CE_PROFILE_DEV_TYPE_GENERIC 0xfe
570 #define RF4CE_PROFILE_DEV_TYPE_RESERVED_FOR_WILDCARDS 0xff
572 static const value_string rf4ce_profile_device_type_vals
[] = {
573 { RF4CE_PROFILE_DEV_TYPE_RESERVED
, "Reserved" },
574 { RF4CE_PROFILE_DEV_TYPE_REMOTE_CONTROL
, "Remote Control" },
575 { RF4CE_PROFILE_DEV_TYPE_TELEVISION
, "Television" },
576 { RF4CE_PROFILE_DEV_TYPE_PROJECTOR
, "Projector" },
577 { RF4CE_PROFILE_DEV_TYPE_PLAYER
, "Player" },
578 { RF4CE_PROFILE_DEV_TYPE_RECORDER
, "Recorder" },
579 { RF4CE_PROFILE_DEV_TYPE_VIDEO_PLAYER_OR_RECORDER
, "Video Player\\Recorder" },
580 { RF4CE_PROFILE_DEV_TYPE_AUDIO_PLAYER_OR_RECORDER
, "Audio Player\\Recorder" },
581 { RF4CE_PROFILE_DEV_TYPE_AUDIO_VIDEO_RECORDER
, "Audio Video Recorder" },
582 { RF4CE_PROFILE_DEV_TYPE_SET_TOP_BOX
, "Set Top Box" },
583 { RF4CE_PROFILE_DEV_TYPE_HOME_THEATER_SYSTEM
, "Home Theater System" },
584 { RF4CE_PROFILE_DEV_TYPE_MEDIA_CENTER_OR_PC
, "Media Center\\PC" },
585 { RF4CE_PROFILE_DEV_TYPE_GAME_CONSOLE
, "Game Console" },
586 { RF4CE_PROFILE_DEV_TYPE_SATELLITE_RADIO_RECEIVER
, "Satellite Radio Receiver" },
587 { RF4CE_PROFILE_DEV_TYPE_IR_EXTENDER
, "IR Extender" },
588 { RF4CE_PROFILE_DEV_TYPE_MONITOR
, "Monitor" },
589 { RF4CE_PROFILE_DEV_TYPE_VENDOR_SPECIFIC_WILDCARD_DEV
, "Vendor Specific Wildcard Device" },
590 { RF4CE_PROFILE_DEV_TYPE_NON_VENDOR_SPECIFIC_WILDCARD_DEV
, "Non-Vendor Specific Wildcard Device" },
591 { RF4CE_PROFILE_DEV_TYPE_GENERIC
, "Generic" },
592 { RF4CE_PROFILE_DEV_TYPE_RESERVED_FOR_WILDCARDS
, "Reserved for Wildcards" },
596 /* RF4CE ZRC 2.0 Profile - Action Mappings attribute - Mapping Flags */
597 static int hf_rf4ce_profile_zrc20_action_mappings_mapping_flags
;
598 static int hf_rf4ce_profile_zrc20_action_mappings_mapping_flags_rf_specified
;
599 static int hf_rf4ce_profile_zrc20_action_mappings_mapping_flags_ir_specified
;
600 static int hf_rf4ce_profile_zrc20_action_mappings_mapping_flags_rf_descr_first
;
601 static int hf_rf4ce_profile_zrc20_action_mappings_mapping_flags_reserved
;
602 static int hf_rf4ce_profile_zrc20_action_mappings_mapping_flags_use_default
;
603 static int hf_rf4ce_profile_zrc20_action_mappings_mapping_flags_permanent
;
605 #define RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_MAPPING_FLAGS_RF_SPECIFIED_MASK 0b00000001
606 #define RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_MAPPING_FLAGS_IR_SPECIFIED_MASK 0b00000010
607 #define RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_MAPPING_FLAGS_RF_DESCR_FIRST_MASK 0b00000100
608 #define RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_MAPPING_FLAGS_RESERVED_MASK 0b00111000
609 #define RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_MAPPING_FLAGS_USE_DEFAULT_MASK 0b01000000
610 #define RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_MAPPING_FLAGS_PERMANENT_MASK 0b10000000
612 #define RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_MAPPING_FLAGS_MASK \
613 (RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_MAPPING_FLAGS_RF_SPECIFIED_MASK \
614 | RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_MAPPING_FLAGS_IR_SPECIFIED_MASK \
615 | RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_MAPPING_FLAGS_RF_DESCR_FIRST_MASK \
616 | RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_MAPPING_FLAGS_RESERVED_MASK \
617 | RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_MAPPING_FLAGS_USE_DEFAULT_MASK \
618 | RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_MAPPING_FLAGS_PERMANENT_MASK)
620 /* RF4CE ZRC 2.0 Profile - Action Mappings attribute - RF Descriptor - RF Config */
621 static int hf_rf4ce_profile_zrc20_action_mappings_rf_descr_rf_conf
;
622 static int hf_rf4ce_profile_zrc20_action_mappings_rf_descr_rf_conf_min_num_of_trans
;
623 static int hf_rf4ce_profile_zrc20_action_mappings_rf_descr_rf_conf_keep_trans_until_key_release
;
624 static int hf_rf4ce_profile_zrc20_action_mappings_rf_descr_rf_conf_short_rf_retry
;
625 static int hf_rf4ce_profile_zrc20_action_mappings_rf_descr_rf_conf_atomic_action
;
626 static int hf_rf4ce_profile_zrc20_action_mappings_rf_descr_rf_conf_reserved
;
628 #define RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_RF_DESCR_RF_CONF_MIN_NUM_OF_TRANS_MASK 0b00001111
629 #define RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_RF_DESCR_RF_CONF_KEEP_TRANS_UNTIL_KEY_RELEASE_MASK 0b00010000
630 #define RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_RF_DESCR_RF_CONF_SHORT_RF_RETRY_MASK 0b00100000
631 #define RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_RF_DESCR_RF_CONF_ATOMIC_ACTION_MASK 0b01000000
632 #define RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_RF_DESCR_RF_CONF_RESERVED_MASK 0b10000000
634 #define RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_RF_DESCR_RF_CONF_MASK \
635 (RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_RF_DESCR_RF_CONF_MIN_NUM_OF_TRANS_MASK \
636 | RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_RF_DESCR_RF_CONF_KEEP_TRANS_UNTIL_KEY_RELEASE_MASK \
637 | RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_RF_DESCR_RF_CONF_SHORT_RF_RETRY_MASK \
638 | RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_RF_DESCR_RF_CONF_ATOMIC_ACTION_MASK \
639 | RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_RF_DESCR_RF_CONF_RESERVED_MASK)
641 /* RF4CE ZRC 2.0 Profile - Action Mappings attribute - RF Descriptor - RF4CE TX Options */
642 static int hf_rf4ce_profile_zrc20_action_mappings_rf_descr_tx_opts
;
643 static int hf_rf4ce_profile_zrc20_action_mappings_rf_descr_tx_opts_trans_mode
;
644 static int hf_rf4ce_profile_zrc20_action_mappings_rf_descr_tx_opts_dst_addr_mode
;
645 static int hf_rf4ce_profile_zrc20_action_mappings_rf_descr_tx_opts_ack_mode
;
646 static int hf_rf4ce_profile_zrc20_action_mappings_rf_descr_tx_opts_sec_mode
;
647 static int hf_rf4ce_profile_zrc20_action_mappings_rf_descr_tx_opts_ch_ag_mode
;
648 static int hf_rf4ce_profile_zrc20_action_mappings_rf_descr_tx_opts_ch_norm_mode
;
649 static int hf_rf4ce_profile_zrc20_action_mappings_rf_descr_tx_opts_payload_mode
;
650 static int hf_rf4ce_profile_zrc20_action_mappings_rf_descr_tx_opts_reserved
;
652 #define RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_RF_DESCR_TX_OPTS_TRANS_MODE_MASK 0b00000001
653 #define RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_RF_DESCR_TX_OPTS_DST_ADDR_MODE_MASK 0b00000010
654 #define RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_RF_DESCR_TX_OPTS_ACK_MODE_MASK 0b00000100
655 #define RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_RF_DESCR_TX_OPTS_SEC_MODE_MASK 0b00001000
656 #define RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_RF_DESCR_TX_OPTS_CH_AG_MODE_MASK 0b00010000
657 #define RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_RF_DESCR_TX_OPTS_CH_NORM_MODE_MASK 0b00100000
658 #define RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_RF_DESCR_TX_OPTS_PAYLOAD_MODE_MASK 0b01000000
659 #define RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_RF_DESCR_TX_OPTS_RESERVED_MASK 0b10000000
661 #define RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_RF_DESCR_TX_OPTS_MASK \
662 (RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_RF_DESCR_TX_OPTS_TRANS_MODE_MASK \
663 | RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_RF_DESCR_TX_OPTS_DST_ADDR_MODE_MASK \
664 | RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_RF_DESCR_TX_OPTS_ACK_MODE_MASK \
665 | RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_RF_DESCR_TX_OPTS_SEC_MODE_MASK \
666 | RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_RF_DESCR_TX_OPTS_CH_AG_MODE_MASK \
667 | RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_RF_DESCR_TX_OPTS_CH_NORM_MODE_MASK \
668 | RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_RF_DESCR_TX_OPTS_PAYLOAD_MODE_MASK \
669 | RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_RF_DESCR_TX_OPTS_RESERVED_MASK)
671 static const true_false_string rf4ce_profile_zrc20_action_mappings_rf_descr_tx_opts_trans_mode_vals
= {
672 "Broadcast Transmission",
673 "Unicast Transmission"
676 static const true_false_string rf4ce_profile_zrc20_action_mappings_rf_descr_tx_opts_dst_addr_mode_vals
= {
677 "Use Destination IEEE Address",
678 "Use Destination Network Address"
681 static const true_false_string rf4ce_profile_zrc20_action_mappings_rf_descr_tx_opts_ack_mode_vals
= {
682 "Acknowledged Transmission",
683 "Unacknowledged Transmission"
686 static const true_false_string rf4ce_profile_zrc20_action_mappings_rf_descr_tx_opts_sec_mode_vals
= {
687 "Transmit with Security",
688 "Transmit without Security"
691 static const true_false_string rf4ce_profile_zrc20_action_mappings_rf_descr_tx_opts_ch_ag_mode_vals
= {
692 "Use Single Channel Operation",
693 "Use Multiple Channel Operation"
696 static const true_false_string rf4ce_profile_zrc20_action_mappings_rf_descr_tx_opts_ch_norm_mode_vals
= {
697 "Specify Channel Designator",
698 "Do not Specify Channel Designator"
701 static const true_false_string rf4ce_profile_zrc20_action_mappings_rf_descr_tx_opts_payload_mode_vals
= {
702 "Data is Vendor-specific",
703 "Data is not Vendor-specific"
706 /* RF4CE ZRC 2.0 Profile - Action Mappings attribute - RF Descriptor - Action Data Length */
707 static int hf_rf4ce_profile_zrc20_action_mappings_rf_descr_action_data_len
;
709 /* RF4CE ZRC 2.0 Profile - Action Mappings attribute - IR Descriptor - IR Config */
710 static int hf_rf4ce_profile_zrc20_action_mappings_ir_descr_ir_conf
;
711 static int hf_rf4ce_profile_zrc20_action_mappings_ir_descr_ir_conf_vendor_specific
;
712 static int hf_rf4ce_profile_zrc20_action_mappings_ir_descr_ir_conf_reserved
;
714 #define RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_IR_DESCR_IR_CONF_VENDOR_SPECIFIC_MASK 0b00000001
715 #define RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_IR_DESCR_IR_CONF_RESERVED_MASK 0b11111110
717 #define RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_IR_DESCR_IR_CONF_MASK \
718 (RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_IR_DESCR_IR_CONF_VENDOR_SPECIFIC_MASK \
719 | RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_IR_DESCR_IR_CONF_RESERVED_MASK)
721 /* RF4CE ZRC 2.0 Profile - Action Mappings attribute - IR Descriptor */
722 static int hf_rf4ce_profile_zrc20_action_mappings_ir_descr_ir_vendor_id
;
723 static int hf_rf4ce_profile_zrc20_action_mappings_ir_descr_ir_code_len
;
724 static int hf_rf4ce_profile_zrc20_action_mappings_ir_descr_ir_code
;
726 /* RF4CE ZRC 2.0 Profile - IRDB Vendor Support attribute - Vendor ID */
727 static int hf_rf4ce_profile_zrc20_irdb_vendor_support_vendor_id
;
729 /* RF4CE Profile command - Check Validation */
730 #define RF4CE_PROFILE_CMD_CHECK_VALIDATION_SUB_TYPE_REQ 0x00
731 #define RF4CE_PROFILE_CMD_CHECK_VALIDATION_SUB_TYPE_RSP 0x01
732 /* 0x02 - 0xff - reserved */
734 static const value_string rf4ce_profile_cmd_check_validation_sub_type_vals
[] = {
735 { RF4CE_PROFILE_CMD_CHECK_VALIDATION_SUB_TYPE_REQ
, "Request" },
736 { RF4CE_PROFILE_CMD_CHECK_VALIDATION_SUB_TYPE_RSP
, "Response" },
740 #define RF4CE_PROFILE_CMD_CHECK_VALIDATION_STATUS_SUCCESS 0x00
741 #define RF4CE_PROFILE_CMD_CHECK_VALIDATION_STATUS_PENDING 0x01
742 #define RF4CE_PROFILE_CMD_CHECK_VALIDATION_STATUS_TIMEOUT 0x02
743 #define RF4CE_PROFILE_CMD_CHECK_VALIDATION_STATUS_FAILURE 0x03
745 static const value_string rf4ce_profile_cmd_check_validation_status_vals
[] = {
746 { RF4CE_PROFILE_CMD_CHECK_VALIDATION_STATUS_SUCCESS
, "Success" },
747 { RF4CE_PROFILE_CMD_CHECK_VALIDATION_STATUS_PENDING
, "Pending" },
748 { RF4CE_PROFILE_CMD_CHECK_VALIDATION_STATUS_TIMEOUT
, "Timeout" },
749 { RF4CE_PROFILE_CMD_CHECK_VALIDATION_STATUS_FAILURE
, "Failure" },
753 /* RF4CE Profile command - Client Notification */
754 #define RF4CE_PROFILE_CMD_CL_NOTIF_SUB_TYPE_IDENTIFY 0x00
755 #define RF4CE_PROFILE_CMD_CL_NOTIF_SUB_TYPE_REQ_POLL_NEGOTIATION 0x01
757 Reserved for Profile Client Notification Sub Types. */
758 #define RF4CE_PROFILE_CMD_CL_NOTIF_SUB_TYPE_REQ_ACTION_MAPPING_NEGOTIATION 0x40
759 #define RF4CE_PROFILE_CMD_CL_NOTIF_SUB_TYPE_REQ_HOME_AUTOMATION_PULL 0x41
760 #define RF4CE_PROFILE_CMD_CL_NOTIF_SUB_TYPE_REQ_SELECTIVE_ACTION_MAPPING_UPDATE 0x42
762 Reserved for profile-specific (non-Profile) Client Notification Sub Types. */
766 Reserved for vendor specific Client
767 Notification Sub Types. The contents of
768 this field shall be interpreted according to
769 the vendor id of the Recipient. */
771 static const value_string rf4ce_profile_cmd_client_notification_sub_type_vals
[] = {
772 { RF4CE_PROFILE_CMD_CL_NOTIF_SUB_TYPE_IDENTIFY
, "Identify" },
773 { RF4CE_PROFILE_CMD_CL_NOTIF_SUB_TYPE_REQ_POLL_NEGOTIATION
, "Request Poll Negotiation" },
774 { RF4CE_PROFILE_CMD_CL_NOTIF_SUB_TYPE_REQ_ACTION_MAPPING_NEGOTIATION
, "Request Action Mapping Negotiation" },
775 { RF4CE_PROFILE_CMD_CL_NOTIF_SUB_TYPE_REQ_HOME_AUTOMATION_PULL
, "Request Home Automation Pull" },
776 { RF4CE_PROFILE_CMD_CL_NOTIF_SUB_TYPE_REQ_SELECTIVE_ACTION_MAPPING_UPDATE
, "Request Selective Action Mapping Update" },
780 #define RF4CE_PROFILE_CMD_CL_NOTIF_SUB_TYPE_IDENTIFY_STOP_ON_ACTION_FLAG 0b00000001
781 #define RF4CE_PROFILE_CMD_CL_NOTIF_SUB_TYPE_IDENTIFY_FLASH_LIGHT_FLAG 0b00000010
782 #define RF4CE_PROFILE_CMD_CL_NOTIF_SUB_TYPE_IDENTIFY_MAKE_SOUND_FLAG 0b00000100
783 #define RF4CE_PROFILE_CMD_CL_NOTIF_SUB_TYPE_IDENTIFY_VIBRATE_FLAG 0b00001000
784 #define RF4CE_PROFILE_CMD_CL_NOTIF_SUB_TYPE_IDENTIFY_RESERVED_FLAG 0b11110000
786 #define RF4CE_PROFILE_CMD_CL_NOTIF_SUB_TYPE_IDENTIFY_MASK \
787 (RF4CE_PROFILE_CMD_CL_NOTIF_SUB_TYPE_IDENTIFY_STOP_ON_ACTION_FLAG \
788 | RF4CE_PROFILE_CMD_CL_NOTIF_SUB_TYPE_IDENTIFY_FLASH_LIGHT_FLAG \
789 | RF4CE_PROFILE_CMD_CL_NOTIF_SUB_TYPE_IDENTIFY_MAKE_SOUND_FLAG \
790 | RF4CE_PROFILE_CMD_CL_NOTIF_SUB_TYPE_IDENTIFY_VIBRATE_FLAG \
791 | RF4CE_PROFILE_CMD_CL_NOTIF_SUB_TYPE_IDENTIFY_RESERVED_FLAG)
793 /* RF4CE Profile command - Key Exchange */
794 #define RF4CE_PROFILE_CMD_KEY_EXCHANGE_SUB_TYPE_CHALLENGE 0x00
795 #define RF4CE_PROFILE_CMD_KEY_EXCHANGE_SUB_TYPE_CHALLENGE_RSP 0x01
796 #define RF4CE_PROFILE_CMD_KEY_EXCHANGE_SUB_TYPE_RSP 0x02
797 #define RF4CE_PROFILE_CMD_KEY_EXCHANGE_SUB_TYPE_CONFIRM 0x03
798 /* 0x04 - 0xff - Reserved */
800 static const value_string rf4ce_profile_cmd_key_exchange_sub_type_vals
[] = {
801 { RF4CE_PROFILE_CMD_KEY_EXCHANGE_SUB_TYPE_CHALLENGE
, "Challenge" },
802 { RF4CE_PROFILE_CMD_KEY_EXCHANGE_SUB_TYPE_CHALLENGE_RSP
, "Challenge Response" },
803 { RF4CE_PROFILE_CMD_KEY_EXCHANGE_SUB_TYPE_RSP
, "Response" },
804 { RF4CE_PROFILE_CMD_KEY_EXCHANGE_SUB_TYPE_CONFIRM
, "Confirm" },
808 #define RF4CE_PROFILE_CMD_KEY_EXCHANGE_FLAGS_DEFAULT_SECRET_FLAG (0b0000000000000001)
809 #define RF4CE_PROFILE_CMD_KEY_EXCHANGE_FLAGS_INITIATOR_VENDOR_SPECIFIC_SECRET_FLAG (0b0000000000000010)
810 #define RF4CE_PROFILE_CMD_KEY_EXCHANGE_FLAGS_RESPONDER_VENDOR_SPECIFIC_SECRET_FLAG (0b0000000000000100)
811 #define RF4CE_PROFILE_CMD_KEY_EXCHANGE_FLAGS_RESERVED_FLAG (0b0000000011111000)
812 #define RF4CE_PROFILE_CMD_KEY_EXCHANGE_FLAGS_VENDOR_SPECIFIC_PARAMETER_FLAG (0b1111111100000000)
814 #define RF4CE_PROFILE_CMD_KEY_EXCHANGE_FLAGS_MASK \
815 (RF4CE_PROFILE_CMD_KEY_EXCHANGE_FLAGS_DEFAULT_SECRET_FLAG \
816 | RF4CE_PROFILE_CMD_KEY_EXCHANGE_FLAGS_INITIATOR_VENDOR_SPECIFIC_SECRET_FLAG \
817 | RF4CE_PROFILE_CMD_KEY_EXCHANGE_FLAGS_RESPONDER_VENDOR_SPECIFIC_SECRET_FLAG \
818 | RF4CE_PROFILE_CMD_KEY_EXCHANGE_FLAGS_RESERVED_FLAG \
819 | RF4CE_PROFILE_CMD_KEY_EXCHANGE_FLAGS_VENDOR_SPECIFIC_PARAMETER_FLAG)
821 /* RF4CE - Vendor ID list */
822 #define RF4CE_VENDOR_ID_RESERVED 0x0000
823 #define RF4CE_VENDOR_ID_PANASONIC 0x0001
824 #define RF4CE_VENDOR_ID_SONY 0x0002
825 #define RF4CE_VENDOR_ID_SAMSUNG 0x0003
826 #define RF4CE_VENDOR_ID_PHILIPS 0x0004
827 #define RF4CE_VENDOR_ID_FREESCALE 0x0005
828 #define RF4CE_VENDOR_ID_OKI_SEMICONDUCTOR 0x0006
829 #define RF4CE_VENDOR_ID_TEXAS_INSTRUMENTS 0x0007
830 /* 0x0008 - 0xfff0 Reserved */
831 #define RF4CE_VENDOR_ID_TEST_VENDOR_1 0xfff1
832 #define RF4CE_VENDOR_ID_TEST_VENDOR_2 0xfff2
833 #define RF4CE_VENDOR_ID_TEST_VENDOR_3 0xfff3
834 /* 0xfff4 - 0xffff Reserved */
836 #define RF4CE_VENDOR_ID_MASK 0x0007
838 static const value_string rf4ce_vendor_id_vals
[] = {
839 { RF4CE_VENDOR_ID_RESERVED
, "Reserved" },
840 { RF4CE_VENDOR_ID_PANASONIC
, "Panasonic" },
841 { RF4CE_VENDOR_ID_SONY
, "Sony" },
842 { RF4CE_VENDOR_ID_SAMSUNG
, "Samsung" },
843 { RF4CE_VENDOR_ID_PHILIPS
, "Philips" },
844 { RF4CE_VENDOR_ID_FREESCALE
, "Freescale" },
845 { RF4CE_VENDOR_ID_OKI_SEMICONDUCTOR
, "Oki Semiconductor" },
846 { RF4CE_VENDOR_ID_TEXAS_INSTRUMENTS
, "Texas Instruments" },
850 static int dissect_rf4ce_profile_common(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void *data
);
852 /* RF4CE Profile common commands dissectors */
853 static void dissect_rf4ce_profile_cmd(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, unsigned *offset
, uint8_t cmd_id
, char *profile_str
, bool is_cmd_frame
);
855 static void dissect_rf4ce_profile_common_cmd(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, unsigned *offset
, uint8_t cmd_id
, bool is_zrc20
);
857 static void dissect_rf4ce_profile_cmd_generic_resp(tvbuff_t
*tvb
, proto_tree
*tree
, unsigned *offset
);
858 static void dissect_rf4ce_profile_cmd_configuration_complete(tvbuff_t
*tvb
, proto_tree
*tree
, unsigned *offset
);
859 static void dissect_rf4ce_profile_cmd_heartbeat(tvbuff_t
*tvb
, proto_tree
*tree
, unsigned *offset
);
861 static bool dissect_rf4ce_profile_zrc20_attrs(tvbuff_t
*tvb
, proto_tree
*tree
, unsigned *offset
, uint8_t attr_id
, uint8_t attr_length
);
862 static bool dissect_rf4ce_profile_gdp_attrs(tvbuff_t
*tvb
, proto_tree
*tree
, unsigned *offset
, uint8_t attr_id
);
863 static void dissect_rf4ce_profile_attrs(tvbuff_t
*tvb
, proto_tree
*tree
, unsigned *offset
, uint8_t dissection_mask
, bool is_zrc20
);
864 static void dissect_rf4ce_profile_cmd_get_attrs(tvbuff_t
*tvb
, proto_tree
*tree
, unsigned *offset
, bool is_zrc20
);
865 static void dissect_rf4ce_profile_cmd_get_attrs_resp(tvbuff_t
*tvb
, proto_tree
*tree
, unsigned *offset
, bool is_zrc20
);
866 static void dissect_rf4ce_profile_cmd_push_attrs(tvbuff_t
*tvb
, proto_tree
*tree
, unsigned *offset
, bool is_zrc20
);
867 static void dissect_rf4ce_profile_cmd_set_attrs(tvbuff_t
*tvb
, proto_tree
*tree
, unsigned *offset
, bool is_zrc20
);
868 static void dissect_rf4ce_profile_cmd_pull_attrs(tvbuff_t
*tvb
, proto_tree
*tree
, unsigned *offset
, bool is_zrc20
);
869 static void dissect_rf4ce_profile_cmd_pull_attrs_resp(tvbuff_t
*tvb
, proto_tree
*tree
, unsigned *offset
, bool is_zrc20
);
870 static bool rf4ce_profile_is_gdp_attr_arrayed(uint8_t attr_id
);
871 static bool rf4ce_profile_is_zrc20_attr_arrayed(uint8_t attr_id
);
873 static void dissect_rf4ce_profile_cmd_check_validation(tvbuff_t
*tvb
, proto_tree
*tree
, unsigned *offset
);
874 static void dissect_rf4ce_profile_cmd_client_notification(tvbuff_t
*tvb
, proto_tree
*tree
, unsigned *offset
);
875 static void dissect_rf4ce_profile_cmd_key_exchange(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, unsigned *offset
);
877 /* RF4CE ZRC 1.0 profile commands dissectors */
878 static void dissect_rf4ce_profile_zrc10_cmd(tvbuff_t
*tvb
, proto_tree
*tree
, unsigned *offset
, uint8_t cmd_id
);
880 static void dissect_rf4ce_profile_zrc10_cmd_user_control_common(tvbuff_t
*tvb
, proto_tree
*tree
, unsigned *offset
, bool parse_payload
);
882 static void dissect_rf4ce_profile_zrc10_cmd_discovery_req(tvbuff_t
*tvb
, proto_tree
*tree
, unsigned *offset
);
883 static void dissect_rf4ce_profile_zrc10_cmd_discovery_rsp(tvbuff_t
*tvb
, proto_tree
*tree
, unsigned *offset
);
885 /* RF4CE ZRC 2.0 profile commands dissectors */
886 static void dissect_rf4ce_profile_zrc20_cmd(tvbuff_t
*tvb
, proto_tree
*tree
, unsigned *offset
, uint8_t cmd_id
);
887 static void dissect_rf4ce_profile_zrc20_action_data(tvbuff_t
*tvb
, proto_tree
*tree
, unsigned *offset
, bool dissect_action_control
);
889 void proto_register_rf4ce_profile(void)
891 static hf_register_info hf
[] = {
892 {&hf_rf4ce_profile_fcf
,
893 {"Frame Control Field", "rf4ce-profile.fcf",
897 {&hf_rf4ce_profile_fcf_cmd_id
,
898 {"Command ID", "rf4ce-profile.fcf.cmd_id",
900 VALS(rf4ce_profile_fcf_cmd_id_vals
), RF4CE_PROFILE_FCF_CMD_ID_MASK
,
902 {&hf_rf4ce_zrc20_fcf_cmd_id
,
903 {"Command ID", "rf4ce-profile.fcf.cmd_id",
905 VALS(rf4ce_zrc20_fcf_cmd_id_vals
), RF4CE_PROFILE_FCF_CMD_ID_MASK
,
907 {&hf_rf4ce_profile_fcf_reserved
,
908 {"Reserved", "rf4ce-profile.fcf.reserved",
910 NULL
, RF4CE_PROFILE_FCF_RESERVED_MASK
,
912 {&hf_rf4ce_profile_fcf_cmd_frame
,
913 {"Command Frame", "rf4ce-profile.fcf.cmd_frame",
915 VALS(rf4ce_profile_fcf_cmd_frame_vals
), RF4CE_PROFILE_FCF_CMD_FRAME_MASK
,
917 {&hf_rf4ce_profile_fcf_data_pending
,
918 {"Data Pending", "rf4ce-profile.fcf.data_pending",
920 TFS(&tfs_yes_no
), RF4CE_PROFILE_FCF_DATA_PENDING_MASK
,
922 {&hf_rf4ce_profile_cmd_generic_resp_status
,
923 {"Status", "rf4ce-profile.cmd.generic_resp.status",
925 VALS(hf_rf4ce_profile_cmd_generic_resp_status_vals
), 0x0,
927 {&hf_rf4ce_profile_cmd_configuration_complete_status
,
928 {"Status", "rf4ce-profile.cmd.configuration_complete.status",
930 VALS(hf_rf4ce_profile_cmd_configuration_complete_status_vals
), 0x0,
932 {&hf_rf4ce_profile_cmd_heartbeat_trigger
,
933 {"Trigger", "rf4ce-profile.cmd.heartbeat.trigger",
935 VALS(hf_rf4ce_profile_cmd_heartbeat_trigger_vals
), 0x0,
937 {&hf_rf4ce_profile_gdp_attr_id
,
938 {"Attribute ID", "rf4ce-profile.gdp.attr.id",
940 VALS(rf4ce_profile_gdp_attr_vals
), 0x0,
942 {&hf_rf4ce_profile_zrc20_attr_id
,
943 {"Attribute ID", "rf4ce-profile.zrc20.attr.id",
945 VALS(rf4ce_profile_zrc20_attr_vals
), 0x0,
947 {&hf_rf4ce_profile_attr_entry_id
,
948 {"Entry Identifier", "rf4ce-profile.zrc20.attr.entry_identifier",
952 {&hf_rf4ce_profile_attr_status
,
953 {"Status", "rf4ce-profile.attr.status",
955 VALS(hf_rf4ce_profile_attr_status_vals
), 0x0,
957 {&hf_rf4ce_profile_attr_length
,
958 {"Length", "rf4ce-profile.attr.length",
962 {&hf_rf4ce_profile_attr_value
,
963 {"Value", "rf4ce-profile.attr.value",
967 {&hf_rf4ce_profile_gdp_ident_cap
,
968 {"Identification Capabilities", "rf4ce-profile.attr.ident_cap",
972 {&hf_rf4ce_profile_gdp_ident_cap_reserved
,
973 {"Reserved", "rf4ce-profile.attr.ident_cap.reserved",
975 NULL
, RF4CE_PROFILE_GDP_IDENT_CAP_RESERVED_MASK
,
977 {&hf_rf4ce_profile_gdp_ident_cap_support_flash_light
,
978 {"Support Flash Light", "rf4ce-profile.attr.ident_cap.support_flash_light",
980 NULL
, RF4CE_PROFILE_GDP_IDENT_CAP_SUPPORT_FLASH_LIGHT_MASK
,
982 {&hf_rf4ce_profile_gdp_ident_cap_support_make_short_sound
,
983 {"Support Make Short Sound", "rf4ce-profile.attr.ident_cap.support_make_short_sound",
985 NULL
, RF4CE_PROFILE_GDP_IDENT_CAP_SUPPORT_MAKE_SHORT_SOUND_MASK
,
987 {&hf_rf4ce_profile_gdp_ident_cap_support_vibrate
,
988 {"Support Vibrate", "rf4ce-profile.attr.ident_cap.support_vibrate",
990 NULL
, RF4CE_PROFILE_GDP_IDENT_CAP_SUPPORT_VIBRATE_MASK
,
992 {&hf_rf4ce_profile_gdp_ident_cap_reserved2
,
993 {"Reserved", "rf4ce-profile.attr.ident_cap.reserved2",
995 NULL
, RF4CE_PROFILE_GDP_IDENT_CAP_RESERVED2_MASK
,
997 {&hf_rf4ce_profile_gdp_poll_constraints_methods_num
,
998 {"Polling Methods Number", "rf4ce-profile.attr.poll_constraints.methods_num",
1002 {&hf_rf4ce_profile_gdp_poll_constraints_polling_rec_method_id
,
1003 {"Polling Method ID", "rf4ce-profile.attr.poll_constraints.polling_record.method_id",
1005 VALS(rf4ce_profile_gdp_poll_constraints_polling_rec_method_id_vals
), 0x0,
1007 {&hf_rf4ce_profile_gdp_poll_constraints_polling_rec_polling_trig_cap
,
1008 {"Polling Trigger Capabilities", "rf4ce-profile.attr.poll_constraints.polling_record.polling_trig_cap",
1009 FT_UINT16
, BASE_HEX
,
1010 NULL
, RF4CE_PROFILE_GDP_POLL_CONSTRAINTS_POLLING_REC_POLLING_TRIG_CAP_MASK
,
1012 {&hf_rf4ce_profile_gdp_poll_constraints_polling_rec_polling_trig_cap_tbased
,
1013 {"Time based polling capable", "rf4ce-profile.attr.poll_constraints.polling_record.polling_trig_cap.tbased",
1015 TFS(&tfs_enabled_disabled
), RF4CE_PROFILE_GDP_POLL_CONSTRAINTS_POLLING_REC_POLLING_TRIG_CAP_TBASED_MASK
,
1017 {&hf_rf4ce_profile_gdp_poll_constraints_polling_rec_polling_trig_cap_on_k_press
,
1018 {"Polling On Key Press Capable", "rf4ce-profile.attr.poll_constraints.polling_record.polling_trig_cap.on_k_press",
1020 TFS(&tfs_enabled_disabled
), RF4CE_PROFILE_GDP_POLL_CONSTRAINTS_POLLING_REC_POLLING_TRIG_CAP_ON_K_PRESS_MASK
,
1022 {&hf_rf4ce_profile_gdp_poll_constraints_polling_rec_polling_trig_cap_on_pick_up
,
1023 {"Polling On Pick Up Capable", "rf4ce-profile.attr.poll_constraints.polling_record.polling_trig_cap.on_pick_up",
1025 TFS(&tfs_enabled_disabled
), RF4CE_PROFILE_GDP_POLL_CONSTRAINTS_POLLING_REC_POLLING_TRIG_CAP_ON_PICK_UP_MASK
,
1027 {&hf_rf4ce_profile_gdp_poll_constraints_polling_rec_polling_trig_cap_on_reset
,
1028 {"Polling On Reset Capable", "rf4ce-profile.attr.poll_constraints.polling_record.polling_trig_cap.on_reset",
1030 TFS(&tfs_enabled_disabled
), RF4CE_PROFILE_GDP_POLL_CONSTRAINTS_POLLING_REC_POLLING_TRIG_CAP_ON_RESET_MASK
,
1032 {&hf_rf4ce_profile_gdp_poll_constraints_polling_rec_polling_trig_cap_on_micro_act
,
1033 {"Polling On Microphone Activity Capable", "rf4ce-profile.attr.poll_constraints.polling_record.polling_trig_cap.on_micro_act",
1035 TFS(&tfs_enabled_disabled
), RF4CE_PROFILE_GDP_POLL_CONSTRAINTS_POLLING_REC_POLLING_TRIG_CAP_ON_MICRO_ACT_MASK
,
1037 {&hf_rf4ce_profile_gdp_poll_constraints_polling_rec_polling_trig_cap_on_user_act
,
1038 {"Polling On Other User Activity Capable", "rf4ce-profile.attr.poll_constraints.polling_record.polling_trig_cap.on_user_act",
1040 TFS(&tfs_enabled_disabled
), RF4CE_PROFILE_GDP_POLL_CONSTRAINTS_POLLING_REC_POLLING_TRIG_CAP_ON_USER_ACT_MASK
,
1042 {&hf_rf4ce_profile_gdp_poll_constraints_polling_rec_polling_trig_cap_reserved
,
1043 {"Reserved", "rf4ce-profile.attr.poll_constraints.polling_record.polling_trig_cap.reserved",
1044 FT_UINT16
, BASE_HEX
,
1045 NULL
, RF4CE_PROFILE_GDP_POLL_CONSTRAINTS_POLLING_REC_POLLING_TRIG_CAP_RESERVED_MASK
,
1047 {&hf_rf4ce_profile_gdp_poll_constraints_polling_rec_min_polling_key_press_cnt
,
1048 {"Minimum Polling Key Press Counter", "rf4ce-profile.attr.poll_constraints.polling_record.min_polling_key_press_cnt",
1052 {&hf_rf4ce_profile_gdp_poll_constraints_polling_rec_max_polling_key_press_cnt
,
1053 {"Maximum Polling Key Press Counter", "rf4ce-profile.attr.poll_constraints.polling_record.max_polling_key_press_cnt",
1057 {&hf_rf4ce_profile_gdp_poll_constraints_polling_rec_min_polling_time_interval
,
1058 {"Minimum Polling Time Interval", "rf4ce-profile.attr.poll_constraints.polling_record.min_polling_time_interval",
1059 FT_UINT32
, BASE_DEC
,
1062 {&hf_rf4ce_profile_gdp_poll_constraints_polling_rec_max_polling_time_interval
,
1063 {"Maximum Polling Time Interval", "rf4ce-profile.attr.poll_constraints.polling_record.max_polling_time_interval",
1064 FT_UINT32
, BASE_DEC
,
1067 {&hf_rf4ce_profile_gdp_poll_configuration_method_id
,
1068 {"Polling Method ID", "rf4ce-profile.attr.poll_configuration.method_id",
1070 VALS(rf4ce_profile_gdp_poll_constraints_polling_rec_method_id_vals
), 0x0,
1072 {&hf_rf4ce_profile_gdp_poll_configuration_polling_trig_conf
,
1073 {"Polling Trigger Configuration", "rf4ce-profile.attr.poll_configuration.polling_trig_conf",
1074 FT_UINT16
, BASE_HEX
,
1077 {&hf_rf4ce_profile_gdp_poll_configuration_polling_trig_conf_tbased
,
1078 {"Time Based Polling", "rf4ce-profile.attr.poll_configuration.polling_trig_conf.tbased",
1080 TFS(&tfs_enabled_disabled
), RF4CE_PROFILE_GDP_POLL_CONFIGURATION_POLLING_TRIG_CONF_TBASED_MASK
,
1082 {&hf_rf4ce_profile_gdp_poll_configuration_polling_trig_conf_on_k_press
,
1083 {"Polling on Key Press", "rf4ce-profile.attr.poll_configuration.polling_trig_conf.on_k_press",
1085 TFS(&tfs_enabled_disabled
), RF4CE_PROFILE_GDP_POLL_CONFIGURATION_POLLING_TRIG_CONF_ON_K_PRESS_MASK
,
1087 {&hf_rf4ce_profile_gdp_poll_configuration_polling_trig_conf_on_pick_up
,
1088 {"Polling on Pick up", "rf4ce-profile.attr.poll_configuration.polling_trig_conf.on_pick_up",
1090 TFS(&tfs_enabled_disabled
), RF4CE_PROFILE_GDP_POLL_CONFIGURATION_POLLING_TRIG_CONF_ON_PICK_UP_MASK
,
1092 {&hf_rf4ce_profile_gdp_poll_configuration_polling_trig_conf_on_reset
,
1093 {"Polling on Reset", "rf4ce-profile.attr.poll_configuration.polling_trig_conf.on_reset",
1095 TFS(&tfs_enabled_disabled
), RF4CE_PROFILE_GDP_POLL_CONFIGURATION_POLLING_TRIG_CONF_ON_RESET_MASK
,
1097 {&hf_rf4ce_profile_gdp_poll_configuration_polling_trig_conf_on_micro_act
,
1098 {"Polling on Microphone Activity", "rf4ce-profile.attr.poll_configuration.polling_trig_conf.on_micro_act",
1100 TFS(&tfs_enabled_disabled
), RF4CE_PROFILE_GDP_POLL_CONFIGURATION_POLLING_TRIG_CONF_ON_MICRO_ACT_MASK
,
1102 {&hf_rf4ce_profile_gdp_poll_configuration_polling_trig_conf_on_user_act
,
1103 {"Polling on User Activity", "rf4ce-profile.attr.poll_configuration.polling_trig_conf.on_user_act",
1105 TFS(&tfs_enabled_disabled
), RF4CE_PROFILE_GDP_POLL_CONFIGURATION_POLLING_TRIG_CONF_ON_USER_ACT_MASK
,
1107 {&hf_rf4ce_profile_gdp_poll_configuration_polling_trig_conf_reserved
,
1108 {"Reserved", "rf4ce-profile.attr.poll_configuration.polling_trig_conf.reserved",
1109 FT_UINT16
, BASE_HEX
,
1110 NULL
, RF4CE_PROFILE_GDP_POLL_CONFIGURATION_POLLING_TRIG_CONF_RESERVED_MASK
,
1112 {&hf_rf4ce_profile_gdp_poll_configuration_polling_key_press_cnt
,
1113 {"Polling Key Press Counter", "rf4ce-profile.attr.poll_configuration.polling_key_press_cnt",
1117 {&hf_rf4ce_profile_gdp_poll_configuration_polling_time_interval
,
1118 {"Polling Time Interval", "rf4ce-profile.attr.poll_configuration.polling_time_interval",
1119 FT_UINT32
, BASE_DEC
,
1122 {&hf_rf4ce_profile_gdp_poll_configuration_polling_timeout
,
1123 {"Polling Timeout", "rf4ce-profile.attr.poll_configuration.polling_timeout",
1127 {&hf_rf4ce_profile_zrc20_mappable_actions_action_dev_type
,
1128 {"Action Device Type", "rf4ce-profile.attr.mappable_actions.action_dev_type",
1130 VALS(rf4ce_profile_device_type_vals
), 0x0,
1132 {&hf_rf4ce_profile_zrc20_mappable_actions_action_bank
,
1133 {"Action Bank", "rf4ce-profile.attr.mappable_actions.action_bank",
1137 {&hf_rf4ce_profile_zrc20_mappable_actions_action_code
,
1138 {"Action Code", "rf4ce-profile.attr.mappable_actions.action_code",
1142 {&hf_rf4ce_profile_zrc20_action_mappings_mapping_flags
,
1143 {"Mapping Flags", "rf4ce-profile.attr.action_mappings.mapping_flags",
1145 NULL
, RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_MAPPING_FLAGS_MASK
,
1147 {&hf_rf4ce_profile_zrc20_action_mappings_mapping_flags_rf_specified
,
1148 {"RF Specified", "rf4ce-profile.attr.action_mappings.mapping_flags.rf_specified",
1149 FT_BOOLEAN
, SEP_DOT
,
1150 NULL
, RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_MAPPING_FLAGS_RF_SPECIFIED_MASK
,
1152 {&hf_rf4ce_profile_zrc20_action_mappings_mapping_flags_ir_specified
,
1153 {"IR Specified", "rf4ce-profile.attr.action_mappings.mapping_flags.ir_specified",
1154 FT_BOOLEAN
, SEP_DOT
,
1155 NULL
, RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_MAPPING_FLAGS_IR_SPECIFIED_MASK
,
1157 {&hf_rf4ce_profile_zrc20_action_mappings_mapping_flags_rf_descr_first
,
1158 {"RF Descriptor First", "rf4ce-profile.attr.action_mappings.mapping_flags.rf_descr_first",
1159 FT_BOOLEAN
, SEP_DOT
,
1160 NULL
, RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_MAPPING_FLAGS_RF_DESCR_FIRST_MASK
,
1162 {&hf_rf4ce_profile_zrc20_action_mappings_mapping_flags_reserved
,
1163 {"Reserved", "rf4ce-profile.attr.action_mappings.mapping_flags.reserved",
1165 NULL
, RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_MAPPING_FLAGS_RESERVED_MASK
,
1167 {&hf_rf4ce_profile_zrc20_action_mappings_mapping_flags_use_default
,
1168 {"Use Default", "rf4ce-profile.attr.action_mappings.mapping_flags.use_default",
1169 FT_BOOLEAN
, SEP_DOT
,
1170 NULL
, RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_MAPPING_FLAGS_USE_DEFAULT_MASK
,
1172 {&hf_rf4ce_profile_zrc20_action_mappings_mapping_flags_permanent
,
1173 {"Permanent", "rf4ce-profile.attr.action_mappings.mapping_flags.permanent",
1174 FT_BOOLEAN
, SEP_DOT
,
1175 NULL
, RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_MAPPING_FLAGS_PERMANENT_MASK
,
1177 {&hf_rf4ce_profile_zrc20_action_mappings_rf_descr_rf_conf
,
1178 {"RF Config", "rf4ce-profile.attr.action_mappings.rf_descr.rf_conf",
1180 NULL
, RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_RF_DESCR_RF_CONF_MASK
,
1182 {&hf_rf4ce_profile_zrc20_action_mappings_rf_descr_rf_conf_min_num_of_trans
,
1183 {"Minimum Number of Transmissions", "rf4ce-profile.attr.action_mappings.rf_descr.rf_conf.min_num_of_trans",
1185 NULL
, RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_RF_DESCR_RF_CONF_MIN_NUM_OF_TRANS_MASK
,
1187 {&hf_rf4ce_profile_zrc20_action_mappings_rf_descr_rf_conf_keep_trans_until_key_release
,
1188 {"Keep Transmitting Until Key Release", "rf4ce-profile.attr.action_mappings.rf_descr.rf_conf.keep_trans_until_key_release",
1189 FT_BOOLEAN
, SEP_DOT
,
1190 NULL
, RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_RF_DESCR_RF_CONF_KEEP_TRANS_UNTIL_KEY_RELEASE_MASK
,
1192 {&hf_rf4ce_profile_zrc20_action_mappings_rf_descr_rf_conf_short_rf_retry
,
1193 {"Short RF Retry", "rf4ce-profile.attr.action_mappings.rf_descr.rf_conf.short_rf_retry",
1194 FT_BOOLEAN
, SEP_DOT
,
1195 NULL
, RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_RF_DESCR_RF_CONF_SHORT_RF_RETRY_MASK
,
1197 {&hf_rf4ce_profile_zrc20_action_mappings_rf_descr_rf_conf_atomic_action
,
1198 {"Atomic Action", "rf4ce-profile.attr.action_mappings.rf_descr.rf_conf.atomic_action",
1199 FT_BOOLEAN
, SEP_DOT
,
1200 NULL
, RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_RF_DESCR_RF_CONF_ATOMIC_ACTION_MASK
,
1202 {&hf_rf4ce_profile_zrc20_action_mappings_rf_descr_rf_conf_reserved
,
1203 {"Reserved", "rf4ce-profile.attr.action_mappings.rf_descr.rf_conf.reserved",
1205 NULL
, RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_RF_DESCR_RF_CONF_RESERVED_MASK
,
1207 {&hf_rf4ce_profile_zrc20_action_mappings_rf_descr_tx_opts
,
1208 {"TX Options", "rf4ce-profile.attr.action_mappings.rf_descr.tx_opts",
1210 NULL
, RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_RF_DESCR_TX_OPTS_MASK
,
1212 {&hf_rf4ce_profile_zrc20_action_mappings_rf_descr_tx_opts_trans_mode
,
1213 {"Transmission Mode", "rf4ce-profile.attr.action_mappings.rf_descr.tx_opts.trans_mode",
1214 FT_BOOLEAN
, SEP_DOT
,
1215 TFS(&rf4ce_profile_zrc20_action_mappings_rf_descr_tx_opts_trans_mode_vals
), RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_RF_DESCR_TX_OPTS_TRANS_MODE_MASK
,
1217 {&hf_rf4ce_profile_zrc20_action_mappings_rf_descr_tx_opts_dst_addr_mode
,
1218 {"Destination Addressing Mode", "rf4ce-profile.attr.action_mappings.rf_descr.tx_opts.dst_addr_mode",
1219 FT_BOOLEAN
, SEP_DOT
,
1220 TFS(&rf4ce_profile_zrc20_action_mappings_rf_descr_tx_opts_dst_addr_mode_vals
), RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_RF_DESCR_TX_OPTS_DST_ADDR_MODE_MASK
,
1222 {&hf_rf4ce_profile_zrc20_action_mappings_rf_descr_tx_opts_ack_mode
,
1223 {"Acknowledgement Mode", "rf4ce-profile.attr.action_mappings.rf_descr.tx_opts.ack_mode",
1224 FT_BOOLEAN
, SEP_DOT
,
1225 TFS(&rf4ce_profile_zrc20_action_mappings_rf_descr_tx_opts_ack_mode_vals
), RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_RF_DESCR_TX_OPTS_ACK_MODE_MASK
,
1227 {&hf_rf4ce_profile_zrc20_action_mappings_rf_descr_tx_opts_sec_mode
,
1228 {"Security Mode", "rf4ce-profile.attr.action_mappings.rf_descr.tx_opts.sec_mode",
1229 FT_BOOLEAN
, SEP_DOT
,
1230 TFS(&rf4ce_profile_zrc20_action_mappings_rf_descr_tx_opts_sec_mode_vals
), RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_RF_DESCR_TX_OPTS_SEC_MODE_MASK
,
1232 {&hf_rf4ce_profile_zrc20_action_mappings_rf_descr_tx_opts_ch_ag_mode
,
1233 {"Channel Agility Mode", "rf4ce-profile.attr.action_mappings.rf_descr.tx_opts.ch_ag_mode",
1234 FT_BOOLEAN
, SEP_DOT
,
1235 TFS(&rf4ce_profile_zrc20_action_mappings_rf_descr_tx_opts_ch_ag_mode_vals
), RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_RF_DESCR_TX_OPTS_CH_AG_MODE_MASK
,
1237 {&hf_rf4ce_profile_zrc20_action_mappings_rf_descr_tx_opts_ch_norm_mode
,
1238 {"Channel Normalization Mode", "rf4ce-profile.attr.action_mappings.rf_descr.tx_opts.ch_norm_mode",
1239 FT_BOOLEAN
, SEP_DOT
,
1240 TFS(&rf4ce_profile_zrc20_action_mappings_rf_descr_tx_opts_ch_norm_mode_vals
), RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_RF_DESCR_TX_OPTS_CH_NORM_MODE_MASK
,
1242 {&hf_rf4ce_profile_zrc20_action_mappings_rf_descr_tx_opts_payload_mode
,
1243 {"Payload Mode", "rf4ce-profile.attr.action_mappings.rf_descr.tx_opts.payload_mode",
1244 FT_BOOLEAN
, SEP_DOT
,
1245 TFS(&rf4ce_profile_zrc20_action_mappings_rf_descr_tx_opts_payload_mode_vals
), RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_RF_DESCR_TX_OPTS_PAYLOAD_MODE_MASK
,
1247 {&hf_rf4ce_profile_zrc20_action_mappings_rf_descr_tx_opts_reserved
,
1248 {"Reserved", "rf4ce-profile.attr.action_mappings.rf_descr.tx_opts.reserved",
1249 FT_BOOLEAN
, SEP_DOT
,
1250 NULL
, RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_RF_DESCR_TX_OPTS_RESERVED_MASK
,
1252 {&hf_rf4ce_profile_zrc20_action_mappings_rf_descr_action_data_len
,
1253 {"Action Data Length", "rf4ce-profile.attr.action_mappings.rf_descr.action_data_len",
1257 {&hf_rf4ce_profile_zrc20_action_mappings_ir_descr_ir_conf
,
1258 {"IR Config", "rf4ce-profile.attr.action_mappings.ir_descr.ir_conf",
1260 NULL
, RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_IR_DESCR_IR_CONF_MASK
,
1262 {&hf_rf4ce_profile_zrc20_action_mappings_ir_descr_ir_conf_vendor_specific
,
1263 {"Vendor Specific", "rf4ce-profile.attr.action_mappings.ir_descr.ir_conf.vendor_specific",
1264 FT_BOOLEAN
, SEP_DOT
,
1265 NULL
, RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_IR_DESCR_IR_CONF_VENDOR_SPECIFIC_MASK
,
1267 {&hf_rf4ce_profile_zrc20_action_mappings_ir_descr_ir_conf_reserved
,
1268 {"Reserved", "rf4ce-profile.attr.action_mappings.ir_descr.ir_conf.reserved",
1270 NULL
, RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_IR_DESCR_IR_CONF_RESERVED_MASK
,
1272 {&hf_rf4ce_profile_zrc20_action_mappings_ir_descr_ir_vendor_id
,
1273 {"IR Vendor ID", "rf4ce-profile.attr.action_mappings.ir_descr.ir_vendor_id",
1274 FT_UINT16
, BASE_HEX
,
1275 VALS(rf4ce_vendor_id_vals
), RF4CE_VENDOR_ID_MASK
,
1277 {&hf_rf4ce_profile_zrc20_action_mappings_ir_descr_ir_code_len
,
1278 {"IR Code Length", "rf4ce-profile.attr.action_mappings.ir_descr.ir_code_len",
1282 {&hf_rf4ce_profile_zrc20_action_mappings_ir_descr_ir_code
,
1283 {"IR Code", "rf4ce-profile.attr.action_mappings.ir_descr.ir_code",
1284 FT_BYTES
, SEP_COLON
,
1287 {&hf_rf4ce_profile_zrc20_irdb_vendor_support_vendor_id
,
1288 {"Vendor ID", "rf4ce-profile.attr.irdb_vendor_support.vendor_id",
1289 FT_UINT16
, BASE_HEX
,
1290 VALS(rf4ce_vendor_id_vals
), RF4CE_VENDOR_ID_MASK
,
1292 {&hf_rf4ce_profile_cmd_check_validation_sub_type
,
1293 {"Sub-type", "rf4ce-profile.cmd.check_validation.sub_type",
1295 VALS(rf4ce_profile_cmd_check_validation_sub_type_vals
), 0x0,
1297 {&hf_rf4ce_profile_cmd_check_validation_control
,
1298 {"Validation Control", "rf4ce-profile.cmd.check_validation.validation_control",
1302 {&hf_rf4ce_profile_cmd_check_validation_status
,
1303 {"Validation Status", "rf4ce-profile.cmd.check_validation.validation_status",
1305 VALS(rf4ce_profile_cmd_check_validation_status_vals
), 0x0,
1307 {&hf_rf4ce_profile_cmd_client_notification_sub_type
,
1308 {"Sub-ype", "rf4ce-profile.cmd.client_notification.sub_type",
1310 VALS(rf4ce_profile_cmd_client_notification_sub_type_vals
), 0x0,
1312 {&hf_rf4ce_profile_cmd_client_notification_identify_flags
,
1313 {"Identify Flags", "rf4ce-profile.cmd.client_notification.identify_flags",
1317 {&hf_rf4ce_profile_cmd_client_notification_identify_flags_stop_on_action
,
1318 {"Stop on Action", "rf4ce-profile.cmd.client_notification.identify_flags.stop_on_action",
1320 NULL
, RF4CE_PROFILE_CMD_CL_NOTIF_SUB_TYPE_IDENTIFY_STOP_ON_ACTION_FLAG
,
1322 {&hf_rf4ce_profile_cmd_client_notification_identify_flags_flash_light
,
1323 {"Flash Light", "rf4ce-profile.cmd.client_notification.identify_flags.flash_light",
1325 NULL
, RF4CE_PROFILE_CMD_CL_NOTIF_SUB_TYPE_IDENTIFY_FLASH_LIGHT_FLAG
,
1327 {&hf_rf4ce_profile_cmd_client_notification_identify_flags_make_sound
,
1328 {"Make Sound", "rf4ce-profile.cmd.client_notification.identify_flags.make_sound",
1330 NULL
, RF4CE_PROFILE_CMD_CL_NOTIF_SUB_TYPE_IDENTIFY_MAKE_SOUND_FLAG
,
1332 {&hf_rf4ce_profile_cmd_client_notification_identify_flags_vibrate
,
1333 {"Vibrate", "rf4ce-profile.cmd.client_notification.identify_flags.vibrate",
1335 NULL
, RF4CE_PROFILE_CMD_CL_NOTIF_SUB_TYPE_IDENTIFY_VIBRATE_FLAG
,
1337 {&hf_rf4ce_profile_cmd_client_notification_identify_flags_reserved
,
1338 {"Reserved", "rf4ce-profile.cmd.client_notification.identify_flags.reserved",
1340 NULL
, RF4CE_PROFILE_CMD_CL_NOTIF_SUB_TYPE_IDENTIFY_RESERVED_FLAG
,
1342 {&hf_rf4ce_profile_cmd_client_notification_identify_time
,
1343 {"Identify Time", "rf4ce-profile.cmd.client_notification.identify_time",
1344 FT_UINT16
, BASE_DEC
,
1347 {&hf_rf4ce_profile_cmd_key_exchange_sub_type
,
1348 {"Sub-type", "rf4ce-profile.cmd.key_exchange.sub_type",
1350 VALS(rf4ce_profile_cmd_key_exchange_sub_type_vals
), 0x0,
1352 {&hf_rf4ce_profile_cmd_key_exchange_flags
,
1353 {"Key Exchange Flags", "rf4ce-profile.cmd.key_exchange.flags",
1354 FT_UINT16
, BASE_HEX
,
1357 {&hf_rf4ce_profile_cmd_key_exchange_flags_default_secret
,
1358 {"Default Secret", "rf4ce-profile.cmd.key_exchange.flags.default_secret",
1359 FT_UINT16
, BASE_HEX
,
1360 NULL
, RF4CE_PROFILE_CMD_KEY_EXCHANGE_FLAGS_DEFAULT_SECRET_FLAG
,
1362 {&hf_rf4ce_profile_cmd_key_exchange_flags_initiator_vendor_specific_secret
,
1363 {"Initiator Vendor Specific Secret", "rf4ce-profile.cmd.key_exchange.flags.initiator_vendor_specific_secret",
1364 FT_UINT16
, BASE_HEX
,
1365 NULL
, RF4CE_PROFILE_CMD_KEY_EXCHANGE_FLAGS_INITIATOR_VENDOR_SPECIFIC_SECRET_FLAG
,
1367 {&hf_rf4ce_profile_cmd_key_exchange_flags_responder_vendor_specific_secret
,
1368 {"Responder Vendor Specific Secret", "rf4ce-profile.cmd.key_exchange.flags.responder_vendor_specific_secret",
1369 FT_UINT16
, BASE_HEX
,
1370 NULL
, RF4CE_PROFILE_CMD_KEY_EXCHANGE_FLAGS_RESPONDER_VENDOR_SPECIFIC_SECRET_FLAG
,
1372 {&hf_rf4ce_profile_cmd_key_exchange_flags_reserved
,
1373 {"Reserved", "rf4ce-profile.cmd.key_exchange.flags.reserved",
1374 FT_UINT16
, BASE_HEX
,
1375 NULL
, RF4CE_PROFILE_CMD_KEY_EXCHANGE_FLAGS_RESERVED_FLAG
,
1377 {&hf_rf4ce_profile_cmd_key_exchange_flags_vendor_specific_parameter
,
1378 {"Vendor Specific Parameter", "rf4ce-profile.cmd.key_exchange.flags.vendor_specific_parameter",
1379 FT_UINT16
, BASE_HEX
,
1380 NULL
, RF4CE_PROFILE_CMD_KEY_EXCHANGE_FLAGS_VENDOR_SPECIFIC_PARAMETER_FLAG
,
1382 {&hf_rf4ce_profile_cmd_key_exchange_rand_a
,
1383 {"Rand-A", "rf4ce-profile.cmd.key_exchange.rand_a",
1384 FT_BYTES
, SEP_COLON
,
1387 {&hf_rf4ce_profile_cmd_key_exchange_rand_b
,
1388 {"Rand-B", "rf4ce-profile.cmd.key_exchange.rand_b",
1389 FT_BYTES
, SEP_COLON
,
1392 {&hf_rf4ce_profile_cmd_key_exchange_tag_b
,
1393 {"TAG-B", "rf4ce-profile.cmd.key_exchange.tag_b",
1394 FT_BYTES
, SEP_COLON
,
1397 {&hf_rf4ce_profile_cmd_key_exchange_tag_a
,
1398 {"TAG-A", "rf4ce-profile.cmd.key_exchange.tag_a",
1399 FT_BYTES
, SEP_COLON
,
1403 {&hf_rf4ce_zrc20_cmd_actions
,
1404 {"Actions", "rf4ce-profile.zrc20.cmd.actions",
1405 FT_BYTES
, SEP_COLON
,
1409 {&hf_rf4ce_zrc20_cmd_actions_action_control
,
1410 {"Action Control", "rf4ce-profile.zrc20.cmd.actions.action_control",
1414 {&hf_rf4ce_zrc20_cmd_actions_action_control_action_type
,
1415 {"Action Type", "rf4ce-profile.zrc20.cmd.actions.action_control.action_type",
1417 VALS(rf4ce_zrc20_cmd_actions_action_control_action_type_vals
), RF4CE_ZRC20_CMD_ACTIONS_ACTION_CONTROL_ACTION_TYPE_MASK
,
1419 {&hf_rf4ce_zrc20_cmd_actions_action_control_reserved
,
1420 {"Reserved", "rf4ce-profile.zrc20.cmd.actions.action_control.reserved",
1422 NULL
, RF4CE_ZRC20_CMD_ACTIONS_ACTION_CONTROL_RESERVED
,
1424 {&hf_rf4ce_zrc20_cmd_actions_action_control_modifier_bits_gui
,
1425 {"GUI Modifier", "rf4ce-profile.zrc20.cmd.actions.action_control.modifier_bits.gui",
1427 TFS(&tfs_yes_no
), RF4CE_ZRC20_CMD_ACTIONS_ACTION_CONTROL_MODIFIER_BITS_GUI
,
1429 {&hf_rf4ce_zrc20_cmd_actions_action_control_modifier_bits_alt
,
1430 {"ALT Modifier", "rf4ce-profile.zrc20.cmd.actions.action_control.modifier_bits.alt",
1432 TFS(&tfs_yes_no
), RF4CE_ZRC20_CMD_ACTIONS_ACTION_CONTROL_MODIFIER_BITS_ALT
,
1434 {&hf_rf4ce_zrc20_cmd_actions_action_control_modifier_bits_shift
,
1435 {"SHIFT Modifier", "rf4ce-profile.zrc20.cmd.actions.action_control.modifier_bits.shift",
1437 TFS(&tfs_yes_no
), RF4CE_ZRC20_CMD_ACTIONS_ACTION_CONTROL_MODIFIER_BITS_SHIFT
,
1439 {&hf_rf4ce_zrc20_cmd_actions_action_control_modifier_bits_ctrl
,
1440 {"CTRL Modifier", "rf4ce-profile.zrc20.cmd.actions.action_control.modifier_bits.ctrl",
1442 TFS(&tfs_yes_no
), RF4CE_ZRC20_CMD_ACTIONS_ACTION_CONTROL_MODIFIER_BITS_CTRL
,
1444 {&hf_rf4ce_zrc20_cmd_actions_action_data_payload_length
,
1445 {"Payload Length", "rf4ce-profile.zrc20.cmd.actions.action_data.payload_length",
1449 {&hf_rf4ce_zrc20_cmd_actions_action_data_action_bank
,
1450 {"Action Bank", "rf4ce-profile.zrc20.cmd.actions.action_data.action_bank",
1454 {&hf_rf4ce_zrc20_cmd_actions_action_data_action_code
,
1455 {"Action Code", "rf4ce-profile.zrc20.cmd.actions.action_data.action_code",
1459 {&hf_rf4ce_zrc20_cmd_actions_action_data_action_vendor
,
1460 {"Action Vendor", "rf4ce-profile.zrc20.cmd.actions.action_data.action_vendor",
1461 FT_UINT16
, BASE_HEX
,
1462 VALS(rf4ce_vendor_id_vals
), RF4CE_VENDOR_ID_MASK
,
1464 {&hf_rf4ce_zrc20_cmd_actions_action_data_action_payload
,
1465 {"Action Payload", "rf4ce-profile.zrc20.cmd.actions.action_data.action_payload",
1466 FT_BYTES
, SEP_COLON
,
1469 {&hf_rf4ce_zrc10_fcf
,
1470 {"Frame Control Field", "rf4ce-profile.zrc10.fcf",
1474 {&hf_rf4ce_zrc10_fcf_cmd_id
,
1475 {"Command ID", "rf4ce-profile.zrc10.fcf.cmd_id",
1477 VALS(rf4ce_zrc10_fcf_cmd_id_vals
), RF4CE_ZRC10_FCF_CMD_ID_MASK
,
1479 {&hf_rf4ce_zrc10_fcf_reserved
,
1480 {"Reserved", "rf4ce-profile.zrc10.fcf.reserved",
1482 NULL
, RF4CE_ZRC10_FCF_RESERVED_MASK
,
1484 {&hf_rf4ce_zrc10_cmd_common_rc_command_code
,
1485 {"RC Command Code", "rf4ce-profile.zrc10.cmd_common.rc_command_code",
1489 {&hf_rf4ce_zrc10_cmd_common_rc_command_payload
,
1490 {"RC Command Payload", "rf4ce-profile.zrc10.cmd_common.rc_command_payload",
1491 FT_BYTES
, SEP_COLON
,
1494 {&hf_rf4ce_zrc10_cmd_disc_reserved
,
1495 {"Reserved", "rf4ce-profile.zrc10.cmd.discovery.reserved",
1499 {&hf_rf4ce_zrc10_cmd_disc_rsp_supported_commands
,
1500 {"Supported Commands", "rf4ce-profile.zrc10.cmd_disc_rsp.supported_commands",
1501 FT_BYTES
, SEP_COLON
,
1504 {&hf_rf4ce_profile_unparsed_payload
,
1505 {"Unparsed Profile Payload", "rf4ce-profile.unparsed_payload",
1506 FT_BYTES
, SEP_COLON
,
1511 /* Setup protocol subtree array */
1512 static int *ett
[] = {
1514 &ett_rf4ce_profile_cmd_frame
,
1515 &ett_rf4ce_profile_attrs
,
1516 &ett_rf4ce_profile_attrs_sub
,
1517 &ett_rf4ce_profile_zrc20_ident_cap
,
1518 &ett_rf4ce_profile_zrc20_mappable_actions_entry
,
1519 &ett_rf4ce_profile_zrc20_action_control
,
1520 &ett_rf4ce_profile_zrc20_action_mappings_flags
,
1521 &ett_rf4ce_profile_zrc20_action_mappings_rf_descr
,
1522 &ett_rf4ce_profile_zrc20_action_mappings_rf_descr_rf_conf
,
1523 &ett_rf4ce_profile_zrc20_action_mappings_rf_descr_tx_opts
,
1524 &ett_rf4ce_profile_zrc20_action_mappings_ir_descr
,
1525 &ett_rf4ce_profile_zrc20_action_mappings_ir_descr_ir_conf
,
1526 &ett_rf4ce_profile_gdp_poll_constraints_polling_rec
,
1527 &ett_rf4ce_profile_gdp_poll_constraints_polling_rec_polling_trig_cap
,
1528 &ett_rf4ce_profile_gdp_poll_configuration_polling_trig_conf
,
1529 &ett_rf4ce_profile_action_records
,
1530 &ett_rf4ce_profile_action_records_sub
,
1531 &ett_rf4ce_profile_zrc10_supported_commands
,
1532 &ett_rf4ce_profile_zrc10_supported_commands_sub
};
1534 proto_rf4ce_profile
= proto_register_protocol("RF4CE Profile", "RF4CE Profile", "rf4ce_profile");
1535 proto_register_field_array(proto_rf4ce_profile
, hf
, array_length(hf
));
1536 proto_register_subtree_array(ett
, array_length(ett
));
1538 rf4ce_profile_dissector_table
= register_dissector_table("rf4ce.profile", "RF4CE Profile", proto_rf4ce_profile
, FT_NONE
, BASE_NONE
);
1539 rf4ce_profile_handle
= register_dissector("rf4ce_profile", dissect_rf4ce_profile_common
, proto_rf4ce_profile
);
1542 void proto_reg_handoff_rf4ce_profile(void)
1546 /* RF4CE Profile common dissector */
1547 static int dissect_rf4ce_profile_common(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void *data
)
1549 unsigned offset
= 0;
1550 proto_item
*ti
= proto_tree_add_item(tree
, proto_rf4ce_profile
, tvb
, 0, -1, ENC_LITTLE_ENDIAN
);
1551 proto_tree
*rf4ce_profile_tree
= proto_item_add_subtree(ti
, ett_rf4ce_profile
);
1553 uint8_t fcf
= tvb_get_uint8(tvb
, offset
);
1554 uint8_t cmd_id
= fcf
& RF4CE_PROFILE_FCF_CMD_ID_MASK
;
1555 bool is_cmd_frame
= fcf
& RF4CE_PROFILE_FCF_CMD_FRAME_MASK
;
1556 bool is_gdp
= !strncmp("GDP", (char *)data
, 3);
1557 bool is_zrc20
= !strncmp("ZRC 2.0", (char *)data
, 7);
1558 bool is_zrc10
= !strncmp("ZRC 1.0", (char *)data
, 7);
1560 char protocol_str
[14] = {0};
1562 /* Clear the info column */
1563 col_clear(pinfo
->cinfo
, COL_INFO
);
1565 if (is_gdp
|| (is_zrc20
&& is_cmd_frame
))
1567 static int *const gdp_fcf_bits
[] = {
1568 &hf_rf4ce_profile_fcf_cmd_id
,
1569 &hf_rf4ce_profile_fcf_reserved
,
1570 &hf_rf4ce_profile_fcf_cmd_frame
,
1571 &hf_rf4ce_profile_fcf_data_pending
,
1574 proto_tree_add_bitmask(rf4ce_profile_tree
, tvb
, offset
, hf_rf4ce_profile_fcf
, ett_rf4ce_profile
, gdp_fcf_bits
, ENC_LITTLE_ENDIAN
);
1579 static int *const zrc20_fcf_bits
[] = {
1580 &hf_rf4ce_zrc20_fcf_cmd_id
,
1581 &hf_rf4ce_profile_fcf_reserved
,
1582 &hf_rf4ce_profile_fcf_cmd_frame
,
1583 &hf_rf4ce_profile_fcf_data_pending
,
1586 proto_tree_add_bitmask(rf4ce_profile_tree
, tvb
, offset
, hf_rf4ce_profile_fcf
, ett_rf4ce_profile
, zrc20_fcf_bits
, ENC_LITTLE_ENDIAN
);
1591 static int *const zrc10_fcf_bits
[] = {
1592 &hf_rf4ce_zrc10_fcf_cmd_id
,
1593 &hf_rf4ce_zrc10_fcf_reserved
,
1596 proto_tree_add_bitmask(rf4ce_profile_tree
, tvb
, offset
, hf_rf4ce_zrc10_fcf
, ett_rf4ce_profile
, zrc10_fcf_bits
, ENC_LITTLE_ENDIAN
);
1599 cmd_id
= fcf
& RF4CE_ZRC10_FCF_CMD_ID_MASK
;
1602 snprintf(protocol_str
, sizeof(protocol_str
), "%s %s", "RF4CE", (char *)data
);
1603 col_add_str(pinfo
->cinfo
, COL_PROTOCOL
, protocol_str
);
1605 if (is_gdp
|| is_zrc20
|| is_zrc10
)
1607 dissect_rf4ce_profile_cmd(tvb
, pinfo
, rf4ce_profile_tree
, &offset
, cmd_id
, (char *)data
, is_cmd_frame
);
1610 if (offset
< tvb_captured_length(tvb
))
1612 unsigned unparsed_length
= tvb_captured_length(tvb
) - offset
;
1613 proto_tree_add_item(rf4ce_profile_tree
, hf_rf4ce_profile_unparsed_payload
, tvb
, offset
, unparsed_length
, ENC_NA
);
1614 offset
+= unparsed_length
;
1620 static void dissect_rf4ce_profile_cmd(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, unsigned *offset
, uint8_t cmd_id
, char *profile_str
, bool is_cmd_frame
)
1622 proto_tree
*profile_cmd_tree
;
1623 bool is_zrc10
= !strncmp("ZRC 1.0", profile_str
, 7);
1624 bool is_zrc20
= !strncmp("ZRC 2.0", profile_str
, 7);
1626 profile_cmd_tree
= proto_tree_add_subtree(tree
, tvb
, *offset
, tvb_captured_length(tvb
) - *offset
, ett_rf4ce_profile_cmd_frame
, NULL
, "Profile Command Frame");
1630 col_set_str(pinfo
->cinfo
, COL_INFO
, val_to_str_const(cmd_id
, rf4ce_profile_fcf_cmd_id_vals
, "Unknown Command"));
1631 dissect_rf4ce_profile_common_cmd(tvb
, pinfo
, profile_cmd_tree
, offset
, cmd_id
, is_zrc20
);
1635 col_set_str(pinfo
->cinfo
, COL_INFO
, val_to_str_const(cmd_id
, rf4ce_zrc10_fcf_cmd_id_vals
, "Unknown Command"));
1636 dissect_rf4ce_profile_zrc10_cmd(tvb
, profile_cmd_tree
, offset
, cmd_id
);
1638 /* cmd_frame bit MUST be zero for ZRC 2.0 profile */
1639 else if (is_zrc20
|| !is_cmd_frame
)
1641 col_set_str(pinfo
->cinfo
, COL_INFO
, val_to_str_const(cmd_id
, rf4ce_zrc20_fcf_cmd_id_vals
, "Unknown Command"));
1642 dissect_rf4ce_profile_zrc20_cmd(tvb
, profile_cmd_tree
, offset
, cmd_id
);
1646 static void dissect_rf4ce_profile_common_cmd(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, unsigned *offset
, uint8_t cmd_id
, bool is_zrc20
)
1650 case RF4CE_PROFILE_CMD_GENERIC_RESPONSE
:
1651 dissect_rf4ce_profile_cmd_generic_resp(tvb
, tree
, offset
);
1654 case RF4CE_PROFILE_CMD_CONFIGURATION_COMPLETE
:
1655 dissect_rf4ce_profile_cmd_configuration_complete(tvb
, tree
, offset
);
1658 case RF4CE_PROFILE_CMD_HEARTBEAT
:
1659 dissect_rf4ce_profile_cmd_heartbeat(tvb
, tree
, offset
);
1662 case RF4CE_PROFILE_CMD_GET_ATTRIBUTES
:
1663 dissect_rf4ce_profile_cmd_get_attrs(tvb
, tree
, offset
, is_zrc20
);
1666 case RF4CE_PROFILE_CMD_GET_ATTRIBUTES_RESPONSE
:
1667 dissect_rf4ce_profile_cmd_get_attrs_resp(tvb
, tree
, offset
, is_zrc20
);
1670 case RF4CE_PROFILE_CMD_PUSH_ATTRIBUTES
:
1671 dissect_rf4ce_profile_cmd_push_attrs(tvb
, tree
, offset
, is_zrc20
);
1674 case RF4CE_PROFILE_CMD_SET_ATTRIBUTES
:
1675 dissect_rf4ce_profile_cmd_set_attrs(tvb
, tree
, offset
, is_zrc20
);
1678 case RF4CE_PROFILE_CMD_PULL_ATTRIBUTES
:
1679 dissect_rf4ce_profile_cmd_pull_attrs(tvb
, tree
, offset
, is_zrc20
);
1682 case RF4CE_PROFILE_CMD_PULL_ATTRIBUTES_RESPONSE
:
1683 dissect_rf4ce_profile_cmd_pull_attrs_resp(tvb
, tree
, offset
, is_zrc20
);
1686 case RF4CE_PROFILE_CMD_CHECK_VALIDATION
:
1687 dissect_rf4ce_profile_cmd_check_validation(tvb
, tree
, offset
);
1690 case RF4CE_PROFILE_CMD_CLIENT_NOTIFICATION
:
1691 dissect_rf4ce_profile_cmd_client_notification(tvb
, tree
, offset
);
1694 case RF4CE_PROFILE_CMD_KEY_EXCHANGE
:
1695 dissect_rf4ce_profile_cmd_key_exchange(tvb
, pinfo
, tree
, offset
);
1700 static void dissect_rf4ce_profile_cmd_generic_resp(tvbuff_t
*tvb
, proto_tree
*tree
, unsigned *offset
)
1702 proto_tree_add_item(tree
, hf_rf4ce_profile_cmd_generic_resp_status
, tvb
, *offset
, 1, ENC_LITTLE_ENDIAN
);
1706 static void dissect_rf4ce_profile_cmd_configuration_complete(tvbuff_t
*tvb
, proto_tree
*tree
, unsigned *offset
)
1708 proto_tree_add_item(tree
, hf_rf4ce_profile_cmd_configuration_complete_status
, tvb
, *offset
, 1, ENC_LITTLE_ENDIAN
);
1712 static void dissect_rf4ce_profile_cmd_heartbeat(tvbuff_t
*tvb
, proto_tree
*tree
, unsigned *offset
)
1714 proto_tree_add_item(tree
, hf_rf4ce_profile_cmd_heartbeat_trigger
, tvb
, *offset
, 1, ENC_LITTLE_ENDIAN
);
1718 static bool dissect_rf4ce_profile_gdp_attrs(tvbuff_t
*tvb
, proto_tree
*tree
, unsigned *offset
, uint8_t attr_id
)
1720 bool is_parsed
= true;
1722 if (attr_id
== RF4CE_GDP_ATTR_IDENTIFICATION_CAPABILITIES
)
1724 static int *const ident_cap_bits
[] = {
1725 &hf_rf4ce_profile_gdp_ident_cap_reserved
,
1726 &hf_rf4ce_profile_gdp_ident_cap_support_flash_light
,
1727 &hf_rf4ce_profile_gdp_ident_cap_support_make_short_sound
,
1728 &hf_rf4ce_profile_gdp_ident_cap_support_vibrate
,
1729 &hf_rf4ce_profile_gdp_ident_cap_reserved2
,
1732 proto_tree_add_bitmask(tree
, tvb
, *offset
, hf_rf4ce_profile_gdp_ident_cap
, ett_rf4ce_profile_zrc20_ident_cap
, ident_cap_bits
, ENC_LITTLE_ENDIAN
);
1735 else if (attr_id
== RF4CE_GDP_ATTR_POLL_CONSTRAINTS
)
1738 uint8_t methods_num
;
1740 static int *const polling_trig_cap_bits
[] = {
1741 &hf_rf4ce_profile_gdp_poll_constraints_polling_rec_polling_trig_cap_tbased
,
1742 &hf_rf4ce_profile_gdp_poll_constraints_polling_rec_polling_trig_cap_on_k_press
,
1743 &hf_rf4ce_profile_gdp_poll_constraints_polling_rec_polling_trig_cap_on_pick_up
,
1744 &hf_rf4ce_profile_gdp_poll_constraints_polling_rec_polling_trig_cap_on_reset
,
1745 &hf_rf4ce_profile_gdp_poll_constraints_polling_rec_polling_trig_cap_on_micro_act
,
1746 &hf_rf4ce_profile_gdp_poll_constraints_polling_rec_polling_trig_cap_on_user_act
,
1747 &hf_rf4ce_profile_gdp_poll_constraints_polling_rec_polling_trig_cap_reserved
,
1750 proto_tree_add_item(tree
, hf_rf4ce_profile_gdp_poll_constraints_methods_num
, tvb
, *offset
, 1, ENC_LITTLE_ENDIAN
);
1751 methods_num
= tvb_get_uint8(tvb
, *offset
);
1754 for (methods_index
= 1; methods_index
<= methods_num
; methods_index
++)
1756 char subtree_name
[40];
1757 proto_tree
*record_subtree
;
1759 snprintf(subtree_name
, sizeof(subtree_name
), "Polling Constraint Record %d:", methods_index
);
1760 record_subtree
= proto_tree_add_subtree(tree
, tvb
, *offset
, tvb_captured_length(tvb
) - *offset
, ett_rf4ce_profile_gdp_poll_constraints_polling_rec
, NULL
, subtree_name
);
1762 proto_tree_add_item(record_subtree
, hf_rf4ce_profile_gdp_poll_constraints_polling_rec_method_id
, tvb
, *offset
, 1, ENC_LITTLE_ENDIAN
);
1765 proto_tree_add_bitmask(record_subtree
, tvb
, *offset
, hf_rf4ce_profile_gdp_poll_constraints_polling_rec_polling_trig_cap
, ett_rf4ce_profile_gdp_poll_constraints_polling_rec_polling_trig_cap
, polling_trig_cap_bits
, ENC_LITTLE_ENDIAN
);
1768 proto_tree_add_item(record_subtree
, hf_rf4ce_profile_gdp_poll_constraints_polling_rec_min_polling_key_press_cnt
, tvb
, *offset
, 1, ENC_LITTLE_ENDIAN
);
1771 proto_tree_add_item(record_subtree
, hf_rf4ce_profile_gdp_poll_constraints_polling_rec_max_polling_key_press_cnt
, tvb
, *offset
, 1, ENC_LITTLE_ENDIAN
);
1774 proto_tree_add_item(record_subtree
, hf_rf4ce_profile_gdp_poll_constraints_polling_rec_min_polling_time_interval
, tvb
, *offset
, 4, ENC_LITTLE_ENDIAN
);
1777 proto_tree_add_item(record_subtree
, hf_rf4ce_profile_gdp_poll_constraints_polling_rec_max_polling_time_interval
, tvb
, *offset
, 4, ENC_LITTLE_ENDIAN
);
1781 else if (attr_id
== RF4CE_GDP_ATTR_POLL_CONFIGURATION
)
1783 proto_tree_add_item(tree
, hf_rf4ce_profile_gdp_poll_configuration_method_id
, tvb
, *offset
, 1, ENC_LITTLE_ENDIAN
);
1786 static int *const polling_trig_conf_bits
[] = {
1787 &hf_rf4ce_profile_gdp_poll_configuration_polling_trig_conf_tbased
,
1788 &hf_rf4ce_profile_gdp_poll_configuration_polling_trig_conf_on_k_press
,
1789 &hf_rf4ce_profile_gdp_poll_configuration_polling_trig_conf_on_pick_up
,
1790 &hf_rf4ce_profile_gdp_poll_configuration_polling_trig_conf_on_reset
,
1791 &hf_rf4ce_profile_gdp_poll_configuration_polling_trig_conf_on_micro_act
,
1792 &hf_rf4ce_profile_gdp_poll_configuration_polling_trig_conf_on_user_act
,
1793 &hf_rf4ce_profile_gdp_poll_configuration_polling_trig_conf_reserved
,
1796 proto_tree_add_bitmask_len(tree
, tvb
, *offset
, 2, hf_rf4ce_profile_gdp_poll_configuration_polling_trig_conf
, ett_rf4ce_profile_gdp_poll_configuration_polling_trig_conf
, polling_trig_conf_bits
, NULL
, ENC_LITTLE_ENDIAN
);
1799 proto_tree_add_item(tree
, hf_rf4ce_profile_gdp_poll_configuration_polling_key_press_cnt
, tvb
, *offset
, 1, ENC_LITTLE_ENDIAN
);
1802 proto_tree_add_item(tree
, hf_rf4ce_profile_gdp_poll_configuration_polling_time_interval
, tvb
, *offset
, 4, ENC_LITTLE_ENDIAN
);
1805 proto_tree_add_item(tree
, hf_rf4ce_profile_gdp_poll_configuration_polling_timeout
, tvb
, *offset
, 1, ENC_LITTLE_ENDIAN
);
1809 else if (attr_id
== RF4CE_GDP_ATTR_GDP_PROFILE_CAPABILITIES
)
1811 /* TODO: Implement RF4CE_GDP_ATTR_GDP_CAPABILITIES parsing */
1813 else if (attr_id
== RF4CE_GDP_ATTR_POWER_STATUS
)
1815 /* TODO: Implement RF4CE_GDP_ATTR_POWER_STATUS parsing */
1826 static bool dissect_rf4ce_profile_zrc20_attrs(tvbuff_t
*tvb
, proto_tree
*tree
, unsigned *offset
, uint8_t attr_id
, uint8_t attr_length
)
1828 bool is_parsed
= true;
1830 if (attr_id
== RF4CE_ZRC20_ATTR_MAPPABLE_ACTIONS
)
1832 proto_tree
*entry_subtree
;
1833 char entry_subtree_name
[11];
1834 unsigned entries_num
= attr_length
/ 3;
1836 for (unsigned i
= 1; i
<= entries_num
; i
++)
1838 snprintf(entry_subtree_name
, sizeof(entry_subtree_name
), "Entry %d:", i
);
1839 entry_subtree
= proto_tree_add_subtree(tree
, tvb
, *offset
, tvb_captured_length(tvb
) - *offset
, ett_rf4ce_profile_zrc20_mappable_actions_entry
, NULL
, entry_subtree_name
);
1841 proto_tree_add_item(entry_subtree
, hf_rf4ce_profile_zrc20_mappable_actions_action_dev_type
, tvb
, *offset
, 1, ENC_LITTLE_ENDIAN
);
1844 proto_tree_add_item(entry_subtree
, hf_rf4ce_profile_zrc20_mappable_actions_action_bank
, tvb
, *offset
, 1, ENC_LITTLE_ENDIAN
);
1847 proto_tree_add_item(entry_subtree
, hf_rf4ce_profile_zrc20_mappable_actions_action_code
, tvb
, *offset
, 1, ENC_LITTLE_ENDIAN
);
1851 else if (attr_id
== RF4CE_ZRC20_ATTR_ACTION_MAPPINGS
)
1853 uint8_t action_mapping_flags
= tvb_get_uint8(tvb
, *offset
);
1854 bool rf_specified
= (action_mapping_flags
& RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_MAPPING_FLAGS_RF_SPECIFIED_MASK
) != 0;
1855 bool ir_specified
= (action_mapping_flags
& RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_MAPPING_FLAGS_IR_SPECIFIED_MASK
) != 0;
1856 bool use_default
= (action_mapping_flags
& RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_MAPPING_FLAGS_USE_DEFAULT_MASK
) != 0;
1858 static int *const action_mapping_flags_bits
[] = {
1859 &hf_rf4ce_profile_zrc20_action_mappings_mapping_flags_rf_specified
,
1860 &hf_rf4ce_profile_zrc20_action_mappings_mapping_flags_ir_specified
,
1861 &hf_rf4ce_profile_zrc20_action_mappings_mapping_flags_rf_descr_first
,
1862 &hf_rf4ce_profile_zrc20_action_mappings_mapping_flags_reserved
,
1863 &hf_rf4ce_profile_zrc20_action_mappings_mapping_flags_use_default
,
1864 &hf_rf4ce_profile_zrc20_action_mappings_mapping_flags_permanent
,
1867 proto_tree_add_bitmask(tree
, tvb
, *offset
, hf_rf4ce_profile_zrc20_action_mappings_mapping_flags
, ett_rf4ce_profile_zrc20_action_mappings_flags
, action_mapping_flags_bits
, ENC_LITTLE_ENDIAN
);
1870 if (rf_specified
&& !use_default
)
1872 proto_tree
*rf_desc_subtree
= proto_tree_add_subtree(tree
, tvb
, *offset
, tvb_captured_length(tvb
) - *offset
, ett_rf4ce_profile_zrc20_action_mappings_rf_descr
, NULL
, "RF Descriptor");
1873 uint8_t action_data_len
;
1875 static int *const rf_conf_bits
[] = {
1876 &hf_rf4ce_profile_zrc20_action_mappings_rf_descr_rf_conf_min_num_of_trans
,
1877 &hf_rf4ce_profile_zrc20_action_mappings_rf_descr_rf_conf_keep_trans_until_key_release
,
1878 &hf_rf4ce_profile_zrc20_action_mappings_rf_descr_rf_conf_short_rf_retry
,
1879 &hf_rf4ce_profile_zrc20_action_mappings_rf_descr_rf_conf_atomic_action
,
1880 &hf_rf4ce_profile_zrc20_action_mappings_rf_descr_rf_conf_reserved
,
1883 proto_tree_add_bitmask(rf_desc_subtree
, tvb
, *offset
, hf_rf4ce_profile_zrc20_action_mappings_rf_descr_rf_conf
, ett_rf4ce_profile_zrc20_action_mappings_rf_descr_rf_conf
, rf_conf_bits
, ENC_LITTLE_ENDIAN
);
1886 static int *const tx_opts_bits
[] = {
1887 &hf_rf4ce_profile_zrc20_action_mappings_rf_descr_tx_opts_trans_mode
,
1888 &hf_rf4ce_profile_zrc20_action_mappings_rf_descr_tx_opts_dst_addr_mode
,
1889 &hf_rf4ce_profile_zrc20_action_mappings_rf_descr_tx_opts_ack_mode
,
1890 &hf_rf4ce_profile_zrc20_action_mappings_rf_descr_tx_opts_sec_mode
,
1891 &hf_rf4ce_profile_zrc20_action_mappings_rf_descr_tx_opts_ch_ag_mode
,
1892 &hf_rf4ce_profile_zrc20_action_mappings_rf_descr_tx_opts_ch_norm_mode
,
1893 &hf_rf4ce_profile_zrc20_action_mappings_rf_descr_tx_opts_payload_mode
,
1894 &hf_rf4ce_profile_zrc20_action_mappings_rf_descr_tx_opts_reserved
,
1897 proto_tree_add_bitmask(rf_desc_subtree
, tvb
, *offset
, hf_rf4ce_profile_zrc20_action_mappings_rf_descr_tx_opts
, ett_rf4ce_profile_zrc20_action_mappings_rf_descr_tx_opts
, tx_opts_bits
, ENC_LITTLE_ENDIAN
);
1900 proto_tree_add_item(rf_desc_subtree
, hf_rf4ce_profile_zrc20_action_mappings_rf_descr_action_data_len
, tvb
, *offset
, 1, ENC_LITTLE_ENDIAN
);
1901 action_data_len
= tvb_get_uint8(tvb
, *offset
);
1904 if (action_data_len
> 0)
1906 dissect_rf4ce_profile_zrc20_action_data(tvb
, rf_desc_subtree
, offset
, false /* do not dissect the Action Control field */);
1910 if (ir_specified
&& !use_default
)
1912 proto_tree
*ir_desc_subtree
= proto_tree_add_subtree(tree
, tvb
, *offset
, tvb_captured_length(tvb
) - *offset
, ett_rf4ce_profile_zrc20_action_mappings_ir_descr
, NULL
, "IR Descriptor");
1914 bool vendor_specific
;
1915 uint8_t ir_code_len
;
1917 static int *const ir_conf_bits
[] = {
1918 &hf_rf4ce_profile_zrc20_action_mappings_ir_descr_ir_conf_vendor_specific
,
1919 &hf_rf4ce_profile_zrc20_action_mappings_ir_descr_ir_conf_reserved
,
1922 proto_tree_add_bitmask(ir_desc_subtree
, tvb
, *offset
, hf_rf4ce_profile_zrc20_action_mappings_ir_descr_ir_conf
, ett_rf4ce_profile_zrc20_action_mappings_ir_descr_ir_conf
, ir_conf_bits
, ENC_LITTLE_ENDIAN
);
1923 ir_config
= tvb_get_uint8(tvb
, *offset
);
1926 vendor_specific
= (ir_config
& RF4CE_PROFILE_ZRC20_ACTION_MAPPINGS_IR_DESCR_IR_CONF_VENDOR_SPECIFIC_MASK
) != 0;
1927 if (vendor_specific
)
1929 proto_tree_add_item(ir_desc_subtree
, hf_rf4ce_profile_zrc20_action_mappings_ir_descr_ir_vendor_id
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
);
1933 proto_tree_add_item(ir_desc_subtree
, hf_rf4ce_profile_zrc20_action_mappings_ir_descr_ir_code_len
, tvb
, *offset
, 1, ENC_NA
);
1934 ir_code_len
= tvb_get_uint8(tvb
, *offset
);
1937 if (ir_code_len
> 0)
1939 proto_tree_add_item(ir_desc_subtree
, hf_rf4ce_profile_zrc20_action_mappings_ir_descr_ir_code
, tvb
, *offset
, ir_code_len
, ENC_NA
);
1940 *offset
+= ir_code_len
;
1944 else if (attr_id
== RF4CE_ZRC20_ATTR_IRDB_VENDOR_SUPPORT
)
1946 int remaining_length
= tvb_reported_length_remaining(tvb
, *offset
);
1947 while (remaining_length
> 0)
1949 proto_tree_add_item(tree
, hf_rf4ce_profile_zrc20_irdb_vendor_support_vendor_id
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
);
1951 remaining_length
-= 2;
1962 static void dissect_rf4ce_profile_attrs(tvbuff_t
*tvb
, proto_tree
*tree
, unsigned *offset
, uint8_t dissection_mask
, bool is_zrc20
)
1964 int attr_counter
= 1;
1965 uint8_t attr_id
= 0xff;
1966 uint8_t attr_status
= RF4CE_PROFILE_ATTR_STATUS_ATTRIBUTE_SUCCESSFULLY_READ_AND_INCLUDED
;
1967 uint8_t attr_length
= 0xff;
1968 proto_tree
*attrs_tree
= proto_tree_add_subtree(tree
, tvb
, *offset
, tvb_captured_length(tvb
) - *offset
, ett_rf4ce_profile_attrs
, NULL
, "Attributes List");
1969 unsigned prev_offset
= *offset
;
1971 while (tvb_captured_length(tvb
) - *offset
)
1973 char attr_subtree_name
[14];
1974 proto_tree
*attrs_subtree
;
1976 snprintf(attr_subtree_name
, sizeof(attr_subtree_name
), "Attribute %d:", attr_counter
);
1979 attrs_subtree
= proto_tree_add_subtree(attrs_tree
, tvb
, *offset
, tvb_captured_length(tvb
) - *offset
, ett_rf4ce_profile_attrs_sub
, NULL
, attr_subtree_name
);
1981 if (dissection_mask
& RF4CE_PROFILE_ATTR_DISSECT_ATTR_ID_MASK
)
1983 int hf_temp
= is_zrc20
? hf_rf4ce_profile_zrc20_attr_id
: hf_rf4ce_profile_gdp_attr_id
;
1985 proto_tree_add_item(attrs_subtree
, hf_temp
, tvb
, *offset
, 1, ENC_LITTLE_ENDIAN
);
1986 attr_id
= tvb_get_uint8(tvb
, *offset
);
1990 if (dissection_mask
& RF4CE_PROFILE_ATTR_DISSECT_ENTRY_ID_MASK
)
1992 bool is_attr_arrayed
=
1993 is_zrc20
? rf4ce_profile_is_zrc20_attr_arrayed(attr_id
) : rf4ce_profile_is_gdp_attr_arrayed(attr_id
);
1994 if (is_attr_arrayed
)
1996 proto_tree_add_item(attrs_subtree
, hf_rf4ce_profile_attr_entry_id
, tvb
, *offset
, 2, ENC_NA
);
2001 if (dissection_mask
& RF4CE_PROFILE_ATTR_DISSECT_ATTR_STATUS_MASK
)
2003 proto_tree_add_item(attrs_subtree
, hf_rf4ce_profile_attr_status
, tvb
, *offset
, 1, ENC_LITTLE_ENDIAN
);
2004 attr_status
= tvb_get_uint8(tvb
, *offset
);
2008 if (attr_status
== RF4CE_PROFILE_ATTR_STATUS_ATTRIBUTE_SUCCESSFULLY_READ_AND_INCLUDED
&& dissection_mask
& RF4CE_PROFILE_ATTR_DISSECT_ATTR_LENGTH_MASK
)
2010 proto_tree_add_item(attrs_subtree
, hf_rf4ce_profile_attr_length
, tvb
, *offset
, 1, ENC_LITTLE_ENDIAN
);
2011 attr_length
= tvb_get_uint8(tvb
, *offset
);
2015 if (attr_status
== RF4CE_PROFILE_ATTR_STATUS_ATTRIBUTE_SUCCESSFULLY_READ_AND_INCLUDED
&& dissection_mask
& RF4CE_PROFILE_ATTR_DISSECT_ATTR_VALUE_MASK
&& attr_length
!= 0xff && attr_length
!= 0x00)
2021 is_parsed
= dissect_rf4ce_profile_zrc20_attrs(tvb
, attrs_subtree
, offset
, attr_id
, attr_length
);
2025 is_parsed
= dissect_rf4ce_profile_gdp_attrs(tvb
, attrs_subtree
, offset
, attr_id
);
2030 proto_tree_add_item(attrs_subtree
, hf_rf4ce_profile_attr_value
, tvb
, *offset
, attr_length
, ENC_NA
);
2031 *offset
+= attr_length
;
2035 if (dissection_mask
== RF4CE_PROFILE_ATTR_DISSECT_NOT_SET
|| prev_offset
== *offset
)
2037 attr_length
= tvb_captured_length(tvb
) - *offset
;
2038 proto_tree_add_item(attrs_subtree
, hf_rf4ce_profile_attr_value
, tvb
, *offset
, attr_length
, ENC_NA
);
2039 *offset
+= attr_length
;
2042 prev_offset
= *offset
;
2046 static void dissect_rf4ce_profile_cmd_get_attrs(tvbuff_t
*tvb
, proto_tree
*tree
, unsigned *offset
, bool is_zrc20
)
2048 dissect_rf4ce_profile_attrs(tvb
, tree
, offset
, RF4CE_PROFILE_ATTR_DISSECT_GET_ATTRS_MASK
, is_zrc20
);
2051 static void dissect_rf4ce_profile_cmd_get_attrs_resp(tvbuff_t
*tvb
, proto_tree
*tree
, unsigned *offset
, bool is_zrc20
)
2053 dissect_rf4ce_profile_attrs(tvb
, tree
, offset
, RF4CE_PROFILE_ATTR_DISSECT_GET_ATTRS_RESP_MASK
, is_zrc20
);
2056 static void dissect_rf4ce_profile_cmd_push_attrs(tvbuff_t
*tvb
, proto_tree
*tree
, unsigned *offset
, bool is_zrc20
)
2058 dissect_rf4ce_profile_attrs(tvb
, tree
, offset
, RF4CE_PROFILE_ATTR_DISSECT_PUSH_ATTRS_MASK
, is_zrc20
);
2061 static void dissect_rf4ce_profile_cmd_set_attrs(tvbuff_t
*tvb
, proto_tree
*tree
, unsigned *offset
, bool is_zrc20
)
2063 dissect_rf4ce_profile_attrs(tvb
, tree
, offset
, RF4CE_PROFILE_ATTR_DISSECT_SET_ATTRS_MASK
, is_zrc20
);
2066 static void dissect_rf4ce_profile_cmd_pull_attrs(tvbuff_t
*tvb
, proto_tree
*tree
, unsigned *offset
, bool is_zrc20
)
2068 dissect_rf4ce_profile_attrs(tvb
, tree
, offset
, RF4CE_PROFILE_ATTR_DISSECT_PULL_ATTRS_MASK
, is_zrc20
);
2071 static void dissect_rf4ce_profile_cmd_pull_attrs_resp(tvbuff_t
*tvb
, proto_tree
*tree
, unsigned *offset
, bool is_zrc20
)
2073 dissect_rf4ce_profile_attrs(tvb
, tree
, offset
, RF4CE_PROFILE_ATTR_DISSECT_PULL_ATTRS_RESP_MASK
, is_zrc20
);
2076 static bool rf4ce_profile_is_gdp_attr_arrayed(uint8_t attr_id
)
2078 /* other values are scalar */
2079 return ((attr_id
>= RF4CE_GDP_ATTR_ARRAYED1_RESERVED_MIN
&& attr_id
<= RF4CE_GDP_ATTR_ARRAYED1_RESERVED_MAX
) || (attr_id
>= RF4CE_GDP_ATTR_ARRAYED2_RESERVED_MIN
&& attr_id
<= RF4CE_GDP_ATTR_ARRAYED2_RESERVED_MAX
));
2082 static bool rf4ce_profile_is_zrc20_attr_arrayed(uint8_t attr_id
)
2084 /* other values are scalar */
2085 return (attr_id
== RF4CE_ZRC20_ATTR_ACTION_CODES_SUPPORTED_RX
|| attr_id
== RF4CE_ZRC20_ATTR_ACTION_CODES_SUPPORTED_TX
|| attr_id
== RF4CE_ZRC20_ATTR_MAPPABLE_ACTIONS
|| attr_id
== RF4CE_ZRC20_ATTR_ACTION_MAPPINGS
|| attr_id
== RF4CE_ZRC20_ATTR_HOME_AUTOMATION
|| attr_id
== RF4CE_ZRC20_ATTR_HOME_AUTOMATION_SUPPORTED
|| (attr_id
>= RF4CE_ZRC20_ATTR_ARRAYED1_MIN
&& attr_id
<= RF4CE_ZRC20_ATTR_ARRAYED2_MAX
));
2088 static void dissect_rf4ce_profile_cmd_check_validation(tvbuff_t
*tvb
, proto_tree
*tree
, unsigned *offset
)
2090 uint8_t sub_type
= tvb_get_uint8(tvb
, *offset
);
2091 proto_tree_add_item(tree
, hf_rf4ce_profile_cmd_check_validation_sub_type
, tvb
, *offset
, 1, ENC_LITTLE_ENDIAN
);
2094 if (sub_type
== RF4CE_PROFILE_CMD_CHECK_VALIDATION_SUB_TYPE_REQ
)
2096 proto_tree_add_item(tree
, hf_rf4ce_profile_cmd_check_validation_control
, tvb
, *offset
, 1, ENC_LITTLE_ENDIAN
);
2099 else if (sub_type
== RF4CE_PROFILE_CMD_CHECK_VALIDATION_SUB_TYPE_RSP
)
2101 proto_tree_add_item(tree
, hf_rf4ce_profile_cmd_check_validation_status
, tvb
, *offset
, 1, ENC_LITTLE_ENDIAN
);
2106 static void dissect_rf4ce_profile_cmd_client_notification(tvbuff_t
*tvb
, proto_tree
*tree
, unsigned *offset
)
2108 uint8_t sub_type
= tvb_get_uint8(tvb
, *offset
);
2110 proto_tree_add_item(tree
, hf_rf4ce_profile_cmd_client_notification_sub_type
, tvb
, *offset
, 1, ENC_LITTLE_ENDIAN
);
2113 if (sub_type
== RF4CE_PROFILE_CMD_CL_NOTIF_SUB_TYPE_IDENTIFY
)
2115 static int *const identify_bits
[] = {
2116 &hf_rf4ce_profile_cmd_client_notification_identify_flags_stop_on_action
,
2117 &hf_rf4ce_profile_cmd_client_notification_identify_flags_flash_light
,
2118 &hf_rf4ce_profile_cmd_client_notification_identify_flags_make_sound
,
2119 &hf_rf4ce_profile_cmd_client_notification_identify_flags_vibrate
,
2120 &hf_rf4ce_profile_cmd_client_notification_identify_flags_reserved
,
2123 proto_tree_add_bitmask(tree
, tvb
, *offset
, hf_rf4ce_profile_cmd_client_notification_identify_flags
, ett_rf4ce_profile_cmd_frame
, identify_bits
, ENC_LITTLE_ENDIAN
);
2126 proto_tree_add_item(tree
, hf_rf4ce_profile_cmd_client_notification_identify_time
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
);
2129 else if (sub_type
== RF4CE_PROFILE_CMD_CL_NOTIF_SUB_TYPE_REQ_HOME_AUTOMATION_PULL
)
2131 /* TODO: implement payload parsing */
2133 else if (sub_type
== RF4CE_PROFILE_CMD_CL_NOTIF_SUB_TYPE_REQ_SELECTIVE_ACTION_MAPPING_UPDATE
)
2135 /* TODO: implement payload parsing */
2137 else if (sub_type
== RF4CE_PROFILE_CMD_CL_NOTIF_SUB_TYPE_REQ_POLL_NEGOTIATION
|| sub_type
== RF4CE_PROFILE_CMD_CL_NOTIF_SUB_TYPE_REQ_ACTION_MAPPING_NEGOTIATION
)
2143 static void dissect_rf4ce_profile_cmd_key_exchange(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, unsigned *offset
)
2145 uint8_t sub_type
= tvb_get_uint8(tvb
, *offset
);
2147 proto_tree_add_item(tree
, hf_rf4ce_profile_cmd_key_exchange_sub_type
, tvb
, *offset
, 1, ENC_LITTLE_ENDIAN
);
2150 if (sub_type
== RF4CE_PROFILE_CMD_KEY_EXCHANGE_SUB_TYPE_CHALLENGE
|| sub_type
== RF4CE_PROFILE_CMD_KEY_EXCHANGE_SUB_TYPE_CHALLENGE_RSP
)
2152 static int *const key_exchange_bits
[] = {
2153 &hf_rf4ce_profile_cmd_key_exchange_flags_default_secret
,
2154 &hf_rf4ce_profile_cmd_key_exchange_flags_initiator_vendor_specific_secret
,
2155 &hf_rf4ce_profile_cmd_key_exchange_flags_responder_vendor_specific_secret
,
2156 &hf_rf4ce_profile_cmd_key_exchange_flags_reserved
,
2157 &hf_rf4ce_profile_cmd_key_exchange_flags_vendor_specific_parameter
,
2160 proto_tree_add_bitmask(tree
, tvb
, *offset
, hf_rf4ce_profile_cmd_key_exchange_flags
, ett_rf4ce_profile_cmd_frame
, key_exchange_bits
, ENC_LITTLE_ENDIAN
);
2164 if (sub_type
== RF4CE_PROFILE_CMD_KEY_EXCHANGE_SUB_TYPE_CHALLENGE
)
2166 uint8_t rand_a
[RF4CE_PROFILE_CMD_KEY_EXCHANGE_RAND_A_LENGTH
];
2167 uint8_t target_addr
[RF4CE_IEEE_ADDR_LEN
];
2169 proto_tree_add_item(tree
, hf_rf4ce_profile_cmd_key_exchange_rand_a
, tvb
, *offset
, RF4CE_PROFILE_CMD_KEY_EXCHANGE_RAND_A_LENGTH
, ENC_NA
);
2170 tvb_memcpy(tvb
, (void *)rand_a
, *offset
, RF4CE_PROFILE_CMD_KEY_EXCHANGE_RAND_A_LENGTH
);
2171 *offset
+= RF4CE_PROFILE_CMD_KEY_EXCHANGE_RAND_A_LENGTH
;
2173 if (!key_exchange_context_is_procedure_started())
2175 if (rf4ce_addr_table_get_ieee_addr(target_addr
, pinfo
, true))
2177 key_exchange_context_init();
2179 key_exchange_context_set_rand_a(rand_a
);
2180 key_exchange_context_set_mac_a(target_addr
);
2182 key_exchange_context_start_procedure();
2187 if (sub_type
== RF4CE_PROFILE_CMD_KEY_EXCHANGE_SUB_TYPE_CHALLENGE_RSP
)
2189 uint8_t rand_b
[RF4CE_PROFILE_CMD_KEY_EXCHANGE_RAND_A_LENGTH
];
2190 uint32_t tag_b_pack
;
2192 uint8_t controller_addr
[RF4CE_IEEE_ADDR_LEN
];
2194 proto_tree_add_item(tree
, hf_rf4ce_profile_cmd_key_exchange_rand_b
, tvb
, *offset
, RF4CE_PROFILE_CMD_KEY_EXCHANGE_RAND_B_LENGTH
, ENC_NA
);
2195 tvb_memcpy(tvb
, (void *)rand_b
, *offset
, RF4CE_PROFILE_CMD_KEY_EXCHANGE_RAND_A_LENGTH
);
2196 *offset
+= RF4CE_PROFILE_CMD_KEY_EXCHANGE_RAND_B_LENGTH
;
2198 proto_tree_add_item(tree
, hf_rf4ce_profile_cmd_key_exchange_tag_b
, tvb
, *offset
, RF4CE_PROFILE_CMD_KEY_EXCHANGE_TAG_B_LENGTH
, ENC_NA
);
2199 tag_b_pack
= tvb_get_uint32(tvb
, *offset
, ENC_LITTLE_ENDIAN
);
2200 *offset
+= RF4CE_PROFILE_CMD_KEY_EXCHANGE_TAG_B_LENGTH
;
2202 if (key_exchange_context_is_procedure_started())
2204 if (rf4ce_addr_table_get_ieee_addr(controller_addr
, pinfo
, true))
2206 key_exchange_context_set_rand_b(rand_b
);
2207 key_exchange_context_set_mac_b(controller_addr
);
2209 key_exchange_calc_key(tag_b_pack
);
2212 key_exchange_context_stop_procedure();
2216 if (sub_type
== RF4CE_PROFILE_CMD_KEY_EXCHANGE_SUB_TYPE_RSP
)
2218 proto_tree_add_item(tree
, hf_rf4ce_profile_cmd_key_exchange_tag_a
, tvb
, *offset
, RF4CE_PROFILE_CMD_KEY_EXCHANGE_TAG_A_LENGTH
, ENC_NA
);
2219 *offset
+= RF4CE_PROFILE_CMD_KEY_EXCHANGE_TAG_A_LENGTH
;
2223 static void dissect_rf4ce_profile_zrc10_cmd(tvbuff_t
*tvb
, proto_tree
*tree
, unsigned *offset
, uint8_t cmd_id
)
2227 case RF4CE_ZRC10_FCF_CMD_ID_USER_CONTROL_PRESSED
:
2228 dissect_rf4ce_profile_zrc10_cmd_user_control_common(tvb
, tree
, offset
, true);
2231 case RF4CE_ZRC10_FCF_CMD_ID_USER_CONTROL_REPEATED
:
2232 dissect_rf4ce_profile_zrc10_cmd_user_control_common(tvb
, tree
, offset
, true);
2235 case RF4CE_ZRC10_FCF_CMD_ID_USER_CONTROL_RELEASED
:
2236 dissect_rf4ce_profile_zrc10_cmd_user_control_common(tvb
, tree
, offset
, false);
2239 case RF4CE_ZRC10_FCF_CMD_ID_USER_CONTROL_CMD_DISCOVERY_REQ
:
2240 dissect_rf4ce_profile_zrc10_cmd_discovery_req(tvb
, tree
, offset
);
2243 case RF4CE_ZRC10_FCF_CMD_ID_USER_CONTROL_CMD_DISCOVERY_RSP
:
2244 dissect_rf4ce_profile_zrc10_cmd_discovery_rsp(tvb
, tree
, offset
);
2249 static void dissect_rf4ce_profile_zrc10_cmd_user_control_common(tvbuff_t
*tvb
, proto_tree
*tree
, unsigned *offset
, bool parse_payload
)
2251 proto_tree_add_item(tree
, hf_rf4ce_zrc10_cmd_common_rc_command_code
, tvb
, *offset
, 1, ENC_NA
);
2256 int remaining_length
= tvb_reported_length_remaining(tvb
, *offset
);
2257 if (remaining_length
> 0)
2259 proto_tree_add_item(tree
, hf_rf4ce_zrc10_cmd_common_rc_command_payload
, tvb
, *offset
, remaining_length
, ENC_NA
);
2260 *offset
+= remaining_length
;
2265 static void dissect_rf4ce_profile_zrc10_cmd_discovery_req(tvbuff_t
*tvb
, proto_tree
*tree
, unsigned *offset
)
2267 proto_tree_add_item(tree
, hf_rf4ce_zrc10_cmd_disc_reserved
, tvb
, *offset
, 1, ENC_LITTLE_ENDIAN
);
2271 static void dissect_rf4ce_profile_zrc10_cmd_discovery_rsp(tvbuff_t
*tvb
, proto_tree
*tree
, unsigned *offset
)
2273 int remaining_length
= tvb_reported_length_remaining(tvb
, *offset
);
2275 if (remaining_length
> 0)
2277 proto_tree_add_item(tree
, hf_rf4ce_zrc10_cmd_disc_rsp_supported_commands
, tvb
, *offset
, remaining_length
, ENC_NA
);
2278 *offset
+= remaining_length
;
2282 static void dissect_rf4ce_profile_zrc20_cmd(tvbuff_t
*tvb
, proto_tree
*tree
, unsigned *offset
, uint8_t cmd_id
)
2284 if (cmd_id
== RF4CE_ZRC20_CMD_ACTIONS
)
2286 int remaining_length
= tvb_reported_length_remaining(tvb
, *offset
);
2287 proto_tree
*action_records_tree
;
2289 if (remaining_length
> 0)
2291 action_records_tree
= proto_tree_add_subtree(tree
, tvb
, *offset
, remaining_length
, ett_rf4ce_profile_action_records
, NULL
, "Action Records List");
2293 while (remaining_length
> 0)
2295 dissect_rf4ce_profile_zrc20_action_data(tvb
, action_records_tree
, offset
, true /* dissect the Action Control field */);
2296 remaining_length
= tvb_reported_length_remaining(tvb
, *offset
);
2301 proto_tree_add_subtree(tree
, tvb
, *offset
, remaining_length
, ett_rf4ce_profile_action_records
, NULL
, "Action Records List - empty");
2306 static void dissect_rf4ce_profile_zrc20_action_data(tvbuff_t
*tvb
, proto_tree
*tree
, unsigned *offset
, bool dissect_action_control
)
2308 char record_tree_name
[10];
2309 proto_tree
*record_tree
;
2310 uint8_t payload_length
;
2311 int remaining_length
;
2312 int attr_counter
= 1;
2314 snprintf(record_tree_name
, sizeof(record_tree_name
), "Record %d:", attr_counter
);
2317 record_tree
= proto_tree_add_subtree(tree
, tvb
, *offset
, tvb_reported_length_remaining(tvb
, *offset
), ett_rf4ce_profile_action_records_sub
, NULL
, record_tree_name
);
2319 if (dissect_action_control
)
2321 static int *const action_control_bits
[] = {
2322 &hf_rf4ce_zrc20_cmd_actions_action_control_action_type
,
2323 &hf_rf4ce_zrc20_cmd_actions_action_control_reserved
,
2324 &hf_rf4ce_zrc20_cmd_actions_action_control_modifier_bits_gui
,
2325 &hf_rf4ce_zrc20_cmd_actions_action_control_modifier_bits_alt
,
2326 &hf_rf4ce_zrc20_cmd_actions_action_control_modifier_bits_shift
,
2327 &hf_rf4ce_zrc20_cmd_actions_action_control_modifier_bits_ctrl
,
2330 proto_tree_add_bitmask(record_tree
, tvb
, *offset
, hf_rf4ce_zrc20_cmd_actions_action_control
, ett_rf4ce_profile_zrc20_action_control
, action_control_bits
, ENC_LITTLE_ENDIAN
);
2334 proto_tree_add_item(record_tree
, hf_rf4ce_zrc20_cmd_actions_action_data_payload_length
, tvb
, *offset
, 1, ENC_LITTLE_ENDIAN
);
2335 payload_length
= tvb_get_uint8(tvb
, *offset
);
2338 proto_tree_add_item(record_tree
, hf_rf4ce_zrc20_cmd_actions_action_data_action_bank
, tvb
, *offset
, 1, ENC_LITTLE_ENDIAN
);
2341 proto_tree_add_item(record_tree
, hf_rf4ce_zrc20_cmd_actions_action_data_action_code
, tvb
, *offset
, 1, ENC_LITTLE_ENDIAN
);
2344 /* TODO: fix action_vendor parsing according to spec */
2345 remaining_length
= tvb_reported_length_remaining(tvb
, *offset
);
2346 if (((payload_length
> 0) && (remaining_length
- payload_length
== 3)) || ((payload_length
== 0) && (remaining_length
- payload_length
== 2)))
2348 proto_tree_add_item(record_tree
, hf_rf4ce_zrc20_cmd_actions_action_data_action_vendor
, tvb
, *offset
, 2, ENC_LITTLE_ENDIAN
);
2352 if (payload_length
> 0)
2354 proto_tree_add_item(record_tree
, hf_rf4ce_zrc20_cmd_actions_action_data_action_payload
, tvb
, *offset
, payload_length
, ENC_NA
);
2355 *offset
+= payload_length
;