net: lwm2m: do not report object when object instances available
Per LwM2M specification 5.3.1 Register. When object instances are available, object ID can be ignored in registration message Signed-off-by: Robert Chou <robert.ch.chou@acer.com>
This commit is contained in:
parent
c21372eeb8
commit
a64dcbb7bf
1 changed files with 12 additions and 8 deletions
|
@ -591,6 +591,8 @@ u16_t lwm2m_get_rd_data(u8_t *client_data, u16_t size)
|
|||
continue;
|
||||
}
|
||||
|
||||
/* Only report <OBJ_ID> when no instance available */
|
||||
if (obj->instance_count == 0) {
|
||||
len = snprintf(temp, sizeof(temp), "%s</%u>",
|
||||
(pos > 0) ? "," : "", obj->obj_id);
|
||||
if (pos + len >= size) {
|
||||
|
@ -600,6 +602,8 @@ u16_t lwm2m_get_rd_data(u8_t *client_data, u16_t size)
|
|||
|
||||
memcpy(&client_data[pos], temp, len);
|
||||
pos += len;
|
||||
continue;
|
||||
}
|
||||
|
||||
SYS_SLIST_FOR_EACH_CONTAINER(&engine_obj_inst_list,
|
||||
obj_inst, node) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue