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 the URI is by encoding it using QR codes.