| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
python4yahdlc is a Python binding of the yahdlc library, allowing to encode and decode HDLC frames.
This software requires Python 3.
pip3 install --upgrade python4yahdlc
git clone https://github.com/SkypLabs/python4yahdlc.git cd python4yahdlc git submodule update --init --recursive python3 setup.py install
You need the setuptools package to execute setup.py.
To generate a new HDLC data frame:
from yahdlc import *
frame = frame_data('hello world!')
To generate a new HDLC ACK frame with a specific sequence number:
frame = frame_data('', FRAME_ACK, 3)
The highest sequence number is 7 and the following frame types are available:
Note that when you generate an ACK or NACK frame, the payload is useless.
To decode a received HDLC frame:
data, ftype, seq_no = get_data(frame)
For a more advanced use, take a look at the examples available in the examples folder.
Before publishing the new release:
After having pushed the changes:
This project is released under the GPL version 3 license. The yahdlc library is released under the MIT license.
| Back | FazBrowse Home | New Git URL |