Compare commits

...

5 Commits

Author SHA1 Message Date
jkdevito
9ff139bc00 fix: update TcpIpServer case to TcpServer in CreateCommForDevice method 2025-11-19 17:31:00 -06:00
jkdevito
563de96e7c feat: add TcpIpServer case to CreateCommForDevice method 2025-11-19 17:28:54 -06:00
jkdevito
dd5d1457d2 feat: add TcpServer control method to eControlMethod enum 2025-11-19 17:28:46 -06:00
Neil Dorin
2fbc32947c Merge pull request #1357 from PepperDash/url-parsing
fix: check for multiple URL patterns for both template & system URLS
2025-11-18 14:14:16 -05:00
Andrew Welker
c06b57a5f9 fix: check for multiple URL patterns for both template & system URLS 2025-11-18 12:30:54 -06:00
3 changed files with 43 additions and 17 deletions

View File

@@ -82,6 +82,10 @@ namespace PepperDash.Core
/// <summary>
/// InfinetEX control
/// </summary>
InfinetEx
InfinetEx,
/// <summary>
/// TCP/IP Server
/// </summary>
TcpServer
}
}

View File

@@ -104,6 +104,12 @@ namespace PepperDash.Essentials.Core
comm = secureTcp;
break;
}
case eControlMethod.TcpServer:
{
var tcpServer = new GenericTcpIpServer(deviceConfig.Key + "-tcpServer", c.Address, c.Port, c.BufferSize);
comm = tcpServer;
break;
}
default:
break;
}

View File

@@ -36,21 +36,29 @@ namespace PepperDash.Essentials.Core.Config
{
get
{
if (string.IsNullOrEmpty(SystemUrl))
return "missing url";
string uuid;
if (SystemUrl.Contains("#"))
if (string.IsNullOrEmpty(SystemUrl))
{
uuid = "missing url";
}
else if (SystemUrl.Contains("#"))
{
var result = Regex.Match(SystemUrl, @"https?:\/\/.*\/systems\/(.*)\/#.*");
string uuid = result.Groups[1].Value;
return uuid;
uuid = result.Groups[1].Value;
}
else if (SystemUrl.Contains("detail"))
{
var result = Regex.Match(SystemUrl, @"https?:\/\/.*\/systems\/detail\/(.*)\/.*");
uuid = result.Groups[1].Value;
}
else
{
var result = Regex.Match(SystemUrl, @"https?:\/\/.*\/systems\/detail\/(.*)\/.*");
string uuid = result.Groups[1].Value;
return uuid;
var result = Regex.Match(SystemUrl, @"https?:\/\/.*\/systems\/(.*)\/.*");
uuid = result.Groups[1].Value;
}
return uuid;
}
}
@@ -62,21 +70,29 @@ namespace PepperDash.Essentials.Core.Config
{
get
{
if (string.IsNullOrEmpty(TemplateUrl))
return "missing template url";
string uuid;
if (TemplateUrl.Contains("#"))
if (string.IsNullOrEmpty(TemplateUrl))
{
uuid = "missing template url";
}
else if (TemplateUrl.Contains("#"))
{
var result = Regex.Match(TemplateUrl, @"https?:\/\/.*\/templates\/(.*)\/#.*");
string uuid = result.Groups[1].Value;
return uuid;
uuid = result.Groups[1].Value;
}
else if (TemplateUrl.Contains("detail"))
{
var result = Regex.Match(TemplateUrl, @"https?:\/\/.*\/system-templates\/detail\/(.*)\/system-template-versions\/detail\/(.*)\/.*");
uuid = result.Groups[2].Value;
}
else
{
var result = Regex.Match(TemplateUrl, @"https?:\/\/.*\/system-templates\/detail\/(.*)\/system-template-versions\/detail\/(.*)\/.*");
string uuid = result.Groups[2].Value;
return uuid;
var result = Regex.Match(TemplateUrl, @"https?:\/\/.*\/system-templates\/(.*)\/system-template-versions\/(.*)\/.*");
uuid = result.Groups[2].Value;
}
return uuid;
}
}