Revision for “Actuating on IoTResources” created on December 17, 2014 @ 10:25:50
Title | Actuating on IoTResources |
---|---|
Content | The IoTResource Catalogue provides two means to actuate on an IoTResource:
<ul>
<li>By providing the unique identifier of a specific IoTResource</li>
<li>By providing the local endpoint of a specific IoTResource</li>
<li>By providing a semantic description that matches one or several IoTResource</li>
</ul>
<h3>Using identifier</h3>
The keyword is <em>IoTResource </em> to be supplied directly after the <catalogueendpoint> followed by the specific identifier and then the actuation expression:
http://<catalogueendpoint>/IoTResources/<IoTresourceid>/services/switch/actions/TurnOn
<h3>Using endpoint</h3>
By first calling the action GetIoTResourcesEndpoint in the <a title="Catalogue Services and Actions" href="http://www.iotworldservices.com/wiki/iotworldserviceswiki/iotresource-catalogue/services-and-actions/">catalogue </a>service of the IoTResourceCatalogue you will be able to retrieve the local endpoint of the device and can start communicating direclty with the IoTResource. This method is recommended if you need to do a massive amount of calls to IoTResource and then you don´t have to go throught the central IoTResourceCatalogue. However, it will only work if your Application is executing in the same local network as the IoTResources.
<h3>Using Semantic Description</h3>
Provide an xpath expression directly after the <catalogueendpoint> followed by the actuation expression:
http://<catalogueendpoint>/<xpath>/services/switch/actions/TurnOn
<strong><span style="text-decoration: underline;">Example</span></strong>
Turn on all IoTResources that are of type <em>switchdevice:</em>
http://<catalogueendpoint>//upnp:devicetype[contains(.,'switchdevice')]/services/switch/actions/TurnOn
<span style="text-decoration: underline;"><strong>Example</strong></span>
Turn off all IoTResources that are from CNet and that currently consumes more than 200W.
http://<catalogueendpoint>//upnp:device[upnp:manufacturer='CNet'][IoT:currentconsumption>200]/services/switch/actions/TurnOff
<strong><span style="text-decoration: underline;">Notes</span></strong>
One current limitation when using semantic descriptions is that the xpath expression cannot contain the word <em>services.</em> |
Excerpt |