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,15 +591,19 @@ u16_t lwm2m_get_rd_data(u8_t *client_data, u16_t size)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
len = snprintf(temp, sizeof(temp), "%s</%u>",
|
/* Only report <OBJ_ID> when no instance available */
|
||||||
(pos > 0) ? "," : "", obj->obj_id);
|
if (obj->instance_count == 0) {
|
||||||
if (pos + len >= size) {
|
len = snprintf(temp, sizeof(temp), "%s</%u>",
|
||||||
/* full buffer -- exit loop */
|
(pos > 0) ? "," : "", obj->obj_id);
|
||||||
break;
|
if (pos + len >= size) {
|
||||||
}
|
/* full buffer -- exit loop */
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
memcpy(&client_data[pos], temp, len);
|
memcpy(&client_data[pos], temp, len);
|
||||||
pos += len;
|
pos += len;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
SYS_SLIST_FOR_EACH_CONTAINER(&engine_obj_inst_list,
|
SYS_SLIST_FOR_EACH_CONTAINER(&engine_obj_inst_list,
|
||||||
obj_inst, node) {
|
obj_inst, node) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue