tray
tray copied to clipboard
Add ability to detect "offline" printer status
Per https://stackoverflow.com/questions/41437023
~~This is a proof of concept, not ready for merge.~~ Ready for testing.
Code looks good. Assigning to @klabarge for testing. This should fire an "offline" event when a USB printer is unplugged.
@klabarge pinging again for testing and approval.
I'm testing on:
OS: Windows 10 Java: Temurin-11.0.14.1+1
When I unplug my Epson TM-T88VI I get a NOT_AVAILABLE
event. However, this is the same behavior as 2.1.6.
- Thu Aug 25 2022 16:24:40 GMT-0400 (Bolivia Time): NOT_AVAILABLE: Level: FATAL, From: EPSON TM-T88VI Receipt, EventType: PRINTER, Code: 4096
When I plug the printer back in, I do see the OFFLINE
event after another NOT_AVAILABLE
event is thrown.
- Thu Aug 25 2022 16:27:51 GMT-0400 (Bolivia Time): NOT_AVAILABLE: Level: FATAL, From: EPSON TM-T88VI Receipt, EventType: PRINTER, Code: 4096
- Thu Aug 25 2022 16:27:51 GMT-0400 (Bolivia Time): OFFLINE: Level: FATAL, From: EPSON TM-T88VI Receipt, EventType: PRINTER, Code: 128
Thu Aug 25 2022 16:27:51 GMT-0400 (Bolivia Time): INITIALIZING: Level: INFO, From: EPSON TM-T88VI Receipt, EventType: PRINTER, Code: 32768
Thu Aug 25 2022 16:27:51 GMT-0400 (Bolivia Time): OK: Level: INFO, From: EPSON TM-T88VI Receipt, EventType: PRINTER, Code: 0
Thu Aug 25 2022 16:27:51 GMT-0400 (Bolivia Time): OK: Level: INFO, From: EPSON TM-T88VI Receipt, EventType: PRINTER, Code: 0
@klabarge do you have another USB printer you can test with? @Vzor- any thoughts?
@klabarge do you have another USB printer you can test with? @Vzor- any thoughts?
I think the next step is checking to see if that printer property is changing when it is unplugged, rather than us failing to report it.
When I plug the printer back in, I do see the OFFLINE event after another NOT_AVAILABLE event is thrown.
I missed this portion. @Vzor- let us know what you need to reproduce (hardware, remote connection, etc).
@Vzor- pinging again. I'd like to find out if this is good to merge of if it needs additional changes.
@Vzor- pinging again please provide next steps so we can decide on this.
@klabarge in that SO question, the question shows the print dialog with the selected printer's status as offline. Do you see this as well when the printer is disconnected?
If it shows as online even when disconnected, queue a print job then check the status again.
Do you have other printers to test with? anything via usb should work, even consumer printers.
It works on my Boca Lemur (Windows called it a fgl46). This is most likely dependent on the driver.
- Thu Sep 29 2022 15:06:27 GMT-0400 (Eastern Daylight Time): OFFLINE: Level: FATAL, From: Boca BIDI FGL 26/46 200 DPI, EventType: PRINTER, Code: 67108864
Thu Sep 29 2022 15:06:29 GMT-0400 (Eastern Daylight Time): OK: Level: INFO, From: Boca BIDI FGL 26/46 200 DPI, EventType: PRINTER, Code: 0
- Thu Sep 29 2022 15:06:36 GMT-0400 (Eastern Daylight Time): OFFLINE: Level: FATAL, From: Boca BIDI FGL 26/46 200 DPI, EventType: PRINTER, Code: 67108864
Thu Sep 29 2022 15:06:37 GMT-0400 (Eastern Daylight Time): OK: Level: INFO, From: Boca BIDI FGL 26/46 200 DPI, EventType: PRINTER, Code: 0
@Vzor- thanks for testing! So according to your results, this should be good to merge.