net: lwm2m: Fix handling of multi instance resources with one instance
This will fix a bug caused by creating a multi instance resource with only a single resource. Previously this was treated as a single instance resource. This is now properly treated as a multi instance resource with one instance Signed-off-by: Markus Rekdal <markus.rekdal@nordicsemi.no>
This commit is contained in:
parent
94338c1640
commit
3221a1e8e7
1 changed files with 2 additions and 2 deletions
|
@ -2299,7 +2299,7 @@ static int lwm2m_read_handler(struct lwm2m_engine_obj_inst *obj_inst,
|
|||
}
|
||||
|
||||
loop_max = res->res_inst_count;
|
||||
if (loop_max > 1) {
|
||||
if (res->multi_res_inst) {
|
||||
/* search for valid resource instances */
|
||||
for (i = 0; i < loop_max; i++) {
|
||||
if (res->res_instances[i].res_inst_id !=
|
||||
|
@ -2427,7 +2427,7 @@ static int lwm2m_read_handler(struct lwm2m_engine_obj_inst *obj_inst,
|
|||
}
|
||||
}
|
||||
|
||||
if (res->res_inst_count > 1) {
|
||||
if (res->multi_res_inst) {
|
||||
engine_put_end_ri(&msg->out, &msg->path);
|
||||
msg->path.res_inst_id = res_inst_id_tmp;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue