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
Close
Hashes for simple-hdlc-0.4.linux-x86_64.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 088f7224d71b16151aacf13a169f7124ecc04ead3c6576d859379f73431eff01 |
|
MD5 | cede748fb6eb3c7d2a707fab1c7ade10 |
|
BLAKE2b-256 | 86134f12c74700900fa3eae416568fc9a384fb54d9205db76b096448b1ab76bd |