wakaama icon indicating copy to clipboard operation
wakaama copied to clipboard

Multiple issues for observe with just an object ID

Open sbertin-telular opened this issue 7 years ago • 4 comments

An observe with just the object ID is allowed by the spec, but I see multiple problems in the implementation:

  1. New instances do not generate a notify.
  2. Deletion of an instance does not generate a notify.
  3. It is not possible to observe an object ID that currently has no instances. The object_readData function will return COAP_404_NOT_FOUND if there are no instances and the observe will not be added.

sbertin-telular avatar Apr 18 '17 13:04 sbertin-telular

  1. and 2. are the Object plugin responsability. It should call lwm2m_resource_value_changed() when instances are created and deleted. Note that creating or deleting instances will generate a registration update message.

Regarding 3., I could not reproduce the issue. I started the example client and deleted the instances of object 1024 from the server. I then started on observation on /1024 and everything went fine.

Regards,

dnav avatar Apr 19 '17 08:04 dnav

  1. and 2. The example objects do not do this. Seems like a bug in the examples.
  2. I was looking at an older version of the code. This was fixed by commit 8842c7343f22a69f68e7e96591c6915112c02a84.

sbertin-telular avatar Apr 19 '17 12:04 sbertin-telular

The context isn't available to do this in the example objects. I'm thinking of adding the context to all callbacks as there are other cases where it would also be useful.

sbertin-telular avatar Mar 07 '19 15:03 sbertin-telular

#553 adds the context to the callbacks.

sbertin-telular avatar Mar 08 '21 14:03 sbertin-telular