Skip to content

Commit

Permalink
Fix console test app and verify functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
CandL Development committed Aug 30, 2021
1 parent 2867d83 commit 3ac0e26
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions ESCPOS_NET.ConsoleTest/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ static void Main(string[] args)
{
networkPort = "9100";
}
printer = new NetworkPrinter(ipAddress: ip, port: int.Parse(networkPort), reconnectOnTimeout: true);
printer = new NetworkPrinter(settings: new NetworkPrinterSettings() { ConnectionString = $"{ip}:{networkPort}" });
}

bool monitor = false;
Expand Down Expand Up @@ -148,7 +148,9 @@ static void Main(string[] args)

if (monitor)
{
printer.StartMonitoring();
printer.Write(e.Initialize());
printer.Write(e.Enable());
printer.Write(e.EnableAutomaticStatusBack());
}
Setup(monitor);

Expand Down Expand Up @@ -238,7 +240,7 @@ private static void StatusChanged(object sender, EventArgs ps)
{
var status = (PrinterStatusEventArgs)ps;
if (status == null) { Console.WriteLine("Status was null - unable to read status from printer."); return; }
Console.WriteLine($"Printer Online Status: {status.DeviceIsConnected}");
Console.WriteLine($"Printer Online Status: {status.IsPrinterOnline}");
Console.WriteLine(JsonConvert.SerializeObject(status));
}
private static bool _hasEnabledStatusMonitoring = false;
Expand Down

0 comments on commit 3ac0e26

Please sign in to comment.