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

Looping through available components

The first step is to find the thing registry. We assume that it is made available as a component of the same broker that we are connected to. To avoid searching the broker every time the device is restarted, we first check if we already know the address of the registry:

private async Task RegisterDevice() 
{ 
   string ThingRegistryJid = await RuntimeSettings.GetAsync( 
         "ThingRegistry.JID", string.Empty); 
 
   if (!string.IsNullOrEmpty(ThingRegistryJid)) 
         await this.RegisterDevice(ThingRegistryJid); 
   else 
   { 
         Log.Informational("Searching for Thing Registry."); 

Our search begins by looping through all items on the broker. These items publish a set of features. These items and features are accessed through Service Discovery ...

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