1
0
mirror of https://github.com/python-escpos/python-escpos synced 2025-09-13 09:09:58 +00:00

Paper sensor querying command (#242)

The DLE EOT command allows querying the status of several features of
the printer.
Added to the online/offline status developed in #237, this commit adds a
paper sensor querying.

Tested with an Epson TM-T20II, which only has an end-paper sensor. The
near-end paper sensor should be tested with a compatible printer.
However, the implementation is quite straight-forward.
This commit is contained in:
csoft2k
2017-07-27 23:05:50 +02:00
committed by Patrick Kanzler
parent c7080165a7
commit 1f57b04974
2 changed files with 33 additions and 6 deletions

View File

@@ -251,5 +251,10 @@ S_RASTER_2H = _PRINT_RASTER_IMG(b'\x02') # Set raster image double height
S_RASTER_Q = _PRINT_RASTER_IMG(b'\x03') # Set raster image quadruple
# Status Command
RT_STATUS_ONLINE = DLE + EOT + b'\x01';
RT_MASK_ONLINE = 8;
RT_STATUS = DLE + EOT
RT_STATUS_ONLINE = RT_STATUS + b'\x01'
RT_STATUS_PAPER = RT_STATUS + b'\x04'
RT_MASK_ONLINE = 8
RT_MASK_PAPER = 18
RT_MASK_LOWPAPER = 30
RT_MASK_NOPAPER = 114