mirror of
https://github.com/furrtek/PrecIR.git
synced 2026-04-04 06:55:53 +00:00
PriceHax app
ESL Blaster FW V3 Updated setsegs to support new tx.py
This commit is contained in:
@@ -67,8 +67,8 @@ if (port == "0"):
|
||||
blaster_info = tx.search_esl_blaster()
|
||||
if blaster_info[0] == False:
|
||||
exit()
|
||||
if blaster_info[2] == 1:
|
||||
pp16 = 1 # ESL Blaster FW V2 is PP16 compatible
|
||||
if blaster_info[2] >= 2:
|
||||
pp16 = 1 # ESL Blaster FW V2 and above is PP16 compatible
|
||||
|
||||
# Open image file
|
||||
image = imread(sys.argv[2])
|
||||
|
||||
@@ -23,8 +23,8 @@ def terminate_frame(frame, pp16, repeats):
|
||||
frame[0:0] = [0x00, 0x00, 0x00, 0x40] # Prepend special PP16 header
|
||||
frame.append(crc & 255)
|
||||
frame.append((crc // 256) & 255)
|
||||
frame.append(repeats & 255) # This is used by the transmitter, it's not part of the transmitted data
|
||||
frame.append((repeats // 256) & 255) # This is used by the transmitter, it's not part of the transmitted data
|
||||
frame.append(repeats & 255) # This is used by the serial transmitter, it's not part of the transmitted data
|
||||
frame.append((repeats // 256) & 255) # This is used by the serial transmitter, it's not part of the transmitted data
|
||||
|
||||
def make_raw_frame(protocol, PLID, cmd):
|
||||
frame = [protocol, PLID[3], PLID[2], PLID[1], PLID[0], cmd]
|
||||
|
||||
@@ -21,11 +21,12 @@ if len(sys.argv[3]) != 46:
|
||||
usage()
|
||||
|
||||
port = sys.argv[1]
|
||||
pp16 = 0 # None of the segment-based ESLs tested support PP16
|
||||
|
||||
# Search for connected ESL Blaster if required
|
||||
if (port == "0"):
|
||||
blaster_port = tx.search_esl_blaster()
|
||||
if (blaster_port == "0"):
|
||||
blaster_info = tx.search_esl_blaster()
|
||||
if blaster_info[0] == False:
|
||||
exit()
|
||||
|
||||
# Get PLID from barcode string
|
||||
@@ -47,7 +48,7 @@ payload.extend([0x00, 0x00, 0x09, 0x00, 0x10, 0x00, 0x31])
|
||||
|
||||
frame = pr.make_raw_frame(0x84, PLID, payload[0])
|
||||
frame.extend(payload[1:])
|
||||
pr.terminate_frame(frame, 100)
|
||||
pr.terminate_frame(frame, pp16, 100)
|
||||
frames.append(frame)
|
||||
|
||||
# DEBUG
|
||||
@@ -60,7 +61,7 @@ frames.append(frame)
|
||||
|
||||
# Send data to IR transmitter
|
||||
if (port == "0"):
|
||||
tx.transmit_esl_blaster(frames, blaster_port)
|
||||
tx.transmit_esl_blaster(frames, pp16, blaster_info[0])
|
||||
else:
|
||||
tx.transmit_serial(frames, port)
|
||||
print("Done.")
|
||||
|
||||
Reference in New Issue
Block a user