Closed tomekmalek closed 1 year ago
I rechecked this case once again and I discovered that this behaviour appears when Default Maximum Period (/1/x/3) is set to 10 (in my case Anjay 3.4.1). Is it OK that pmin & pmax are ignored if Default Maximum Period is set?
Hi Tomasz,
Thank you for your report.
First of all, there are no changes between 3.4.0 and 3.4.1 related to the Observe/Notify mechanism, so I am fairly sure that the difference in behavior you're seeing is related to some other factor (perhaps this Default Maximum Period setting) rather than the library version.
In case of an Observe-Composite request, the "effective pmax" value is calculated for each of the paths specified in the Observe-Composite request, and the notification will be generated after the shortest of those (provided that other event for its generation does not occur earlier).
The "effective pmax" is calculated by taking the "pmax" value attached to the Resource; if that's not set, then the "pmax" value attached to its enclosing Object Instance is checked; if that's not set either, then the "pmax" value attached to its enclosing Object is used; and if that's not set, the Default Maximum Period (/1/x/3) is used; if that's empty as well, then there's no "effective pmax" (i.e., it's "infinity").
So, if you have an Observe-Composite request targeting resource /1/0/1 where you have set the "pmax" value to 45, but also targeting any other resource that does not have an associated "pmax" value, then the "effective pmax" for /1/0/1 will be 45, but the "effective pmax" for that other resource will be the Default Maximum Period. If the Default Maximum Period is shorter than 45 (as is in your example), then that will be the effective notification interval.
The LwM2M specification is not super clear on the intended behavior in such a case; we believe that our implementation is compliant with the spec, but I admit that it is a bit of a gray area, open to interpretation.
I hope that this answers your doubts and that the logic behind the behavior you're observing is clear now.
Best regards, Mateusz Kwiatkowski
Thank you for your explanation, @kFYatek .
best regards T.
Hello,
I am playing with Observe-Composite. I am little bit confused when I set pmin=30 and pmax=45 and receive notification every 10 secs using Anjay 3.4.1. Anjay 3.4.0 seems to be OK (see attached screens).
best regards Tomasz Malek