summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2019-03-28 16:05:06 +0100
committerChristophe Simonis <chs@odoo.com>2019-03-28 16:05:06 +0100
commita039d657e49862a9fb69a15cf192a1a4aed73ea3 (patch)
tree059a58b2f6085abfb8a24e6d3c6f455a267c1227
parent03d74f4f76a8d873a15792c1959189d72b407712 (diff)
parent6b54bd88a9c080a191f801ac75721f81eb5def47 (diff)
[MERGE] forward port branch saas-15 up to 6b54bd88a9c
-rw-r--r--addons/hw_escpos/escpos/constants.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/addons/hw_escpos/escpos/constants.py b/addons/hw_escpos/escpos/constants.py
index 238e8bdbf0f..6519c76f69c 100644
--- a/addons/hw_escpos/escpos/constants.py
+++ b/addons/hw_escpos/escpos/constants.py
@@ -19,9 +19,10 @@ DLE_EOT_PAPER = '\x10\x04\x04'
HW_INIT = '\x1b\x40' # Clear data in buffer and reset modes
HW_SELECT = '\x1b\x3d\x01' # Printer select
HW_RESET = '\x1b\x3f\x0a\x00' # Reset printer hardware
-# Cash Drawer
-CD_KICK_2 = '\x1b\x70\x00' # Sends a pulse to pin 2 []
-CD_KICK_5 = '\x1b\x70\x01' # Sends a pulse to pin 5 []
+# Cash Drawer (ESC p <pin> <on time: 2*ms> <off time: 2*ms>)
+_CASH_DRAWER = lambda m, t1='', t2='': ESC + 'p' + m + chr(t1) + chr(t2)
+CD_KICK_2 = _CASH_DRAWER('\x00', 50, 50) # Sends a pulse to pin 2 []
+CD_KICK_5 = _CASH_DRAWER('\x01', 50, 50) # Sends a pulse to pin 5 []
# Paper
PAPER_FULL_CUT = '\x1d\x56\x00' # Full cut paper
PAPER_PART_CUT = '\x1d\x56\x01' # Partial cut paper