XMODEM protocol implementation.
Project description
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.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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file xmodem-0.4.3.tar.gz
.
File metadata
- Download URL: xmodem-0.4.3.tar.gz
- Upload date:
- Size: 30.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ba0a5833d50adb701f045e4e4522bcb0785d2200e9a00fe4c74c226ec1e26fd |
|
MD5 | a6f6de41a6e60e664d569fd5e5f9b6ef |
|
BLAKE2b-256 | ac0b93b6449f0ead398af195907e434edc6f0bb145b8f2731dfe8225717bd279 |
File details
Details for the file xmodem-0.4.3-py2.py3-none-any.whl
.
File metadata
- Download URL: xmodem-0.4.3-py2.py3-none-any.whl
- Upload date:
- Size: 34.8 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75d48d9be7636fa9fda8cf1873a09756272a3d5f5a53b0b92d8feea2c34a8bb3 |
|
MD5 | fd79f9fabc2e3bd5bda11bc4e3017317 |
|
BLAKE2b-256 | 0b93432cde2336a97a2aaa5db9dc8f93e09a29b7fb90681442cd9b95ae3e8704 |