fix: CS LAN fixes

This commit is contained in:
Andrew Welker
2025-09-17 11:38:20 -05:00
parent 7c6aa1c0ff
commit 557e39f2f2

View File

@@ -190,6 +190,14 @@ namespace PepperDash.Essentials.Touchpanel
RegisterForExtenders(); RegisterForExtenders();
if (CrestronEnvironment.DevicePlatform != eDevicePlatform.Appliance)
{
this.LogInformation("Not running on processor. Skipping CS LAN Configuration");
return;
}
try
{
var csAdapterId = CrestronEthernetHelper.GetAdapterdIdForSpecifiedAdapterType(EthernetAdapterType.EthernetCSAdapter); var csAdapterId = CrestronEthernetHelper.GetAdapterdIdForSpecifiedAdapterType(EthernetAdapterType.EthernetCSAdapter);
var csSubnetMask = CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_MASK, csAdapterId); var csSubnetMask = CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_MASK, csAdapterId);
var csIpAddress = CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_ADDRESS, csAdapterId); var csIpAddress = CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_ADDRESS, csAdapterId);
@@ -197,6 +205,11 @@ namespace PepperDash.Essentials.Touchpanel
this.csSubnetMask = System.Net.IPAddress.Parse(csSubnetMask); this.csSubnetMask = System.Net.IPAddress.Parse(csSubnetMask);
this.csIpAddress = System.Net.IPAddress.Parse(csIpAddress); this.csIpAddress = System.Net.IPAddress.Parse(csIpAddress);
} }
catch (ArgumentException)
{
this.LogInformation("This processor does not have a CS LAN");
}
}
/// <summary> /// <summary>
/// Updates the theme setting for this touchpanel controller and persists the change to configuration. /// Updates the theme setting for this touchpanel controller and persists the change to configuration.