def __init__(self, tty, timeout=2):
self.conn = serial.Serial(tty,
baudrate=19200,
bytesize=serial.SEVENBITS,
parity=serial.PARITY_ODD,
stopbits=serial.STOPBITS_ONE,
timeout=timeout,
xonxoff=1,
rtscts=0,
dsrdtr=0
)
# switch on power for hardware RS232
# transmitter via handshake-signals
self.conn.dtr = True
self.conn.rts = False
评论列表
文章目录