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

Registration of device

We must also modify our registration procedure with the Thing Registry. In the previous chapter, we registered self-owned things. These are their own owners and manage security decisions by themselves. Now we must point out that the devices are not self-owned:

this.registryClient.RegisterThing(false, MetaInfo, 
   async (sender, e) => 
   { 
         try 
         { 

In the response, we can learn if the thing has already been claimed. If so, we make sure to update our internal state to reflect this ownership:

if (e.Ok) 
{ 
   await RuntimeSettings.SetAsync("ThingRegistry.Location", 
         true); 
   await RuntimeSettings.SetAsync("ThingRegistry.Owner", 
         e.OwnerJid); 

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