From 47af06578ae1c9d55444495b233eb041f1a16e22 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Mon, 9 Nov 2020 09:58:51 -0700 Subject: [PATCH 01/11] added IDeviceInfoProvider interface --- .../Device Info/DeviceInfo.cs | 7 +++++++ .../Device Info/DeviceInfoEventArgs.cs | 19 +++++++++++++++++++ .../Device Info/IDeviceInfoProvider.cs | 13 +++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 essentials-framework/Essentials Core/PepperDashEssentialsBase/Device Info/DeviceInfo.cs create mode 100644 essentials-framework/Essentials Core/PepperDashEssentialsBase/Device Info/DeviceInfoEventArgs.cs create mode 100644 essentials-framework/Essentials Core/PepperDashEssentialsBase/Device Info/IDeviceInfoProvider.cs diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Device Info/DeviceInfo.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Device Info/DeviceInfo.cs new file mode 100644 index 00000000..1b235ed2 --- /dev/null +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Device Info/DeviceInfo.cs @@ -0,0 +1,7 @@ +namespace PepperDash.Essentials.Core.DeviceInfo +{ + public class DeviceInfo + { + + } +} \ No newline at end of file diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Device Info/DeviceInfoEventArgs.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Device Info/DeviceInfoEventArgs.cs new file mode 100644 index 00000000..6727bce6 --- /dev/null +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Device Info/DeviceInfoEventArgs.cs @@ -0,0 +1,19 @@ +using System; + +namespace PepperDash.Essentials.Core.DeviceInfo +{ + public class DeviceInfoEventArgs:EventArgs + { + public DeviceInfo DeviceInfo { get; set; } + + public DeviceInfoEventArgs() + { + + } + + public DeviceInfoEventArgs(DeviceInfo devInfo) + { + DeviceInfo = devInfo; + } + } +} \ No newline at end of file diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Device Info/IDeviceInfoProvider.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Device Info/IDeviceInfoProvider.cs new file mode 100644 index 00000000..081fb46a --- /dev/null +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Device Info/IDeviceInfoProvider.cs @@ -0,0 +1,13 @@ +using System; + +namespace PepperDash.Essentials.Core.DeviceInfo +{ + public interface IDeviceInfoProvider + { + DeviceInfo DeviceInfo { get; } + + event EventHandler DeviceInfoChanged; + + void UpdateDeviceInfo(); + } +} \ No newline at end of file From e37fb33afe57c262721fcbf6b1ab54f07cb680d3 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Mon, 9 Nov 2020 12:10:44 -0700 Subject: [PATCH 02/11] add DeviceInfo class --- .../PepperDashEssentialsBase/Device Info/DeviceInfo.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Device Info/DeviceInfo.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Device Info/DeviceInfo.cs index 1b235ed2..9b03ec11 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Device Info/DeviceInfo.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Device Info/DeviceInfo.cs @@ -2,6 +2,10 @@ { public class DeviceInfo { - + public string HostName { get; set; } + public string IpAddress { get; set; } + public string MacAddress { get; set; } + public string SerialNumber { get; set; } + public string FirmwareVersion { get; set; } } } \ No newline at end of file From 51e338749ab29471d10b8db3ba89db8d44339ca1 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Mon, 9 Nov 2020 12:11:39 -0700 Subject: [PATCH 03/11] Implement IDeviceInfoProvider on DGE100 --- .../Endpoints/DGEs/Dge100Controller.cs | 102 ++++++++++++++++-- 1 file changed, 95 insertions(+), 7 deletions(-) diff --git a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/DGEs/Dge100Controller.cs b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/DGEs/Dge100Controller.cs index dd07f696..46692912 100644 --- a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/DGEs/Dge100Controller.cs +++ b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/DGEs/Dge100Controller.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; -using System.Linq; +using System.Linq; +using System.Net.Sockets; using System.Text; using Crestron.SimplSharp; using Crestron.SimplSharpPro; @@ -14,15 +15,19 @@ using Newtonsoft.Json; using PepperDash.Core; using PepperDash.Essentials.Core; using PepperDash.Essentials.Core.Config; -using Crestron.SimplSharpPro.DeviceSupport; - +using Crestron.SimplSharpPro.DeviceSupport; +using PepperDash.Essentials.Core.DeviceInfo; + namespace PepperDash.Essentials.DM.Endpoints.DGEs { [Description("Wrapper class for DGE-100")] - public class Dge100Controller : CrestronGenericBaseDevice, IComPorts, IIROutputPorts, IHasBasicTriListWithSmartObject, ICec + public class Dge100Controller : CrestronGenericBaseDevice, IComPorts, IIROutputPorts, IHasBasicTriListWithSmartObject, ICec, IDeviceInfoProvider { + private const int CtpPort = 41795; private readonly Dge100 _dge; + private readonly TsxCcsUcCodec100EthernetReservedSigs _dgeEthernetInfo; + public BasicTriListWithSmartObject Panel { get { return _dge; } } private DeviceConfig _dc; @@ -32,7 +37,12 @@ namespace PepperDash.Essentials.DM.Endpoints.DGEs public Dge100Controller(string key, string name, Dge100 device, DeviceConfig dc, CrestronTouchpanelPropertiesConfig props) :base(key, name, device) { - _dge = device; + _dge = device; + _dgeEthernetInfo = _dge.ExtenderEthernetReservedSigs; + _dgeEthernetInfo.DeviceExtenderSigChange += (extender, args) => UpdateDeviceInfo(); + _dgeEthernetInfo.Use(); + + DeviceInfo = new DeviceInfo(); _dc = dc; @@ -69,8 +79,86 @@ namespace PepperDash.Essentials.DM.Endpoints.DGEs #region ICec Members public Cec StreamCec { get { return _dge.HdmiOut.StreamCec; } } - #endregion - + #endregion + + #region Implementation of IDeviceInfoProvider + + public DeviceInfo DeviceInfo { get; private set; } + + public event EventHandler DeviceInfoChanged; + + public void UpdateDeviceInfo() + { + DeviceInfo.IpAddress = _dgeEthernetInfo.IpAddressFeedback.StringValue; + DeviceInfo.MacAddress = _dgeEthernetInfo.MacAddressFeedback.StringValue; + + GetFirmwareAndSerialInfo(); + + OnDeviceInfoChange(); + } + + private void GetFirmwareAndSerialInfo() + { + if (String.IsNullOrEmpty(_dgeEthernetInfo.IpAddressFeedback.StringValue)) + { + Debug.Console(1, this, "IP Address information not yet received. No device is online"); + return; + } + + var tcpClient = new GenericTcpIpClient("", _dgeEthernetInfo.IpAddressFeedback.StringValue, CtpPort, 1024); + + var gather = new CommunicationGather(tcpClient, "\r\n\r\n"); + + tcpClient.ConnectionChange += (sender, args) => + { + if (!args.Client.IsConnected) + { + return; + } + + args.Client.SendText("ver\r\n"); + }; + + gather.LineReceived += (sender, args) => + { + if (args.Text.ToLower().Contains("host")) + { + DeviceInfo.HostName = args.Text.Split(';')[1].Trim(); + + tcpClient.Disconnect(); + return; + } + + //ignore console prompt + if (args.Text.ToLower().Contains(">")) + { + return; + } + + if (!args.Text.ToLower().Contains("dge")) + { + return; + } + + DeviceInfo.SerialNumber = args.Text.Split('[')[1].Split(' ')[4].Replace("#", ""); + DeviceInfo.FirmwareVersion = args.Text.Split('[')[1].Split(' ')[1]; + + tcpClient.SendText("host\r\n"); + }; + + tcpClient.Connect(); + } + + private void OnDeviceInfoChange() + { + var handler = DeviceInfoChanged; + + if (handler == null) return; + + handler(this, new DeviceInfoEventArgs(DeviceInfo)); + } + + #endregion } public class Dge100ControllerFactory : EssentialsDeviceFactory From 3c60dfdf7b6c7d3afc7d929aaf9c6146bcf6aab2 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Tue, 10 Nov 2020 09:14:43 -0700 Subject: [PATCH 04/11] add IDeviceInfoProvider & start implementation --- .../PepperDash_Essentials_Core.csproj | 3 + .../Endpoints/Receivers/DmRmcHelper.cs | 90 ++++++++++++++++++- 2 files changed, 91 insertions(+), 2 deletions(-) diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj b/essentials-framework/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj index 2b45030c..91d49574 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj @@ -183,6 +183,9 @@ + + + diff --git a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmcHelper.cs b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmcHelper.cs index 7cc913e2..ba25fa9c 100644 --- a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmcHelper.cs +++ b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmcHelper.cs @@ -8,14 +8,16 @@ using Newtonsoft.Json; using PepperDash.Core; using PepperDash.Essentials.Core; using PepperDash.Essentials.Core.Bridges; +using PepperDash.Essentials.Core.DeviceInfo; using PepperDash.Essentials.DM.Config; using PepperDash.Essentials.Core.Config; namespace PepperDash.Essentials.DM { [Description("Wrapper class for all DM-RMC variants")] - public abstract class DmRmcControllerBase : CrestronGenericBridgeableBaseDevice + public abstract class DmRmcControllerBase : CrestronGenericBridgeableBaseDevice, IDeviceInfoProvider { + private const int CtpPort = 41795; private readonly EndpointReceiverBase _rmc; //kept here just in case. Only property or method on this class that's not device-specific is the DMOutput that it's attached to. public StringFeedback VideoOutputResolutionFeedback { get; protected set; } @@ -32,6 +34,8 @@ namespace PepperDash.Essentials.DM PreventRegistration = _rmc.DMOutput != null; AddToFeedbackList(VideoOutputResolutionFeedback, EdidManufacturerFeedback, EdidSerialNumberFeedback, EdidNameFeedback, EdidPreferredTimingFeedback); + + DeviceInfo = new DeviceInfo(); } protected void LinkDmRmcToApi(DmRmcControllerBase rmc, BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge) @@ -79,7 +83,89 @@ namespace PepperDash.Essentials.DM trilist.SetUShortSigAction(joinMap.AudioVideoSource.JoinNumber, a => routing.ExecuteNumericSwitch(a, 1, eRoutingSignalType.AudioVideo)); } - } + + #region Implementation of IDeviceInfoProvider + + public DeviceInfo DeviceInfo { get; private set; } + public event EventHandler DeviceInfoChanged; + + public void UpdateDeviceInfo() + { + if (!_rmc.IsOnline || _rmc.ConnectedIpList.Count == 0) + { + Debug.Console(1, this, "IP Address information not yet received. No device is online"); + return; + } + + DeviceInfo.IpAddress = _rmc.ConnectedIpList[0].DeviceIpAddress; + + foreach (var ip in _rmc.ConnectedIpList) + { + Debug.Console(0, this, "Connected IP Address: {0}", ip.DeviceIpAddress); + } + + GetFirmwareAndSerialInfo(); + + OnDeviceInfoChange(); + } + + private void GetFirmwareAndSerialInfo() + { + var tcpClient = new GenericTcpIpClient("", _rmc.ConnectedIpList[0].DeviceIpAddress, CtpPort, 1024); + + var gather = new CommunicationGather(tcpClient, "\r\n\r\n"); + + tcpClient.ConnectionChange += (sender, args) => + { + if (!args.Client.IsConnected) + { + return; + } + + args.Client.SendText("ver\r\n"); + }; + + gather.LineReceived += (sender, args) => + { + if (args.Text.ToLower().Contains("host")) + { + DeviceInfo.HostName = args.Text.Split(';')[1].Trim(); + + tcpClient.Disconnect(); + return; + } + + //ignore console prompt + if (args.Text.ToLower().Contains(">")) + { + return; + } + + if (!args.Text.ToLower().Contains("rmc")) + { + return; + } + + DeviceInfo.SerialNumber = args.Text.Split('[')[1].Split(' ')[4].Replace("#", ""); + DeviceInfo.FirmwareVersion = args.Text.Split('[')[1].Split(' ')[1]; + + tcpClient.SendText("host\r\n"); + }; + + tcpClient.Connect(); + } + + private void OnDeviceInfoChange() + { + var handler = DeviceInfoChanged; + + if (handler == null) return; + + handler(this, new DeviceInfoEventArgs(DeviceInfo)); + } + + #endregion + } public abstract class DmHdBaseTControllerBase : CrestronGenericBaseDevice { From 5076ba405ea6f91572f48191ea13513fceadb988 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Tue, 10 Nov 2020 09:23:51 -0700 Subject: [PATCH 05/11] add logic to update device info when IP-ID comes online --- .../Essentials_DM/Endpoints/DGEs/Dge100Controller.cs | 4 +++- .../Essentials_DM/Endpoints/Receivers/DmRmcHelper.cs | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/DGEs/Dge100Controller.cs b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/DGEs/Dge100Controller.cs index 46692912..06b5f1cf 100644 --- a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/DGEs/Dge100Controller.cs +++ b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/DGEs/Dge100Controller.cs @@ -42,7 +42,9 @@ namespace PepperDash.Essentials.DM.Endpoints.DGEs _dgeEthernetInfo.DeviceExtenderSigChange += (extender, args) => UpdateDeviceInfo(); _dgeEthernetInfo.Use(); - DeviceInfo = new DeviceInfo(); + DeviceInfo = new DeviceInfo(); + + _dge.OnlineStatusChange += (currentDevice, args) => { if (args.DeviceOnLine) UpdateDeviceInfo(); }; _dc = dc; diff --git a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmcHelper.cs b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmcHelper.cs index ba25fa9c..54b7ca2c 100644 --- a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmcHelper.cs +++ b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmcHelper.cs @@ -36,6 +36,8 @@ namespace PepperDash.Essentials.DM AddToFeedbackList(VideoOutputResolutionFeedback, EdidManufacturerFeedback, EdidSerialNumberFeedback, EdidNameFeedback, EdidPreferredTimingFeedback); DeviceInfo = new DeviceInfo(); + + _rmc.OnlineStatusChange += (currentDevice, args) => { if (args.DeviceOnLine) UpdateDeviceInfo(); }; } protected void LinkDmRmcToApi(DmRmcControllerBase rmc, BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge) From c686ee394ddb8d52a476af0f24b028d696bcd8a4 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Tue, 10 Nov 2020 10:28:39 -0700 Subject: [PATCH 06/11] update event to use delegate --- .../Device Info/IDeviceInfoProvider.cs | 5 ++++- .../Essentials_DM/Endpoints/DGEs/Dge100Controller.cs | 2 +- .../Essentials_DM/Endpoints/Receivers/DmRmcHelper.cs | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Device Info/IDeviceInfoProvider.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Device Info/IDeviceInfoProvider.cs index 081fb46a..8dc7d572 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Device Info/IDeviceInfoProvider.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Device Info/IDeviceInfoProvider.cs @@ -1,4 +1,5 @@ using System; +using PepperDash.Core; namespace PepperDash.Essentials.Core.DeviceInfo { @@ -6,8 +7,10 @@ namespace PepperDash.Essentials.Core.DeviceInfo { DeviceInfo DeviceInfo { get; } - event EventHandler DeviceInfoChanged; + event DeviceInfoChangeHandler DeviceInfoChanged; void UpdateDeviceInfo(); } + + public delegate void DeviceInfoChangeHandler(IKeyed device, DeviceInfoEventArgs args); } \ No newline at end of file diff --git a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/DGEs/Dge100Controller.cs b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/DGEs/Dge100Controller.cs index 06b5f1cf..7e6e085d 100644 --- a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/DGEs/Dge100Controller.cs +++ b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/DGEs/Dge100Controller.cs @@ -87,7 +87,7 @@ namespace PepperDash.Essentials.DM.Endpoints.DGEs public DeviceInfo DeviceInfo { get; private set; } - public event EventHandler DeviceInfoChanged; + public event DeviceInfoChangeHandler DeviceInfoChanged; public void UpdateDeviceInfo() { diff --git a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmcHelper.cs b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmcHelper.cs index 54b7ca2c..1931d9cb 100644 --- a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmcHelper.cs +++ b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmcHelper.cs @@ -89,7 +89,7 @@ namespace PepperDash.Essentials.DM #region Implementation of IDeviceInfoProvider public DeviceInfo DeviceInfo { get; private set; } - public event EventHandler DeviceInfoChanged; + public event DeviceInfoChangeHandler DeviceInfoChanged; public void UpdateDeviceInfo() { From 10509991c1f1eb13ac76aa3029da99ef4a75dd4f Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Tue, 10 Nov 2020 10:39:49 -0700 Subject: [PATCH 07/11] updates for getting connected IP stuff --- .../Essentials_DM/Endpoints/Receivers/DmRmcHelper.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmcHelper.cs b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmcHelper.cs index 1931d9cb..783552f5 100644 --- a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmcHelper.cs +++ b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmcHelper.cs @@ -93,7 +93,9 @@ namespace PepperDash.Essentials.DM public void UpdateDeviceInfo() { - if (!_rmc.IsOnline || _rmc.ConnectedIpList.Count == 0) + Debug.Console(1, this, "Updating Device Info"); + + if (_rmc.ConnectedIpList.Count == 0) { Debug.Console(1, this, "IP Address information not yet received. No device is online"); return; From 010fdde45cd7e6047f78b28acaff8f5b543eccf3 Mon Sep 17 00:00:00 2001 From: Trevor Payne Date: Tue, 10 Nov 2020 11:46:51 -0600 Subject: [PATCH 08/11] Fixes issues with Adding HDMI LoopOut Ports --- .../Chassis/DmChassisController.cs | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs index 428bb8bc..09c7988a 100644 --- a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs +++ b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs @@ -774,10 +774,15 @@ namespace PepperDash.Essentials.DM { var portKey = string.Format("{0}--{1}", cardName, portName); Debug.Console(2, this, "Adding output port '{0}'", portKey); - OutputPorts.Add(new RoutingOutputPort(portKey, sigType, portType, selector, this) + + var outputPort = new RoutingOutputPort(portKey, sigType, portType, selector, this); + + if (portName.IndexOf("Loop", StringComparison.InvariantCultureIgnoreCase) < 0) { - FeedbackMatchObject = Chassis.Outputs[(uint)selector] - }); + outputPort.FeedbackMatchObject = Chassis.Outputs[(uint) selector]; + } + + OutputPorts.Add(outputPort); } /// @@ -786,12 +791,13 @@ namespace PepperDash.Essentials.DM void AddOutputPortWithDebug(string cardName, string portName, eRoutingSignalType sigType, eRoutingPortConnectionType portType, object selector, ICec cecPort) { var portKey = string.Format("{0}--{1}", cardName, portName); - Debug.Console(2, this, "Adding output port '{0}'", portKey); - var outputPort = new RoutingOutputPort(portKey, sigType, portType, selector, this) + Debug.Console(2, this, "Adding output port '{0}'", portKey); + var outputPort = new RoutingOutputPort(portKey, sigType, portType, selector, this); + + if (portName.IndexOf("Loop", StringComparison.InvariantCultureIgnoreCase) < 0) { - FeedbackMatchObject = Chassis.Outputs[(uint)selector] - }; ; - + outputPort.FeedbackMatchObject = Chassis.Outputs[(uint)selector]; + } if (cecPort != null) outputPort.Port = cecPort; From 1689b15d952a1b81938a5fb6a31290a836b26d0d Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Tue, 10 Nov 2020 12:00:58 -0700 Subject: [PATCH 09/11] make IDeviceInfoProvider inherit from IKeyed --- .../PepperDashEssentialsBase/Device Info/IDeviceInfoProvider.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Device Info/IDeviceInfoProvider.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Device Info/IDeviceInfoProvider.cs index 8dc7d572..ea9c16e6 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Device Info/IDeviceInfoProvider.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Device Info/IDeviceInfoProvider.cs @@ -3,7 +3,7 @@ using PepperDash.Core; namespace PepperDash.Essentials.Core.DeviceInfo { - public interface IDeviceInfoProvider + public interface IDeviceInfoProvider:IKeyed { DeviceInfo DeviceInfo { get; } From ed6ad6ae76fb207c7813d1c74f04ed234315d245 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Wed, 11 Nov 2020 11:29:43 -0700 Subject: [PATCH 10/11] updates for device info --- .../Essentials_DM/Endpoints/Receivers/DmRmcHelper.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmcHelper.cs b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmcHelper.cs index 783552f5..93f93ca8 100644 --- a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmcHelper.cs +++ b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmcHelper.cs @@ -115,7 +115,10 @@ namespace PepperDash.Essentials.DM private void GetFirmwareAndSerialInfo() { - var tcpClient = new GenericTcpIpClient("", _rmc.ConnectedIpList[0].DeviceIpAddress, CtpPort, 1024); + var tcpClient = new GenericTcpIpClient(String.Format("{0}-devInfoSocket", Key), _rmc.ConnectedIpList[0].DeviceIpAddress, CtpPort, 1024) + { + AutoReconnect = false, + }; var gather = new CommunicationGather(tcpClient, "\r\n\r\n"); @@ -123,6 +126,7 @@ namespace PepperDash.Essentials.DM { if (!args.Client.IsConnected) { + OnDeviceInfoChange(); return; } From 5d2f20efd57599822220e3c936ecdb76649ba803 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Wed, 11 Nov 2020 13:02:12 -0700 Subject: [PATCH 11/11] initial implementations for DM Rmc & DGE --- .../Endpoints/DGEs/Dge100Controller.cs | 2 +- .../Endpoints/Receivers/DmRmcHelper.cs | 27 +++++++++++++------ 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/DGEs/Dge100Controller.cs b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/DGEs/Dge100Controller.cs index 7e6e085d..d7996554 100644 --- a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/DGEs/Dge100Controller.cs +++ b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/DGEs/Dge100Controller.cs @@ -107,7 +107,7 @@ namespace PepperDash.Essentials.DM.Endpoints.DGEs return; } - var tcpClient = new GenericTcpIpClient("", _dgeEthernetInfo.IpAddressFeedback.StringValue, CtpPort, 1024); + var tcpClient = new GenericTcpIpClient("", _dgeEthernetInfo.IpAddressFeedback.StringValue, CtpPort, 1024){AutoReconnect = false}; var gather = new CommunicationGather(tcpClient, "\r\n\r\n"); diff --git a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmcHelper.cs b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmcHelper.cs index 93f93ca8..83c386bc 100644 --- a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmcHelper.cs +++ b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmcHelper.cs @@ -135,20 +135,31 @@ namespace PepperDash.Essentials.DM gather.LineReceived += (sender, args) => { - if (args.Text.ToLower().Contains("host")) - { - DeviceInfo.HostName = args.Text.Split(';')[1].Trim(); - - tcpClient.Disconnect(); - return; - } - //ignore console prompt if (args.Text.ToLower().Contains(">")) { return; } + + if (args.Text.ToLower().Contains("host")) + { + DeviceInfo.HostName = args.Text.Split(':')[1].Trim(); + + tcpClient.SendText("maca\r\n"); + + return; + } + + if (args.Text.ToLower().Contains("mac")) + { + DeviceInfo.MacAddress = args.Text.Split(':')[1].Trim().Replace(" ", ":"); + + tcpClient.Disconnect(); + + return; + } + if (!args.Text.ToLower().Contains("rmc")) { return;