You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Writing to ressources which have a pre_write callback registered that can return a buffer thats longer than the original ressource buffers size may fail with -EINVAL.
To Reproduce
Try to write a value to e.g. "3/0/13" (device time). assert(!lwm2m_engine_set_s32("3/0/13", 1607477126)
This will fail with -EINVAL.
Expected behavior
The value should've been written to the temporary buffer returned by "3/0/13"s pre_write callback (registered in lwm2m_obj_device.c) and used to update the device's UTC-offset.
Impact
Setting time externaly via lwm2m is impossible.
This also makes it hard/impossible to create ressources that use an external buffer/mechanism to store the values, e.g. to save on memory footprint.
Environment (please complete the following information):
OS: Linux
Toolchain: Zephyr SDK 0.11.4
Commit SHA or Version used: 105a1b9 (from nordics zephyr fork)
The text was updated successfully, but these errors were encountered:
Previously, lwm2m_engine set would check against the max_data_len
parameter of the ressource, but didn't take into consideration the
(possibly changed) max_data_len returned by the pre_write callback.
Fixeszephyrproject-rtos#30541
Signed-off-by: Henning Fleddermann <henning.fleddermann@grandcentrix.net>
Previously, lwm2m_engine set would check against the max_data_len
parameter of the ressource, but didn't take into consideration the
(possibly changed) max_data_len returned by the pre_write callback.
Fixes#30541
Signed-off-by: Henning Fleddermann <henning.fleddermann@grandcentrix.net>
bwasim
pushed a commit
to bwasim/zephyr
that referenced
this issue
Jan 5, 2021
Previously, lwm2m_engine set would check against the max_data_len
parameter of the ressource, but didn't take into consideration the
(possibly changed) max_data_len returned by the pre_write callback.
Fixeszephyrproject-rtos#30541
Signed-off-by: Henning Fleddermann <henning.fleddermann@grandcentrix.net>
Describe the bug
Writing to ressources which have a pre_write callback registered that can return a buffer thats longer than the original ressource buffers size may fail with -EINVAL.
To Reproduce
Try to write a value to e.g. "3/0/13" (device time).
assert(!lwm2m_engine_set_s32("3/0/13", 1607477126)
This will fail with -EINVAL.
Expected behavior
The value should've been written to the temporary buffer returned by "3/0/13"s pre_write callback (registered in lwm2m_obj_device.c) and used to update the device's UTC-offset.
Impact
Setting time externaly via lwm2m is impossible.
This also makes it hard/impossible to create ressources that use an external buffer/mechanism to store the values, e.g. to save on memory footprint.
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: