Commit 92fe4b86 authored by Peter Waher's avatar Peter Waher

Simple control example added.

parent e2efa04d
Simple Control Actions
==========================
Simple control actions are sent to a control server by embedding a `set` element in an `iq` stanza of type `set`.
![Simple Control](Diagrams/SimpleControl.png)
The `set` element contains the set of control parameters with their corresponding values to be set. It can also optionally contain node definitions,
if the control server is divided into nodes. The response is either an `iq` of type `error`, in case the operation is rejected, or an `iq` of type `result`,
in case the operation succeeded, or was partially accepted. The result contains the nodes and parameters successfully operated on. If this set is smaller
than the original request, the device decided to reduce the request, probably due to restrictions based on the sender identity. If the device denies all
control operations, an error is returned instead of a partial result.
Examples
---------------
Simple set of parameters for a spotlight:
```xml
<iq type='set' from='client@example.org/1234' to='device@example.org/abcd' id='R0001'>
<set xmlns='urn:ieee:iot:ctr:1.0'>
<b n="MainSwitch" v="true"/>
<db n="HorizontalAngle" v="0"/>
<db n="ElevationAngle" v="0"/>
</set>
</iq>
```
Response:
```xml
<iq type='result' from='device@example.org/abcd' to='client@example.org/1234' id='R0001'>
<resp xmlns='urn:ieee:iot:ctr:1.0'>
<p n="MainSwitch"/>
<p n="HorizontalAngle"/>
<p n="ElevationAngle"/>
</resp>
</iq>
```
<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentScriptType="application/ecmascript" contentStyleType="text/css" height="198px" preserveAspectRatio="none" style="width:327px;height:198px;" version="1.1" viewBox="0 0 327 198" width="327px" zoomAndPan="magnify"><defs><filter height="300%" id="fiqnso8mc0nnr" width="300%" x="-1" y="-1"><feGaussianBlur result="blurOut" stdDeviation="2.0"/><feColorMatrix in="blurOut" result="blurOut2" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .4 0"/><feOffset dx="4.0" dy="4.0" in="blurOut2" result="blurOut3"/><feBlend in="SourceGraphic" in2="blurOut3" mode="normal"/></filter></defs><g><rect fill="#FFFFFF" filter="url(#fiqnso8mc0nnr)" height="71.2656" style="stroke: #A80036; stroke-width: 1.0;" width="10" x="194.5" y="69.2969"/><rect fill="#FFFFFF" filter="url(#fiqnso8mc0nnr)" height="34.1328" style="stroke: #A80036; stroke-width: 1.0;" width="10" x="199.5" y="106.4297"/><line style="stroke: #A80036; stroke-width: 1.0; stroke-dasharray: 5.0,5.0;" x1="36" x2="36" y1="38.2969" y2="158.6953"/><line style="stroke: #A80036; stroke-width: 1.0; stroke-dasharray: 5.0,5.0;" x1="199" x2="199" y1="38.2969" y2="158.6953"/><rect fill="#FEFECE" filter="url(#fiqnso8mc0nnr)" height="30.2969" style="stroke: #A80036; stroke-width: 1.5;" width="53" x="8" y="3"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="39" x="15" y="22.9951">Client</text><rect fill="#FEFECE" filter="url(#fiqnso8mc0nnr)" height="30.2969" style="stroke: #A80036; stroke-width: 1.5;" width="53" x="8" y="157.6953"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="39" x="15" y="177.6904">Client</text><rect fill="#FEFECE" filter="url(#fiqnso8mc0nnr)" height="30.2969" style="stroke: #A80036; stroke-width: 1.5;" width="61" x="167" y="3"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="47" x="174" y="22.9951">Device</text><rect fill="#FEFECE" filter="url(#fiqnso8mc0nnr)" height="30.2969" style="stroke: #A80036; stroke-width: 1.5;" width="61" x="167" y="157.6953"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="47" x="174" y="177.6904">Device</text><rect fill="#FFFFFF" filter="url(#fiqnso8mc0nnr)" height="71.2656" style="stroke: #A80036; stroke-width: 1.0;" width="10" x="194.5" y="69.2969"/><rect fill="#FFFFFF" filter="url(#fiqnso8mc0nnr)" height="34.1328" style="stroke: #A80036; stroke-width: 1.0;" width="10" x="199.5" y="106.4297"/><polygon fill="#A80036" points="182.5,65.2969,192.5,69.2969,182.5,73.2969,186.5,69.2969" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.0;" x1="36.5" x2="188.5" y1="69.2969" y2="69.2969"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="110" x="43.5" y="64.3638">iq[type=set](set)</text><line style="stroke: #A80036; stroke-width: 1.0;" x1="204.5" x2="251.5" y1="93.5625" y2="93.5625"/><line style="stroke: #A80036; stroke-width: 1.0;" x1="251.5" x2="251.5" y1="93.5625" y2="106.5625"/><line style="stroke: #A80036; stroke-width: 1.0;" x1="210.5" x2="251.5" y1="106.5625" y2="106.5625"/><polygon fill="#A80036" points="220.5,102.5625,210.5,106.5625,220.5,110.5625,216.5,106.5625" style="stroke: #A80036; stroke-width: 1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="99" x="216.5" y="88.4966">set parameters</text><polygon fill="#A80036" points="47.5,136.5625,37.5,140.5625,47.5,144.5625,43.5,140.5625" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.0;" x1="41.5" x2="198.5" y1="140.5625" y2="140.5625"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="134" x="53.5" y="135.6294">iq[type=result](resp)</text><!--
@startuml
Client -> Device : iq[type=set](set)
Activate Device
Device -> Device : set parameters
Activate Device
Client <- Device : iq[type=result](resp)
Deactivate Device
Deactivate Device
@enduml
PlantUML version 1.2017.18(Fri Oct 06 16:56:32 UTC 2017)
(GPL source distribution)
Java Runtime: Java(TM) SE Runtime Environment
JVM: Java HotSpot(TM) 64-Bit Server VM
Java Version: 1.7.0_25-b15
Operating System: Linux
Default Encoding: UTF-8
Language: en
Country: US
--></g></svg>
\ No newline at end of file
@startuml
Client -> Device : iq[type=set](set)
Activate Device
Device -> Device : set parameters
Activate Device
Client <- Device : iq[type=result](resp)
Deactivate Device
Deactivate Device
@enduml
\ No newline at end of file
......@@ -17,7 +17,7 @@ Communication Patterns
* [Sensor Data Request/Response communication pattern](SensorDataRequestResponse.md)
* [Sensor Data Event Subscription communication pattern](SensorDataEventSubscription.md)
* [Simple Control Actions](ControlSimpleActions.md)
Schemas
-------------
......@@ -32,7 +32,9 @@ Implementations
### Sensor data related libraries.
| Project | Language | Environment | Description |
|------------------------------------------------------------------------------------------------------|----------|--------------|-------------------------------------------------------------------------------------------------|
| [Waher.Networking.XMPP.Sensor](https://www.nuget.org/packages/Waher.Networking.XMPP.Sensor/) | C# | .NET Std 1.3 | Sensor data library. Handles both sensor data requests, as well as event subscriptions. |
| [Waher.Networking.XMPP.Sensor.UWP](https://www.nuget.org/packages/Waher.Networking.XMPP.Sensor.UWP/) | C# | UWP | Sensor data library for UWP. Handles both sensor data requests, as well as event subscriptions. |
| Project | Language | Environment | Description |
|--------------------------------------------------------------------------------------------------------|----------|--------------|----------------------------------------------------------------------------------------------------------------------------------------|
| [Waher.Networking.XMPP.Sensor](https://www.nuget.org/packages/Waher.Networking.XMPP.Sensor/) | C# | .NET Std 1.3 | Sensor data library. Handles both sensor data requests, as well as event subscriptions. Both client and server side supported. |
| [Waher.Networking.XMPP.Sensor.UWP](https://www.nuget.org/packages/Waher.Networking.XMPP.Sensor.UWP/) | C# | UWP | Sensor data library for UWP. Handles both sensor data requests, as well as event subscriptions. Both client and server side supported. |
| [Waher.Networking.XMPP.Control](https://www.nuget.org/packages/Waher.Networking.XMPP.Control/) | C# | .NET Std 1.3 | Control library. Handles both simple and data form control parameter operations. Both client and server side supported. |
| [Waher.Networking.XMPP.Control.UWP](https://www.nuget.org/packages/Waher.Networking.XMPP.Control.UWP/) | C# | UWP | Control library for UWP. Handles both simple and data form control parameter operations. Both client and server side supported. |
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