ESC-POS-.NET icon indicating copy to clipboard operation
ESC-POS-.NET copied to clipboard

No existing code for BasePrinter.Startmonitoring()

Open Jury-jpg opened this issue 2 years ago • 3 comments

Jury-jpg avatar May 21 '23 10:05 Jury-jpg

Hey @Jury-jpg could you provide some more details on what your question / concern is regarding this function? Are you not sure how to use it? There is an example in the README:

// In your program, register event handler to call the method when printer status changes:
printer.StatusChanged += StatusChanged;

// and start monitoring for changes.
printer.StartMonitoring();

lukevp avatar Jun 17 '23 16:06 lukevp

NetworkPrinter does not contain a definition for StartMonitoring

HGCollier avatar Jun 22 '23 15:06 HGCollier

Looking at the tests implemented in this git, I found how to get the data, maybe it will help you

using(var xPrinter = new SerialPrinter(portName: "COM2", baudRate: 115200))
{
        xPrinter.StatusChanged += StatusChanged;
        xPrinter.Connected += ConnectedChanged;
        var xEpson = new EPSON();
        
        xPrinter.Write(xEpson.Initialize());
        xPrinter.Write(xEpson.Enable());

        xPrinter.Write(xEpson.EnableAutomaticStatusBack());
        Thread.Sleep(5000);
}
void StatusChanged(object sender, EventArgs e)
{
	var status = (PrinterStatusEventArgs)e;
	status.Dump();
}

2024-03-05_23h46_26

wzuqui avatar Mar 06 '24 02:03 wzuqui