Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

oic/d piid issue with notification #40

Closed
bjornAndreassen opened this issue May 26, 2021 · 0 comments · Fixed by #175
Closed

oic/d piid issue with notification #40

bjornAndreassen opened this issue May 26, 2021 · 0 comments · Fixed by #175
Assignees
Labels
bug Something isn't working

Comments

@bjornAndreassen
Copy link

Since a few weeks its been possible to observe the oic/d resource. Changing the n parameter (name) on the oc/con resource will automaticaly change the n parameter on the oic/d resource. This will then trigger a notification to be sent to any observers of this resource. This works.

However, in the request callback for that resource (oc_core_device_handler() in https://github.com/iotivity/iotivity-lite/blob/master/api/oc_core_res.c) the piid resource has a condition on it.

if (request->origin && request->origin->version != OIC_VER_1_1_0) {
oc_rep_set_text_string(root, piid, piid);
}

This works fine when a client does a get on this resource, but when this is used for the notification scenario above the request->origin is not set and the piid will be ommited from the notification.

This will then look from a clients perspective as: Chainging the n parameter on oc/con deletes the piid on oic/d.

@WAvdBeek WAvdBeek added the bug Something isn't working label Jun 9, 2021
Danielius1922 added a commit to plgd-dev/hub that referenced this issue Jan 19, 2022
Add test case to verify resource data consistency
after device name change.
This is a test case for iotivility-lite issue #40
oic/d piid issue with notification
(iotivity/iotivity-lite#40).
Danielius1922 added a commit to plgd-dev/hub that referenced this issue Jan 20, 2022
Add test case to verify resource data consistency
after device name change.
This is a test case for iotivility-lite issue #40
oic/d piid issue with notification
(iotivity/iotivity-lite#40).
Danielius1922 added a commit to plgd-dev/hub that referenced this issue Jan 20, 2022
Add test case to verify resource data consistency
after device name change.
This is a test case for iotivility-lite issue #40
oic/d piid issue with notification
(iotivity/iotivity-lite#40).
Danielius1922 added a commit that referenced this issue Jan 20, 2022
When generating the representation for the /oic/d
resource the getter checks the endpoint_t version
provided as argument to the call. If the endpoint
is NULL or has an old version the piid field
is skipped.
When sending observation messages NULL was used
as the endpoint value, therefore the piid field
was never present in the notifications.

The issue is fixed by taking the endpoint value
from the currently handled observer.
@Danielius1922 Danielius1922 linked a pull request Jan 20, 2022 that will close this issue
Danielius1922 added a commit to plgd-dev/hub that referenced this issue Jan 24, 2022
Add test case to verify resource data consistency
after device name change.
This is a test case for iotivility-lite issue #40
oic/d piid issue with notification
(iotivity/iotivity-lite#40).
WAvdBeek added a commit that referenced this issue Jan 26, 2022
Fix issue oic/d piid issue with notification (#40)
Danielius1922 added a commit to plgd-dev/hub that referenced this issue Jan 26, 2022
Add test case to verify resource data consistency
after device name change.
This is a test case for iotivility-lite issue #40
oic/d piid issue with notification
(iotivity/iotivity-lite#40).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants