1
0
mirror of https://github.com/moparisthebest/xeps synced 2024-11-21 08:45:04 -05:00

Retab IoT examples

This commit is contained in:
Sam Whited 2017-05-20 09:38:03 -05:00
parent 43279ef184
commit 52c76b2437
4 changed files with 9743 additions and 9743 deletions

View File

@ -465,12 +465,12 @@
</p>
<example caption='Read-out request of momentary values from a device'>
<![CDATA[
<iq type='get'
<iq type='get'
from='client@example.org/amr'
to='device@example.org'
id='S0001'>
<req xmlns='urn:xmpp:iot:sensordata' seqnr='1' momentary='true'/>
</iq>]]>
</iq>]]>
</example>
<p>
@ -479,12 +479,12 @@
<example caption='Read-out request accepted by device'>
<![CDATA[
<iq type='result'
<iq type='result'
from='device@example.org'
to='client@example.org/amr'
id='S0001'>
<accepted xmlns='urn:xmpp:iot:sensordata' seqnr='1'/>
</iq>]]>
</iq>]]>
</example>
<p>
@ -493,7 +493,7 @@
<example caption='Momentary read-out response'>
<![CDATA[
<message from='device@example.org'
<message from='device@example.org'
to='client@example.org/amr'>
<fields xmlns='urn:xmpp:iot:sensordata' seqnr='1' done='true'>
<node nodeId='Device01'>
@ -502,7 +502,7 @@
</timestamp>
</node>
</fields>
</message>]]>
</message>]]>
</example>
</section2>
@ -513,26 +513,26 @@
<example caption='Momentary read-out failure'>
<![CDATA[
<iq type='get'
<iq type='get'
from='client@example.org/amr'
to='device@example.org'
id='S0002'>
<req xmlns='urn:xmpp:iot:sensordata' seqnr='2' momentary='true'/>
</iq>
</iq>
<iq type='result'
<iq type='result'
from='device@example.org'
to='client@example.org/amr'
id='S0002'>
<accepted xmlns='urn:xmpp:iot:sensordata' seqnr='2'/>
</iq>
</iq>
<message from='device@example.org'
<message from='device@example.org'
to='client@example.org/amr'>
<failure xmlns='urn:xmpp:iot:sensordata' seqnr='2' done='true'>
<error nodeId='Device01' timestamp='2013-03-07T17:13:30'>Timeout.</error>
</failure>
</message>]]>
</message>]]>
</example>
</section2>
<section2 topic='Read-out rejected' anchor='readoutrejected'>
@ -542,14 +542,14 @@
<example caption='Momentary read-out rejected'>
<![CDATA[
<iq type='get'
<iq type='get'
from='client@example.org/amr'
to='device@example.org'
id='S0003'>
<req xmlns='urn:xmpp:iot:sensordata' seqnr='3' momentary='true'/>
</iq>
</iq>
<iq type='error'
<iq type='error'
from='device@example.org'
to='client@example.org/amr'
id='S0003'>
@ -557,7 +557,7 @@
<forbidden xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
<text xmlns='urn:ietf:params:xml:ns:xmpp-stanzas' xml:lang='en'>Access denied.</text>
</error>
</iq>]]>
</iq>]]>
</example>
<p>
Depending on the reason for rejecting the request, different XMPP errors can be returned, according to the description in the following table. The table also
@ -597,26 +597,26 @@
<example caption='Scheduled read-out of device with multiple responses'>
<![CDATA[
<iq type='get'
<iq type='get'
from='client@example.org/amr'
to='device@example.org'
id='S0004'>
<req xmlns='urn:xmpp:iot:sensordata' seqnr='4' all='true' when='2013-03-07T19:00:00'/>
</iq>
</iq>
<iq type='result'
<iq type='result'
from='device@example.org'
to='client@example.org/amr'
id='S0004'>
<accepted xmlns='urn:xmpp:iot:sensordata' seqnr='4' queued='true'/>
</iq>
</iq>
<message from='device@example.org'
<message from='device@example.org'
to='client@example.org/amr'>
<started xmlns='urn:xmpp:iot:sensordata' seqnr='4'/>
</message>
</message>
<message from='device@example.org'
<message from='device@example.org'
to='client@example.org/amr'>
<fields xmlns='urn:xmpp:iot:sensordata' seqnr='4'>
<node nodeId='Device01'>
@ -627,9 +627,9 @@
</timestamp>
</node>
</fields>
</message>
</message>
<message from='device@example.org'
<message from='device@example.org'
to='client@example.org/amr'>
<fields xmlns='urn:xmpp:iot:sensordata' seqnr='4'>
<node nodeId='Device01'>
@ -640,9 +640,9 @@
</timestamp>
</node>
</fields>
</message>
</message>
<message from='device@example.org'
<message from='device@example.org'
to='client@example.org/amr'>
<fields xmlns='urn:xmpp:iot:sensordata' seqnr='4'>
<node nodeId='Device01'>
@ -661,12 +661,12 @@
</timestamp>
</node>
</fields>
</message>
</message>
<message from='device@example.org'
<message from='device@example.org'
to='client@example.org/amr'>
<done xmlns='urn:xmpp:iot:sensordata' seqnr='4'/>
</message>]]>
</message>]]>
</example>
</section2>
<section2 topic='Read-out of multiple devices' anchor='readmulti'>
@ -676,7 +676,7 @@
<example caption='Read-out of multiple devices'>
<![CDATA[
<iq type='get'
<iq type='get'
from='client@example.org/amr'
to='device@example.org'
id='S0005'>
@ -684,16 +684,16 @@
<node nodeId='Device02'/>
<node nodeId='Device03'/>
</req>
</iq>
</iq>
<iq type='result'
<iq type='result'
from='device@example.org'
to='client@example.org/amr'
id='S0005'>
<accepted xmlns='urn:xmpp:iot:sensordata' seqnr='5'/>
</iq>
</iq>
<message from='device@example.org'
<message from='device@example.org'
to='client@example.org/amr'>
<fields xmlns='urn:xmpp:iot:sensordata' seqnr='5'>
<node nodeId='Device02'>
@ -702,9 +702,9 @@
</timestamp>
</node>
</fields>
</message>
</message>
<message from='device@example.org'
<message from='device@example.org'
to='client@example.org/amr'>
<fields xmlns='urn:xmpp:iot:sensordata' seqnr='5' done='true'>
<node nodeId='Device03'>
@ -713,7 +713,7 @@
</timestamp>
</node>
</fields>
</message>]]>
</message>]]>
</example>
</section2>
<section2 topic='Read-out of specific fields' anchor='readfields'>
@ -732,7 +732,7 @@
<example caption='Read-out of multiple devices'>
<![CDATA[
<iq type='get'
<iq type='get'
from='client@example.org/amr'
to='device@example.org'
id='S0006'>
@ -741,16 +741,16 @@
<field name='Energy'/>
<field name='Power'/>
</req>
</iq>
</iq>
<iq type='result'
<iq type='result'
from='device@example.org'
to='client@example.org/amr'
id='S0006'>
<accepted xmlns='urn:xmpp:iot:sensordata' seqnr='6'/>
</iq>
</iq>
<message from='device@example.org'
<message from='device@example.org'
to='client@example.org/amr'>
<fields xmlns='urn:xmpp:iot:sensordata' seqnr='6' done='true'>
<node nodeId='Device04'>
@ -760,7 +760,7 @@
</timestamp>
</node>
</fields>
</message>]]>
</message>]]>
</example>
</section2>
<section2 topic="Cancelling a scheduled read-out request" anchor="cancelreadout">
@ -769,33 +769,33 @@
</p>
<example caption='Scheduled read-out of device with multiple responses'>
<![CDATA[
<iq type='get'
<iq type='get'
from='client@example.org/amr'
to='device@example.org'
id='S0007'>
<req xmlns='urn:xmpp:iot:sensordata' seqnr='8' all='true' when='2013-03-09T23:30:00'/>
</iq>
</iq>
<iq type='result'
<iq type='result'
from='device@example.org'
to='client@example.org/amr'
id='S0007'>
<accepted xmlns='urn:xmpp:iot:sensordata' seqnr='8' queued='true'/>
</iq>
</iq>
<iq type='get'
<iq type='get'
from='client@example.org/amr'
to='device@example.org'
id='S0008'>
<cancel xmlns='urn:xmpp:iot:sensordata' seqnr='8'/>
</iq>
</iq>
<iq type='result'
<iq type='result'
from='device@example.org'
to='client@example.org/amr'
id='S0008'>
<cancelled xmlns='urn:xmpp:iot:sensordata' seqnr='8'/>
</iq>]]>
</iq>]]>
</example>
</section2>
</section1>
@ -1246,21 +1246,21 @@
</p>
<example caption='Localized field names'>
<![CDATA[
<iq type='get'
<iq type='get'
from='client@example.org/amr'
to='device@example.org'
id='S0009'>
<req xmlns='urn:xmpp:iot:sensordata' seqnr='7' all='true'/>
</iq>
</iq>
<iq type='result'
<iq type='result'
from='device@example.org'
to='client@example.org/amr'
id='S0009'>
<accepted xmlns='urn:xmpp:iot:sensordata' seqnr='7'/>
</iq>
</iq>
<message from='device@example.org'
<message from='device@example.org'
to='client@example.org/amr'>
<fields xmlns='urn:xmpp:iot:sensordata' seqnr='7' done='true'>
<node nodeId='Device05'>
@ -1276,7 +1276,7 @@
</timestamp>
</node>
</fields>
</message>]]>
</message>]]>
</example>
<p>
The above example defines a language module called <strong>Watchamacallit</strong>. In this language module it defines four strings, with IDs 1-4. A system might store these as follows,

View File

@ -1,7 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE xep SYSTEM 'xep.dtd' [
<!ENTITY % ents SYSTEM 'xep.ent'>
%ents;
%ents;
]>
<?xml-stylesheet type='text/xsl' href='xep.xsl'?>
<xep>
@ -467,48 +467,48 @@
</p>
<example caption="Checking if server supports components">
<![CDATA[
<iq from='device@example.org/device' to='example.org' type='get' id='1'>
<iq from='device@example.org/device' to='example.org' type='get' id='1'>
<query xmlns="http://jabber.org/protocol/disco#info"/>
</iq>
</iq>
<iq type="result" id="1" from="example.org" to="device@example.org/device">
<iq type="result" id="1" from="example.org" to="device@example.org/device">
<query xmlns="http://jabber.org/protocol/disco#info">
...
<feature var="http://jabber.org/protocol/disco#items"/>
...
</query>
</iq>]]>
</iq>]]>
</example>
<p>
If components (items) are supported, a request for available components is made:
</p>
<example caption="Requesting list of server components">
<![CDATA[
<iq from='device@example.org/device' to='example.org' type='get' id='2'>
<iq from='device@example.org/device' to='example.org' type='get' id='2'>
<query xmlns="http://jabber.org/protocol/disco#items"/>
</iq>
</iq>
<iq type="result" id="2" from="example.org" to="995fab3dd759452ca9c370647323af0c@example.org/ebe2348e">
<iq type="result" id="2" from="example.org" to="995fab3dd759452ca9c370647323af0c@example.org/ebe2348e">
<query xmlns="http://jabber.org/protocol/disco#items">
...
<item jid="provisioning.example.org" name="Provisioning"/>
...
</query>
</iq>]]>
</iq>]]>
</example>
<p>
The client then loops through all components (items) and checks what features they support, until a Provisioning Server is found:
</p>
<example caption="Service discovery information request made to each component">
<![CDATA[
<iq type='get'
<iq type='get'
from='device@example.org/device'
to='provisioning.example.org'
id='3'>
<query xmlns='http://jabber.org/protocol/disco#info'/>
</iq>
</iq>
<iq type='result'
<iq type='result'
from='provisioning.example.org'
to='device@example.org/device'
id='3'>
@ -517,7 +517,7 @@
<feature var='urn:xmpp:iot:provisioning'/>
...
</query>
</iq>]]>
</iq>]]>
</example>
</section3>
<section3 topic="Tokens and X.509 Certificates" anchor="tokenscertificats">
@ -550,33 +550,33 @@
</p>
<example caption='Requesting a token'>
<![CDATA[
<iq type='get'
<iq type='get'
from='device@example.org/device'
to='provisioning.example.org'
id='4'>
<getToken xmlns='urn:xmpp:iot:provisioning'>BASE-64 ENCODED PUBLIC X.509 CERTIFICATE</getToken>
</iq>
</iq>
<iq type='result'
<iq type='result'
from='provisioning.example.org'
to='device@example.org/device'
id='4'>
<getTokenChallenge xmlns='urn:xmpp:iot:provisioning' seqnr='1'>BASE-64 ENCODED CHALLENGE</getTokenChallenge>
</iq>
</iq>
<iq type='get'
<iq type='get'
from='device@example.org/device'
to='provisioning.example.org'
id='5'>
<getTokenChallengeResponse xmlns='urn:xmpp:iot:provisioning' seqnr='1'>BASE-64 ENCODED RESPONSE</getTokenChallengeResponse>
</iq>
</iq>
<iq type='result'
<iq type='result'
from='provisioning.example.org'
to='device@example.org/device'
id='5'>
<getTokenResponse xmlns='urn:xmpp:iot:provisioning' token='TOKEN'/>
</iq>]]>
</iq>]]>
</example>
<p>
The <strong>getToken</strong> element contains the base-64 encoded public version of the certificate that is used to identify the device or service. The server
@ -592,28 +592,28 @@
</p>
<example caption='Challenge reponse incorrect'>
<![CDATA[
<iq type='result'
<iq type='result'
from='provisioning.example.org'
to='device@example.org/device'
id='5'>
<error type='modify'>
<bad-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
</error>
</iq>]]>
</iq>]]>
</example>
<p>
If the sequence number identifying the challenge is not found on the server, the server returns a <strong>item-not-found</strong> error result, as is shown below.
</p>
<example caption='Challenge sequence number not found'>
<![CDATA[
<iq type='result'
<iq type='result'
from='provisioning.example.org'
to='device@example.org/device'
id='5'>
<error type='cancel'>
<item-not-found xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
</error>
</iq>]]>
</iq>]]>
</example>
<p>
The server must retain the challenge in memory for at least one minute before assuming the challenge will go unresponded.
@ -639,19 +639,19 @@
</p>
<example caption='Requesting a token'>
<![CDATA[
<iq type='get'
<iq type='get'
from='provisioning.example.org'
to='device@example.org/device'
id='6'>
<tokenChallenge xmlns='urn:xmpp:iot:provisioning' token='TOKEN'>BASE-64 encoded challenge</tokenChallenge>
</iq>
</iq>
<iq type='result'
<iq type='result'
from='device@example.org/device'
to='provisioning.example.org'
id='6'>
<tokenChallengeResponse xmlns='urn:xmpp:iot:provisioning'>BASE-64 encoded response</tokenChallengeResponse>
</iq>]]>
</iq>]]>
</example>
<p>
<strong>Note:</strong> It is important that a unit only responds to a <strong>tokenChallenge</strong> request from a JID to which the corresponding token
@ -659,14 +659,14 @@
</p>
<example caption='Invalid token challenge'>
<![CDATA[
<iq type='error'
<iq type='error'
from='device@example.org/device'
to='provisioning.example.org'
id='6'>
<error type='cancel'>
<forbidden xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
</error>
</iq>]]>
</iq>]]>
</example>
</section4>
</section3>
@ -695,33 +695,33 @@
</p>
<example caption='Readout request using multiple tokens'>
<![CDATA[
<iq type='get'
<iq type='get'
from='master@example.org/amr'
to='device@example.org'
id='7'>
<req xmlns='urn:xmpp:iot:sensordata' momentary='true' serviceToken='SERVICETOKEN1 SERVICETOKEN2' userToken='USERTOKEN1' seqnr='4'/>
</iq>
</iq>
<iq type='get'
<iq type='get'
from='device@example.org/device'
to='provisioning.example.org'
id='8'>
<canRead xmlns='urn:xmpp:iot:provisioning' jid='master@example.org' serviceToken='SERVICETOKEN1 SERVICETOKEN2' userToken='USERTOKEN1' momentary='true'/>
</iq>
</iq>
<iq type='result'
<iq type='result'
from='provisioning.example.org'
to='device@example.org/device'
id='8'>
<canReadResponse xmlns='urn:xmpp:iot:provisioning' jid='master@example.org' momentary='true' result='true'/>
</iq>
</iq>
<iq type='result'
<iq type='result'
from='device@example.org'
to='master@example.org/amr'
id='7'>
<accepted xmlns='urn:xmpp:iot:sensordata' seqnr='4'/>
</iq>]]>
</iq>]]>
</example>
</section3>
<p>
@ -741,19 +741,19 @@
</p>
<example caption='Friendship request accepted'>
<![CDATA[
<iq type='get'
<iq type='get'
from='device@example.org/device'
to='provisioning.example.org'
id='9'>
<isFriend xmlns='urn:xmpp:iot:provisioning' jid='client1@example.org'/>
</iq>
</iq>
<iq type='result'
<iq type='result'
from='provisioning.example.org'
to='device@example.org/device'
id='9'>
<isFriendResponse xmlns='urn:xmpp:iot:provisioning' jid='client1@example.org' result='true'/>
</iq>]]>
</iq>]]>
</example>
<p>
<strong>Note:</strong> The provisioning server implicitly understands which two JIDs that are to be checked: The first one is the sender of the message, the second one
@ -775,19 +775,19 @@
</p>
<example caption='Friendship request rejected'>
<![CDATA[
<iq type='get'
<iq type='get'
from='device@example.org/device'
to='provisioning.example.org'
id='10'>
<isFriend xmlns='urn:xmpp:iot:provisioning' jid='client2@example.org'/>
</iq>
</iq>
<iq type='result'
<iq type='result'
from='provisioning.example.org'
to='device@example.org/device'
id='10'>
<isFriendResponse xmlns='urn:xmpp:iot:provisioning' jid='client2@example.org' result='false'/>
</iq>]]>
</iq>]]>
</example>
</section3>
<section3 topic='Unfriending existing friends' anchor='unfriendingexistingfriends'>
@ -808,10 +808,10 @@
<example caption='Unfriending existing friend'>
<![CDATA[
<message from='provisioning.example.org'
<message from='provisioning.example.org'
to='device@example.org'>
<unfriend xmlns='urn:xmpp:iot:provisioning' jid='client2@example.org'/>
</message>]]>
</message>]]>
</example>
</section3>
<section3 topic='Recommending friendships' anchor='recommendingfriendships'>
@ -824,10 +824,10 @@
</p>
<example caption='Recommending friendships'>
<![CDATA[
<message from='provisioning.example.org'
<message from='provisioning.example.org'
to='device@example.org'>
<friend xmlns='urn:xmpp:iot:provisioning' jid='client2@example.org'/>
</message>]]>
</message>]]>
</example>
<p>
Note that the receptor can still ask the provisioning server if it can form a friendship with the suggested friend, using the <strong>isFriend</strong> command.
@ -852,35 +852,35 @@
</p>
<example caption='Rejecting read-outs'>
<![CDATA[
<iq type='get'
<iq type='get'
from='master@example.org/amr'
to='device@example.org'
id='11'>
<req xmlns='urn:xmpp:iot:sensordata' momentary='true' serviceToken='SERVICETOKEN1' userToken='USERTOKEN1' seqnr='1'/>
</iq>
</iq>
<iq type='get'
<iq type='get'
from='device@example.org/device'
to='provisioning.example.org'
id='12'>
<canRead xmlns='urn:xmpp:iot:provisioning' jid='master@example.org' serviceToken='SERVICETOKEN1' userToken='USERTOKEN1' momentary='true'/>
</iq>
</iq>
<iq type='result'
<iq type='result'
from='provisioning.example.org'
to='device@example.org/device'
id='12'>
<canReadResponse xmlns='urn:xmpp:iot:provisioning' jid='master@example.org' momentary='true' result='false'/>
</iq>
</iq>
<iq type='error'
<iq type='error'
from='device@example.org'
to='master@example.org/amr'
id='11'>
<rejected xmlns='urn:xmpp:iot:sensordata' seqnr='1'>
<error>Access denied.</error>
</rejected>
</iq>]]>
</iq>]]>
</example>
</section3>
<section3 topic='Restricting nodes during read-out' anchor='restrictingnodes'>
@ -905,7 +905,7 @@
<example caption='Restricting nodes during read-out'>
<![CDATA[
<iq type='get'
<iq type='get'
from='master@example.org/amr'
to='device@example.org'
id='13'>
@ -913,9 +913,9 @@
<node nodeId='Device02'/>
<node nodeId='Device03'/>
</req>
</iq>
</iq>
<iq type='get'
<iq type='get'
from='device@example.org/device'
to='provisioning.example.org'
id='14'>
@ -923,23 +923,23 @@
<node nodeId='Device02'/>
<node nodeId='Device03'/>
</canRead>
</iq>
</iq>
<iq type='result'
<iq type='result'
from='provisioning.example.org'
to='device@example.org/device'
id='14'>
<canReadResponse xmlns='urn:xmpp:iot:provisioning' jid='master@example.org' momentary='true' result='true'>
<node nodeId='Device02'/>
</canReadResponse>
</iq>
</iq>
<iq type='result'
<iq type='result'
from='device@example.org'
to='master@example.org/amr'
id='13'>
<accepted xmlns='urn:xmpp:iot:sensordata' seqnr='2'/>
</iq>]]>
</iq>]]>
</example>
<p>
Note that the provisioning server responds with a <strong>canReadResponse</strong> element, similar to the <strong>canRead</strong> element in the request, except
@ -965,21 +965,21 @@
<example caption='Restricting fields during read-out'>
<![CDATA[
<iq type='get'
<iq type='get'
from='master@example.org/amr'
to='device@example.org'
id='15'>
<req xmlns='urn:xmpp:iot:sensordata' momentary='true' serviceToken='SERVICETOKEN1' userToken='USERTOKEN1' seqnr='3'/>
</iq>
</iq>
<iq type='get'
<iq type='get'
from='device@example.org/device'
to='provisioning.example.org'
id='16'>
<canRead xmlns='urn:xmpp:iot:provisioning' jid='master@example.org' momentary='true' serviceToken='SERVICETOKEN1' userToken='USERTOKEN1'/>
</iq>
</iq>
<iq type='result'
<iq type='result'
from='provisioning.example.org'
to='device@example.org/device'
id='16'>
@ -987,14 +987,14 @@
<field name='Energy'/>
<field name='Power'/>
</canReadResponse>
</iq>
</iq>
<iq type='result'
<iq type='result'
from='device@example.org'
to='master@example.org/amr'
id='15'>
<accepted xmlns='urn:xmpp:iot:sensordata' seqnr='3'/>
</iq>]]>
</iq>]]>
</example>
<p>
Note that the provisioning server responds with a <strong>canReadResponse</strong> element, similar to the <strong>canRead</strong> element in the request, except only
@ -1021,37 +1021,37 @@
</p>
<example caption='Rejecting control action'>
<![CDATA[
<iq type='set'
<iq type='set'
from='master@example.org/amr'
to='device@example.org'
id='17'>
<set xmlns='urn:xmpp:iot:control' xml:lang='en'>
<boolean name='Output' value='true'/>
</set>
</iq>
</iq>
<iq type='get'
<iq type='get'
from='device@example.org/device'
to='provisioning.example.org'
id='18'>
<canControl xmlns='urn:xmpp:iot:provisioning' jid='master@example.org' serviceToken='SERVICETOKEN1' userToken='USERTOKEN1'>
<parameter name='Output'/>
</canControl>
</iq>
</iq>
<iq type='result'
<iq type='result'
from='provisioning.example.org'
to='device@example.org/device'
id='18'>
<canControlResponse xmlns='urn:xmpp:iot:provisioning' jid='master@example.org' result='false'/>
</iq>
</iq>
<iq type='error'
<iq type='error'
from='device@example.org'
to='master@example.org/amr'
id='17'>
<setResponse xmlns='urn:xmpp:iot:control' responseCode='InsufficientPrivileges'/>
</iq>]]>
</iq>]]>
</example>
</section3>
<section3 topic='Restricting nodes during control' anchor='restrictingnodescontrol'>
@ -1073,7 +1073,7 @@
</p>
<example caption='Restricting nodes during control'>
<![CDATA[
<iq type='set'
<iq type='set'
from='master@example.org/amr'
to='concentrator@example.org'
id='19'>
@ -1084,9 +1084,9 @@
<node nodeId='DigitalOutput4'/>
<boolean name='Output' value='true'/>
</set>
</iq>
</iq>
<iq type='get'
<iq type='get'
from='concentrator@example.org/plc'
to='provisioning.example.org'
id='20'>
@ -1097,9 +1097,9 @@
<node nodeId='DigitalOutput4'/>
<parameter name='Output'/>
</canControl>
</iq>
</iq>
<iq type='result'
<iq type='result'
from='provisioning.example.org'
to='concentrator@example.org/plc'
id='20'>
@ -1107,9 +1107,9 @@
<node nodeId='DigitalOutput2'/>
<node nodeId='DigitalOutput3'/>
</canControlResponse>
</iq>
</iq>
<iq type='result'
<iq type='result'
from='concentrator@example.org'
to='master@example.org/amr'
id='19'>
@ -1117,7 +1117,7 @@
<node nodeId='DigitalOutput2'/>
<node nodeId='DigitalOutput3'/>
</setResponse>
</iq>]]>
</iq>]]>
</example>
<p>
Note that the provisioning server responds with a <strong>canControlResponse</strong> element, similar to the <strong>canControl</strong> element in the request, except
@ -1148,7 +1148,7 @@
</p>
<example caption='Restricting parameters during control'>
<![CDATA[
<iq type='set'
<iq type='set'
from='master@example.org/amr'
to='plc@example.org'
id='21'>
@ -1162,9 +1162,9 @@
<int name='AnalogOutput3' value='65535'/>
<int name='AnalogOutput4' value='65535'/>
</set>
</iq>
</iq>
<iq type='get'
<iq type='get'
from='plc@example.org/plc'
to='provisioning.example.org'
id='22'>
@ -1178,9 +1178,9 @@
<parameter name='AnalogOutput3'/>
<parameter name='AnalogOutput4'/>
</canControl>
</iq>
</iq>
<iq type='result'
<iq type='result'
from='provisioning.example.org'
to='plc@example.org/plc'
id='22'>
@ -1190,9 +1190,9 @@
<parameter name='DigitalOutput3'/>
<parameter name='DigitalOutput4'/>
</canControlResponse>
</iq>
</iq>
<iq type='result'
<iq type='result'
from='plc@example.org'
to='master@example.org/amr'
id='21'>
@ -1202,7 +1202,7 @@
<parameter name='DigitalOutput3'/>
<parameter name='DigitalOutput4'/>
</setResponse>
</iq>]]>
</iq>]]>
</example>
<p>
Note that the provisioning server responds with a <strong>canControlResponse</strong> element, similar to the <strong>canControl</strong> element in the request, except only
@ -1231,19 +1231,19 @@
<example caption='Clear cache'>
<![CDATA[
<iq type='set'
<iq type='set'
from='provisioning.example.org'
to='device@example.org'
id='23'>
<clearCache xmlns='urn:xmpp:iot:provisioning'/>
</iq>
</iq>
<iq type='result'
<iq type='result'
from='device@example.org'
to='provisioning.example.org'
id='23'>
<clearCacheResponse xmlns='urn:xmpp:iot:provisioning'/>
</iq>]]>
</iq>]]>
</example>
</section3>
</section2>
@ -1255,33 +1255,33 @@
</p>
<example caption='Requesting a service token'>
<![CDATA[
<iq type='get'
<iq type='get'
from='device@example.org/device'
to='provisioning.example.org'
id='24'>
<getToken xmlns='urn:xmpp:iot:provisioning'>BASE-64 ENCODED PUBLIC X.509 CERTIFICATE</getToken>
</iq>
</iq>
<iq type='result'
<iq type='result'
from='provisioning.example.org'
to='device@example.org/device'
id='24'>
<getTokenChallenge xmlns='urn:xmpp:iot:provisioning' seqnr='1'>BASE-64 ENCODED CHALLENGE</getTokenChallenge>
</iq>
</iq>
<iq type='get'
<iq type='get'
from='device@example.org/device'
to='provisioning.example.org'
id='25'>
<getTokenChallengeResponse xmlns='urn:xmpp:iot:provisioning' seqnr='1'>BASE-64 ENCODED RESPONSE</getTokenChallengeResponse>
</iq>
</iq>
<iq type='result'
<iq type='result'
from='provisioning.example.org'
to='device@example.org/device'
id='25'>
<getTokenResponse xmlns='urn:xmpp:iot:provisioning' token='TOKEN'/>
</iq>]]>
</iq>]]>
</example>
</section3>
<section3 topic='User access to service' anchor='usertoken'>
@ -1373,9 +1373,9 @@
</p>
<example caption='User access to service'>
<![CDATA[
<!-- user connects to service -->
<!-- user connects to service -->
<iq type='get'
<iq type='get'
from='service@example.org/service'
to='provisioning.example.org'
id='26'>
@ -1384,23 +1384,23 @@
<credentials type='Longitude' value='123.45'/>
<credentials type='Latitude' value='67.89'/>
</canAccess>
</iq>
</iq>
<iq type='result'
<iq type='result'
from='provisioning.example.org'
to='service@example.org/service'
id='26'>
<canAccessResponse xmlns='urn:xmpp:iot:provisioning' userToken='USERTOKEN1' result='true'/>
</iq>
</iq>
<!-- user performs login into service -->
<!-- user performs login into service -->
<message from='service@example.org/service'
<message from='service@example.org/service'
to='provisioning.example.org'>
<userLoggedIn xmlns='urn:xmpp:iot:provisioning' serviceToken='SERVICETOKEN1' userToken='USERTOKEN1' userName='Kermit' />
</message>
</message>
<!-- user continues interacting with service -->]]>
<!-- user continues interacting with service -->]]>
</example>
</section3>
</section2>
@ -1471,23 +1471,23 @@
</p>
<example caption='User privileges in service'>
<![CDATA[
<!-- user wants to perform action -->
<!-- user wants to perform action -->
<iq type='get'
<iq type='get'
from='service@example.org/service'
to='provisioning.example.org'
id='27'>
<hasPrivilege xmlns='urn:xmpp:iot:provisioning' serviceToken='SERVICETOKEN1' userToken='USERTOKEN1' privilegeId='Sensors.View'/>
</iq>
</iq>
<iq type='result'
<iq type='result'
from='provisioning.example.org'
to='service@example.org/service'
id='27'>
<hasPrivilegeResponse xmlns='urn:xmpp:iot:provisioning' result='true'/>
</iq>
</iq>
<!-- user performs action -->]]>
<!-- user performs action -->]]>
</example>
</section3>
<section3 topic='Download all user privileges' anchor='downloadall'>
@ -1505,9 +1505,9 @@
</p>
<example caption='Download all user privileges'>
<![CDATA[
<!-- user connects to service -->
<!-- user connects to service -->
<iq type='get'
<iq type='get'
from='service@example.org/service'
to='provisioning.example.org'
id='28'>
@ -1516,30 +1516,30 @@
<credentials type='Longitude' value='123.45'/>
<credentials type='Latitude' value='67.89'/>
</canAccess>
</iq>
</iq>
<iq type='result'
<iq type='result'
from='provisioning.example.org'
to='service@example.org/service'
id='28'>
<canAccessResponse xmlns='urn:xmpp:iot:provisioning' userToken='USERTOKEN1' result='true'/>
</iq>
</iq>
<!-- user performs login into service -->
<!-- user performs login into service -->
<message from='service@example.org/service'
<message from='service@example.org/service'
to='provisioning.example.org'>
<userLoggedIn xmlns='urn:xmpp:iot:provisioning' serviceToken='SERVICETOKEN1' userToken='USERTOKEN1' userName='Kermit' />
</message>
</message>
<iq type='get'
<iq type='get'
from='service@example.org/service'
to='provisioning.example.org'
id='29'>
<downloadPrivileges xmlns='urn:xmpp:iot:provisioning' serviceToken='SERVICETOKEN1' userToken='USERTOKEN1'/>
</iq>
</iq>
<iq type='result'
<iq type='result'
from='provisioning.example.org'
to='service@example.org/service'
id='29'>
@ -1547,9 +1547,9 @@
<exclude id='Sensors.Delete'/>
<include id='Sensors'/>
</downloadPrivilegesResponse>
</iq>
</iq>
<!-- user performs actions without interaction with the provisioning server -->]]>
<!-- user performs actions without interaction with the provisioning server -->]]>
</example>
<p>
<strong>Note:</strong> If the user or service has not been correctly identified, logged in, etc., the resulting list must only include privileges

