This is to explain about the extension of IoTivity for Resource-Directory.
In the current IoTivity, Resource-Directory Feature was already applied onto the IoTivity Cloud. but there is no API related RD in stack API of IoTivity. As we support New API related RD. 3rd Party can use it in both D2S and local(D2D). Current RD API is developed for D2S. Local RD Server API is not supported yet.
A resource directory is a server that acts on behalf of the thin-client. The thin-client after it publishes their resources, resource-directory will respond on behalf of these devices. The device acting as a resource directory could itself hold resources. A thin-client is an OIC server which is a power constrained, resource constrained and has the limited resources. A thin-client will use resource directory service to publish its resource to be discoverable in the user network. A querying client is an OIC client device which is looking for a resource. It will make a query at /oic/res by sending a multicast packet to discover a resource. Resource directory will respond on behalf of the thin-client. The response structure is based on the OIC /oic/res response
1) Resource Publishing First publish: Resource Server send request message that wll be published to Cloud RD (ins value is setting 0)
2) Receive Response from RD RD send response message after storing the resource information.
3) Update published resource Update can be used for updating about all resources that are published on a RD or can use to do per resource published.
4) Receive Response from RD RD send response message after updating the resource information.
5) Delete resource information The delete is done using the device ID “id” as the tag in DELETE request query when all the resource information from the device is to be deleted. In the case of a specific resource then the DELETE request shall include the instance “ins” tag along with the device ID in the query. case 1: delete All resources => /oic/rd?di=device1 case 2: delete with ‘ins’ value for specific resource =>/oic/rd?di=device1&ins=1
Linux, Android, Tizen, Arduino
IoTivity samples can be built using the build option as RD_MODE
Ex: scons TARGET_OS=linux TARGET_TRANSPORT=IP RELEASE=0 RD_MODE=CLIENT or SERVER or ALL