Module for handling communication via serial port like Universal asynchronous receiver-transmitter (UART)
Project description
[!IMPORTANT]
This project is under development. All source code and features on the main branch are for the purpose of testing or evaluation and not production ready.
MFD SERIAL
Tool for communication via serial port (e.g UART).
Usage
Open serial connection put serial port and baud rate:
port can be e.g. COM1 if windows or /dev/ttyUSB0 if linux
serial = SerialConnection(serial_port='/dev/ttyUSB0', baud=115200)
Read data from serial:
serial.read()
Send text msg via serial port
serial.send('Text to send')
Read until some expression appear:
serial.read_until('Module Error')
Close serial connection:
serial.close()
Read in background (e.g. if we want to run tests and log everything what happen on serial port during the test)
serial.read_in_background()
(... test steps ...)
serial_log = serial.get_result() #get_result will automatically close the connection
SerialConnection can be used as context manager:
with SerialConnection(serial_port='/dev/ttyUSB0', baud=115200) as serial:
log = serial.read()
Issue reporting
If you encounter any bugs or have suggestions for improvements, you're welcome to contribute directly or open an issue here.
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 Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mfd_serial-1.7.0-py3-none-any.whl.
File metadata
- Download URL: mfd_serial-1.7.0-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
af694f818fbb69e36b9eca59045c8f43f2209c41d1a41e368d1dc7f5512422d9
|
|
| MD5 |
048df17498745667a9577941f1ce9b42
|
|
| BLAKE2b-256 |
2b0cbf6a5ff4f33c2bc40c1a5812738f297974e138175d3bbfc4b3bbb3d3f014
|