xmodem
xmodem copied to clipboard
Reworking the example
First of all, is xmodem UNIX only project or does it truly support Windows? If it only supports UNIX-like operating systems, would it make sense to add select()
call to the getc()
routine so that it can benefit from the timeout
parameter?
def getc(size, timeout=1):
buf = None
readable,_,_ = select.select([ser], [], [], timeout)
if ser in readable:
buf = ser.read(size)
return buf
I would also replace serial.Serial()
with serial.serial_for_url()
.
What about Py2 support? Does it still make sense to support it?
Frankly I have no idea, do not possess any Windows endpoint to test on currently.