March 2018
Beginner to intermediate
410 pages
10h 40m
English
The Internet contains a huge number of devices. To be able to distinguish our device from the rest, we must make sure to create a persistent Device ID for it, and make sure it's unique:
private string deviceId;
After having started the Arduino initiation, we need to check whether we have a deviceId created. We use our runtime settings library for this:
this.deviceId = await RuntimeSettings.GetAsync( "DeviceId", string.Empty);
If you haven't created one yet, let's do so. A simple way to generate a globally unique deviceId is to create a Guid. We also remove any hyphens:
if (string.IsNullOrEmpty(this.deviceId)) { this.deviceId = Guid.NewGuid().ToString(). Replace("-", string.Empty); await RuntimeSettings.SetAsync("DeviceId", ...Read now
Unlock full access