make BmsTunnel buildable, it's still broken

This commit is contained in:
ig 2023-02-23 16:14:11 +01:00
parent 4f8709d4d8
commit 426c447483
1 changed files with 15 additions and 8 deletions

View File

@ -2,7 +2,6 @@
// rsync -av bin/Release/net6.0/linux-arm/publish/ root@10.2.1.6:/home/root/tunnel && clear && \ // rsync -av bin/Release/net6.0/linux-arm/publish/ root@10.2.1.6:/home/root/tunnel && clear && \
// ssh root@10.2.1.6 /home/root/tunnel/BmsTunnel // ssh root@10.2.1.6 /home/root/tunnel/BmsTunnel
using System.Net;
using InnovEnergy.Lib.Utils; using InnovEnergy.Lib.Utils;
using static System.String; using static System.String;
@ -21,13 +20,21 @@ public static class Program
Console.WriteLine("\nstarting BMS tunnel\n"); Console.WriteLine("\nstarting BMS tunnel\n");
var path = $"/dev/{tty}"; // var path = $"/dev/{tty}";
if (host != null) // if (host != null)
path = $"root@{host}" + path; // path = $"root@{host}" + path;
//
// var node = connection.Nodes.Any()
// ? connection.Nodes.First()
// : DefaultNode;
//
var node = connection.Nodes.Any() // TODO: Fixme
? connection.Nodes.First() var path = "";
: DefaultNode; Byte node = 2;
var nodes = new Byte[] { 1, 2, 3 };
// TODO: Fixme
using var tunnel = new BmsTunnel(path, node); using var tunnel = new BmsTunnel(path, node);
@ -82,7 +89,7 @@ public static class Program
void ListNodes() void ListNodes()
{ {
if(nodes.Count >= 250) if(nodes.Length >= 250)
return; return;
nodes.Aggregate("available nodes:", (a, b) => $"{a} {b}") nodes.Aggregate("available nodes:", (a, b) => $"{a} {b}")