DLE/STX/ETX is a packet framing algorithm, used by some devices (such as Metlink LED passenger information displays) to transmit data as packets over a serial medium. This algorithm delimits data using DLE, STX, and ETX control codes.
Packets begin with a DLE STX sequence, follow with a byte-stuffed data stream (all DLE bytes in the data are conveyed as DLE DLE), and end with a DLE ETX sequence.
The dlestxetx module provides functions to encode data into packets:
>>> from dlestxetx import encode >>> encode(b'\x01\x10\x05') b'\x10\x02\x01\x10\x10\x05\x10\x03'
decode packets into data:
>>> from dlestxetx import decode >>> decode(b'\x10\x02\x01\x10\x10\x05\x10\x03') b'\x01\x10\x05'
and read packets directly from file objects:
>>> from dlestxetx import read >>> packets = BytesIO(encode(b'\x04\x05\x06') + encode(b'\x07\x08\x09')) >>> read(packets) b'\x04\x05\x06' >>> read(packets) b'\x07\x08\x09'
Installation
Install this module from PyPI using pip:
pip install dlestxetx
Contribute
Source code: https://github.com/Lx/python-dlestxetx
Support
Issue tracker: https://github.com/Lx/python-dlestxetx/issues
License
This project is licensed under the MIT License.
Metadata
Release files for dlestxetx 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| dlestxetx-1.0.0.tar.gz | 3.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| dlestxetx-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.9 kB
Release files / dlestxetx-1.0.0.tar.gz
| Download URL | dlestxetx-1.0.0.tar.gz |
|---|---|
| Size | 3.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
57c329e0ff6482710d9ac63b3bdc8ed20d1101ee05d523363a7d8e8704ad103f
|
|
BLAKE2b-256 checksum How to use checksums |
15021ecce2d4c7c5bdf895b39484a9608206e4147e20d8f56976e9814a6a70e7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3
|
Release files / dlestxetx-1.0.0-py3-none-any.whl
| Download URL | dlestxetx-1.0.0-py3-none-any.whl |
|---|---|
| Size | 4.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
34ff952091e4e977695e84d31b4130c7112b9536a120efd7637fa8c7a0074e2f
|
|
BLAKE2b-256 checksum How to use checksums |
6da33758967da2e2e5d1828fadf60a5e8f23a65467378e93f79571ee35716c2f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3
|