Skip to main content

XMODEM protocol implementation.

Project description

https://travis-ci.org/tehmaze/xmodem.png?branch=master https://coveralls.io/repos/tehmaze/xmodem/badge.png

XMODEM protocol implementation

Documentation available at http://packages.python.org/xmodem/

Python Package Index (PyPI) page is available at https://pypi-hypernode.com/pypi/xmodem

Usage

Create a function to get and put character data (to a serial line for example):

>>> from xmodem import XMODEM
>>> def getc(size, timeout=1):
...     return data or None
...
>>> def putc(data, timeout=1):
...     return size or None
...
>>> modem = XMODEM(getc, putc)

Now, to upload a file, use the send method:

>>> stream = open('/etc/fstab', 'rb')
>>> modem.send(stream)

To download a file, use the recv method:

>>> stream = open('output', 'wb')
>>> modem.recv(stream)

For more information, take a look at the documentation.

Changes

0.4.4:
  • bugfix: Large file transfers in send() were more likely to fail for small values of retry: This value should be the maximum failures per block transfer as documented, but was improperly implemented as the number of failures allowed for the total duration of the transfer, PR #21.

  • bugfix: send(retry=n) and recv(retry=n) would not retry n-1 times, rather than n times as documented, causing ‘retry=1’ to never retry, for example.

0.4.3:
  • bugfix: putc() callback was called in series, 3 times for each part of xmodem block header, data, and checksum during block transfer. Now all three data blocks are sent by single putc() call. This resolves issues when integrating with microcontrollers or equipment sensitive to timing issues at stream boundaries, PR #19.

0.4.2:
  • bugfix: documentation files missing from the release tarball Issue #16.

0.4.1
  • bugfix: re-transmit in send() on NAK or timeout, previously re-transmissions (wrongly) occurred only on garbage bytes. PR #12.

0.4.0
  • enhancement: support for python 3 PR #8.

  • bugfix: CRC failures in XMODEM.recv() were not renegotiated correctly PR #11.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xmodem-0.4.4.tar.gz (30.4 kB view details)

Uploaded Source

Built Distribution

xmodem-0.4.4-py2.py3-none-any.whl (35.0 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file xmodem-0.4.4.tar.gz.

File metadata

  • Download URL: xmodem-0.4.4.tar.gz
  • Upload date:
  • Size: 30.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for xmodem-0.4.4.tar.gz
Algorithm Hash digest
SHA256 bbbacfd8a72ede2479bd87cce748d092a3e5142ce90c8c7c2106ddf4c91f68a1
MD5 570772c676cb346bde827960a465ef38
BLAKE2b-256 bdccc6748df0948bcc272f4bc66e468cbd15290df8df3e51f9d660af3eb4352f

See more details on using hashes here.

File details

Details for the file xmodem-0.4.4-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for xmodem-0.4.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 b0edd36fb62faebbb2b990a350ea9fd134c506debef89ca1e2e780b19ea1ea4a
MD5 6552eecf0d2b3cbe75b2242b3b2a7fc2
BLAKE2b-256 23abcfa79b8eaff649f18f4f17b83fea07321eac6ef84bd09b13424ffe045ba8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page