using System.Net.NetworkInformation; using DTS.Common.Enums.Hardware; using DTS.Common.Interface.Communication; namespace DTS.DASLib.Service.Classes.SLICE { /// /// describes a device connected to a S6DB as determined by /// QAUTIL_QUERY_MAC_IP_TABLE /// part of /// 10582 Implement auto-discover and monitor DAS status. /// public class S6DBConnectedDevice : IDASConnectedDevice { /// /// the device type of the connected device /// public HardwareTypes DeviceType { get; } = HardwareTypes.SLICE6_Base; /// /// the port the device is on only positive values are valid /// 0 based /// public int Port { get; private set; } = -1; /// /// the position on the chain or port /// only positive values are valid /// 0 based /// public int SpotOnPort { get; private set; } = -1; /// /// MAC address /// public PhysicalAddress PhysicalAddress { get; private set; } /// /// IP address reported by device /// default value empty string /// public string IPAddress { get; private set; } = string.Empty; /// /// serial number of device /// default value empty string /// public string SerialNumber { get; private set; } = string.Empty; /// /// location of device /// default value empty string /// public string Location { get; private set; } = string.Empty; /// /// version of device /// default value empty string /// public string Version { get; private set; } = string.Empty; /// /// constructs new connected device record /// /// port, 0 based /// position on port/chain 0 based /// mac address /// ip address /// serial number of connected device /// location /// version public S6DBConnectedDevice(int port, int spotOnPort, PhysicalAddress physicalAddress, string ipAddress, string serialNumber, string location, string version) { Port = port; SpotOnPort = spotOnPort; PhysicalAddress = physicalAddress; IPAddress = ipAddress; SerialNumber = serialNumber; Location = location; Version = version; if (SerialNumber.StartsWith("S6A")) { DeviceType = HardwareTypes.SLICE6_AIR; } } } }