March 2018
Beginner to intermediate
410 pages
10h 40m
English
Each thing in the search result, apart from being public, is also returned with the complete set of metadata tags it has registered with the registry. We loop through the things found, and analyze the TYPE tag to identify which things correspond to our sensor and actuator:
foreach (SearchResultThing Thing in e.Things)
{
foreach (MetaDataTag Tag in Thing.Tags)
{
if (Tag.Name == "TYPE" &&
Tag is MetaDataStringTag StringTag)
{
switch (Tag.StringValue)
{
case "MIoT Sensor":
if (string.IsNullOrEmpty(
this.sensorJid))
{
this.sensorJid = Thing.Jid;
this.sensor = Thing.Node;
Read now
Unlock full access