mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-15 20:54:58 +00:00
feat: Use CrestronEnvironment.SystemInfo.SerialNumber to retrieve the serial number, instead of trying to convert TSID from console.
This commit is contained in:
@@ -1,7 +1,8 @@
|
|||||||
using System.Globalization;
|
#if SIMPLSHARP
|
||||||
|
using System.Globalization;
|
||||||
|
using Crestron.SimplSharp;
|
||||||
using ICD.Common.Utils.Services;
|
using ICD.Common.Utils.Services;
|
||||||
using ICD.Common.Utils.Services.Logging;
|
using ICD.Common.Utils.Services.Logging;
|
||||||
#if SIMPLSHARP
|
|
||||||
using System;
|
using System;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using ICD.Common.Properties;
|
using ICD.Common.Properties;
|
||||||
@@ -117,19 +118,7 @@ namespace ICD.Common.Utils
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
Regex regex = new Regex(VER_REGEX);
|
return CrestronEnvironment.SystemInfo.SerialNumber;
|
||||||
Match match = regex.Match(VersionResult);
|
|
||||||
|
|
||||||
if (!match.Success)
|
|
||||||
{
|
|
||||||
ServiceProvider.TryGetService<ILoggerService>()
|
|
||||||
.AddEntry(eSeverity.Warning, "Unable to get serial number from \"{0}\"", VersionResult);
|
|
||||||
|
|
||||||
return string.Empty;
|
|
||||||
}
|
|
||||||
|
|
||||||
int decValue = int.Parse(match.Groups["serial"].Value, System.Globalization.NumberStyles.HexNumber);
|
|
||||||
return decValue.ToString();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user