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

Updating the registration of our device

In the same way, we need to react to the thing being disowned. This can also happen either when the device is online or offline. If it happens offline, we detect it when we update our registration in the Thing Registry, by checking the response arguments. When the device has been disowned, we make sure to forget the identity of the previous owner, and re-register the device as a claimable device again:

this.registryClient.UpdateThing(MetaInfo, async (sender, e) => { try { if (e.Disowned) { await RuntimeSettings.SetAsync( "ThingRegistry.Owner", string.Empty); await this.RegisterDevice(MetaInfo); } else if (e.Ok) Log.Informational( "Registration update successful."); else { Log.Error("Registration update ...

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