aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-zbee-zcl-hvac.c
diff options
context:
space:
mode:
authorKenneth Soerensen <knnthsrnsn@gmail.com>2018-03-31 21:23:47 +0200
committerAnders Broman <a.broman58@gmail.com>2018-04-05 05:20:52 +0000
commit62af7654388645a2479193bd1a280b65c1e714e0 (patch)
tree4b12880f9e0b26249574fd481e38c2ab60985a7a /epan/dissectors/packet-zbee-zcl-hvac.c
parent2f44216f3aab9a9a31b7b00df50de70d0c6b5f8e (diff)
ZigBee: Allow a different set of attributes for ZCL client and server
Some clusters, for example the Smart Energy Metering cluster, requires a different set of attributes for the ZCL client and server but with overlapping IDs. This change allows to specify a different set of attributes for the ZCL client. To avoid breaking existing clusters that might have client attributes the same set of attributes are used for server and client when zbee_zcl_init_cluster is called. This new client attribute set is used in the Smart Energy Metering cluster in this commit. Change-Id: Ie25ad746dac1ccbb233ae8975ef9047d3fc6a170 Reviewed-on: https://code.wireshark.org/review/26694 Reviewed-by: Martin Boye Petersen <martinboyepetersen@gmail.com> Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Paul Zander <p.j.zander@lighting.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-zbee-zcl-hvac.c')
-rw-r--r--epan/dissectors/packet-zbee-zcl-hvac.c32
1 files changed, 20 insertions, 12 deletions
diff --git a/epan/dissectors/packet-zbee-zcl-hvac.c b/epan/dissectors/packet-zbee-zcl-hvac.c
index 84dce46474..f16d323758 100644
--- a/epan/dissectors/packet-zbee-zcl-hvac.c
+++ b/epan/dissectors/packet-zbee-zcl-hvac.c
@@ -94,7 +94,7 @@ void proto_register_zbee_zcl_pump_config_control(void);
void proto_reg_handoff_zbee_zcl_pump_config_control(void);
/* Command Dissector Helpers */
-static void dissect_zcl_pump_config_control_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type);
+static void dissect_zcl_pump_config_control_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr);
/* Private functions prototype */
@@ -218,9 +218,10 @@ dissect_zbee_zcl_pump_config_control(tvbuff_t *tvb _U_, packet_info *pinfo _U_,
*@param offset pointer to buffer offset
*@param attr_id attribute identifier
*@param data_type attribute data type
+ *@param client_attr ZCL client
*/
void
-dissect_zcl_pump_config_control_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type)
+dissect_zcl_pump_config_control_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr)
{
static const int * pump_status[] = {
&hf_zbee_zcl_pump_config_control_status_device_fault,
@@ -305,7 +306,7 @@ dissect_zcl_pump_config_control_attr_data(proto_tree *tree, tvbuff_t *tvb, guint
case ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_POWER:
case ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_LIFETIME_ENERGY_CONS:
default:
- dissect_zcl_attr_data(tvb, tree, offset, data_type);
+ dissect_zcl_attr_data(tvb, tree, offset, data_type, client_attr);
break;
}
@@ -476,6 +477,7 @@ proto_reg_handoff_zbee_zcl_pump_config_control(void)
ZBEE_ZCL_CID_PUMP_CONFIG_CONTROL,
ZBEE_MFG_CODE_NONE,
hf_zbee_zcl_pump_config_control_attr_id,
+ hf_zbee_zcl_pump_config_control_attr_id,
-1, -1,
(zbee_zcl_fn_attr_data)dissect_zcl_pump_config_control_attr_data
);
@@ -508,7 +510,7 @@ void proto_register_zbee_zcl_fan_control(void);
void proto_reg_handoff_zbee_zcl_fan_control(void);
/* Command Dissector Helpers */
-static void dissect_zcl_fan_control_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type);
+static void dissect_zcl_fan_control_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr);
/* Private functions prototype */
@@ -581,9 +583,10 @@ dissect_zbee_zcl_fan_control(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tr
*@param offset pointer to buffer offset
*@param attr_id attribute identifier
*@param data_type attribute data type
+ *@param client_attr ZCL client
*/
void
-dissect_zcl_fan_control_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type)
+dissect_zcl_fan_control_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr)
{
/* Dissect attribute data type and data */
switch (attr_id) {
@@ -599,7 +602,7 @@ dissect_zcl_fan_control_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset
break;
default:
- dissect_zcl_attr_data(tvb, tree, offset, data_type);
+ dissect_zcl_attr_data(tvb, tree, offset, data_type, client_attr);
break;
}
@@ -656,6 +659,7 @@ proto_reg_handoff_zbee_zcl_fan_control(void)
ZBEE_ZCL_CID_FAN_CONTROL,
ZBEE_MFG_CODE_NONE,
hf_zbee_zcl_fan_control_attr_id,
+ hf_zbee_zcl_fan_control_attr_id,
-1, -1,
(zbee_zcl_fn_attr_data)dissect_zcl_fan_control_attr_data
);
@@ -694,7 +698,7 @@ void proto_register_zbee_zcl_dehumidification_control(void);
void proto_reg_handoff_zbee_zcl_dehumidification_control(void);
/* Command Dissector Helpers */
-static void dissect_zcl_dehumidification_control_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type);
+static void dissect_zcl_dehumidification_control_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr);
/* Private functions prototype */
@@ -773,9 +777,10 @@ dissect_zbee_zcl_dehumidification_control(tvbuff_t *tvb _U_, packet_info *pinfo
*@param offset pointer to buffer offset
*@param attr_id attribute identifier
*@param data_type attribute data type
+ *@param client_attr ZCL client
*/
void
-dissect_zcl_dehumidification_control_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type)
+dissect_zcl_dehumidification_control_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr)
{
/* Dissect attribute data type and data */
switch (attr_id) {
@@ -801,7 +806,7 @@ dissect_zcl_dehumidification_control_attr_data(proto_tree *tree, tvbuff_t *tvb,
case ZBEE_ZCL_ATTR_ID_DEHUMIDIFICATION_CONTROL_DEHUM_HYSTERESIS:
case ZBEE_ZCL_ATTR_ID_DEHUMIDIFICATION_CONTROL_DEHUM_MAX_COOL:
default:
- dissect_zcl_attr_data(tvb, tree, offset, data_type);
+ dissect_zcl_attr_data(tvb, tree, offset, data_type, client_attr);
break;
}
@@ -862,6 +867,7 @@ proto_reg_handoff_zbee_zcl_dehumidification_control(void)
ZBEE_ZCL_CID_DEHUMIDIFICATION_CONTROL,
ZBEE_MFG_CODE_NONE,
hf_zbee_zcl_dehumidification_control_attr_id,
+ hf_zbee_zcl_dehumidification_control_attr_id,
-1, -1,
(zbee_zcl_fn_attr_data)dissect_zcl_dehumidification_control_attr_data
);
@@ -894,7 +900,7 @@ void proto_register_zbee_zcl_thermostat_ui_config(void);
void proto_reg_handoff_zbee_zcl_thermostat_ui_config(void);
/* Command Dissector Helpers */
-static void dissect_zcl_thermostat_ui_config_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type);
+static void dissect_zcl_thermostat_ui_config_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr);
/* Private functions prototype */
@@ -963,9 +969,10 @@ dissect_zbee_zcl_thermostat_ui_config(tvbuff_t *tvb _U_, packet_info *pinfo _U_,
*@param offset pointer to buffer offset
*@param attr_id attribute identifier
*@param data_type attribute data type
+ *@param client_attr ZCL client
*/
void
-dissect_zcl_thermostat_ui_config_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type)
+dissect_zcl_thermostat_ui_config_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr)
{
/* Dissect attribute data type and data */
switch (attr_id) {
@@ -981,7 +988,7 @@ dissect_zcl_thermostat_ui_config_attr_data(proto_tree *tree, tvbuff_t *tvb, guin
break;
default:
- dissect_zcl_attr_data(tvb, tree, offset, data_type);
+ dissect_zcl_attr_data(tvb, tree, offset, data_type, client_attr);
break;
}
@@ -1037,6 +1044,7 @@ proto_reg_handoff_zbee_zcl_thermostat_ui_config(void)
ZBEE_ZCL_CID_THERMOSTAT_UI_CONFIG,
ZBEE_MFG_CODE_NONE,
hf_zbee_zcl_thermostat_ui_config_attr_id,
+ hf_zbee_zcl_thermostat_ui_config_attr_id,
-1, -1,
(zbee_zcl_fn_attr_data)dissect_zcl_thermostat_ui_config_attr_data
);