From 5d2f20efd57599822220e3c936ecdb76649ba803 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Wed, 11 Nov 2020 13:02:12 -0700 Subject: [PATCH] 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;