22 lines
565 B
C#
22 lines
565 B
C#
|
|
using System.Text.Json;
|
|
using System.Text.Json.Serialization;
|
|
using InnovEnergy.Lib.Utils;
|
|
|
|
namespace InnovEnergy.Lib.Devices.Battery48TL;
|
|
|
|
public static class Program
|
|
{
|
|
public static Task Main(string[] args)
|
|
{
|
|
var d = new Battery48TlDevice("ttyUSB0", 2, "10.2.3.47");
|
|
|
|
var options = new JsonSerializerOptions { WriteIndented = true, Converters = { new JsonStringEnumConverter() }};
|
|
|
|
while (true)
|
|
{
|
|
var x = d.Read();
|
|
(x, options).Apply(JsonSerializer.Serialize).WriteLine();
|
|
}
|
|
}
|
|
} |