ZigBee: Dissect Electrical Measurement cluster
Bug: 15882 Change-Id: Iccd6b7d66b0ea87f57de8ae0fd4bedc296787749 Reviewed-on: https://code.wireshark.org/review/33901 Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
parent
96abc05815
commit
51464397c8
|
@ -589,6 +589,7 @@ const range_string zbee_aps_cid_names[] = {
|
|||
{ ZBEE_ZCL_CID_FLOW_MEASUREMENT, ZBEE_ZCL_CID_FLOW_MEASUREMENT, "Flow Measurement"},
|
||||
{ ZBEE_ZCL_CID_REL_HUMIDITY_MEASUREMENT, ZBEE_ZCL_CID_REL_HUMIDITY_MEASUREMENT, "Relative Humidity Measurement"},
|
||||
{ ZBEE_ZCL_CID_OCCUPANCY_SENSING, ZBEE_ZCL_CID_OCCUPANCY_SENSING, "Occupancy Sensing"},
|
||||
{ ZBEE_ZCL_CID_ELECTRICAL_MEASUREMENT, ZBEE_ZCL_CID_ELECTRICAL_MEASUREMENT, "Electrical Measurement"},
|
||||
|
||||
/* Security and Safety */
|
||||
{ ZBEE_ZCL_CID_IAS_ZONE, ZBEE_ZCL_CID_IAS_ZONE, "Intruder Alarm System Zone"},
|
||||
|
|
|
@ -168,6 +168,7 @@
|
|||
#define ZBEE_ZCL_CID_FLOW_MEASUREMENT 0x0404
|
||||
#define ZBEE_ZCL_CID_REL_HUMIDITY_MEASUREMENT 0x0405
|
||||
#define ZBEE_ZCL_CID_OCCUPANCY_SENSING 0x0406
|
||||
#define ZBEE_ZCL_CID_ELECTRICAL_MEASUREMENT 0x0b04
|
||||
|
||||
/* ZCL Cluster IDs - Security and Safety */
|
||||
#define ZBEE_ZCL_CID_IAS_ZONE 0x0500
|
||||
|
|
|
@ -1868,6 +1868,654 @@ proto_reg_handoff_zbee_zcl_occ_sen(void)
|
|||
);
|
||||
} /*proto_reg_handoff_zbee_zcl_occ_sen*/
|
||||
|
||||
/* ########################################################################## */
|
||||
/* #### (0x0b04) ELECTRICAL MEASUREMENT CLUSTER ############################# */
|
||||
/* ########################################################################## */
|
||||
|
||||
/*************************/
|
||||
/* Defines */
|
||||
/*************************/
|
||||
|
||||
#define ZBEE_ZCL_ELEC_MES_NUM_ETT 1
|
||||
|
||||
/* Attributes */
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_MEASUREMENT_TYPE 0x0000
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_DC_VOLTAGE 0x0100
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_DC_VOLTAGE_MIN 0x0101
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_DC_VOLTAGE_MAX 0x0102
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_DC_CURRENT 0x0103
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_DC_CURRENT_MIN 0x0104
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_DC_CURRENT_MAX 0x0105
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_DC_POWER 0x0106
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_DC_POWER_MIN 0x0107
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_DC_POWER_MAX 0x0108
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_DC_VOLTAGE_MULTIPLIER 0x0200
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_DC_VOLTAGE_DIVISOR 0x0201
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_DC_CURRENT_MULTIPLIER 0x0202
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_DC_CURRENT_DIVISOR 0x0203
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_DC_POWER_MULTIPLIER 0x0204
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_DC_POWER_DIVISOR 0x0205
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_AC_FREQUENCY 0x0300
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_AC_FREQUENCY_MIN 0x0301
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_AC_FREQUENCY_MAX 0x0302
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_NEUTRAL_CURRENT 0x0303
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_TOTAL_ACTIVE_POWER 0x0304
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_TOTAL_REACTIVE_POWER 0x0305
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_TOTAL_APPARENT_POWER 0x0306
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_MEASURED_1ST_HARMONIC_CURRENT 0x0307
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_MEASURED_3RD_HARMONIC_CURRENT 0x0308
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_MEASURED_5TH_HARMONIC_CURRENT 0x0309
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_MEASURED_7TH_HARMONIC_CURRENT 0x030A
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_MEASURED_9TH_HARMONIC_CURRENT 0x030B
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_MEASURED_11TH_HARMONIC_CURRENT 0x030C
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_MEASURED_PHASE_1ST_HARMONIC_CURRENT 0x030D
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_MEASURED_PHASE_3RD_HARMONIC_CURRENT 0x030E
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_MEASURED_PHASE_5TH_HARMONIC_CURRENT 0x030F
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_MEASURED_PHASE_7TH_HARMONIC_CURRENT 0x0310
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_MEASURED_PHASE_9TH_HARMONIC_CURRENT 0x0311
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_MEASURED_PHASE_11TH_HARMONIC_CURRENT 0x0312
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_AC_FREQUENCY_MULTIPLIER 0x0400
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_AC_FREQUENCY_DIVISOR 0x0401
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_POWER_MULTIPLIER 0x0402
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_POWER_DIVISOR 0x0403
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_HARMONIC_CURRENT_MULTIPLIER 0x0404
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_PHASE_HARMONIC_CURRENT_MULTIPLIER 0x0405
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_LINE_CURRENT 0x0501
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_ACTIVE_CURRENT 0x0502
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_REACTIVE_CURRENT 0x0503
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_VOLTAGE 0x0505
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_VOLTAGE_MIN 0x0506
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_VOLTAGE_MAX 0x0507
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_CURRENT 0x0508
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_CURRENT_MIN 0x0509
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_CURRENT_MAX 0x050A
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_ACTIVE_POWER 0x050B
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_ACTIVE_POWER_MIN 0x050C
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_ACTIVE_POWER_MAX 0x050D
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_REACTIVE_POWER 0x050E
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_APPARENT_POWER 0x050F
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_POWER_FACTOR 0x0510
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_AVERAGE_RMS_VOLTAGE_MEASUREMENT_PERIOD 0x0511
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_AVERAGE_RMS_OVER_VOLTAGE_COUNTER 0x0512
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_AVERAGE_RMS_UNDER_VOLTAGE_COUNTER 0x0513
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_EXTREME_OVER_VOLTAGE_PERIOD 0x0514
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_EXTREME_UNDER_VOLTAGE_PERIOD 0x0515
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_VOLTAGE_SAG_PERIOD 0x0516
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_VOLTAGE_SWELL_PERIOD 0x0517
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_AC_VOLTAGE_MULTIPLIER 0x0600
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_AC_VOLTAGE_DIVISOR 0x0601
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_AC_CURRENT_MULTIPLIER 0x0602
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_AC_CURRENT_DIVISOR 0x0603
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_AC_POWER_MULTIPLIER 0x0604
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_AC_POWER_DIVISOR 0x0605
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_DC_OVERLOAD_ALARMS_MASK 0x0700
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_DC_VOLTAGE_OVERLOAD 0x0701
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_DC_CURRENT_OVERLOAD 0x0702
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_AC_ALARMS_MASK 0x0800
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_AC_VOLTAGE_OVERLOAD 0x0801
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_AC_CURRENT_OVERLOAD 0x0802
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_AC_ACTIVE_POWER_OVERLOAD 0x0803
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_AC_REACTIVE_POWER_OVERLOAD 0x0804
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_AVERAGE_RMS_OVER_VOLTAGE 0x0805
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_AVERAGE_RMS_UNDER_VOLTAGE 0x0806
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_EXTREME_OVER_VOLTAGE 0x0807
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_EXTREME_UNDER_VOLTAGE 0x0808
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_VOLTAGE_SAG 0x0809
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_VOLTAGE_SWELL 0x080A
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_LINE_CURRENT_PH_B 0x0901
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_ACTIVE_CURRENT_PH_B 0x0902
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_REACTIVE_CURRENT_PH_B 0x0903
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_VOLTAGE_PH_B 0x0905
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_VOLTAGE_MIN_PH_B 0x0906
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_VOLTAGE_MAX_PH_B 0x0907
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_CURRENT_PH_B 0x0908
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_CURRENT_MIN_PH_B 0x0909
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_CURRENT_MAX_PH_B 0x090A
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_ACTIVE_POWER_PH_B 0x090B
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_ACTIVE_POWER_MIN_PH_B 0x090C
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_ACTIVE_POWER_MAX_PH_B 0x090D
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_REACTIVE_POWER_PH_B 0x090E
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_APPARENT_POWER_PH_B 0x090F
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_POWER_FACTOR_PH_B 0x0910
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_AVERAGE_RMS_VOLTAGE_MEASUREMENT_PERIOD_PH_B 0x0911
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_AVERAGE_RMS_OVER_VOLTAGE_COUNTER_PH_B 0x0912
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_AVERAGE_RMS_UNDER_VOLTAGE_COUNTER_PH_B 0x0913
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_EXTREME_OVER_VOLTAGE_PERIOD_PH_B 0x0914
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_EXTREME_UNDER_VOLTAGE_PERIOD_PH_B 0x0915
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_VOLTAGE_SAG_PERIOD_PH_B 0x0916
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_VOLTAGE_SWELL_PERIOD_PH_B 0x0917
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_LINE_CURRENT_PH_C 0x0A01
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_REACTIVE_CURRENT_PH_C 0x0A03
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_VOLTAGE_PH_C 0x0A05
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_VOLTAGE_MIN_PH_C 0x0A06
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_VOLTAGE_MAX_PH_C 0x0A07
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_CURRENT_PH_C 0x0A08
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_CURRENT_MIN_PH_C 0x0A09
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_CURRENT_MAX_PH_C 0x0A0A
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_ACTIVE_POWER_PH_C 0x0A0B
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_ACTIVE_POWER_MIN_PH_C 0x0A0C
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_ACTIVE_POWER_MAX_PH_C 0x0A0D
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_REACTIVE_POWER_PH_C 0x0A0E
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_APPARENT_POWER_PH_C 0x0A0F
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_POWER_FACTOR_PH_C 0x0A10
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_AVERAGE_RMS_VOLTAGE_MEASUREMENT_PERIOD_PH_C 0x0A11
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_AVERAGE_RMS_OVER_VOLTAGE_COUNTER_PH_C 0x0A12
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_AVERAGE_RMS_UNDER_VOLTAGE_COUNTER_PH_C 0x0A13
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_EXTREME_OVER_VOLTAGE_PERIOD_PH_C 0x0A14
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_EXTREME_UNDER_VOLTAGE_PERIOD_PH_C 0x0A15
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_VOLTAGE_SAG_PERIOD_PH_C 0x0A16
|
||||
#define ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_VOLTAGE_SWELL_PERIOD_PH_C 0x0A17
|
||||
|
||||
/* Server Commands Received */
|
||||
#define ZBEE_ZCL_CMD_GET_PROFILE_INFO 0x00
|
||||
#define ZBEE_ZCL_CMD_GET_MEASUREMENT_PROFILE_INFO 0x01
|
||||
|
||||
/* Server Commands Generated */
|
||||
#define ZBEE_ZCL_CMD_GET_PROFILE_INFO_RESPONSE 0x00
|
||||
#define ZBEE_ZCL_CMD_GET_MEASUREMENT_PROFILE_INFO_RESPONSE 0x01
|
||||
|
||||
/* Profile Interval Period */
|
||||
#define ZBEE_ZCL_ELEC_MES_PROFILE_INTERVAL_PERIOD_DAILY 0
|
||||
#define ZBEE_ZCL_ELEC_MES_PROFILE_INTERVAL_PERIOD_60_MINUTES 1
|
||||
#define ZBEE_ZCL_ELEC_MES_PROFILE_INTERVAL_PERIOD_30_MINUTES 2
|
||||
#define ZBEE_ZCL_ELEC_MES_PROFILE_INTERVAL_PERIOD_15_MINUTES 3
|
||||
#define ZBEE_ZCL_ELEC_MES_PROFILE_INTERVAL_PERIOD_10_MINUTES 4
|
||||
#define ZBEE_ZCL_ELEC_MES_PROFILE_INTERVAL_PERIOD_7_5_MINUTES 5
|
||||
#define ZBEE_ZCL_ELEC_MES_PROFILE_INTERVAL_PERIOD_5_MINUTES 6
|
||||
#define ZBEE_ZCL_ELEC_MES_PROFILE_INTERVAL_PERIOD_2_5_MINUTES 7
|
||||
|
||||
/* List of Status Valid Values */
|
||||
#define ZBEE_ZCL_ELEC_MES_STATUS_SUCCESS 0x00
|
||||
#define ZBEE_ZCL_ELEC_MES_STATUS_ATTRIBUTE_PROFILE_NOT_SUPPORTED 0x01
|
||||
#define ZBEE_ZCL_ELEC_MES_STATUS_INVALID_START_TIME 0x02
|
||||
#define ZBEE_ZCL_ELEC_MES_STATUS_MORE_INTERVALS_REQUESTED_THAN_CAN_BE_RET 0x03
|
||||
#define ZBEE_ZCL_ELEC_MES_STATUS_NO_INTERVALS_AVAILABLE_FOR_THE_REQ_TIME 0x04
|
||||
|
||||
/*************************/
|
||||
/* Function Declarations */
|
||||
/*************************/
|
||||
|
||||
void proto_register_zbee_zcl_elec_mes(void);
|
||||
void proto_reg_handoff_zbee_zcl_elec_mes(void);
|
||||
|
||||
/* Command Dissector Helpers */
|
||||
static void dissect_zcl_elec_mes_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr);
|
||||
static void dissect_zcl_elec_mes_get_measurement_profile_info (tvbuff_t *tvb, proto_tree *tree, guint *offset);
|
||||
static void dissect_zcl_elec_mes_get_profile_info_response (tvbuff_t *tvb, proto_tree *tree, guint *offset);
|
||||
static void dissect_zcl_elec_mes_get_measurement_profile_info_response (tvbuff_t *tvb, proto_tree *tree, guint *offset);
|
||||
|
||||
/*************************/
|
||||
/* Global Variables */
|
||||
/*************************/
|
||||
|
||||
/* Initialize the protocol and registered fields */
|
||||
static int proto_zbee_zcl_elec_mes = -1;
|
||||
|
||||
static int hf_zbee_zcl_elec_mes_srv_tx_cmd_id = -1;
|
||||
static int hf_zbee_zcl_elec_mes_srv_rx_cmd_id = -1;
|
||||
static int hf_zbee_zcl_elec_mes_attr_id = -1;
|
||||
static int hf_zbee_zcl_elec_mes_start_time = -1;
|
||||
static int hf_zbee_zcl_elec_mes_number_of_intervals = -1;
|
||||
static int hf_zbee_zcl_elec_mes_profile_count = -1;
|
||||
static int hf_zbee_zcl_elec_mes_profile_interval_period = -1;
|
||||
static int hf_zbee_zcl_elec_mes_max_number_of_intervals = -1;
|
||||
static int hf_zbee_zcl_elec_mes_status = -1;
|
||||
static int hf_zbee_zcl_elec_mes_number_of_intervals_delivered = -1;
|
||||
static int hf_zbee_zcl_elec_mes_intervals = -1;
|
||||
|
||||
/* Initialize the subtree pointers */
|
||||
static gint ett_zbee_zcl_elec_mes = -1;
|
||||
|
||||
/* Attributes */
|
||||
static const value_string zbee_zcl_elec_mes_attr_names[] = {
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_MEASUREMENT_TYPE, "Measurement Type" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_DC_VOLTAGE, "DC Voltage" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_DC_VOLTAGE_MIN, "DC Voltage Min" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_DC_VOLTAGE_MAX, "DC Voltage Max" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_DC_CURRENT, "DC Current" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_DC_CURRENT_MIN, "DC Current Min" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_DC_CURRENT_MAX, "DC Current Max" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_DC_POWER, "DC Power" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_DC_POWER_MIN, "DC Power Min" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_DC_POWER_MAX, "DC Power Max" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_DC_VOLTAGE_MULTIPLIER, "DC Voltage Multiplier" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_DC_VOLTAGE_DIVISOR, "DC Voltage Divisor" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_DC_CURRENT_MULTIPLIER, "DC Current Multiplier" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_DC_CURRENT_DIVISOR, "DC Current Divisor" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_DC_POWER_MULTIPLIER, "DC Power Multiplier" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_DC_POWER_DIVISOR, "DC Power Divisor" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_AC_FREQUENCY, "AC Frequency" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_AC_FREQUENCY_MIN, "AC Frequency Min" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_AC_FREQUENCY_MAX, "AC Frequency Max" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_NEUTRAL_CURRENT, "Neutral Current" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_TOTAL_ACTIVE_POWER, "Total Active Power" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_TOTAL_REACTIVE_POWER, "Total Reactive Power" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_TOTAL_APPARENT_POWER, "Total Apparent Power" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_MEASURED_1ST_HARMONIC_CURRENT, "Measured 1st Harmonic Current" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_MEASURED_3RD_HARMONIC_CURRENT, "Measured 3rd Harmonic Current" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_MEASURED_5TH_HARMONIC_CURRENT, "Measured 5th Harmonic Current" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_MEASURED_7TH_HARMONIC_CURRENT, "Measured 7th Harmonic Current" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_MEASURED_9TH_HARMONIC_CURRENT, "Measured 9th Harmonic Current" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_MEASURED_11TH_HARMONIC_CURRENT, "Measured 11th Harmonic Current" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_MEASURED_PHASE_1ST_HARMONIC_CURRENT, "Measured Phase 1st Harmonic Current" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_MEASURED_PHASE_3RD_HARMONIC_CURRENT, "Measured Phase 3rd Harmonic Current" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_MEASURED_PHASE_5TH_HARMONIC_CURRENT, "Measured Phase 5th Harmonic Current" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_MEASURED_PHASE_7TH_HARMONIC_CURRENT, "Measured Phase 7th Harmonic Current" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_MEASURED_PHASE_9TH_HARMONIC_CURRENT, "Measured Phase 9th Harmonic Current" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_MEASURED_PHASE_11TH_HARMONIC_CURRENT, "Measured Phase 11th Harmonic Current" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_AC_FREQUENCY_MULTIPLIER, "AC Frequency Multiplier" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_AC_FREQUENCY_DIVISOR, "AC Frequency Divisor" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_POWER_MULTIPLIER, "Power Multiplier" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_POWER_DIVISOR, "Power Divisor" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_HARMONIC_CURRENT_MULTIPLIER, "Harmonic Current Multiplier" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_PHASE_HARMONIC_CURRENT_MULTIPLIER, "Phase Harmonic Current Multiplier" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_LINE_CURRENT, "Line Current" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_ACTIVE_CURRENT, "Active Current" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_REACTIVE_CURRENT, "Reactive Current" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_VOLTAGE, "RMS Voltage" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_VOLTAGE_MIN, "RMS Voltage Min" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_VOLTAGE_MAX, "RMS Voltage Max" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_CURRENT, "RMS Current" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_CURRENT_MIN, "RMS Current Min" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_CURRENT_MAX, "RMS Current Max" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_ACTIVE_POWER, "Active Power" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_ACTIVE_POWER_MIN, "Active Power Min" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_ACTIVE_POWER_MAX, "Active Power Max" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_REACTIVE_POWER, "Reactive Power" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_APPARENT_POWER, "Apparent Power" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_POWER_FACTOR, "Power Factor" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_AVERAGE_RMS_VOLTAGE_MEASUREMENT_PERIOD, "Average RMS Voltage Measurement Period" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_AVERAGE_RMS_OVER_VOLTAGE_COUNTER, "Average RMS Over Voltage Counter" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_AVERAGE_RMS_UNDER_VOLTAGE_COUNTER, "Average RMS Under Voltage Counter" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_EXTREME_OVER_VOLTAGE_PERIOD, "RMS Extreme Over Voltage Period" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_EXTREME_UNDER_VOLTAGE_PERIOD, "RMS Extreme Under Voltage Period" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_VOLTAGE_SAG_PERIOD, "RMS Voltage Sag Period" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_VOLTAGE_SWELL_PERIOD, "RMS Voltage Swell Period" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_AC_VOLTAGE_MULTIPLIER, "AC Voltage Multiplier" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_AC_VOLTAGE_DIVISOR, "AC Voltage Divisor" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_AC_CURRENT_MULTIPLIER, "AC Current Multiplier" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_AC_CURRENT_DIVISOR, "AC Current Divisor" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_AC_POWER_MULTIPLIER, "AC Power Multiplier" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_AC_POWER_DIVISOR, "AC Power Divisor" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_DC_OVERLOAD_ALARMS_MASK, "DC Overload Alarms Mask" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_DC_VOLTAGE_OVERLOAD, "DC Voltage Overload" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_DC_CURRENT_OVERLOAD, "DC Current Overload" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_AC_ALARMS_MASK, "AC Alarms Mask" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_AC_VOLTAGE_OVERLOAD, "AC Voltage Overload" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_AC_CURRENT_OVERLOAD, "AC Current Overload" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_AC_ACTIVE_POWER_OVERLOAD, "AC Active Power Overload" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_AC_REACTIVE_POWER_OVERLOAD, "AC Reactive Power Overload" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_AVERAGE_RMS_OVER_VOLTAGE, "Average RMS Over Voltage" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_AVERAGE_RMS_UNDER_VOLTAGE, "Average RMS Under Voltage" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_EXTREME_OVER_VOLTAGE, "RMS Extreme Over Voltage" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_EXTREME_UNDER_VOLTAGE, "RMS Extreme Under Voltage" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_VOLTAGE_SAG, "RMS Voltage Sag" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_VOLTAGE_SWELL, "RMS Voltage Swell" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_LINE_CURRENT_PH_B, "Line Current Ph B" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_ACTIVE_CURRENT_PH_B, "Active Current Ph B" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_REACTIVE_CURRENT_PH_B, "Reactive Current Ph B" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_VOLTAGE_PH_B, "RMS Voltage Ph B" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_VOLTAGE_MIN_PH_B, "RMS Voltage Min Ph B" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_VOLTAGE_MAX_PH_B, "RMS Voltage Max Ph B" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_CURRENT_PH_B, "RMS Current Ph B" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_CURRENT_MIN_PH_B, "RMS Current Min Ph B" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_CURRENT_MAX_PH_B, "RMS Current Max Ph B" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_ACTIVE_POWER_PH_B, "Active Power Ph B" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_ACTIVE_POWER_MIN_PH_B, "Active Power Min Ph B" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_ACTIVE_POWER_MAX_PH_B, "Active Power Max Ph B" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_REACTIVE_POWER_PH_B, "Reactive Power Ph B" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_APPARENT_POWER_PH_B, "Apparent Power Ph B" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_POWER_FACTOR_PH_B, "Power Factor Ph B" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_AVERAGE_RMS_VOLTAGE_MEASUREMENT_PERIOD_PH_B, "Average RMS Voltage Measurement Period Ph B" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_AVERAGE_RMS_OVER_VOLTAGE_COUNTER_PH_B, "Average RMS Over Voltage Counter Ph B" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_AVERAGE_RMS_UNDER_VOLTAGE_COUNTER_PH_B, "Average RMS Under Voltage Counter Ph B" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_EXTREME_OVER_VOLTAGE_PERIOD_PH_B, "RMS Extreme Over Voltage Period Ph B" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_EXTREME_UNDER_VOLTAGE_PERIOD_PH_B, "RMS Extreme Under Voltage Period Ph B" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_VOLTAGE_SAG_PERIOD_PH_B, "RMS Voltage Sag Period Ph B" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_VOLTAGE_SWELL_PERIOD_PH_B, "RMS Voltage Swell Period Ph B" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_LINE_CURRENT_PH_C, "Line Current Ph C" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_REACTIVE_CURRENT_PH_C, "Reactive Current Ph C" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_VOLTAGE_PH_C, "RMS Voltage Ph C" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_VOLTAGE_MIN_PH_C, "RMS Voltage Min Ph C" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_VOLTAGE_MAX_PH_C, "RMS Voltage Max Ph C" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_CURRENT_PH_C, "RMS Current Ph C" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_CURRENT_MIN_PH_C, "RMS Current Min Ph C" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_CURRENT_MAX_PH_C, "RMS Current Max Ph C" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_ACTIVE_POWER_PH_C, "Active Power Ph C" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_ACTIVE_POWER_MIN_PH_C, "Active Power Min Ph C" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_ACTIVE_POWER_MAX_PH_C, "Active Power Max Ph C" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_REACTIVE_POWER_PH_C, "Reactive Power Ph C" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_APPARENT_POWER_PH_C, "Apparent Power Ph C" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_POWER_FACTOR_PH_C, "Power Factor Ph C" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_AVERAGE_RMS_VOLTAGE_MEASUREMENT_PERIOD_PH_C, "Average RMS Voltage Measurement Period Ph C" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_AVERAGE_RMS_OVER_VOLTAGE_COUNTER_PH_C, "Average RMS Over Voltage Counter Ph C" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_AVERAGE_RMS_UNDER_VOLTAGE_COUNTER_PH_C, "Average RMS Under Voltage Counter Ph C" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_EXTREME_OVER_VOLTAGE_PERIOD_PH_C, "RMS Extreme Over Voltage Period Ph C" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_EXTREME_UNDER_VOLTAGE_PERIOD_PH_C, "RMS Extreme Under Voltage Period Ph C" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_VOLTAGE_SAG_PERIOD_PH_C, "RMS Voltage Sag Period Ph C" },
|
||||
{ ZBEE_ZCL_ATTR_ID_ELEC_MES_RMS_VOLTAGE_SWELL_PERIOD_PH_C, "RMS Voltage Swell Period Ph C" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
static value_string_ext zbee_zcl_elec_mes_attr_names_ext = VALUE_STRING_EXT_INIT(zbee_zcl_elec_mes_attr_names);
|
||||
|
||||
/* Server Commands Received */
|
||||
static const value_string zbee_zcl_elec_mes_srv_rx_cmd_names[] = {
|
||||
{ ZBEE_ZCL_CMD_GET_PROFILE_INFO, "Get Profile Info", },
|
||||
{ ZBEE_ZCL_CMD_GET_MEASUREMENT_PROFILE_INFO, "Get Measurement Profile", },
|
||||
{ 0, NULL }
|
||||
};
|
||||
|
||||
/* Server Commands Generated */
|
||||
static const value_string zbee_zcl_elec_mes_srv_tx_cmd_names[] = {
|
||||
{ ZBEE_ZCL_CMD_GET_PROFILE_INFO_RESPONSE, "Get Profile Info Response", },
|
||||
{ ZBEE_ZCL_CMD_GET_MEASUREMENT_PROFILE_INFO_RESPONSE, "Get Measurement Profile Response", },
|
||||
{ 0, NULL }
|
||||
};
|
||||
|
||||
/* Profile Interval Period */
|
||||
static const value_string zbee_zcl_elec_mes_profile_interval_period_names[] = {
|
||||
{ ZBEE_ZCL_ELEC_MES_PROFILE_INTERVAL_PERIOD_DAILY, "Daily", },
|
||||
{ ZBEE_ZCL_ELEC_MES_PROFILE_INTERVAL_PERIOD_60_MINUTES, "60 Minutes", },
|
||||
{ ZBEE_ZCL_ELEC_MES_PROFILE_INTERVAL_PERIOD_30_MINUTES, "30 Minutes", },
|
||||
{ ZBEE_ZCL_ELEC_MES_PROFILE_INTERVAL_PERIOD_15_MINUTES, "15 Minutes", },
|
||||
{ ZBEE_ZCL_ELEC_MES_PROFILE_INTERVAL_PERIOD_10_MINUTES, "10 Minutes", },
|
||||
{ ZBEE_ZCL_ELEC_MES_PROFILE_INTERVAL_PERIOD_7_5_MINUTES, "7.5 Minutes", },
|
||||
{ ZBEE_ZCL_ELEC_MES_PROFILE_INTERVAL_PERIOD_5_MINUTES, "5 Minutes", },
|
||||
{ ZBEE_ZCL_ELEC_MES_PROFILE_INTERVAL_PERIOD_2_5_MINUTES, "2.5 Minutes", },
|
||||
{ 0, NULL }
|
||||
};
|
||||
|
||||
/* List of Status Valid Values */
|
||||
static const value_string zbee_zcl_elec_mes_status_names[] = {
|
||||
{ ZBEE_ZCL_ELEC_MES_STATUS_SUCCESS, "Success", },
|
||||
{ ZBEE_ZCL_ELEC_MES_STATUS_ATTRIBUTE_PROFILE_NOT_SUPPORTED, "Attribute Profile not supported", },
|
||||
{ ZBEE_ZCL_ELEC_MES_STATUS_INVALID_START_TIME, "Invalid Start Time", },
|
||||
{ ZBEE_ZCL_ELEC_MES_STATUS_MORE_INTERVALS_REQUESTED_THAN_CAN_BE_RET, "More intervals requested than can be returned", },
|
||||
{ ZBEE_ZCL_ELEC_MES_STATUS_NO_INTERVALS_AVAILABLE_FOR_THE_REQ_TIME, "No intervals available for the requested time", },
|
||||
{ 0, NULL }
|
||||
};
|
||||
|
||||
/*************************/
|
||||
/* Function Bodies */
|
||||
/*************************/
|
||||
|
||||
/**
|
||||
*ZigBee ZCL Electrical Measurement cluster dissector for wireshark.
|
||||
*
|
||||
*@param tvb pointer to buffer containing raw packet.
|
||||
*@param pinfo pointer to packet information fields
|
||||
*@param tree pointer to data tree Wireshark uses to display packet.
|
||||
*/
|
||||
static int
|
||||
dissect_zbee_zcl_elec_mes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
|
||||
{
|
||||
proto_tree *payload_tree;
|
||||
zbee_zcl_packet *zcl;
|
||||
guint offset = 0;
|
||||
guint8 cmd_id;
|
||||
gint rem_len;
|
||||
|
||||
/* Reject the packet if data is NULL */
|
||||
if (data == NULL)
|
||||
return 0;
|
||||
zcl = (zbee_zcl_packet *)data;
|
||||
cmd_id = zcl->cmd_id;
|
||||
|
||||
/* Create a subtree for the ZCL Command frame, and add the command ID to it. */
|
||||
if (zcl->direction == ZBEE_ZCL_FCF_TO_SERVER) {
|
||||
/* Append the command name to the info column. */
|
||||
col_append_fstr(pinfo->cinfo, COL_INFO, "%s, Seq: %u",
|
||||
val_to_str_const(cmd_id, zbee_zcl_elec_mes_srv_rx_cmd_names, "Unknown Command"),
|
||||
zcl->tran_seqno);
|
||||
|
||||
/* Add the command ID. */
|
||||
proto_tree_add_uint(tree, hf_zbee_zcl_elec_mes_srv_rx_cmd_id, tvb, offset, 1, cmd_id);
|
||||
|
||||
/* Check is this command has a payload, than add the payload tree */
|
||||
rem_len = tvb_reported_length_remaining(tvb, ++offset);
|
||||
if (rem_len > 0) {
|
||||
payload_tree = proto_tree_add_subtree(tree, tvb, offset, rem_len, ett_zbee_zcl_elec_mes, NULL, "Payload");
|
||||
|
||||
/* Call the appropriate command dissector */
|
||||
switch (cmd_id) {
|
||||
|
||||
case ZBEE_ZCL_CMD_GET_PROFILE_INFO:
|
||||
/* No Payload */
|
||||
break;
|
||||
|
||||
case ZBEE_ZCL_CMD_GET_MEASUREMENT_PROFILE_INFO:
|
||||
dissect_zcl_elec_mes_get_measurement_profile_info(tvb, payload_tree, &offset);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else { /* ZBEE_ZCL_FCF_TO_CLIENT */
|
||||
/* Append the command name to the info column. */
|
||||
col_append_fstr(pinfo->cinfo, COL_INFO, "%s, Seq: %u",
|
||||
val_to_str_const(cmd_id, zbee_zcl_elec_mes_srv_tx_cmd_names, "Unknown Command"),
|
||||
zcl->tran_seqno);
|
||||
|
||||
/* Add the command ID. */
|
||||
proto_tree_add_uint(tree, hf_zbee_zcl_elec_mes_srv_tx_cmd_id, tvb, offset, 1, cmd_id);
|
||||
|
||||
/* Check is this command has a payload, than add the payload tree */
|
||||
rem_len = tvb_reported_length_remaining(tvb, ++offset);
|
||||
if (rem_len > 0) {
|
||||
payload_tree = proto_tree_add_subtree(tree, tvb, offset, rem_len, ett_zbee_zcl_elec_mes, NULL, "Payload");
|
||||
|
||||
/* Call the appropriate command dissector */
|
||||
switch (cmd_id) {
|
||||
|
||||
case ZBEE_ZCL_CMD_GET_PROFILE_INFO_RESPONSE:
|
||||
dissect_zcl_elec_mes_get_profile_info_response(tvb, payload_tree, &offset);
|
||||
break;
|
||||
|
||||
case ZBEE_ZCL_CMD_GET_MEASUREMENT_PROFILE_INFO_RESPONSE:
|
||||
dissect_zcl_elec_mes_get_measurement_profile_info_response(tvb, payload_tree, &offset);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return tvb_captured_length(tvb);
|
||||
} /*dissect_zbee_zcl_elec_mes*/
|
||||
|
||||
/**
|
||||
*This function is called by ZCL foundation dissector in order to decode
|
||||
*
|
||||
*@param tree pointer to data tree Wireshark uses to display packet.
|
||||
*@param tvb pointer to buffer containing raw packet.
|
||||
*@param offset pointer to buffer offset
|
||||
*@param attr_id attribute identifier
|
||||
*@param data_type attribute data type
|
||||
*@param client_attr ZCL client
|
||||
*/
|
||||
static void
|
||||
dissect_zcl_elec_mes_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 ) {
|
||||
default:
|
||||
dissect_zcl_attr_data(tvb, tree, offset, data_type, client_attr);
|
||||
break;
|
||||
}
|
||||
} /*dissect_zcl_elec_mes_attr_data*/
|
||||
|
||||
/**
|
||||
*This function manages the Get Measurement Profile Info payload
|
||||
*
|
||||
*@param tvb pointer to buffer containing raw packet.
|
||||
*@param tree pointer to data tree Wireshark uses to display packet.
|
||||
*@param offset pointer to offset from caller
|
||||
*/
|
||||
static void dissect_zcl_elec_mes_get_measurement_profile_info(tvbuff_t *tvb, proto_tree *tree, guint *offset)
|
||||
{
|
||||
nstime_t start_time;
|
||||
|
||||
proto_tree_add_item(tree, hf_zbee_zcl_elec_mes_attr_id, tvb, *offset, 2, ENC_LITTLE_ENDIAN);
|
||||
*offset += 2;
|
||||
|
||||
start_time.secs = (time_t)tvb_get_letohl(tvb, *offset) + ZBEE_ZCL_NSTIME_UTC_OFFSET;
|
||||
start_time.nsecs = 0;
|
||||
proto_tree_add_time(tree, hf_zbee_zcl_elec_mes_start_time, tvb, *offset, 4, &start_time);
|
||||
*offset += 4;
|
||||
|
||||
proto_tree_add_item(tree, hf_zbee_zcl_elec_mes_number_of_intervals, tvb, *offset, 1, ENC_NA);
|
||||
*offset += 1;
|
||||
}
|
||||
|
||||
/**
|
||||
*This function manages the Get Profile Info Response payload
|
||||
*
|
||||
*@param tvb pointer to buffer containing raw packet.
|
||||
*@param tree pointer to data tree Wireshark uses to display packet.
|
||||
*@param offset pointer to offset from caller
|
||||
*/
|
||||
static void dissect_zcl_elec_mes_get_profile_info_response(tvbuff_t *tvb, proto_tree *tree, guint *offset)
|
||||
{
|
||||
proto_tree_add_item(tree, hf_zbee_zcl_elec_mes_profile_count, tvb, *offset, 1, ENC_NA);
|
||||
*offset += 1;
|
||||
|
||||
proto_tree_add_item(tree, hf_zbee_zcl_elec_mes_profile_interval_period, tvb, *offset, 1, ENC_NA);
|
||||
*offset += 1;
|
||||
|
||||
proto_tree_add_item(tree, hf_zbee_zcl_elec_mes_max_number_of_intervals, tvb, *offset, 1, ENC_NA);
|
||||
*offset += 1;
|
||||
|
||||
while (tvb_reported_length_remaining(tvb, *offset) > 0) {
|
||||
proto_tree_add_item(tree, hf_zbee_zcl_elec_mes_attr_id, tvb, *offset, 2, ENC_LITTLE_ENDIAN);
|
||||
*offset += 2;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*This function manages the Get Measurement Profile Info Response payload
|
||||
*
|
||||
*@param tvb pointer to buffer containing raw packet.
|
||||
*@param tree pointer to data tree Wireshark uses to display packet.
|
||||
*@param offset pointer to offset from caller
|
||||
*/
|
||||
static void dissect_zcl_elec_mes_get_measurement_profile_info_response(tvbuff_t *tvb, proto_tree *tree, guint *offset)
|
||||
{
|
||||
nstime_t start_time;
|
||||
guint rem_len;
|
||||
|
||||
start_time.secs = (time_t)tvb_get_letohl(tvb, *offset) + ZBEE_ZCL_NSTIME_UTC_OFFSET;
|
||||
start_time.nsecs = 0;
|
||||
proto_tree_add_time(tree, hf_zbee_zcl_elec_mes_start_time, tvb, *offset, 4, &start_time);
|
||||
*offset += 4;
|
||||
|
||||
proto_tree_add_item(tree, hf_zbee_zcl_elec_mes_status, tvb, *offset, 1, ENC_NA);
|
||||
*offset += 1;
|
||||
|
||||
proto_tree_add_item(tree, hf_zbee_zcl_elec_mes_profile_interval_period, tvb, *offset, 1, ENC_NA);
|
||||
*offset += 1;
|
||||
|
||||
proto_tree_add_item(tree, hf_zbee_zcl_elec_mes_number_of_intervals_delivered, tvb, *offset, 1, ENC_NA);
|
||||
*offset += 1;
|
||||
|
||||
proto_tree_add_item(tree, hf_zbee_zcl_elec_mes_attr_id, tvb, *offset, 2, ENC_LITTLE_ENDIAN);
|
||||
*offset += 2;
|
||||
|
||||
rem_len = tvb_reported_length_remaining(tvb, *offset);
|
||||
proto_tree_add_item(tree, hf_zbee_zcl_elec_mes_intervals, tvb, *offset, rem_len, ENC_NA);
|
||||
*offset += rem_len;
|
||||
}
|
||||
|
||||
/**
|
||||
*This function registers the ZCL Occupancy Sensing dissector
|
||||
*
|
||||
*/
|
||||
void
|
||||
proto_register_zbee_zcl_elec_mes(void)
|
||||
{
|
||||
static hf_register_info hf[] = {
|
||||
|
||||
{ &hf_zbee_zcl_elec_mes_srv_tx_cmd_id,
|
||||
{ "Command", "zbee_zcl_meas_sensing.elecmes.cmd.srv_tx.id", FT_UINT8, BASE_HEX, VALS(zbee_zcl_elec_mes_srv_tx_cmd_names),
|
||||
0x00, NULL, HFILL } },
|
||||
|
||||
{ &hf_zbee_zcl_elec_mes_srv_rx_cmd_id,
|
||||
{ "Command", "zbee_zcl_meas_sensing.elecmes.cmd.srv_rx.id", FT_UINT8, BASE_HEX, VALS(zbee_zcl_elec_mes_srv_rx_cmd_names),
|
||||
0x00, NULL, HFILL } },
|
||||
|
||||
{ &hf_zbee_zcl_elec_mes_attr_id,
|
||||
{ "Attribute", "zbee_zcl_meas_sensing.elecmes.attr_id", FT_UINT16, BASE_HEX | BASE_EXT_STRING, &zbee_zcl_elec_mes_attr_names_ext,
|
||||
0x00, NULL, HFILL } },
|
||||
|
||||
{ &hf_zbee_zcl_elec_mes_start_time,
|
||||
{ "Start Time", "zbee_zcl_meas_sensing.elecmes.start_time", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL,
|
||||
0x00, NULL, HFILL } },
|
||||
|
||||
{ &hf_zbee_zcl_elec_mes_number_of_intervals,
|
||||
{ "Number of Intervals", "zbee_zcl_meas_sensing.elecmes.number_of_intervals", FT_UINT8, BASE_DEC, NULL,
|
||||
0x00, NULL, HFILL } },
|
||||
|
||||
{ &hf_zbee_zcl_elec_mes_profile_count,
|
||||
{ "Profile Count", "zbee_zcl_meas_sensing.elecmes.profile_count", FT_UINT8, BASE_DEC, NULL,
|
||||
0x00, NULL, HFILL } },
|
||||
|
||||
{ &hf_zbee_zcl_elec_mes_profile_interval_period,
|
||||
{ "Profile Interval Pediod", "zbee_zcl_meas_sensing.elecmes.profile_interval_period", FT_UINT8, BASE_DEC, NULL,
|
||||
0x00, NULL, HFILL } },
|
||||
|
||||
{ &hf_zbee_zcl_elec_mes_max_number_of_intervals,
|
||||
{ "Max Number of Intervals", "zbee_zcl_meas_sensing.elecmes.max_number_of_intervals", FT_UINT8, BASE_DEC, VALS(zbee_zcl_elec_mes_profile_interval_period_names),
|
||||
0x00, NULL, HFILL } },
|
||||
|
||||
{ &hf_zbee_zcl_elec_mes_status,
|
||||
{ "Status", "zbee_zcl_meas_sensing.elecmes.status", FT_UINT8, BASE_HEX, VALS(zbee_zcl_elec_mes_status_names),
|
||||
0x00, NULL, HFILL } },
|
||||
|
||||
{ &hf_zbee_zcl_elec_mes_number_of_intervals_delivered,
|
||||
{ "Number of Intervals Delivered", "zbee_zcl_meas_sensing.elecmes.number_of_intervals_delivered", FT_UINT8, BASE_DEC, NULL,
|
||||
0x00, NULL, HFILL } },
|
||||
|
||||
{ &hf_zbee_zcl_elec_mes_intervals,
|
||||
{ "Intervals", "zbee_zcl_meas_sensing.elecmes.intervals", FT_BYTES, BASE_NONE, NULL,
|
||||
0x00, NULL, HFILL } }
|
||||
};
|
||||
|
||||
/* ZCL Electrical Measurement subtrees */
|
||||
static gint *ett[ZBEE_ZCL_ELEC_MES_NUM_ETT];
|
||||
ett[0] = &ett_zbee_zcl_elec_mes;
|
||||
|
||||
/* Register the ZigBee ZCL Electrical Measurement cluster protocol name and description */
|
||||
proto_zbee_zcl_elec_mes = proto_register_protocol("ZigBee ZCL Electrical Measurement", "ZCL Electrical Measurement", ZBEE_PROTOABBREV_ZCL_ELECMES);
|
||||
proto_register_field_array(proto_zbee_zcl_elec_mes, hf, array_length(hf));
|
||||
proto_register_subtree_array(ett, array_length(ett));
|
||||
|
||||
/* Register the ZigBee ZCL Electrical Measurement dissector. */
|
||||
register_dissector(ZBEE_PROTOABBREV_ZCL_ELECMES, dissect_zbee_zcl_elec_mes, proto_zbee_zcl_elec_mes);
|
||||
|
||||
} /*proto_register_zbee_zcl_elec_mes*/
|
||||
|
||||
|
||||
/**
|
||||
*Hands off the ZCL Electrical Measurement dissector.
|
||||
*
|
||||
*/
|
||||
void
|
||||
proto_reg_handoff_zbee_zcl_elec_mes(void)
|
||||
{
|
||||
zbee_zcl_init_cluster( ZBEE_PROTOABBREV_ZCL_ELECMES,
|
||||
proto_zbee_zcl_elec_mes,
|
||||
ett_zbee_zcl_elec_mes,
|
||||
ZBEE_ZCL_CID_ELECTRICAL_MEASUREMENT,
|
||||
ZBEE_MFG_CODE_NONE,
|
||||
hf_zbee_zcl_elec_mes_attr_id,
|
||||
-1,
|
||||
hf_zbee_zcl_elec_mes_srv_rx_cmd_id,
|
||||
hf_zbee_zcl_elec_mes_srv_tx_cmd_id,
|
||||
(zbee_zcl_fn_attr_data)dissect_zcl_elec_mes_attr_data
|
||||
);
|
||||
} /*proto_reg_handoff_zbee_zcl_elec_mes*/
|
||||
|
||||
/*
|
||||
* Editor modelines - http://www.wireshark.org/tools/modelines.html
|
||||
|
|
|
@ -1159,6 +1159,7 @@
|
|||
#define ZBEE_PROTOABBREV_ZCL_RELHUMMEAS "zbee_zcl_meas_sensing.relhummeas"
|
||||
#define ZBEE_PROTOABBREV_ZCL_TEMPMEAS "zbee_zcl_meas_sensing.tempmeas"
|
||||
#define ZBEE_PROTOABBREV_ZCL_OCCSEN "zbee_zcl_meas_sensing.occsen"
|
||||
#define ZBEE_PROTOABBREV_ZCL_ELECMES "zbee_zcl_meas_sensing.elecmes"
|
||||
#define ZBEE_PROTOABBREV_ZCL_KEEP_ALIVE "zbee_zcl_se.keep_alive"
|
||||
#define ZBEE_PROTOABBREV_ZCL_PRICE "zbee_zcl_se.price"
|
||||
#define ZBEE_PROTOABBREV_ZCL_DRLC "zbee_zcl_se.drlc"
|
||||
|
|
Loading…
Reference in New Issue