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.python.org/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.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.2.tar.gz (29.6 kB view hashes)

Uploaded Source

Built Distributions

xmodem-0.4.2-py3-none-any.whl (34.2 kB view hashes)

Uploaded Python 3

xmodem-0.4.2-py2-none-any.whl (34.4 kB view hashes)

Uploaded Python 2

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