From 8f1fb86d37cd3b387172a51fff2c920351b167aa Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Mon, 7 Jul 2025 09:49:01 -0500 Subject: [PATCH 1/4] fix: add NVX network port info interface --- .../INvxNetworkPortInformation.cs | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 src/PepperDash.Essentials.Core/DeviceTypeInterfaces/INvxNetworkPortInformation.cs diff --git a/src/PepperDash.Essentials.Core/DeviceTypeInterfaces/INvxNetworkPortInformation.cs b/src/PepperDash.Essentials.Core/DeviceTypeInterfaces/INvxNetworkPortInformation.cs new file mode 100644 index 00000000..3fcb7e26 --- /dev/null +++ b/src/PepperDash.Essentials.Core/DeviceTypeInterfaces/INvxNetworkPortInformation.cs @@ -0,0 +1,89 @@ +using Crestron.SimplSharpPro.DM.Streaming; +using System; +using System.Collections.Generic; + +namespace PepperDash.Essentials.Core +{ + /// + /// Represents a collection of network port information and provides notifications when the information changes. + /// + /// This interface is designed to provide access to a list of network port details and to notify + /// subscribers when the port information is updated. Implementations of this interface should ensure that the event is raised whenever the collection + /// changes. + public interface INvxNetworkPortInformation + { + /// + /// Occurs when the port information changes. + /// + /// This event is triggered whenever there is a change in the port information, such as + /// updates to port settings or status. Subscribers can handle this event to respond to such changes. + event EventHandler PortInformationChanged; + + /// + /// Gets the collection of network port information associated with the current instance. + /// + /// The collection provides information about the network ports, such as their status, + /// configuration, or other relevant details. The returned list is read-only and cannot be modified + /// directly. + List NetworkPorts { get; } + } + + /// + /// Represents information about a network port, including its configuration and associated system details. + /// + /// This class provides properties to describe various attributes of a network port, such as its + /// name, description, VLAN configuration, and management IP address. It is typically used to store and retrieve + /// metadata about network ports in a managed environment. + public class NvxNetworkPortInformation + { + private readonly DmNvxBaseClass.DmNvx35xNetwork.DmNvxNetworkLldpPort port; + + /// + /// Gets or sets the index of the device port. + /// + public uint DevicePortIndex { get; } + + /// + /// Gets or sets the name of the port used for communication. + /// + public string PortName => port.PortNameFeedback.StringValue; + + /// + /// Gets or sets the description of the port. + /// + public string PortDescription => port.PortNameDescriptionFeedback.StringValue; + + /// + /// Gets or sets the name of the VLAN (Virtual Local Area Network). + /// + public string VlanName => port.VlanNameFeedback.StringValue; + + /// + /// Gets the IP management address associated with the port. + /// + public string IpManagementAddress => port.IpManagementAddressFeedback.StringValue; + + /// + /// Gets the name of the system as reported by the associated port. + /// + public string SystemName => port.SystemNameFeedback.StringValue; + + /// + /// Gets the description of the system name. + /// + public string SystemNameDescription => port.SystemNameDescriptionFeedback.StringValue; + + /// + /// Initializes a new instance of the class with the specified network port + /// and device port index. + /// + /// The network port associated with the device. Cannot be . + /// The index of the device port. + /// Thrown if is . + public NvxNetworkPortInformation(DmNvxBaseClass.DmNvx35xNetwork.DmNvxNetworkLldpPort port, uint devicePortIndex) + { + this.port = port ?? throw new ArgumentNullException(nameof(port), "Port cannot be null"); + DevicePortIndex = devicePortIndex; + } +} From 5e880f01116c466b1bbfef07339fd20bf6fd75a0 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Mon, 7 Jul 2025 10:06:23 -0500 Subject: [PATCH 2/4] chore: add missing brace --- .../DeviceTypeInterfaces/INvxNetworkPortInformation.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/PepperDash.Essentials.Core/DeviceTypeInterfaces/INvxNetworkPortInformation.cs b/src/PepperDash.Essentials.Core/DeviceTypeInterfaces/INvxNetworkPortInformation.cs index 3fcb7e26..7894eca1 100644 --- a/src/PepperDash.Essentials.Core/DeviceTypeInterfaces/INvxNetworkPortInformation.cs +++ b/src/PepperDash.Essentials.Core/DeviceTypeInterfaces/INvxNetworkPortInformation.cs @@ -86,4 +86,5 @@ namespace PepperDash.Essentials.Core this.port = port ?? throw new ArgumentNullException(nameof(port), "Port cannot be null"); DevicePortIndex = devicePortIndex; } + } } From a076d531bc4200f40f9a736b09880099bb5b5376 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Mon, 7 Jul 2025 10:17:08 -0500 Subject: [PATCH 3/4] chore: remove BOM Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../DeviceTypeInterfaces/INvxNetworkPortInformation.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PepperDash.Essentials.Core/DeviceTypeInterfaces/INvxNetworkPortInformation.cs b/src/PepperDash.Essentials.Core/DeviceTypeInterfaces/INvxNetworkPortInformation.cs index 7894eca1..549dd3f5 100644 --- a/src/PepperDash.Essentials.Core/DeviceTypeInterfaces/INvxNetworkPortInformation.cs +++ b/src/PepperDash.Essentials.Core/DeviceTypeInterfaces/INvxNetworkPortInformation.cs @@ -1,4 +1,4 @@ -using Crestron.SimplSharpPro.DM.Streaming; +using Crestron.SimplSharpPro.DM.Streaming; using System; using System.Collections.Generic; From 2b15c2a56f4ad7ad0916d92faeae071af10291dc Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Mon, 7 Jul 2025 10:17:37 -0500 Subject: [PATCH 4/4] docs: remove extra space Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../DeviceTypeInterfaces/INvxNetworkPortInformation.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PepperDash.Essentials.Core/DeviceTypeInterfaces/INvxNetworkPortInformation.cs b/src/PepperDash.Essentials.Core/DeviceTypeInterfaces/INvxNetworkPortInformation.cs index 549dd3f5..c1592c94 100644 --- a/src/PepperDash.Essentials.Core/DeviceTypeInterfaces/INvxNetworkPortInformation.cs +++ b/src/PepperDash.Essentials.Core/DeviceTypeInterfaces/INvxNetworkPortInformation.cs @@ -33,7 +33,7 @@ namespace PepperDash.Essentials.Core /// Represents information about a network port, including its configuration and associated system details. /// /// This class provides properties to describe various attributes of a network port, such as its - /// name, description, VLAN configuration, and management IP address. It is typically used to store and retrieve + /// name, description, VLAN configuration, and management IP address. It is typically used to store and retrieve /// metadata about network ports in a managed environment. public class NvxNetworkPortInformation {