zephyr/subsys/net/lib/lwm2m
Robert Chou 6fbd86113d net: lwm2m: fix reporting attributes with negative fraction
Fraction could be stored with negative value.
The implementation was only considering the positive value case.
Therefore, we have to modify the code to take care of the case.

To test it
======================================================================
1. launch eclipse/wakaama lwm2m server
2. launch zephyr lwm2m client and wait for registration completed
3. Issue commands from server
   * attr 0 /1/0/1 -0.1 0.1
   * disc 0 /1/0

Current output
----------------------------------------------------------------------
Client #0 /1/0 : 2.05 (COAP_205_CONTENT)
105 bytes received of type application/link-format:
</1/0>,</1/0/0>,</1/0/1>;gt=0.1;lt=0/00000,</1/0/2>,</1/0/3>,</1/0/4>,
</1/0/5>,</1/0/6>,</1/0/7>,</1/0/8>

Expected output
----------------------------------------------------------------------
Client #0 /1/0 : 2.05 (COAP_205_CONTENT)
102 bytes received of type application/link-format:
</1/0>,</1/0/0>,</1/0/1>;gt=0.1;lt=-0.1,</1/0/2>,</1/0/3>,</1/0/4>,
</1/0/5>,</1/0/6>,</1/0/7>,</1/0/8>

Signed-off-by: Robert Chou <robert.ch.chou@acer.com>
2018-01-29 23:30:44 -05:00
..
CMakeLists.txt net: lwm2m: add support for DTLS 2017-12-15 16:46:48 -05:00
ipso_light_control.c net: lwm2m: fix all return values from resource callbacks 2017-10-31 09:41:27 +02:00
ipso_temp_sensor.c net: lwm2m: fix max measurement checks 2017-11-15 15:31:45 +02:00
Kconfig net: lwm2m: add write-attribute WRITE support 2018-01-12 20:57:34 -05:00
Kconfig.ipso doc: fix Kconfig misspellings 2017-08-31 14:22:11 -04:00
lwm2m_engine.c net: lwm2m: fix reporting attributes with negative fraction 2018-01-29 23:30:44 -05:00
lwm2m_engine.h net: lwm2m: separate write operation from write-attributes op 2017-12-12 09:26:31 -05:00
lwm2m_obj_device.c net: lwm2m: fix all return values from resource callbacks 2017-10-31 09:41:27 +02:00
lwm2m_obj_firmware.c net: lwm2m: response to peer with correct error code when write fail 2017-11-06 20:49:59 +02:00
lwm2m_obj_firmware_pull.c net: lib: lwm2m: fix coap proxy resource option 2018-01-11 09:18:45 +02:00
lwm2m_obj_security.c net: lwm2m: initial library support for LWM2M 2017-08-09 10:55:53 +03:00
lwm2m_obj_server.c net: lwm2m: initial library support for LWM2M 2017-08-09 10:55:53 +03:00
lwm2m_object.h net: lwm2m: add write-attribute WRITE support 2018-01-12 20:57:34 -05:00
lwm2m_rd_client.c net: lwm2m: use correct remote address when DTLS is enabled 2017-12-15 16:46:48 -05:00
lwm2m_rd_client.h net: lwm2m: add SPX Apache-2.0 license tag w/ Linaro copyright 2017-08-09 10:55:53 +03:00
lwm2m_rw_json.c net: lwm2m: introduce getter/setter for OPAQUE data 2017-10-31 09:41:27 +02:00
lwm2m_rw_json.h net: lwm2m: move non-public data out of shared JSON include 2017-10-20 10:40:55 +03:00
lwm2m_rw_oma_tlv.c net: lwm2m: oma_tlv: fix typo in TLV length processing 2017-11-02 10:01:05 +02:00
lwm2m_rw_oma_tlv.h net: lwm2m: move non-public data out of shared TLV include 2017-10-20 10:40:55 +03:00
lwm2m_rw_plain_text.c net: lwm2m: introduce getter/setter for OPAQUE data 2017-10-31 09:41:27 +02:00
lwm2m_rw_plain_text.h net: lwm2m: add multi fragment support to LwM2M library 2017-10-31 09:41:27 +02:00