| 1 | #!/usr/bin/python
|
|---|
| 2 | import serial
|
|---|
| 3 | import time
|
|---|
| 4 |
|
|---|
| 5 | com = serial.Serial(port='/dev/ttyS3', baudrate=57600, rtscts=True)
|
|---|
| 6 | com.flushInput()
|
|---|
| 7 |
|
|---|
| 8 | # Read sent bytes
|
|---|
| 9 | while True:
|
|---|
| 10 | in_waiting = com.in_waiting
|
|---|
| 11 | a = com.read(in_waiting)
|
|---|
| 12 | print '%d: %r' % (in_waiting, a)
|
|---|
| 13 | time.sleep(1)
|
|---|