March 2018
Beginner to intermediate
410 pages
10h 40m
English
Similarly, we must detect if the device becomes disowned while it is online. This is done by listening to the Disowned event on the ThingRegistry instance:
this.registryClient.Disowned += async (sender, e) =>
{
try
{
await RuntimeSettings.SetAsync("ThingRegistry.Owner",
string.Empty);
await this.RegisterDevice();
}
catch (Exception ex)
{
Log.Critical(ex);
}
};
Read now
Unlock full access