Please sign in to comment.
net: lwm2m: rework resource instance storage / access methods
LwM2M allows for multiple instance resources such the power source resources in the device object. These types of resources have always been very hard to work with, and frankly were poorly implemented. This led to other issues where it was very hard to have non-sequential resource instances, and each resource of this type needed special getter / setter methods such as: lwm2m_device_add_pwrsrc() lwm2m_device_set_pwrsrc_voltage_mv() Going forward, as more LwM2M objects are implemented this just doesn't scale well. To fix this: - split the resource instance data out from the resource data. This includes the data pointer information and resource instance id. - add resource id and resource instance id to the event callback functions so user's can see in more detail what resources and resource instances are being handled. - allow generic functions like lwm2m_engine_get_*() and lwm2m_engine_set_*() to access resource instance data. - adjust object resource initialization macros to map resource instances to resources at the time of object instance creation. - fix up the lwm2m_client as a reflection of all of these changes. Signed-off-by: Michael Scott <email@example.com>
- Loading branch information...
Showing with 865 additions and 423 deletions.
- +39 −7 include/net/lwm2m.h
- +38 −33 samples/net/lwm2m_client/src/lwm2m-client.c
- +40 −21 subsys/net/lib/lwm2m/ipso_light_control.c
- +28 −16 subsys/net/lib/lwm2m/ipso_temp_sensor.c
- +61 −35 subsys/net/lib/lwm2m/ipso_timer.c
- +235 −93 subsys/net/lib/lwm2m/lwm2m_engine.c
- +3 −2 subsys/net/lib/lwm2m/lwm2m_engine.h
- +140 −122 subsys/net/lib/lwm2m/lwm2m_obj_device.c
- +26 −15 subsys/net/lib/lwm2m/lwm2m_obj_firmware.c
- +6 −5 subsys/net/lib/lwm2m/lwm2m_obj_firmware_pull.c
- +31 −13 subsys/net/lib/lwm2m/lwm2m_obj_security.c
- +31 −13 subsys/net/lib/lwm2m/lwm2m_obj_server.c
- +131 −35 subsys/net/lib/lwm2m/lwm2m_object.h
- +22 −6 subsys/net/lib/lwm2m/lwm2m_rw_json.c
- +15 −4 subsys/net/lib/lwm2m/lwm2m_rw_oma_tlv.c
- +19 −3 subsys/net/lib/lwm2m/lwm2m_rw_plain_text.c
Oops, something went wrong.