aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-zbee-zcl-general.c
diff options
context:
space:
mode:
authorPaul Zander <p.j.zander@lighting.com>2018-02-26 21:44:43 +0100
committerAnders Broman <a.broman58@gmail.com>2018-02-27 09:00:08 +0000
commitf31bc46948695d7156f2f130733a29706b900621 (patch)
tree539e0a4453dff7b2c61002325338af9f598656c2 /epan/dissectors/packet-zbee-zcl-general.c
parent0a113beceabcc0cd731874cc482dbb83e9bcdf4e (diff)
Add ZigBee ZCL Identify cluster command.
Change-Id: Ie0ed2388c2f0d992e053166d740209a8e354f31e Reviewed-on: https://code.wireshark.org/review/26122 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-zbee-zcl-general.c')
-rw-r--r--epan/dissectors/packet-zbee-zcl-general.c55
1 files changed, 55 insertions, 0 deletions
diff --git a/epan/dissectors/packet-zbee-zcl-general.c b/epan/dissectors/packet-zbee-zcl-general.c
index 48349a56c3..ea8423dd47 100644
--- a/epan/dissectors/packet-zbee-zcl-general.c
+++ b/epan/dissectors/packet-zbee-zcl-general.c
@@ -1134,6 +1134,7 @@ proto_reg_handoff_zbee_zcl_device_temperature_configuration(void)
/* Server Commands Received */
#define ZBEE_ZCL_CMD_ID_IDENTIFY_IDENTITY 0x00 /* Identify */
#define ZBEE_ZCL_CMD_ID_IDENTIFY_IDENTITY_QUERY 0x01 /* Identify Query */
+#define ZBEE_ZCL_CMD_ID_IDENTIFY_TRIGGER_EFFECT 0x40 /* Trigger Effect */
/* Server Commands Generated */
#define ZBEE_ZCL_CMD_ID_IDENTIFY_IDENTITY_QUERY_RSP 0x00 /* Identify Query Response */
@@ -1149,6 +1150,7 @@ void proto_reg_handoff_zbee_zcl_identify(void);
/* Command Dissector Helpers */
static void dissect_zcl_identify_identify (tvbuff_t *tvb, proto_tree *tree, guint *offset);
static void dissect_zcl_identify_identifyqueryrsp (tvbuff_t *tvb, proto_tree *tree, guint *offset);
+static void dissect_zcl_identify_triggereffect (tvbuff_t *tvb, proto_tree *tree, guint *offset);
static void dissect_zcl_identify_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type);
/* Private functions prototype */
@@ -1162,6 +1164,8 @@ static int proto_zbee_zcl_identify = -1;
static int hf_zbee_zcl_identify_attr_id = -1;
static int hf_zbee_zcl_identify_identify_time = -1;
static int hf_zbee_zcl_identify_identify_timeout = -1;
+static int hf_zbee_zcl_identify_effect_id = -1;
+static int hf_zbee_zcl_identify_effect_variant = -1;
static int hf_zbee_zcl_identify_srv_rx_cmd_id = -1;
static int hf_zbee_zcl_identify_srv_tx_cmd_id = -1;
@@ -1178,6 +1182,7 @@ static const value_string zbee_zcl_identify_attr_names[] = {
static const value_string zbee_zcl_identify_srv_rx_cmd_names[] = {
{ ZBEE_ZCL_CMD_ID_IDENTIFY_IDENTITY, "Identify" },
{ ZBEE_ZCL_CMD_ID_IDENTIFY_IDENTITY_QUERY, "Identify Query" },
+ { ZBEE_ZCL_CMD_ID_IDENTIFY_TRIGGER_EFFECT, "Trigger Effect" },
{ 0, NULL }
};
@@ -1187,6 +1192,17 @@ static const value_string zbee_zcl_identify_srv_tx_cmd_names[] = {
{ 0, NULL }
};
+/* Trigger Effects */
+static const value_string zbee_zcl_identify_effect_id_names[] = {
+ { 0x00, "Blink" },
+ { 0x01, "Breathe" },
+ { 0x02, "Okay" },
+ { 0x0b, "Channel change" },
+ { 0xfe, "Finish" },
+ { 0xff, "Stop" },
+ { 0, NULL }
+};
+
/*************************/
/* Function Bodies */
/*************************/
@@ -1245,6 +1261,10 @@ dissect_zbee_zcl_identify(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, v
/* without payload*/
break;
+ case ZBEE_ZCL_CMD_ID_IDENTIFY_TRIGGER_EFFECT:
+ dissect_zcl_identify_triggereffect(tvb, payload_tree, &offset);
+ break;
+
default:
break;
}
@@ -1325,6 +1345,33 @@ dissect_zcl_identify_identifyqueryrsp(tvbuff_t *tvb, proto_tree *tree, guint *of
} /*dissect_zcl_identify_identifyqueryrsp*/
+ /*FUNCTION:------------------------------------------------------
+ * NAME
+ * dissect_zcl_identify_triggereffect
+ * DESCRIPTION
+ * this function decodes the Trigger Effect payload.
+ * PARAMETERS
+ * tvb - the tv buffer of the current data_type
+ * tree - the tree to append this item to
+ * offset - offset of data in tvb
+ * RETURNS
+ * none
+ *---------------------------------------------------------------
+ */
+static void
+dissect_zcl_identify_triggereffect(tvbuff_t *tvb, proto_tree *tree, guint *offset)
+{
+ /* Retrieve "Trigger Effect Id" field */
+ proto_tree_add_item(tree, hf_zbee_zcl_identify_effect_id, tvb, *offset, 1, ENC_NA);
+ *offset += 1;
+
+ /* Retrieve "Trigger Effect Variant" field */
+ proto_tree_add_item(tree, hf_zbee_zcl_identify_effect_variant, tvb, *offset, 1, ENC_NA);
+ *offset += 1;
+
+} /*dissect_zcl_identify_triggereffect*/
+
+
/*FUNCTION:------------------------------------------------------
* NAME
* dissect_zcl_identify_attr_data
@@ -1389,6 +1436,14 @@ proto_register_zbee_zcl_identify(void)
{ "Identify Timeout", "zbee_zcl_general.identify.identify_timeout", FT_UINT16, BASE_CUSTOM, CF_FUNC(decode_zcl_time_in_seconds),
0x00, NULL, HFILL } },
+ { &hf_zbee_zcl_identify_effect_id,
+ { "Effect", "zbee_zcl_general.identify.effect_id", FT_UINT8, BASE_HEX, VALS(zbee_zcl_identify_effect_id_names),
+ 0x00, NULL, HFILL } },
+
+ { &hf_zbee_zcl_identify_effect_variant,
+ { "Variant", "zbee_zcl_general.identify.effect_variant", FT_UINT8, BASE_DEC, NULL,
+ 0x00, NULL, HFILL } },
+
{ &hf_zbee_zcl_identify_srv_rx_cmd_id,
{ "Command", "zbee_zcl_general.identify.cmd.srv_rx.id", FT_UINT8, BASE_HEX, VALS(zbee_zcl_identify_srv_rx_cmd_names),
0x00, NULL, HFILL } },