zigbee: enhance zigbee illuminance cluster dissection

value displayed wasn't in lux

Change-Id: Id0c48c9a7968639e47d81e128c22c6cdcb3df929
Reviewed-on: https://code.wireshark.org/review/7945
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
This commit is contained in:
Julien STAUB 2015-04-06 15:16:26 +02:00 committed by Pascal Quantin
parent 9147961908
commit 8fec18a0b6
3 changed files with 8 additions and 6 deletions

View File

@ -155,7 +155,7 @@ static const value_string zbee_zcl_basic_pwr_src_names[] = {
{ ZBEE_ZCL_BASIC_PWR_SRC_BATTERY, "Battery" },
{ ZBEE_ZCL_BASIC_PWR_SRC_DC_SRC, "DC source" },
{ ZBEE_ZCL_BASIC_PWR_SRC_EMERGENCY_1, "Emergency mains constantly powered" },
{ ZBEE_ZCL_BASIC_PWR_SRC_EMERGENCY_2, "Emergency mains and tranfer switch" },
{ ZBEE_ZCL_BASIC_PWR_SRC_EMERGENCY_2, "Emergency mains and transfer switch" },
{ 0, NULL }
};

View File

@ -26,6 +26,7 @@
/* Include Files */
#include "config.h"
#include <math.h>
#include <epan/packet.h>
#include "packet-zbee.h"
@ -215,7 +216,8 @@ decode_illum_meas_value(gchar *s, guint16 value)
else if (value == ZBEE_ZCL_ATTR_ID_ILLUM_MEAS_INVALID_VALUE)
g_snprintf(s, ITEM_LABEL_LENGTH, "Invalid value");
else
g_snprintf(s, ITEM_LABEL_LENGTH, "%d [lx]", value);
/* calculate lux value from measured value according to doc 07-5123-04 */
g_snprintf(s, ITEM_LABEL_LENGTH, "%d (=%f [lx])", value, pow(10,value/10000.0)-1);
return;
} /*decode_illum_meas_value*/
@ -239,7 +241,7 @@ decode_illum_meas_min_value(gchar *s, guint16 value)
(value > ZBEE_ZCL_ATTR_ID_ILLUM_MEAS_MIN_HI_VALUE) )
g_snprintf(s, ITEM_LABEL_LENGTH, "Out of range");
else
g_snprintf(s, ITEM_LABEL_LENGTH, "%d [lx]", value);
g_snprintf(s, ITEM_LABEL_LENGTH, "%d (=%f [lx])", value, pow(10,value/10000.0)-1);
return;
} /*decode_illum_meas_min_value*/
@ -263,7 +265,7 @@ decode_illum_meas_max_value(gchar *s, guint16 value)
(value > ZBEE_ZCL_ATTR_ID_ILLUM_MEAS_MAX_HI_VALUE) )
g_snprintf(s, ITEM_LABEL_LENGTH, "Out of range");
else
g_snprintf(s, ITEM_LABEL_LENGTH, "%d [lx]", value);
g_snprintf(s, ITEM_LABEL_LENGTH, "%d (=%f [lx])", value, pow(10,value/10000.0)-1);
return;
} /*decode_illum_meas_max_value*/
@ -286,7 +288,7 @@ decode_illum_meas_tolerance(gchar *s, guint16 value)
if (value > ZBEE_ZCL_ATTR_ID_ILLUM_MEAS_TOL_HI_VALUE)
g_snprintf(s, ITEM_LABEL_LENGTH, "Out of range");
else
g_snprintf(s, ITEM_LABEL_LENGTH, "%d [lx]", value);
g_snprintf(s, ITEM_LABEL_LENGTH, "%d", value);
return;
} /*decode_illum_meas_tolerance*/

View File

@ -757,7 +757,7 @@ proto_reg_handoff_zbee_zcl_msg(void)
} /*proto_reg_handoff_zbee_zcl_msg*/
/* ########################################################################## */
/* #### (0x0704 TUNNELING CLUSTER ########################################### */
/* #### (0x0704) TUNNELING CLUSTER ########################################### */
/* ########################################################################## */
/* Attributes */