Fix logic in zigbee wrapper to correctly evaluate boolean values.
authorMandeep Shetty <mandeep.shetty@intel.com>
Tue, 22 Sep 2015 22:24:53 +0000 (15:24 -0700)
committerPatrick Lankswert <patrick.lankswert@intel.com>
Tue, 29 Sep 2015 23:30:38 +0000 (23:30 +0000)
commite618cf09465de9404d04dc90727f08795c7e709f
tree1d259e84d561f70a62f3d9c033b1f62b7d9ce0c6
parent66ea6de691f2f58652110c9c9cfc9f46e435f669
Fix logic in zigbee wrapper to correctly evaluate boolean values.

Boolean values could be read as either "0" or "00" and thus a simple
strcmp with "0" would not suffice.
Additionally, sometimes, bitmasks are read and so we need the entire
numeric value of the string.

Changed strcmp operations to convert to numeric operations.
Also extracted duplicate code into it's own function

Change-Id: I9a8918d9824dcb452b64fdbe9f344cfa020f9e7c
Signed-off-by: Mandeep Shetty <mandeep.shetty@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/3157
Reviewed-by: Joseph Morrow <joseph.l.morrow@intel.com>
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Patrick Lankswert <patrick.lankswert@intel.com>
plugins/zigbee_wrapper/src/zigbee_wrapper.c