mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-12 19:25:00 +00:00
fix: Fixing DHCP status return type and Hostnames property name
This commit is contained in:
@@ -100,7 +100,7 @@ namespace ICD.Common.Utils
|
||||
/// Gets the dhcp status of the processor.
|
||||
/// </summary>
|
||||
[PublicAPI]
|
||||
public static string DhcpStatus
|
||||
public static bool DhcpStatus
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -112,18 +112,18 @@ namespace ICD.Common.Utils
|
||||
{
|
||||
short id = CrestronEthernetHelper.GetAdapterdIdForSpecifiedAdapterType(type);
|
||||
if (id >= InitialParametersClass.NumberOfEthernetInterfaces)
|
||||
return null;
|
||||
return false;
|
||||
|
||||
string status = CrestronEthernetHelper.GetEthernetParameter(param, id);
|
||||
|
||||
if (!string.IsNullOrEmpty(status) && !status.Equals(INVALID_VALUE))
|
||||
return status;
|
||||
return status == "ON";
|
||||
|
||||
return null;
|
||||
return false;
|
||||
}
|
||||
catch (ArgumentException)
|
||||
{
|
||||
return null;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -132,7 +132,7 @@ namespace ICD.Common.Utils
|
||||
/// Gets the hostname of the processor.
|
||||
/// </summary>
|
||||
[PublicAPI]
|
||||
public static IEnumerable<string> Hostname
|
||||
public static IEnumerable<string> Hostnames
|
||||
{
|
||||
get
|
||||
{
|
||||
|
||||
@@ -53,24 +53,22 @@ namespace ICD.Common.Utils
|
||||
/// Gets the dhcp status of the processor.
|
||||
/// </summary>
|
||||
[PublicAPI]
|
||||
public static string DhcpStatus
|
||||
public static bool DhcpStatus
|
||||
{
|
||||
get
|
||||
{
|
||||
try
|
||||
{
|
||||
bool enabled =
|
||||
return
|
||||
NetworkInterface.GetAllNetworkInterfaces()
|
||||
.Where(ni => ni.NetworkInterfaceType == NetworkInterfaceType.Wireless80211 ||
|
||||
ni.NetworkInterfaceType == NetworkInterfaceType.Ethernet)
|
||||
.Select(ni => ni.GetIPProperties().GetIPv4Properties().IsDhcpEnabled)
|
||||
.FirstOrDefault();
|
||||
|
||||
return enabled.ToString();
|
||||
}
|
||||
catch(PlatformNotSupportedException)
|
||||
catch (PlatformNotSupportedException)
|
||||
{
|
||||
return false.ToString();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -79,7 +77,7 @@ namespace ICD.Common.Utils
|
||||
/// Gets the hostname of the processor.
|
||||
/// </summary>
|
||||
[PublicAPI]
|
||||
public static IEnumerable<string> Hostname { get { yield return Dns.GetHostName(); } }
|
||||
public static IEnumerable<string> Hostnames { get { yield return Dns.GetHostName(); } }
|
||||
|
||||
public static DateTime GetLocalTime()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user