View File

@ -337,12 +337,12 @@
</p>
<example caption='Message stanza for setting a value'>
<![CDATA[
<message from='master@example.org/amr'
<message from='master@example.org/amr'
to='digital.output@example.org'>
<set xmlns='urn:xmpp:iot:control'>
<boolean name='Output' value='true'/>
</set>
</message>]]>
</message>]]>
</example>
<p>
Note that any response is supressed when sending a message stanza, regardless if the desired control command could be executed or not. The following example shows how the same
@ -355,21 +355,21 @@
</p>
<example caption='IQ stanza for setting a value'>
<![CDATA[
<iq type='set'
<iq type='set'
from='master@example.org/amr'
to='digital.output@example.org'
id='1'>
<set xmlns='urn:xmpp:iot:control' xml:lang='en'>
<boolean name='Output' value='true'/>
</set>
</iq>
</iq>
<iq type='result'
<iq type='result'
from='digital.output@example.org'
to='master@example.org/amr'
id='1'>
<setResponse xmlns='urn:xmpp:iot:control'/>
</iq>]]>
</iq>]]>
</example>
<p>
<strong>Note:</strong> An empty <strong>setResponse</strong> element means that the control command was executed as provided in the request. Sometimes, the device
@ -387,16 +387,16 @@
</p>
<example caption='Control failure response'>
<![CDATA[
<iq type='set'
<iq type='set'
from='master@example.org/amr'
to='analog.output@example.org'
id='2'>
<set xmlns='urn:xmpp:iot:control' xml:lang='en'>
<boolean name='Output' value='true'/>
</set>
</iq>
</iq>
<iq type='error'
<iq type='error'
from='analog.output@example.org'
to='master@example.org/amr'
id='2'>
@ -404,7 +404,7 @@
<bad-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
<paramError xmlns='urn:xmpp:iot:control' var='Output'>Invalid parameter type.</error>
</error>
</iq>]]>
</iq>]]>
</example>
<p>
Here, the <strong>paramError</strong> element is used in the IQ Error response, to provide error information related to a specific control parameter.
@ -422,12 +422,12 @@
</p>
<example caption='Setting a single boolean-valued control parameter'>
<![CDATA[
<message from='master@example.org/amr'
<message from='master@example.org/amr'
to='digital.output@example.org'>
<set xmlns='urn:xmpp:iot:control'>
<boolean name='Output' value='true'/>
</set>
</message>]]>
</message>]]>
</example>
</section3>
<section3 topic='Setting a single 32-bit integer-valued control parameter'>
@ -437,12 +437,12 @@
</p>
<example caption='Setting a single 32-bit integer-valued control parameter'>
<![CDATA[
<message from='master@example.org/amr'
<message from='master@example.org/amr'
to='analog.output@example.org'>
<set xmlns='urn:xmpp:iot:control'>
<int name='Output' value='50000'/>
</set>
</message>]]>
</message>]]>
</example>
</section3>
<section3 topic='Setting a single 64-bit integer-valued control parameter'>
@ -453,12 +453,12 @@
</p>
<example caption='Setting a single 64-bit integer-valued control parameter'>
<![CDATA[
<message from='master@example.org/amr'
<message from='master@example.org/amr'
to='megaprecision.analog.output@example.org'>
<set xmlns='urn:xmpp:iot:control'>
<long name='Output' value='500000000000000'/>
</set>
</message>]]>
</message>]]>
</example>
</section3>
<section3 topic='Setting a single string-valued control parameter'>
@ -468,12 +468,12 @@
</p>
<example caption='Setting a single string-valued control parameter'>
<![CDATA[
<message from='master@example.org/amr'
<message from='master@example.org/amr'
to='text.display@example.org'>
<set xmlns='urn:xmpp:iot:control'>
<string name='Row1' value='Temperature: 21.4 °C'/>
</set>
</message>]]>
</message>]]>
</example>
</section3>
<section3 topic='Setting a single double-valued control parameter'>
@ -483,12 +483,12 @@
</p>
<example caption='Setting a single double-valued control parameter'>
<![CDATA[
<message from='master@example.org/amr'
<message from='master@example.org/amr'
to='analog.output2@example.org'>
<set xmlns='urn:xmpp:iot:control'>
<double name='4-20mA' value='8.192'/>
</set>
</message>]]>
</message>]]>
</example>
</section3>
<section3 topic='Setting a single date-valued control parameter'>
@ -498,12 +498,12 @@
</p>
<example caption='Setting a single date-valued control parameter'>
<![CDATA[
<message from='master@example.org/amr'
<message from='master@example.org/amr'
to='alarm@example.org'>
<set xmlns='urn:xmpp:iot:control'>
<date name='TariffStartDate' value='2013-05-01'/>
</set>
</message>]]>
</message>]]>
</example>
</section3>
<section3 topic='Setting a single time-valued control parameter'>
@ -513,12 +513,12 @@
</p>
<example caption='Setting a single time-valued control parameter'>
<![CDATA[
<message from='master@example.org/amr'
<message from='master@example.org/amr'
to='alarm@example.org'>
<set xmlns='urn:xmpp:iot:control'>
<time name='Alarm Time' value='08:00:00'/>
</set>
</message>]]>
</message>]]>
</example>
</section3>
<section3 topic='Setting a single date &amp; time-valued control parameter'>
@ -528,12 +528,12 @@
</p>
<example caption='Setting a single date &amp; time-valued control parameter'>
<![CDATA[
<message from='master@example.org/amr'
<message from='master@example.org/amr'
to='alarm@example.org'>
<set xmlns='urn:xmpp:iot:control'>
<dateTime name='Alarm Time' value='2013-04-02T08:00:00'/>
</set>
</message>]]>
</message>]]>
</example>
</section3>
<section3 topic='Setting a single duration-valued control parameter'>
@ -543,12 +543,12 @@
</p>
<example caption='Setting a single duration-valued control parameter'>
<![CDATA[
<message from='master@example.org/amr'
<message from='master@example.org/amr'
to='alarm@example.org'>
<set xmlns='urn:xmpp:iot:control'>
<duration name='Alarm Duration' value='PT3M30S'/>
</set>
</message>]]>
</message>]]>
</example>
</section3>
<section3 topic='Setting a single color-valued control parameter'>
@ -558,12 +558,12 @@
</p>
<example caption='Setting a single color-valued control parameter'>
<![CDATA[
<message from='master@example.org/amr'
<message from='master@example.org/amr'
to='spotlight@example.org'>
<set xmlns='urn:xmpp:iot:control'>
<color name='Color' value='3399FF'/>
</set>
</message>]]>
</message>]]>
</example>
</section3>
<section3 topic='Setting multiple control parameters at once'>
@ -573,13 +573,13 @@
</p>
<example caption='Setting multiple control parameters at once'>
<![CDATA[
<message from='master@example.org/amr'
<message from='master@example.org/amr'
to='dimmer@example.org'>
<set xmlns='urn:xmpp:iot:control'>
<int name='FadeTimeMilliseconds' value='500'/>
<int name='OutputPercent' value='10'/>
</set>
</message>]]>
</message>]]>
</example>
<p>
Sometimes the order of control parameters are important in the device, and sometimes the parameters form part of a whole. It depends on the context of the device.
@ -602,14 +602,14 @@
</p>
<example caption='Getting a control form'>
<![CDATA[
<iq type='get'
<iq type='get'
from='master@example.org/amr'
to='dimmer@example.org'
id='3'>
<getForm xmlns='urn:xmpp:iot:control' xml:lang='en'/>
</iq>
</iq>
<iq type='result'
<iq type='result'
from='dimmer@example.org'
to='master@example.org/amr'
id='3'>
@ -649,7 +649,7 @@
<xdd:notSame/>
</field>
</x>
</iq>]]>
</iq>]]>
</example>
<p>
<strong>IMPORTANT:</strong> The device MUST mark all control parameters in the form as <strong>notSame</strong>, as defined in
@ -682,14 +682,14 @@
</p>
<example caption='Getting a control form, Failure'>
<![CDATA[
<iq type='get'
<iq type='get'
from='master@example.org/amr'
to='dimmer@example.org'
id='4'>
<getForm xmlns='urn:xmpp:iot:control' xml:lang='en'/>
</iq>
</iq>
<iq type='error'
<iq type='error'
from='dimmer@example.org'
to='master@example.org/amr'
id='4'>
@ -697,7 +697,7 @@
<forbidden xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
<text xmlns='urn:ietf:params:xml:ns:xmpp-stanzas' xml:lang='en'>Access denied.</text>
</error>
</iq>]]>
</iq>]]>
</example>
</section3>
<section3 topic='Setting a (partial) control form'>
@ -710,7 +710,7 @@
</p>
<example caption='Setting a (partial) control form'>
<![CDATA[
<iq type='set'
<iq type='set'
from='master@example.org/amr'
to='dimmer@example.org'
id='5'>
@ -727,14 +727,14 @@
</field>
</x>
</set>
</iq>
</iq>
<iq type='result'
<iq type='result'
from='dimmer@example.org'
to='master@example.org/amr'
id='5'>
<setResponse xmlns='urn:xmpp:iot:control' />
</iq>]]>
</iq>]]>
</example>
<p>
In this example, the FadeTimeMilliseconds and OutputPercent control parameters are sent, while the MainSwitch control parameter is left as is. Fading is therefore
@ -748,7 +748,7 @@
</p>
<example caption='Setting a (partial) control form, Failure'>
<![CDATA[
<iq type='set'
<iq type='set'
from='master@example.org/amr'
to='dimmer@example.org'
id='6'>
@ -765,9 +765,9 @@
</field>
</x>
</set>
</iq>
</iq>
<iq type='error'
<iq type='error'
from='dimmer@example.org'
to='master@example.org/amr'
id='6'>
@ -775,7 +775,7 @@
<bad-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
<paramError xmlns='urn:xmpp:iot:control' var='OutputPercent'>Invalid parameter value.</error>
</error>
</iq>]]>
</iq>]]>
</example>
</section3>
</section2>
@ -791,13 +791,13 @@
</p>
<example caption='Sending a control command to a node behind a concentrator'>
<![CDATA[
<message from='master@example.org/amr'
<message from='master@example.org/amr'
to='concentrator@example.org'>
<set xmlns='urn:xmpp:iot:control'>
<node nodeId='DigitalOutput1'/>
<boolean name='Output' value='false'/>
</set>
</message>]]>
</message>]]>
</example>
</section3>
<section3 topic='Sending a control command to multiple nodes'>
@ -807,7 +807,7 @@
</p>
<example caption='Sending a control command to multiple nodes'>
<![CDATA[
<message from='master@example.org/amr'
<message from='master@example.org/amr'
to='concentrator@example.org'>
<set xmlns='urn:xmpp:iot:control'>
<node nodeId='DigitalOutput1'/>
@ -816,7 +816,7 @@
<node nodeId='DigitalOutput4'/>
<boolean name='Output' value='false'/>
</set>
</message>]]>
</message>]]>
</example>
</section3>
<section3 topic='Sending a control command to multiple nodes, Failure'>
@ -828,7 +828,7 @@
</p>
<example caption='Sending a control command to multiple nodes, Failure'>
<![CDATA[
<iq type='set'
<iq type='set'
from='master@example.org/amr'
to='concentrator@example.org'
id='7'>
@ -843,9 +843,9 @@
<node nodeId='AnalogOutput4'/>
<boolean name='Output' value='true'/>
</set>
</iq>
</iq>
<iq type='error'
<iq type='error'
from='concentrator@example.org'
to='master@example.org/amr'
id='7'>
@ -853,7 +853,7 @@
<bad-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
<paramError xmlns='urn:xmpp:iot:control' var='Output'>Invalid parameter type.</error>
</error>
</iq>]]>
</iq>]]>
</example>
</section3>
<section3 topic='Getting a control form from multiple nodes'>
@ -863,7 +863,7 @@
</p>
<example caption='Getting a control form from multiple nodes'>
<![CDATA[
<iq type='get'
<iq type='get'
from='master@example.org/amr'
to='concentrator@example.org'
id='8'>
@ -873,9 +873,9 @@
<node nodeId='DigitalOutput3'/>
<node nodeId='DigitalOutput4'/>
</getForm>
</iq>
</iq>
<iq type='result'
<iq type='result'
from='concentrator@example.org'
to='master@example.org/amr'
id='8'>
@ -897,7 +897,7 @@
<xdd:notSame/>
</field>
</x>
</iq>]]>
</iq>]]>
</example>
<p>
Note that only parameters that are common between the nodes defined in the request must be returned. However, all parameters must have the
@ -911,7 +911,7 @@
</p>
<example caption='Getting a control form from multiple nodes, Failure'>
<![CDATA[
<iq type='get'
<iq type='get'
from='master@example.org/amr'
to='concentrator@example.org'
id='9'>
@ -921,9 +921,9 @@
<node nodeId='DigitalOutput3'/>
<node nodeId='DigitalOutput4'/>
</getForm>
</iq>
</iq>
<iq type='error'
<iq type='error'
from='concentrator@example.org'
to='master@example.org/amr'
id='9'>
@ -931,7 +931,7 @@
<feature-not-implemented xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
<text xmlns='urn:ietf:params:xml:ns:xmpp-stanzas' xml:lang='en'>Cannot merge control forms from different nodes.</text>
</error>
</iq>]]>
</iq>]]>
</example>
</section3>
<section3 topic='Setting a (partial) control form to multiple nodes'>
@ -943,7 +943,7 @@
</p>
<example caption='Setting a (partial) control form to multiple nodes'>
<![CDATA[
<iq type='set'
<iq type='set'
from='master@example.org/amr'
to='concentrator@example.org'
id='10'>
@ -961,14 +961,14 @@
</field>
</x>
</set>
</iq>
</iq>
<iq type='result'
<iq type='result'
from='concentrator@example.org'
to='master@example.org/amr'
id='10'>
<setResponse xmlns='urn:xmpp:iot:control' />
</iq>]]>
</iq>]]>
</example>
</section3>
<section3 topic='Setting a (partial) control form to multiple nodes, Failure'>
@ -978,7 +978,7 @@
</p>
<example caption='Setting a (partial) control form to multiple nodes'>
<![CDATA[
<iq type='set'
<iq type='set'
from='master@example.org/amr'
to='concentrator@example.org'
id='11'>
@ -1000,9 +1000,9 @@
</field>
</x>
</set>
</iq>
</iq>
<iq type='error'
<iq type='error'
from='concentrator@example.org'
to='master@example.org/amr'
id='11'>
@ -1010,7 +1010,7 @@
<bad-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
<paramError xmlns='urn:xmpp:iot:control' var='Output'>Invalid type.</error>
</error>
</iq>]]>
</iq>]]>
</example>
</section3>
</section2>
@ -1504,14 +1504,14 @@
</p>
<example caption='Grouping control parameters'>
<![CDATA[
<iq type='get'
<iq type='get'
from='master@example.org/amr'
to='spotlight@example.org'
id='12'>
<getForm xmlns='urn:xmpp:iot:control' xml:lang='en'/>
</iq>
</iq>
<iq type='result'
<iq type='result'
from='spotlight@example.org'
to='master@example.org/amr'
id='12'>
@ -1555,7 +1555,7 @@
<parameterGroup xmlns='urn:xmpp:iot:control' name='direction'/>
</field>
</x>
</iq>]]>
</iq>]]>
</example>
<p>
The above example informs the client that the two parameters HorizontalAngle and ElevationAngle should be written together to control a control action

File diff suppressed because it is too large Load Diff