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:
```python
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:
```python
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")
```
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:
```python
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:
```python
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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for simple_hdlc-0.2-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3292eeac691f6cc632dddfe2292a1a954961dd5ba7a595ffc4c76feec0468060 |
|
MD5 | e58b46e4e0f9e8813ce1e1998a2251d7 |
|
BLAKE2b-256 | 2e40060132b0005a356f5e2bc125163facbd371aade4398014a08214a10e34c7 |