Asyncio wrapper for pyserial
Project description
asyncserial is a a wrapper for the pyserial library providing an async interface based on async def and await.
Installation
Documentation
TODO
Examples
import asyncio
from asyncserial import Serial
loop = asyncio.get_event_loop()
test_serial = Serial(loop, "/dev/ttyACM0", baudrate=115200)
async def test():
await test_serial.read() # Drop anything that was already received
while True:
line = await test_serial.readline() # Read a line
print("[+] Serial read: {}".format(line))
await asyncio.sleep(0) # Let's be a bit greedy, should be adjust to your needs
asyncio.ensure_future(test())
print("[+] Starting eventloop")
loop.run_forever()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
asyncserial-0.1.0b2.tar.gz
(7.3 kB
view hashes)
Built Distribution
Close
Hashes for asyncserial-0.1.0b2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 82d520afb7f5e7ea4a4aba74332a0f42be184eb562aaf348bf7555493b8e3497 |
|
MD5 | 95e2c030c6cc898e540bb8fc0af10db5 |
|
BLAKE2b-256 | b56a59656088392582d169169a4f26cdda9b6c6e3cceb010e9f20010ead5371e |