Parse integers and single-precision floats in incoming CBOR streams
authorThiago Macieira <thiago.macieira@intel.com>
Thu, 24 Mar 2016 00:04:08 +0000 (17:04 -0700)
committerHabib Virji <habib.virji@samsung.com>
Thu, 24 Mar 2016 23:27:22 +0000 (23:27 +0000)
commit0026f2b529218f34745cbf5ee54589d4150ff380
tree5291405e647057d5e31d482f713864171879893a
parent58f6af2f58862fc44ae516fbe952c5a713a12077
Parse integers and single-precision floats in incoming CBOR streams

Incoming single-precision data is automatically converted to
double-precision upon parsing. Integers are kept as is, but if the user
requests the data as floating point, we convert on the fly. That is
inefficient if the call is performed more than once, but the appication
shouldn't do that anyway to avoid memory allocations.

Fixes IOT-981.

Change-Id: I11a23ec8442c40bf9f7affff143e9edd0d17eec7
Signed-off-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/6239
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Habib Virji <habib.virji@samsung.com>
resource/csdk/stack/src/ocpayload.c
resource/csdk/stack/src/ocpayloadparse.c