Skip to main content

Simple HDLC Protocol

Project description

simple-hdlc

Simple HDLC Protocol

Used for simple communication with devices. Framing of serial data.

Usage

Use with instance of In/Output with read and write methods (like pyserial).

Blocking Read:

from simple_hdlc import HDLC
import serial 

s = serial.serial_for_url('loop://', timeout=1)
# or
# s = serial.Serial('/dev/tty0')

h = HDLC(s)
h.sendFrame(b"hello")
print h.readFrame()  # Blocking

Reader Thread with callback:

from simple_hdlc import HDLC
import serial

s = serial.serial_for_url('loop://', timeout=1)
h = HDLC(s)
# or
# s = serial.Serial('/dev/tty0')

def frame_callback(data):
    print(data)

h.startReader(onFrame=frame_callback)
h.sendFrame(b"hello")

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

simple-hdlc-0.4.4.tar.gz (3.6 kB view details)

Uploaded Source

File details

Details for the file simple-hdlc-0.4.4.tar.gz.

File metadata

  • Download URL: simple-hdlc-0.4.4.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.6.5

File hashes

Hashes for simple-hdlc-0.4.4.tar.gz
Algorithm Hash digest
SHA256 33fe203d3af8da230fd30ebdc427276cae844d45145506ae760c3ec41c3ab7ba
MD5 293653352605826ced11d97eb2d63ce8
BLAKE2b-256 812c98c8ce5cf08ed63901b5cd49884ec4f6f47d8e221edd9bbe928661a2022f

See more details on using hashes here.

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