Fix logic in zigbee wrapper to correctly evaluate boolean values.
authorJoseph Morrow <joseph.l.morrow@intel.com>
Mon, 5 Oct 2015 23:13:13 +0000 (16:13 -0700)
committerPatrick Lankswert <patrick.lankswert@intel.com>
Tue, 6 Oct 2015 12:55:47 +0000 (12:55 +0000)
commit18c3b9637f02e2df9c1e926d2e7cc508a276eafa
tree8d00372c44fc3fbaedcf591dd787a3b281bb262a
parentcbc5e63127b53bb2adf13c4a81fe8024ac1272dc
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: I9ab20ba5b4f2e9eb335a9dd51503fe19ceca7158
Signed-off-by: Mandeep Shetty <mandeep.shetty@intel.com>
Signed-off-by: Joseph Morrow <joseph.l.morrow@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>
Reviewed-on: https://gerrit.iotivity.org/gerrit/3525
plugins/zigbee_wrapper/src/zigbee_wrapper.c