March 2018
Beginner to intermediate
410 pages
10h 40m
English
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);
}
Read now
Unlock full access