![]() ![]() Serial Communication Library for Windows, Serial communication, Serial Component,RS2. ![]() Here are some C and C++ libraries, DLLs, VCLs, source code, components, modules. Free C/C++ Libraries, Source Code and Frameworks(thefreecountry. We try to implement the protocols as minimalistic as possible without breaking the protocol. This package ports the XMODEM, YMODEM and ZMODEM protocols to Python. Xmodem - *MODEM protocol implementation for Python (XMODEM/YMODEM/ZMODEM). It handles both sending and receiving of data with XModem. ![]() Def xmodem_send(serial, file): t, anim = 0, '|/- ' tTimeout(1) while 1: if serial.read(1)!= NAK: t = t + 1 print anim,' r', if t = 60: return False else: break p = 1 s = file.read(128) while s: s = s + ' xFF'*(128 - len(s)) chk = 0 for c in s: chk+=ord(c) while 1: serial.write(SOH) serial.write(chr(p)) serial.write(chr(255 - p)) serial.write(s) serial.write(chr(chk%256)) serial.flush() answer = serial.read(1) if answer = NAK: continue if answer = ACK: break return False s = file.read(128) p = (p + 1)%256 print '.', serial.write(EOT) return True. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |