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>
Mon, 5 Oct 2015 01:54:13 +0000 (01:54 +0000)
commit5930f8ddbe60c784ccc56869b55d98b7c1ac9d94
tree68a404474bff639195028b806c67fdda1f43b695
parent01a7c66b0961e2d33a2a3fd07638bd1eec5ae273
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/2957
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Patrick Lankswert <patrick.lankswert@intel.com>
plugins/zigbee_wrapper/src/zigbee_wrapper.c