tehmaze / xmodem

XMODEM protocol implementation for Python
https://pypi.org/project/xmodem/
MIT License
98 stars 57 forks source link

Reworking the example #40

Open yegorich opened 4 years ago

yegorich commented 4 years ago

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?

tehmaze commented 4 years ago

Frankly I have no idea, do not possess any Windows endpoint to test on currently.