summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorChris Liechti <cliechti@gmx.net>2015-08-17 03:24:34 +0200
committerChris Liechti <cliechti@gmx.net>2015-08-17 03:24:34 +0200
commitcd42db984c56b3e6321070ad15050fdb2c33c7a0 (patch)
tree88e3a091bac2ce9f567b698966cc34d2f89e3acf /examples
parent2880f0ecf58f781ca37cdbdebf481dc4d5a27f95 (diff)
downloadpyserial-git-cd42db984c56b3e6321070ad15050fdb2c33c7a0.tar.gz
rfc2217_server: use serial_for_url to allow loop:// hwgrep:// etc
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/rfc2217_server.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/examples/rfc2217_server.py b/examples/rfc2217_server.py
index a8685f4..53f11b4 100755
--- a/examples/rfc2217_server.py
+++ b/examples/rfc2217_server.py
@@ -142,8 +142,7 @@ it waits for the next connect.
logging.getLogger('rfc2217').setLevel(level)
# connect to serial port
- ser = serial.Serial()
- ser.port = args.SERIALPORT
+ ser = serial.serial_for_url(args.SERIALPORT, do_not_open=True)
ser.timeout = 3 # required so that the reader thread can exit
logging.info("RFC 2217 TCP/IP to Serial redirector - type Ctrl-C / BREAK to quit")