O'Reilly logo

Mastering Internet of Things by Peter Waher

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Finding the thing registry

We then analyze the set of features presented by each item, or component. If any of them present the namespace defined in XEP-0347 for Thing Registries, we use the JID presented by the component as the address for the registry:

try 
{ 
   Item Item2 = (Item)e2.State; 
 
   if (e2.HasFeature(ThingRegistryClient.NamespaceDiscovery)) 
   { 
         Log.Informational("Thing registry found.", Item2.JID); 
 
         await RuntimeSettings.SetAsync( 
               "ThingRegistry.JID", Item2.JID); 
         await this.RegisterDevice(Item2.JID); 
   } 
} 
catch (Exception ex) 
{ 
   Log.Critical(ex); 
} 

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required