Giter Site home page Giter Site logo

recoord / python4yahdlc Goto Github PK

View Code? Open in Web Editor NEW

This project forked from skyplabs/python4yahdlc

0.0 0.0 0.0 147 KB

Python binding of the yahdlc library

Home Page: https://pypi.python.org/pypi/python4yahdlc

License: GNU General Public License v3.0

C 56.45% Python 43.55%

python4yahdlc's Introduction

python4yahdlc

PyPI Package Latest Release PyPI Package Downloads Per Month PyPI Package Python Versions Build Status Master Branch Build Status Develop Branch Code Coverage LGTM Grade LGTM Alerts

python4yahdlc is a Python binding of the yahdlc library, allowing to encode and decode HDLC frames.

Dependencies

This software requires Python 3.

Installation

With pip (recommanded)

pip3 install --upgrade python4yahdlc

From sources

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.

Usage

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:

  • FRAME_DATA
  • FRAME_ACK
  • FRAME_NACK

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.

Development

Releasing a new version

Before publishing the new release:

  • Run all tests and be sure they all pass
  • Update the VERSION variable in setup.py
  • Update MANIFEST.in if needed
  • Update the package's metadata (description, classifiers, etc) in setup.py if needed
  • Update README.rst and examples/README.rst if needed

After having pushed the changes:

  • Edit the release note on GitHub

License

This project is released under the GPL version 3 license. The yahdlc library is released under the MIT license.

python4yahdlc's People

Contributors

skyplabs avatar 0m-ax avatar imgbotapp avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.