Skip to content

Commit

Permalink
chore: Convert driverOps values to integers in Usb driver initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
alevilar committed Aug 30, 2024
1 parent ad3dcd7 commit 47c0177
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions src/common/ComandosHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,26 +67,17 @@ def runTraductor(jsonTicket, queue):
# classprinter.Usb(idVendor=None, idProduct=None, usb_args={}, timeout=0, in_ep=130, out_ep=1, *args, **kwargs)
# convertir de string a int
if 'out_ep' in driverOps:
driverOps['out_ep'] = hex(driverOps['out_ep'], 16)
driverOps['out_ep'] = hex(int(driverOps['out_ep'], 16))

if 'in_ep' in driverOps:
driverOps['in_ep'] = hex(driverOps['in_ep'], 16)
driverOps['in_ep'] = hex(int(driverOps['in_ep'], 16))

if 'idVendor' in driverOps:
driverOps['idVendor'] = hex(driverOps['idVendor'], 16)
driverOps['idVendor'] = hex(int(driverOps['idVendor'], 16))

if 'idProduct' in driverOps:
driverOps['idProduct'] = hex(driverOps['idProduct'], 16)
printer("*-*-* ACHALAYYYY -* **- -*-")
driverOps['idProduct'] = hex(int(driverOps['idProduct'], 16))

printer("*-*-* ACHALAYYYY -* **- -*-")
printer("*-*-* ACHALAYYYY -* **- -*-")
printer("*-*-* ACHALAYYYY -* **- -*-")

printer(driverOps)
printer("*-*-* ACHALAYYYY -* **- -*-")
printer("*-*-* ACHALAYYYY -* **- -*-")
printer("*-*-* ACHALAYYYY -* **- -*-")
logger.info("Los parametros a enviar driver USB son")
logger.info(driverOps)
driver = printer.Usb(**driverOps)
Expand Down

0 comments on commit 47c0177

Please sign in to comment.