Skip to content

intel/mfd-serial

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.

About

No description or website provided.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors