ComThread is a class used for UART port control programming.
@ Support valid port search @ Support data receiving and keyword search in thread. @ Support Ymodem data xmit (windows only) @ Support data xmit (one time sending or keep sending)
from ComThread import *; rt = ComThread();
ports = serial_ports();
rt.port = ports[0];
rt.dq = Queue();
esc_chars="1B" hex_esc = esc_chars.decode("hex");
if rt.start(">>", hex_esc): rt.waiting(); rt.stop();
if rt.start("NONE", "NONE"): rt.Write_once("hello"); rt.stop();