6 class SerialClientException(Exception): pass
9 def __init__(self, port = '/dev/ttyS1', baud = 9600):
13 bytesize=EIGHTBITS, #number of databits
14 parity=PARITY_NONE, #enable parity checking
15 stopbits=STOPBITS_ONE, #number of stopbits
16 timeout=1, #set a timeout value, None for waiting forever, return on read
17 xonxoff=0, #enable software flow control
18 rtscts=0, #enable RTS/CTS flow control
27 return (self.rfh, self.wfh)
33 if __name__ == '__main__':
34 s = SerialClient("/dev/ttyS1", 9600)
36 (rfh, wfh) = s.get_fh()