mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-16 05:05:00 +00:00
initial implementations for DM Rmc & DGE
This commit is contained in:
@@ -107,7 +107,7 @@ namespace PepperDash.Essentials.DM.Endpoints.DGEs
|
|||||||
return;
|
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");
|
var gather = new CommunicationGather(tcpClient, "\r\n\r\n");
|
||||||
|
|
||||||
|
|||||||
@@ -135,20 +135,31 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
gather.LineReceived += (sender, args) =>
|
gather.LineReceived += (sender, args) =>
|
||||||
{
|
{
|
||||||
if (args.Text.ToLower().Contains("host"))
|
|
||||||
{
|
|
||||||
DeviceInfo.HostName = args.Text.Split(';')[1].Trim();
|
|
||||||
|
|
||||||
tcpClient.Disconnect();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
//ignore console prompt
|
//ignore console prompt
|
||||||
if (args.Text.ToLower().Contains(">"))
|
if (args.Text.ToLower().Contains(">"))
|
||||||
{
|
{
|
||||||
return;
|
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"))
|
if (!args.Text.ToLower().Contains("rmc"))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user