net: lwm2m: Add dimension discovery support

Multi-instance resources shall report its dimension (number of
resource instances) on discovery. Since it was not possible to tell
simply on the instance count whether the resource is multi-instance or
not (there could be a multi-instance resource with only one instance
avaialble) add a new parameter to the structure representing resource,
indicating whether it's multi-instance or not.

Add dimension information to the discovery result.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This commit is contained in:
Robert Lubos 2020-11-26 16:51:49 +01:00 committed by Carles Cufí
commit 366a2147cc
14 changed files with 69 additions and 36 deletions

View file

@ -213,7 +213,7 @@ static struct lwm2m_engine_obj_inst *buzzer_create(uint16_t obj_inst_id)
/* initialize instance resource data */
INIT_OBJ_RES(BUZZER_ON_OFF_ID, res[avail], i,
res_inst[avail], j, 1, true,
res_inst[avail], j, 1, false, true,
&buzzer_data[avail].onoff,
sizeof(buzzer_data[avail].onoff),
NULL, NULL, onoff_post_write_cb, NULL);