-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathsensor-network-concentrators.html
6922 lines (6611 loc) · 492 KB
/
sensor-network-concentrators.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>XEP-0326: Internet of Things - Concentrators</title>
<link rel="stylesheet" type="text/css" href="xmpp.css">
<link href="prettify.css" type="text/css" rel="stylesheet">
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico"><script type="text/javascript" src="prettify.js"></script><meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=2.0">
<meta name="DC.Title" content="Internet of Things - Concentrators">
<meta name="DC.Creator" content="Peter Waher">
<meta name="DC.Description" content="This specification describes how to manage and get information from concentrators of devices over XMPP networks.">
<meta name="DC.Publisher" content="XMPP Standards Foundation">
<meta name="DC.Contributor" content="XMPP Extensions Editor">
<meta name="DC.Date" content="2013-12-04">
<meta name="DC.Type" content="XMPP Extension Protocol">
<meta name="DC.Format" content="XHTML">
<meta name="DC.Identifier" content="XEP-0326">
<meta name="DC.Language" content="en">
<meta name="DC.Rights" content="This XMPP Extension Protocol is copyright © 1999 - 2014 by the XMPP Standards Foundation (XSF).">
</head>
<body onload="prettyPrint()">
<h1>XEP-0326: Internet of Things - Concentrators</h1>
<table>
<tr valign="top">
<td><strong>Abstract:</strong></td>
<td>This specification describes how to manage and get information from concentrators of devices over XMPP networks.</td>
</tr>
<tr valign="top">
<td><strong>Author:</strong></td>
<td>Peter Waher</td>
</tr>
<tr valign="top">
<td><strong>Copyright:</strong></td>
<td>© 1999 - 2014 XMPP Standards Foundation. <a href="#appendix-legal">SEE LEGAL NOTICES</a>.</td>
</tr>
<tr valign="top">
<td><strong>Status:</strong></td>
<td>Experimental</td>
</tr>
<tr valign="top">
<td><strong>Type:</strong></td>
<td>Standards Track</td>
</tr>
<tr valign="top">
<td><strong>Version:</strong></td>
<td>0.1.5</td>
</tr>
<tr valign="top">
<td><strong>Last Updated:</strong></td>
<td>2013-12-04</td>
</tr>
</table>
<hr>
<p style="color:red">WARNING: This Standards-Track document is Experimental. Publication as an XMPP Extension Protocol does not imply approval of this proposal by the XMPP Standards Foundation. Implementation of the protocol described herein is encouraged in exploratory implementations, but production systems are advised to carefully consider whether it is appropriate to deploy implementations of this protocol before it advances to a status of Draft.</p>
<hr>
<h2>Table of Contents</h2>
<div class="indent">
<p><br>1. <a href="#intro">Introduction</a><br>
1.1. <a href="#sect-ID0E2HAC">Relations to other extensions</a><br>
1.1.1. <a href="#sect-ID0EDIAC">XEP-0060</a><br>
1.1.2. <a href="#sect-ID0ELKAC">XEP-0248</a><br>
1.1.3. <a href="#sect-ID0ENLAC">XEP-0050</a><br>2. <a href="#glossary">Glossary</a><br>3. <a href="#usecases">Use Cases</a><br>
3.1. <a href="#sect-ID0EPEAE">Capabilities</a><br>
3.1.1. <a href="#sect-ID0ETEAE">Get Capabilities</a><br>
3.2. <a href="#sect-ID0E3FAE">Data Sources</a><br>
3.2.1. <a href="#sect-ID0EAGAE">Get All Data Sources</a><br>
3.2.2. <a href="#sect-ID0EMGAE">Get Root Data Sources</a><br>
3.2.3. <a href="#sect-ID0EYGAE">Get Child Data Sources</a><br>
3.2.4. <a href="#subscribe">Subscribe to data source events</a><br>
3.2.5. <a href="#sect-ID0EUJAE">Unsubscribe from data source events</a><br>
3.2.6. <a href="#subscribe2">Get changes since given timestamp before subscribing</a><br>
3.2.7. <a href="#sect-ID0EAMAE">Get changes since given timestamp before subscribing, Failure</a><br>
3.3. <a href="#sect-ID0EZMAE">Nodes</a><br>
3.3.1. <a href="#sect-ID0E4MAE">Contains Node</a><br>
3.3.2. <a href="#sect-ID0EJNAE">Contains Nodes</a><br>
3.3.3. <a href="#sect-ID0EZNAE">Get Node</a><br>
3.3.4. <a href="#sect-ID0ENOAE">Get Nodes</a><br>
3.3.5. <a href="#sect-ID0EBPAE">Get Node with parameters</a><br>
3.3.6. <a href="#sect-ID0EVPAE">Get Nodes with parameters</a><br>
3.3.7. <a href="#sect-ID0EJQAE">Get All Nodes</a><br>
3.3.8. <a href="#sect-ID0EVQAE">Get All Nodes with Parameters</a><br>
3.3.9. <a href="#sect-ID0EBRAE">Get All Nodes derived from</a><br>
3.3.10. <a href="#sect-ID0ENRAE">Get All Nodes derived from, with Parameters</a><br>
3.3.11. <a href="#sect-ID0E4RAE">Get Node Inheritance</a><br>
3.3.12. <a href="#sect-ID0EQSAE">Get Root Nodes</a><br>
3.3.13. <a href="#sect-ID0E3SAE">Get Root Nodes with Parameters</a><br>
3.3.14. <a href="#sect-ID0EITAE">Get Child Nodes</a><br>
3.3.15. <a href="#sect-ID0EUTAE">Get Child Nodes with Parameters</a><br>
3.3.16. <a href="#sect-ID0EAUAE">Get Indices of Data Source</a><br>
3.3.17. <a href="#sect-ID0EMUAE">Get Nodes from index</a><br>
3.3.18. <a href="#sect-ID0EYUAE">Get Nodes from index with Parameters</a><br>
3.3.19. <a href="#sect-ID0EEVAE">Get Nodes from indices</a><br>
3.3.20. <a href="#sect-ID0EQVAE">Get Nodes from indices with Parameters</a><br>
3.3.21. <a href="#sect-ID0E3VAE">Get All Index Values</a><br>
3.3.22. <a href="#sect-ID0EIWAE">Get Node Ancestors</a><br>
3.3.23. <a href="#sect-ID0EAXAE">Move Node Up</a><br>
3.3.24. <a href="#sect-ID0EWXAE">Move Node Down</a><br>
3.3.25. <a href="#sect-ID0EMYAE">Move Nodes Up</a><br>
3.3.26. <a href="#sect-ID0ECZAE">Move Nodes Down</a><br>
3.4. <a href="#sect-ID0EZZAE">Node Parameters</a><br>
3.4.1. <a href="#sect-ID0E4ZAE">Get Node Parameters for editing</a><br>
3.4.2. <a href="#sect-ID0ES4AE">Set Node Parameters after editing</a><br>
3.4.3. <a href="#sect-ID0EO5AE">Set Node Parameters after editing, Failure</a><br>
3.4.4. <a href="#sect-ID0EM6AE">Get Common Node Parameters for editing</a><br>
3.4.5. <a href="#sect-ID0EWAAG">Set Common Node Parameters after editing</a><br>
3.4.6. <a href="#sect-ID0E3BAG">Set Common Node Parameters after editing, Failure</a><br>
3.4.7. <a href="#sect-ID0EUCAG">Get Node Messages</a><br>
3.5. <a href="#sect-ID0ECIAG">Creating and Destroying Nodes</a><br>
3.5.1. <a href="#sect-ID0EGIAG">Get Addable Node Types</a><br>
3.5.2. <a href="#sect-ID0EVIAG">Get Parameters for New Node</a><br>
3.5.3. <a href="#sect-ID0EEJAG">Create New Node</a><br>
3.5.4. <a href="#sect-ID0EAKAG">Create New Node, Failure</a><br>
3.5.5. <a href="#sect-ID0EYKAG">Destroy Node</a><br>
3.5.6. <a href="#sect-ID0EQLAG">Destroy Node, Failure</a><br>
3.6. <a href="#sect-ID0EEMAG">Node Commands</a><br>
3.6.1. <a href="#sect-ID0EIMAG">Get Node Commands</a><br>
3.6.2. <a href="#sect-ID0EVNAG">Execute Simple Node Command</a><br>
3.6.3. <a href="#sect-ID0EEOAG">Get Node Command Parameters</a><br>
3.6.4. <a href="#sect-ID0EQOAG">Execute Parameterized Node Command</a><br>
3.6.5. <a href="#sect-ID0E6OAG">Execute Node Command, Failure</a><br>
3.6.6. <a href="#sect-ID0ETPAG">Execute Node Query</a><br>
3.6.7. <a href="#sect-ID0E1QAG">Execute Node Query, Failure</a><br>
3.6.8. <a href="#sect-ID0EORAG">Abort Node Query</a><br>
3.6.9. <a href="#sect-ID0EJSAG">Get Common Commands for Nodes</a><br>
3.6.10. <a href="#sect-ID0EYSAG">Execute Simple Command on multiple nodes</a><br>
3.6.11. <a href="#sect-ID0EHTAG">Get Common Command Parameters from command on multiple nodes</a><br>
3.6.12. <a href="#sect-ID0ETTAG">Execute Common Parameterized Command on multiple nodes</a><br>
3.6.13. <a href="#sect-ID0ECUAG">Execute Parameterized Command on Multiple Nodes, Failure</a><br>
3.6.14. <a href="#sect-ID0EWUAG">Execute Command on Multiple Nodes, Partial Failure</a><br>
3.6.15. <a href="#sect-ID0EQVAG">Execute Common Query on multiple nodes</a><br>
3.6.16. <a href="#sect-ID0EXWAG">Execute Common Query on multiple nodes, Failure</a><br>
3.6.17. <a href="#sect-ID0ELXAG">Execute Common Query on multiple nodes, Partial Failure</a><br>
3.6.18. <a href="#sect-ID0EFYAG">Abort Common Query on multiple nodes</a><br>
3.7. <a href="#queryevents">Query Events</a><br>
3.7.1. <a href="#sect-ID0EK1AG">Query Started</a><br>
3.7.2. <a href="#sect-ID0EZ1AG">Query Done</a><br>
3.7.3. <a href="#sect-ID0EI2AG">Query Aborted</a><br>
3.7.4. <a href="#sect-ID0EX2AG">New Table</a><br>
3.7.5. <a href="#sect-ID0ES3AG">New Records</a><br>
3.7.6. <a href="#sect-ID0EJ4AG">Table Done</a><br>
3.7.7. <a href="#sect-ID0EY4AG">New Object</a><br>
3.7.8. <a href="#sect-ID0EJ5AG">Query Message</a><br>
3.7.9. <a href="#sect-ID0EA6AG">Title</a><br>
3.7.10. <a href="#sect-ID0EM6AG">Status</a><br>
3.7.11. <a href="#sect-ID0EY6AG">Starting a section or subsection</a><br>
3.7.12. <a href="#sect-ID0EIABG">Closing a section or subsection</a><br>
3.8. <a href="#sourceevents">Data Source Events</a><br>
3.8.1. <a href="#sect-ID0EDCBG">Node added event</a><br>
3.8.2. <a href="#sect-ID0EMDBG">Node removed</a><br>
3.8.3. <a href="#sect-ID0EGEBG">Node updated</a><br>
3.8.4. <a href="##nodeStatusChanged">Node status changed</a><br>
3.8.5. <a href="#sect-ID0EEGBG">Node moved up</a><br>
3.8.6. <a href="#sect-ID0E5GBG">Node moved down</a><br>
3.9. <a href="#sect-ID0EZHBG">Field Databases</a><br>
3.9.1. <a href="#sect-ID0EIIBG">Get All Databases</a><br>
3.9.2. <a href="#sect-ID0EXIBG">Get Database Readout Parameters</a><br>
3.9.3. <a href="#sect-ID0EGJBG">Start Database Readout</a><br>
3.9.4. <a href="#sect-ID0EYKBG">Start Database Readout, Failure</a><br>
3.9.5. <a href="#sect-ID0ELLBG">Cancelling a database read-out</a><br>4. <a href="#support">Determining Support</a><br>5. <a href="#impl">Implementation Notes</a><br>
5.1. <a href="#nodeinfo">Node Information</a><br>
5.2. <a href="#sect-ID0EFYBG">Parameter Types</a><br>
5.3. <a href="#sect-ID0EA3BG">Response Codes</a><br>
5.4. <a href="#sect-ID0EF6BG">Unimplemented commands</a><br>
5.5. <a href="#nodecommands">Command attributes</a><br>
5.6. <a href="#sect-ID0EEFAI">Node States</a><br>
5.7. <a href="#sect-ID0E5HAI">Required Data Sources</a><br>
5.8. <a href="#columndef">Table Column definitions in query results</a><br>
5.9. <a href="#recorddef">Record Item definitions in query results</a><br>
5.10. <a href="#messagedef">Message definitions in query results</a><br>
5.11. <a href="#sect-ID0EJWAI">Single vs. batch commands</a><br>6. <a href="#i18n">Internationalization Considerations</a><br>
6.1. <a href="#sect-ID0EGXAI">Localization</a><br>
6.2. <a href="#sect-ID0EWXAI">Time Zones</a><br>
6.3. <a href="#interop">Interoperability</a><br>7. <a href="#security">Security Considerations</a><br>
7.1. <a href="#sect-ID0EVYAI">Access rights</a><br>
7.2. <a href="#sect-ID0ER1AI">Integration with provisioning servers</a><br>
7.2.1. <a href="#sect-ID0EM2AI">Restricting access to data source per contact</a><br>
7.2.2. <a href="#sect-ID0EK4AI">Restricting access to node properties per contact</a><br>
7.2.3. <a href="#sect-ID0EM5AI">Restricting access to node commands per contact</a><br>8. <a href="#iana">IANA Considerations</a><br>9. <a href="#registrar">XMPP Registrar Considerations</a><br>10. <a href="#schema">XML Schema</a><br>11. <a href="#moreinfo">For more information</a><br>12. <a href="#ack">Acknowledgements</a></p>
<p><a href="#appendices">Appendices</a><br> <a href="#appendix-docinfo">A: Document Information</a><br> <a href="#appendix-authorinfo">B: Author Information</a><br> <a href="#appendix-legal">C: Legal Notices</a><br> <a href="#appendix-xmpp">D: Relation to XMPP</a><br> <a href="#appendix-discuss">E: Discussion Venue</a><br> <a href="#appendix-conformance">F: Requirements Conformance</a><br> <a href="#appendix-notes">G: Notes</a><br> <a href="#appendix-revs">H: Revision History</a></p>
</div>
<hr>
<h2>1.
<a name="intro">Introduction</a></h2>
<p class="" style="">
Concentrators are devices in sensor networks, concentrating the management of a sub set of devices to one point. They can be small (for example: PLC:s managing a small
set of sensors and actuators), medium-sized (for example: mid-level concentrators, controlling branches of the network, islands, perhaps using separate communication protocols),
large (for example: entire sub-systems, perhaps managed by a separate child/partner organization) to massive (for example: The entire top-level system, smart-grid, IoT network).
</p>
<p class="" style="">
Even though this XEP is generally written and can be used by other implementations not based on sensor networks, much of the requirements used to define this specification
comes from requirements used in sensor networks and Internet of Things applications and infrastructure.
</p>
<p class="" style="">
This specification will define the following aspects of a general concentrator profile, that can handle all different types of concentrators available in sensor network architectures:
</p>
<ul class="" style="">
<li class="" style="">
A concentrator works with multiple <span class="strong">data sources</span>. Effective management of data sources and their contents is a vital part of this XEP.
</li>
<li class="" style="">The ability to work with massive quantities of entities.</li>
<li class="" style="">Effective synchronization of contents between interested parties.</li>
<li class="" style="">Effective ways to interact with entities controlled by the concentrator.</li>
</ul>
<p class="" style="">
Sensor networks contains many different architectures and use cases. For this reason, the sensor network standards have been divided into multiple XEPs according to the following table:
</p>
<div class="indent">
<p class="caption"><a name="table-1"></a>Table 1: Internet of Things XEPs</p>
<table border="1" cellpadding="3" cellspacing="0">
<tr class="body">
<th colspan="" rowspan="">XEP</th>
<th colspan="" rowspan="">Description</th>
</tr>
<tr class="body">
<td colspan="" rowspan="">xep-0000-IoT-BatteryPoweredSensors</td>
<td colspan="" rowspan="">Defines how to handle the peculiars related to battery powered devices, and other devices intermittently available on the network.</td>
</tr>
<tr class="body">
<td colspan="" rowspan="">xep-0000-IoT-Events</td>
<td colspan="" rowspan="">Defines how sensors send events, how event subscription, hysteresis levels, etc., are configured.</td>
</tr>
<tr class="body">
<td colspan="" rowspan="">xep-0000-IoT-Interoperability</td>
<td colspan="" rowspan="">Defines guidelines for how to achieve interoperability in sensor networks, publishing interoperability interfaces for different types of devices.</td>
</tr>
<tr class="body">
<td colspan="" rowspan="">xep-0000-IoT-Multicast</td>
<td colspan="" rowspan="">Defines how sensor data can be multicast in efficient ways.</td>
</tr>
<tr class="body">
<td colspan="" rowspan="">xep-0000-IoT-PubSub</td>
<td colspan="" rowspan="">Defines how efficient publication of sensor data can be made in sensor networks.</td>
</tr>
<tr class="body">
<td colspan="" rowspan="">xep-0000-IoT-Chat</td>
<td colspan="" rowspan="">Defines how human-to-machine interfaces should be constructed using chat messages to be user friendly, automatable and consistent with other IoT extensions and possible underlying architecture.</td>
</tr>
<tr class="body">
<td colspan="" rowspan="">XEP-0322</td>
<td colspan="" rowspan="">
Defines how to EXI can be used in XMPP to achieve efficient compression of data. Albeit not a sensor network specific XEP, this XEP should be considered
in all sensor network implementations where memory and packet size is an issue.
</td>
</tr>
<tr class="body">
<td colspan="" rowspan="">XEP-0323</td>
<td colspan="" rowspan="">
Provides the underlying architecture, basic operations and data structures for sensor data communication over XMPP networks.
It includes a hardware abstraction model, removing any technical detail implemented in underlying technologies. This XEP is used by all other sensor network XEPs.
</td>
</tr>
<tr class="body">
<td colspan="" rowspan="">XEP-0324</td>
<td colspan="" rowspan="">Defines how provisioning, the management of access privileges, etc., can be efficiently and easily implemented.</td>
</tr>
<tr class="body">
<td colspan="" rowspan="">XEP-0325</td>
<td colspan="" rowspan="">Defines how to control actuators and other devices in Internet of Things.</td>
</tr>
<tr class="body">
<td colspan="" rowspan="">XEP-0326</td>
<td colspan="" rowspan="">This specification. Defines how to handle architectures containing concentrators or servers handling multiple sensors.</td>
</tr>
<tr class="body">
<td colspan="" rowspan="">XEP-0331</td>
<td colspan="" rowspan="">Defines extensions for how color parameters can be handled, based on <span class="ref" style=""><a href="http://xmpp.org/extensions/xep-0004.html">Data Forms</a></span> [<a href="#nt-ID0EMFAC">1</a>]</td>
</tr>
<tr class="body">
<td colspan="" rowspan="">XEP-0336</td>
<td colspan="" rowspan="">Defines extensions for how dynamic forms can be created, based on <span class="ref" style=""><a href="http://xmpp.org/extensions/xep-0004.html">Data Forms</a></span> [<a href="#nt-ID0EDGAC">2</a>], <span class="ref" style=""><a href="http://xmpp.org/extensions/xep-0122.html">Data Forms Validation</a></span> [<a href="#nt-ID0EPGAC">3</a>], <span class="ref" style=""><a href="http://xmpp.org/extensions/xep-0137.html">Publishing Stream Initiation Requests</a></span> [<a href="#nt-ID0E2GAC">4</a>] and <span class="ref" style=""><a href="http://xmpp.org/extensions/xep-0141.html">Data Forms Layout</a></span> [<a href="#nt-ID0EHHAC">5</a>].</td>
</tr>
<tr class="body">
<td colspan="" rowspan="">XEP-0347</td>
<td colspan="" rowspan="">Defines the peculiars of sensor discovery in sensor networks. Apart from discovering sensors by JID, it also defines how to discover sensors based on location, etc.</td>
</tr>
</table>
</div>
<div class="indent">
<h3>1.1 <a name="sect-ID0E2HAC">Relations to other extensions</a></h3>
<p class="" style="">
Even though there are technologies available in forms of XEPs that solve parts of the above mentioned problem, they do not provide sufficient support. The following paragraphs will
take the time to list why different technologies are not applicable.
</p>
<div class="indent">
<h3>1.1.1 <a name="sect-ID0EDIAC">XEP-0060</a></h3>
<p class="" style="">
This XEP defines tree structures for nodes in different data sources. <span class="ref" style=""><a href="http://xmpp.org/extensions/xep-0060.html">Publish-Subscribe</a></span> [<a href="#nt-ID0ERIAC">6</a>] defines a model where a tree structure of nodes is published and users can browse this
tree structure. Furthermore, it allows the possibility to publish items on these nodes as well as syndication of this information.
</p>
<p class="" style="">
This XEP also defines data sources (in a tree structure). These data sources contain nodes. <span class="ref" style=""><a href="http://xmpp.org/extensions/xep-0248.html">PubSub Collection Nodes</a></span> [<a href="#nt-ID0ECJAC">7</a>] defines a structure called a node collection, a structure that
allows the creation of collections containing loosely coupled nodes.
</p>
<p class="" style="">
Even though this document defines tree structures of data, it is not however based on XEP-0060. There are multiple reasons for this:
</p>
<ul class="" style="">
<li class="" style="">
The structures defined in this specification do not include items to publish for each node.
</li>
<li class="" style="">
We want to be able to use XEP-0060 in parallel to this specification, for the purpose of publishing sensor data.
More information about this is found in <a href="xep-0000-IoT-PubSub.html">xep-0000-IoT-PubSub.html</a>.
</li>
<li class="" style="">
For massive systems (hundreds of thousands, or millions, of nodes behind a concentrator, its vitally important to be able to manage sets of nodes directly
(for example: Edit multiple nodes at once). Many of the operations in XEP-0060 only allow for operations of singular nodes. Furthermore, many simple operations
require multiple messages per node. This document defines way to operate of sets of nodes simultaneously, as well as ways to perform operations with a smaller
number of operations.
</li>
<li class="" style="">
In this document, nodes have specific functions, controlled by a specific Node Type. Different Node Types have different parameter sets, different options, commands,
capabilities, etc. XEP-0060 does not differ between node types. There, nodes are only a structural way to sort data into a tree graph.
</li>
<li class="" style="">
In this document, nodes have real-time status, like errors, warnings, etc.
</li>
</ul>
</div>
<div class="indent">
<h3>1.1.2 <a name="sect-ID0ELKAC">XEP-0248</a></h3>
<p class="" style="">
XEP-0248 defines the concept of node collections and syndication of information from nodes in these collections. But XEP-0248 is not used in this specification.
There are multiple reasons:
</p>
<ul class="" style="">
<li class="" style="">
We want to be able to use XEP-0248 in parallel to this specification, for the purpose of publishing sensor data.
More information about this is found in <a href="xep-0000-IoT-PubSub.html">xep-0000-IoT-PubSub.html</a>.
</li>
<li class="" style="">
Node IDs are not necessarily unique by themselves in the system. This document defines a uniqueness concept based on a triple of data: (Data Source ID, Cache Type, Node ID). This
means that Nodes must have IDs unique within a given Cache Type, within a given data source.
</li>
<li class="" style="">
We need to expand on types of events generated from a data source, to make them adhere to the particulars of nodes as defined in this specification.
</li>
<li class="" style="">
Data sources own their nodes. XEP-0248 define a loosely coupled structure with references to nodes. In this document, a data source is the owner of all nodes
contained in it.
</li>
</ul>
</div>
<div class="indent">
<h3>1.1.3 <a name="sect-ID0ENLAC">XEP-0050</a></h3>
<p class="" style="">
<span class="ref" style=""><a href="http://xmpp.org/extensions/xep-0050.html">Ad-Hoc Commands</a></span> [<a href="#nt-ID0E2LAC">8</a>] defines how ad-hoc commands can be implemented and how clients can use such commands to interact with underlying logic. But XEP-0050 is not used in this specification.
There are multiple reasons:
</p>
<ul class="" style="">
<li class="" style="">
We want to be able to use XEP-0050 for other types of commands, than commands defined in this specification. Generally, XEP-0050 is used to implement
system-wide commands.
</li>
<li class="" style="">
Commands defined in this specification are context sensitive, i.e. they depend on the type of node and the context of the node on which the act.
</li>
<li class="" style="">
It is a requirement to be able to execute commands on sets of nodes directly.
</li>
<li class="" style="">
Since commands have to be context sensitive, a large concentrator system may have hundreds or thousands of different commands, making it impossible to create
context sensitive GUI's using XEP-0050.
</li>
<li class="" style="">
Dialog types used for Ad-Hoc-commands are not sufficient. First, dynamic dialogs are required in the general case.
(<a href="http://xmpp.org/extensions/xep-0336.html">XEP-0326</a> define how to create dynamic forms.) Furthermore, the
wizard style type of dialogs used for more complex dialogs in ad-hoc commands, are difficult to automate.
</li>
</ul>
</div>
</div>
<h2>2.
<a name="glossary">Glossary</a></h2>
<p class="" style="">The following table lists common terms and corresponding descriptions.</p>
<div class="indent">
<dl>
<di>
<dt><strong>Actuator</strong></dt>
<dd>Device containing at least one configurable property or output that can and should be controlled by some other entity or device.</dd>
</di>
<di>
<dt><strong>Computed Value</strong></dt>
<dd>A value that is computed instead of measured.</dd>
</di>
<di>
<dt><strong>Concentrator</strong></dt>
<dd>Device managing a set of devices which it publishes on the XMPP network.</dd>
</di>
<di>
<dt><strong>Data Source</strong></dt>
<dd>
A Data source contains a collection of nodes. Three types of data sources exist: Singular, Flat and Tree. Singular data sources only include one object.
Flat data sources contain a list of objects and Tree data sources contain nodes formed as a tree graph with one root element.
</dd>
</di>
<di>
<dt><strong>Field</strong></dt>
<dd>
One item of sensor data. Contains information about: Node, Field Name, Value, Precision, Unit, Value Type, Status, Timestamp, Localization information, etc.
Fields should be unique within the triple (Node ID, Field Name, Timestamp).
</dd>
</di>
<di>
<dt><strong>Field Name</strong></dt>
<dd>Name of a field of sensor data. Examples: Energy, Volume, Flow, Power, etc.</dd>
</di>
<di>
<dt><strong>Field Type</strong></dt>
<dd>What type of value the field represents. Examples: Momentary Value, Status Value, Identification Value, Calculated Value, Peak Value, Historical Value, etc.</dd>
</di>
<di>
<dt><strong>Historical Value</strong></dt>
<dd>A value stored in memory from a previous timestamp.</dd>
</di>
<di>
<dt><strong>Identification Value</strong></dt>
<dd>A value that can be used for identification. (Serial numbers, meter IDs, locations, names, etc.)</dd>
</di>
<di>
<dt><strong>Localization information</strong></dt>
<dd>Optional information for a field, allowing the sensor to control how the information should be presented to human viewers.</dd>
</di>
<di>
<dt><strong>Meter</strong></dt>
<dd>A device possible containing multiple sensors, used in metering applications. Examples: Electricity meter, Water Meter, Heat Meter, Cooling Meter, etc.</dd>
</di>
<di>
<dt><strong>Momentary Value</strong></dt>
<dd>A momentary value represents a value measured at the time of the read-out.</dd>
</di>
<di>
<dt><strong>Node</strong></dt>
<dd>
Graphs contain nodes and edges between nodes. In Internet of Things, sensors, actuators, meters, devices, gateways, etc., are often depicted as nodes whereas links between sensors (friendships)
are depicted as edges. In abstract terms, it's easier to talk about a Node, rather than list different possible node types (sensors, actuators, meters, devices, gateways, etc.).
Each Node has a Node ID. Nodes belong to a data source, and all nodes have a Node Type. Some nodes have a parent node, and some nodes have child nodes. Nodes with the same
parent nodes a called sibling nodes.
</dd>
</di>
<di>
<dt><strong>Node ID</strong></dt>
<dd>
An ID uniquely identifying a node within its corresponding context. If a globally unique ID is desired, an architecture should be used using a universally accepted
ID scheme.
</dd>
</di>
<di>
<dt><strong>Node Type</strong></dt>
<dd>Each node has a Node Type. The Node Type defines the functionality of the node in the system.</dd>
</di>
<di>
<dt><strong>Parameter</strong></dt>
<dd>
Readable and/or writable property on a node/device. The XEP-0326 <span class="ref" style=""><a href="http://xmpp.org/extensions/xep-0326.html">Internet of Things - Concentrators</a></span> [<a href="#nt-ID0ECBAE">9</a>] deals with reading and writing parameters
on nodes/devices. Fields are not parameters, and parameters are not fields.
</dd>
</di>
<di>
<dt><strong>Peak Value</strong></dt>
<dd>A maximum or minimum value during a given period.</dd>
</di>
<di>
<dt><strong>Precision</strong></dt>
<dd>
In physics, precision determines the number of digits of precision. In sensor networks however, this definition is not easily applicable. Instead, precision
determines, for example, the number of decimals of precision, or power of precision. Example: 123.200 MWh contains 3 decimals of precision. All entities parsing and
delivering field information in sensor networks should always retain the number of decimals in a message.
</dd>
</di>
<di>
<dt><strong>Sensor</strong></dt>
<dd>
Device measuring at least one digital value (0 or 1) or analog value (value with precision and physical unit). Examples: Temperature sensor, pressure sensor, etc.
Sensor values are reported as fields during read-out. Each sensor has a unique Node ID.
</dd>
</di>
<di>
<dt><strong>SN</strong></dt>
<dd>Sensor Network. A network consisting, but not limited to sensors, where transport and use of sensor data is of primary concern. A sensor network may contain actuators, network applications, monitors, services, etc.</dd>
</di>
<di>
<dt><strong>Status Value</strong></dt>
<dd>A value displaying status information about something.</dd>
</di>
<di>
<dt><strong>Timestamp</strong></dt>
<dd>Timestamp of value, when the value was sampled or recorded.</dd>
</di>
<di>
<dt><strong>Token</strong></dt>
<dd>
A client, device or user can get a token from a provisioning server. These tokens can be included in requests to other entities in the network, so these entities can validate
access rights with the provisioning server.
</dd>
</di>
<di>
<dt><strong>Unit</strong></dt>
<dd>Physical unit of value. Example: MWh, l/s, etc.</dd>
</di>
<di>
<dt><strong>Value</strong></dt>
<dd>A field value.</dd>
</di>
<di>
<dt><strong>Value Status</strong></dt>
<dd>Status of field value. Contains important status information for Quality of Service purposes. Examples: Ok, Error, Warning, Time Shifted, Missing, Signed, etc.</dd>
</di>
<di>
<dt><strong>Value Type</strong></dt>
<dd>Can be numeric, string, boolean, Date & Time, Time Span or Enumeration.</dd>
</di>
<di>
<dt><strong>WSN</strong></dt>
<dd>Wireless Sensor Network, a sensor network including wireless devices.</dd>
</di>
<di>
<dt><strong>XMPP Client</strong></dt>
<dd>Application connected to an XMPP network, having a JID. Note that sensors, as well as applications requesting sensor data can be XMPP clients.</dd>
</di>
</dl>
</div>
<h2>3.
<a name="usecases">Use Cases</a></h2>
<p class="" style="">
To create a complete set of operations supported by all types of concentrators, ranging from PLCs to subsystems to entire systems is very difficult. So, the aim
of this document is instead to create a very small reduced set of operations, a common denominator, that would allow for basic maintenance and interoperability of
concentrators of different makes and models and of these varying ranges.
</p>
<div class="indent">
<h3>3.1 <a name="sect-ID0EPEAE">Capabilities</a></h3>
<div class="indent">
<h3>3.1.1 <a name="sect-ID0ETEAE">Get Capabilities</a></h3>
<p class="" style="">
This document lists a sequence of commands. Some are very basic, while others are used for managing massive amounts of devices. When developing a small PLC, it might
be difficult to motivate the implementation of the more advanced commands. They are simply not necessary for the management of the device. So, clients connecting to
the concentrator need a way to learn what operations are available in the concentrator, and as a consequence what operations are not. To do this, the
<span class="strong">getCapabilities</span> command is sent, as is shown in the following example.
</p>
<p class="caption"><a name="example-1"></a>Example 1. Full capabilities</p>
<div class="indent">
<pre class="prettyprint">
<iq type='get'
from='[email protected]/client'
to='[email protected]'
id='1'>
<getCapabilities xmlns='urn:xmpp:iot:concentrators'/>
</iq>
<iq type='result'
from='[email protected]'
to='[email protected]/client'
id='1'>
<getCapabilitiesResponse xmlns='urn:xmpp:iot:concentrators' result='OK'>
<value>getCapabilities</value>
<value>getAllDataSources</value>
<value>getRootDataSources</value>
<value>getChildDataSources</value>
<value>containsNode</value>
<value>containsNodes</value>
<value>getNode</value>
<value>getNodes</value>
<value>getAllNodes</value>
<value>getNodeInheritance</value>
<value>getRootNodes</value>
<value>getChildNodes</value>
<value>getIndices</value>
<value>getNodesFromIndex</value>
<value>getNodesFromIndices</value>
<value>getAllIndexValues</value>
<value>getNodeParametersForEdit</value>
<value>setNodeParametersAfterEdit</value>
<value>getCommonNodeParametersForEdit</value>
<value>setCommonNodeParametersAfterEdit</value>
<value>getAddableNodeTypes</value>
<value>getParametersForNewNode</value>
<value>createNewNode</value>
<value>destroyNode</value>
<value>getAncestors</value>
<value>getNodeCommands</value>
<value>getCommandParameters</value>
<value>executeNodeCommand</value>
<value>executeNodeQuery</value>
<value>abortNodeQuery</value>
<value>getCommonNodeCommands</value>
<value>getCommonCommandParameters</value>
<value>executeCommonNodeCommand</value>
<value>executeCommonNodeQuery</value>
<value>abortCommonNodeQuery</value>
<value>moveNodeUp</value>
<value>moveNodeDown</value>
<value>moveNodesUp</value>
<value>moveNodesDown</value>
<value>subscribe</value>
<value>unsubscribe</value>
<value>getDatabases</value>
<value>getDatabaseReadoutParameters</value>
<value>startDatabaseReadout</value>
</getCapabilitiesResponse>
</iq>
</pre>
</div>
<p class="" style="">
A concentrator without databases, but still contain a rich interface for handling masses of nodes may present itself as follows:
</p>
<p class="caption"><a name="example-2"></a>Example 2. No database capabilities</p>
<div class="indent">
<pre class="prettyprint">
<iq type='get'
from='[email protected]/client'
to='[email protected]'
id='63'>
<getCapabilities xmlns='urn:xmpp:iot:concentrators'/>
</iq>
<iq type='result'
from='[email protected]'
to='[email protected]/client'
id='63'>
<getCapabilitiesResponse xmlns='urn:xmpp:iot:concentrators' result='OK'>
<value>getCapabilities</value>
<value>getAllDataSources</value>
<value>getRootDataSources</value>
<value>getChildDataSources</value>
<value>containsNode</value>
<value>containsNodes</value>
<value>getNode</value>
<value>getNodes</value>
<value>getAllNodes</value>
<value>getNodeInheritance</value>
<value>getRootNodes</value>
<value>getChildNodes</value>
<value>getIndices</value>
<value>getNodesFromIndex</value>
<value>getNodesFromIndices</value>
<value>getAllIndexValues</value>
<value>getNodeParametersForEdit</value>
<value>setNodeParametersAfterEdit</value>
<value>getCommonNodeParametersForEdit</value>
<value>setCommonNodeParametersAfterEdit</value>
<value>getAddableNodeTypes</value>
<value>getParametersForNewNode</value>
<value>createNewNode</value>
<value>destroyNode</value>
<value>getAncestors</value>
<value>getNodeCommands</value>
<value>getCommandParameters</value>
<value>executeNodeCommand</value>
<value>executeNodeQuery</value>
<value>abortNodeQuery</value>
<value>getCommonNodeCommands</value>
<value>getCommonCommandParameters</value>
<value>executeCommonNodeCommand</value>
<value>executeCommonNodeQuery</value>
<value>abortCommonNodeQuery</value>
<value>moveNodeUp</value>
<value>moveNodeDown</value>
<value>moveNodesUp</value>
<value>moveNodesDown</value>
<value>subscribe</value>
<value>unsubscribe</value>
</getCapabilitiesResponse>
</iq>
</pre>
</div>
<p class="" style="">
A smaller gateway on the other hand, may have skipped the implementation of the batch commands that are used for larger systems:
</p>
<p class="caption"><a name="example-3"></a>Example 3. No batch command capabilities</p>
<div class="indent">
<pre class="prettyprint">
<iq type='get'
from='[email protected]/client'
to='[email protected]'
id='2'>
<getCapabilities xmlns='urn:xmpp:iot:concentrators'/>
</iq>
<iq type='result'
from='[email protected]'
to='[email protected]/client'
id='2'>
<getCapabilitiesResponse xmlns='urn:xmpp:iot:concentrators' result='OK'>
<value>getCapabilities</value>
<value>getAllDataSources</value>
<value>getRootDataSources</value>
<value>getChildDataSources</value>
<value>containsNode</value>
<value>getNode</value>
<value>getNodeInheritance</value>
<value>getRootNodes</value>
<value>getChildNodes</value>
<value>getNodeParametersForEdit</value>
<value>setNodeParametersAfterEdit</value>
<value>getAddableNodeTypes</value>
<value>getParametersForNewNode</value>
<value>createNewNode</value>
<value>destroyNode</value>
<value>getAncestors</value>
<value>getNodeCommands</value>
<value>getCommandParameters</value>
<value>executeNodeCommand</value>
<value>executeNodeQuery</value>
<value>abortNodeQuery</value>
<value>moveNodeUp</value>
<value>moveNodeDown</value>
<value>moveNodesUp</value>
<value>moveNodesDown</value>
<value>subscribe</value>
<value>unsubscribe</value>
</getCapabilitiesResponse>
</iq>
</pre>
</div>
<p class="" style="">
But a small PLC, possibly with a fixed set of nodes, might have support for an even more reduced set of commands:
</p>
<p class="caption"><a name="example-4"></a>Example 4. No edit capabilities</p>
<div class="indent">
<pre class="prettyprint">
<iq type='get'
from='[email protected]/client'
to='[email protected]'
id='3'>
<getCapabilities xmlns='urn:xmpp:iot:concentrators'/>
</iq>
<iq type='result'
from='[email protected]'
to='[email protected]/client'
id='3'>
<getCapabilitiesResponse xmlns='urn:xmpp:iot:concentrators' result='OK'>
<value>getCapabilities</value>
<value>getAllDataSources</value>
<value>containsNode</value>
<value>getNode</value>
<value>getRootNodes</value>
<value>getChildNodes</value>
<value>getNodeCommands</value>
<value>getCommandParameters</value>
<value>executeNodeCommand</value>
<value>executeNodeQuery</value>
<value>abortNodeQuery</value>
</getCapabilitiesResponse>
</iq>
</pre>
</div>
<p class="" style="">
So, clients who need to interact with different types of concentrators need to be aware of what commands are supported, and limit operations to those commands.
</p>
</div>
</div>
<div class="indent">
<h3>3.2 <a name="sect-ID0E3FAE">Data Sources</a></h3>
<div class="indent">
<h3>3.2.1 <a name="sect-ID0EAGAE">Get All Data Sources</a></h3>
<p class="" style="">
This command will return a flat list of all available data sources on the concentrator. It is not structured hierarchically.
</p>
<p class="caption"><a name="example-5"></a>Example 5. Get All Data Sources</p>
<div class="indent">
<pre class="prettyprint">
<iq type='get'
from='[email protected]/client'
to='[email protected]'
id='4'>
<getAllDataSources xmlns='urn:xmpp:iot:concentrators' xml:lang='en'/>
</iq>
<iq type='result'
from='[email protected]'
to='[email protected]/client'
id='4'>
<getAllDataSourcesResponse xmlns='urn:xmpp:iot:concentrators' result='OK'>
<dataSource sourceId='Applications' name='Applications' hasChildren='false' lastChanged='2013-03-19T17:58:01'/>
<dataSource sourceId='Certificates' name='Certificates' hasChildren='false' lastChanged='2013-02-20T12:31:54'/>
<dataSource sourceId='Clayster.EventSink.Programmable' name='Programmable Event Log' hasChildren='false' lastChanged='2012-10-25T09:31:12'/>
...
</getAllDataSourcesResponse>
</iq>
</pre>
</div>
</div>
<div class="indent">
<h3>3.2.2 <a name="sect-ID0EMGAE">Get Root Data Sources</a></h3>
<p class="" style="">
If the client is interested in the hierarchical structure of available data sources, it should request only the root sources, and then ask the client for their
corresponding child data sources. If the client wants to present the data sources to a user, presenting them in their hierarchical order may be more intuitive.
</p>
<p class="caption"><a name="example-6"></a>Example 6. Get Root Data Sources</p>
<div class="indent">
<pre class="prettyprint">
<iq type='get'
from='[email protected]/client'
to='[email protected]'
id='5'>
<getRootDataSources xmlns='urn:xmpp:iot:concentrators' xml:lang='en'/>
</iq>
<iq type='result'
from='[email protected]'
to='[email protected]/client'
id='5'>
<getRootDataSourcesResponse xmlns='urn:xmpp:iot:concentrators' result='OK'>
<dataSource sourceId='MeteringRoot' name='Metering' hasChildren='true' lastChanged='2013-03-19T17:58:01'/>
<dataSource sourceId='SecurityRoot' name='Security' hasChildren='true' lastChanged='2013-01-12T22:03:50'/>
<dataSource sourceId='SystemRoot' name='System' hasChildren='true' lastChanged='2012-02-20T12:34:56'/>
...
</getRootDataSourcesResponse>
</iq>
</pre>
</div>
</div>
<div class="indent">
<h3>3.2.3 <a name="sect-ID0EYGAE">Get Child Data Sources</a></h3>
<p class="" style="">
Having the ID of a data source that contains child data sources, you can fetch the child sources as follows:
</p>
<p class="caption"><a name="example-7"></a>Example 7. Get Child Data Sources</p>
<div class="indent">
<pre class="prettyprint">
<iq type='get'
from='[email protected]/client'
to='[email protected]'
id='6'>
<getChildDataSources xmlns='urn:xmpp:iot:concentrators' sourceId='MeteringRoot' xml:lang='en'/>
</iq>
<iq type='result'
from='[email protected]'
to='[email protected]/client'
id='6'>
<getChildDataSourcesResponse xmlns='urn:xmpp:iot:concentrators' result='OK'>
<dataSource sourceId='MeteringFieldImports' name='Field Imports' hasChildren='false' lastChanged='2013-03-19T17:58:01'/>
<dataSource sourceId='MeteringFieldProcessors' name='Field Processors' hasChildren='false' lastChanged='2013-03-19T17:58:01'/>
<dataSource sourceId='MeteringFieldSinks' name='Field Sinks' hasChildren='false' lastChanged='2013-03-19T17:58:01'/>
<dataSource sourceId='MeteringGroups' name='Groups' hasChildren='false' lastChanged='2013-03-19T17:58:01'/>
<dataSource sourceId='MeteringJobs' name='Jobs' hasChildren='false' lastChanged='2013-03-19T17:58:01'/>
<dataSource sourceId='MeteringTopology' name='Topology' hasChildren='false' lastChanged='2013-03-19T17:58:01'/>
<dataSource sourceId='MeteringUnitConversion' name='Unit Conversion' hasChildren='false' lastChanged='2013-03-19T17:58:01'/>
</getChildDataSourcesResponse>
</iq>
</pre>
</div>
</div>
<div class="indent">
<h3>3.2.4 <a name="subscribe">Subscribe to data source events</a></h3>
<p class="" style="">
A client can subscribe to changes made in a data source. It does this by sending the <span class="strong">subscribe</span> command to the concentrator,
as is shown in the following example:
</p>
<p class="caption"><a name="example-8"></a>Example 8. Subscribing to data source events</p>
<div class="indent">
<pre class="prettyprint">
<iq type='set'
from='[email protected]/client'
to='[email protected]'
id='57'>
<subscribe xmlns='urn:xmpp:iot:concentrators' sourceId='MeteringTopology'/>
</iq>
<iq type='result'
from='[email protected]'
to='[email protected]/client'
id='57'>
<subscribeResponse xmlns='urn:xmpp:iot:concentrators' result='OK'/>
</iq>
</pre>
</div>
<p class="" style="">
Multiple subscriptions to the same source will not result in an error, however the server will still only send one event message for each event in the data source.
</p>
<p class="" style="">
<span class="strong">Important:</span> Event subscriptions only last for as long as the client and concentrator both maintain presence. The concentrator must not persist
event notification subscriptions, and if it goes offline and back online, or if the client goes offline or online again for any reason, the event subscription
is removed.
</p>
<p class="" style="">
<span class="strong">Note:</span> The <span class="strong">parameters</span> and <span class="strong">messages</span> attributes can be used to retrieve parameter and status message information
about the nodes in event messages sent from the concentrator. Note that the <span class="strong">xml:lang</span> may be used to select the language used in such events,
if the concentrator supports localization of strings.
</p>
<p class="caption"><a name="example-9"></a>Example 9. Subscribing to data source events with localized parameters</p>
<div class="indent">
<pre class="prettyprint">
<iq type='set'
from='[email protected]/client'
to='[email protected]'
id='60'>
<subscribe xmlns='urn:xmpp:iot:concentrators' sourceId='MeteringTopology' parameters='true' messages='true' xml:lang='en'/>
</iq>
<iq type='result'
from='[email protected]'
to='[email protected]/client'
id='60'>
<subscribeResponse xmlns='urn:xmpp:iot:concentrators' result='OK'/>
</iq>
</pre>
</div>
<p class="" style="">
The <span class="strong">subscribe</span> command has a set of optional attributes, one for each event type available, and with the same names (<span class="strong">nodeAdded</span>,
<span class="strong">nodeUpdated</span>, <span class="strong">nodeStatusChanged</span>, <span class="strong">nodeRemoved</span>, <span class="strong">nodeMovedUp</span> and <span class="strong">nodeMovedDown</span>), that the
client can use to subscribe to individual events, but not to others. They have the default value of true implying that if not provided, the
default action is to subscribe to those events. The attributes <span class="strong">parameters</span> and <span class="strong">messages</span> can also be used to specify
if node parameters and node messages respectively should be available in event messages. The default value for the these later attributes is false, implying
that normal events do not include node parameter and node message information.
</p>
<p class="" style="">
The following example shows how a client can subscribe to a set of events only:
</p>
<p class="caption"><a name="example-10"></a>Example 10. Subscribing to data source events, avoiding state events</p>
<div class="indent">
<pre class="prettyprint">
<iq type='set'
from='[email protected]/client'
to='[email protected]'
id='61'>
<subscribe xmlns='urn:xmpp:iot:concentrators' sourceId='MeteringTopology' parameters='true' messages='false' xml:lang='en'
nodeAdded='true' nodeUpdated='true' nodeStatusChanged='false' nodeRemoved='true' nodeMovedUp='false' nodeMovedDown='false'/>
</iq>
<iq type='result'
from='[email protected]'
to='[email protected]/client'
id='61'>
<subscribeResponse xmlns='urn:xmpp:iot:concentrators' result='OK'/>
</iq>
</pre>
</div>
<p class="" style="">
For more information on types of events sent, see the <a href="#sourceevents">Data Source Events</a> section.
</p>
</div>
<div class="indent">
<h3>3.2.5 <a name="sect-ID0EUJAE">Unsubscribe from data source events</a></h3>
<p class="" style="">
A client can unsubscribe to changes made in a data source it is subscribed to. It does this by sending the <span class="strong">unsubscribe</span> command to the concentrator,
as is shown in the following example:
</p>
<p class="caption"><a name="example-11"></a>Example 11. Unsubscribing from data source events</p>
<div class="indent">
<pre class="prettyprint">
<iq type='set'
from='[email protected]/client'
to='[email protected]'
id='58'>
<unsubscribe xmlns='urn:xmpp:iot:concentrators' sourceId='MeteringTopology'/>
</iq>
<iq type='result'
from='[email protected]'
to='[email protected]/client'
id='58'>
<unsubscribeResponse xmlns='urn:xmpp:iot:concentrators' result='OK'/>
</iq>
</pre>
</div>
<p class="" style="">
An unsubscription made to an existing data source, but where an event subscription does not exist, must not result in an error.
</p>
<p class="" style="">
The <span class="strong">unsubscribe</span> command has a set of optional attributes, one for each event type available, and with the same names, that the
client can use to unsubscribe from individual events, but not from others. They have the default value of true implying that if not provided, the
default action is to unsubscribe from those events.
</p>
<p class="" style="">
The following example shows how a client can unsubscribe from a subset of events, keeping subscriptions on the others (if subscribed to):
</p>
<p class="caption"><a name="example-12"></a>Example 12. Unsubscribing from state events</p>
<div class="indent">
<pre class="prettyprint">
<iq type='set'
from='[email protected]/client'
to='[email protected]'
id='62'>
<unsubscribe xmlns='urn:xmpp:iot:concentrators' sourceId='MeteringTopology' parameters='true' messages='false' xml:lang='en'
nodeAdded='false' nodeUpdated='false' nodeStatusChanged='true' nodeRemoved='false' nodeMovedUp='false' nodeMovedDown='false'/>
</iq>
<iq type='result'
from='[email protected]'
to='[email protected]/client'
id='62'>
<subscribeResponse xmlns='urn:xmpp:iot:concentrators' result='OK'/>