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

Creating a Thing Registry client

Now that we know the address of the Thing Registry, we must create a ThingRegistryClient object to communicate with it:

private async Task RegisterDevice(string RegistryJid) 
{ 
   if (this.registryClient == null || 
         this.registryClient.ThingRegistryAddress != RegistryJid) 
   { 
         if (this.registryClient != null) 
         { 
               this.registryClient.Dispose(); 
               this.registryClient = null; 
         } 
 
         this.registryClient = new ThingRegistryClient( 
               this.xmppClient, RegistryJid); }

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