Commit e2efa04d authored by Peter Waher's avatar Peter Waher

Adding control parameter examples

parent 77481393
......@@ -125,21 +125,55 @@ Following is a list of noteable differences:
Examples
---------------
A simple example containing sensor data from a temperature sensor.
Simple set of parameters for a spotlight:
```xml
<ts v="2017-09-22T15:22:33Z" xmlns="urn:ieee:iot:sd:1.0">
<q n="Temperature" v="12.3" u="C" m="true" ar="true"/>
<s n="SN" v="12345678" i="true" ar="true"/>
</ts>
<b n="MainSwitch" v="true"/>
<db n="HorizontalAngle" v="0"/>
<db n="ElevationAngle" v="0"/>
```
If this temperature sensor would be a node inside a concentrator, the same data would be represented as:
Same set of parameters, represented in a Data Form, using the validation, layout and dynamic form extensions:
```xml
<nd id="Node1" xmlns="urn:ieee:iot:sd:1.0">
<ts v="2017-09-22T15:22:33Z">
<q n="Temperature" v="12.3" u="C" m="true" ar="true"/>
<s n="SN" v="12345678" i="true" ar="true"/>
</ts>
</nd>```
\ No newline at end of file
<x type='form'
xmlns='jabber:x:data'
xmlns:xdv='http://jabber.org/protocol/xdata-validate'
xmlns:xdl='http://jabber.org/protocol/xdata-layout'
xmlns:xdd='urn:xmpp:xdata:dynamic'>
<title>Spotlight</title>
<xdl:page label='Output'>
<xdl:fieldref var='MainSwitch'/>
</xdl:page>
<xdl:page label='Direction'>
<xdl:fieldref var='HorizontalAngle'/>
<xdl:fieldref var='ElevationAngle'/>
</xdl:page>
<field var='xdd session' type='hidden'>
<value>83CAA4BC-6D3A-40E6-90DC-5C3CAA030AE1</value>
</field>
<field var='MainSwitch' type='boolean' label='Main switch'>
<desc>If the spotlight is turned on or off.</desc>
<value>true</value>
<xdd:notSame/>
</field>
<field var='HorizontalAngle' type='text-single' label='Horizontal angle:'>
<desc>Horizontal angle of the spotlight.</desc>
<value>0</value>
<xdv:validate datatype='xs:double'>
<xdv:range min='-180' max='180'/>
</xdv:validate>
<xdd:notSame/>
<pGroup xmlns='urn:ieee:iot:ctr:1.0' name='direction'/>
</field>
<field var='ElevationAngle' type='text-single' label='Elevation angle:'>
<desc>Elevation angle of the spotlight.</desc>
<value>0</value>
<xdv:validate datatype='xs:double'>
<xdv:range min='-90' max='90'/>
</xdv:validate>
<xdd:notSame/>
<pGroup xmlns='urn:ieee:iot:ctr:1.0' name='direction'/>
</field>
</x>
```
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<set xmlns="urn:ieee:iot:ctr:1.0">
<x type='form'
xmlns='jabber:x:data'
xmlns:xdv='http://jabber.org/protocol/xdata-validate'
xmlns:xdl='http://jabber.org/protocol/xdata-layout'
xmlns:xdd='urn:xmpp:xdata:dynamic'>
<title>Spotlight</title>
<xdl:page label='Output'>
<xdl:fieldref var='MainSwitch'/>
</xdl:page>
<xdl:page label='Direction'>
<xdl:fieldref var='HorizontalAngle'/>
<xdl:fieldref var='ElevationAngle'/>
</xdl:page>
<field var='xdd session' type='hidden'>
<value>83CAA4BC-6D3A-40E6-90DC-5C3CAA030AE1</value>
</field>
<field var='MainSwitch' type='boolean' label='Main switch'>
<desc>If the spotlight is turned on or off.</desc>
<value>true</value>
<xdd:notSame/>
</field>
<field var='HorizontalAngle' type='text-single' label='Horizontal angle:'>
<desc>Horizontal angle of the spotlight.</desc>
<value>0</value>
<xdv:validate datatype='xs:double'>
<xdv:range min='-180' max='180'/>
</xdv:validate>
<xdd:notSame/>
<pGroup xmlns='urn:ieee:iot:ctr:1.0' name='direction'/>
</field>
<field var='ElevationAngle' type='text-single' label='Elevation angle:'>
<desc>Elevation angle of the spotlight.</desc>
<value>0</value>
<xdv:validate datatype='xs:double'>
<xdv:range min='-90' max='90'/>
</xdv:validate>
<xdd:notSame/>
<pGroup xmlns='urn:ieee:iot:ctr:1.0' name='direction'/>
</field>
</x>
</set>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<set xmlns="urn:ieee:iot:ctr:1.0">
<b n="MainSwitch" v="true"/>
<db n="HorizontalAngle" v="0"/>
<db n="ElevationAngle" v="0"/>
</set>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment