Added support for remote connection by name via Pentair servers
This brings along proper password encryption and validation for the login process (which is still not needed for local connections). You can run the remote connection tests by passing a system name and password as 2 arguments (so the system name needs to be quoted, e.g.: `test "Pentair: xx-xx-xx" 1234`) Also updated to latest .NET Core and C# versions while I was at it.
This commit is contained in:
22
RemoteConnect.cs
Normal file
22
RemoteConnect.cs
Normal file
@ -0,0 +1,22 @@
|
||||
using System.Net.Sockets;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ScreenLogicConnect
|
||||
{
|
||||
public class RemoteConnect
|
||||
{
|
||||
public const int ServerDispatcherPort = 500;
|
||||
public const string ServerDispatcherURL = "screenlogicserver.pentair.com";
|
||||
|
||||
public static async Task<EasyTouchUnit> GetGatewayInfo(string systemName)
|
||||
{
|
||||
using (var client = new TcpClient())
|
||||
{
|
||||
client.Connect(ServerDispatcherURL, ServerDispatcherPort);
|
||||
var ns = client.GetStream();
|
||||
ns.SendHLMessage(Messages.GetGatewayData.QUERY(systemName));
|
||||
return new EasyTouchUnit(new Messages.GetGatewayData(await UnitConnection.GetMessage(ns)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user