Hi, Question about self-link/self-reference of "oic/res":
OCF_Core_Specification_v1.3.1.pdf says: -------- The “/oic/res” shall list all Resources that are indicated as discoverable (see section 11.3). …Conditionally required: “/oic/res” with an "rt" value of "oic.wk.res" as self-reference, on the condition that “oic/res” has to signal that it is observable by a Client. & With the self-link, i.e. the Link with "rel" value of "self", “/oic/res” can have a Link with the target URI of “/oic/res” and indicate itself observable. -------- I’ve tried to use an Android server for experiment. OcResourceHandle ocResourceHandle = OcPlatform.getResourceHandleAtUri("/oic/res"); ==> D/OIC_RI_STACK: Found Resource /oic/res OcPlatform.bindTypeToResource(ocResourceHandle, "oic.wk.res"); ==> I/OIC_RI_STACK: Type oic.wk.res already exists OcPlatform.bindResource(ocResourceHandle, ocResourceHandle); ==> E/OIC_RI_STACK: Added handle equals collection handle It seems that the self-link has been discussed in https://jira.iotivity.org/browse/IOT-2742 And the patch in https://gerrit.iotivity.org/gerrit/#/c/22577 for resource/csdk/stack/src/ocstack.c was proposed to allow “Container to contain itself”. But it’s not applied to iotivity-1.3.1 and iotivity-1.4.0-RC1. Another way to achieve self-link is using collection(OcRepresentation.addChild): resource/csdk/stack/src/occollection.c But is it OK to manually modified "/oic/res" ‘s payload? Thanks. Best Regards, ChiaYu
_______________________________________________ iotivity-dev mailing list iotivity-dev@lists.iotivity.org https://lists.iotivity.org/mailman/listinfo/iotivity-dev