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

Transmitting the conceptual identity

If our device does not have an owner, we must make it possible for the owner to claim the device. This is done by presenting the same meta-information as the device just registered. We do this by creating an iotdisco URI that we store to a file:

if (string.IsNullOrEmpty(e.OwnerJid)) 
{ 
   string ClaimUrl = registryClient.EncodeAsIoTDiscoURI( MetaInfo); 
   string FilePath = ApplicationData.Current.LocalFolder.Path + 
         Path.DirectorySeparatorChar + "Sensor.iotdisco"; 
 
   Log.Informational("Registration successful."); 
   Log.Informational(ClaimUrl, new KeyValuePair<string, object>( 
         "Path", FilePath)); 
 
   File.WriteAllText(FilePath, ClaimUrl); 
} 
Instead of storing the iotdisco URI as a file, a more efficient way to transmit ...

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