Client: Use UUID if no serial number is found

This commit is contained in:
Gary Sharp
2018-04-19 17:04:25 +10:00
parent 0755b6fc8a
commit d477ad5d9c
+12
View File
@@ -242,7 +242,19 @@ namespace Disco.Client.Interop
var uUID = (string)mItem.GetPropertyValue("UUID");
if (!string.IsNullOrWhiteSpace(uUID))
{
DeviceHardware.UUID = uUID.Trim();
// if serial number is absent attempt using UUID if valid
if (string.IsNullOrWhiteSpace(DeviceHardware.SerialNumber))
{
Guid uuidGuid;
if (Guid.TryParse(DeviceHardware.UUID, out uuidGuid) && uuidGuid != Guid.Empty)
{
DeviceHardware.SerialNumber = $"UUID{uuidGuid:N}";
}
}
}
}
else
{