Skip to content

Commit

Permalink
Merge branch 'release/0.1.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
Daisuke Baba committed Jul 21, 2016
2 parents 252321a + 2c9e504 commit 7f58159
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ $ ./setup.py test

# Revision history

* 0.1.1
* 0.1.1-0.1.2
- Fix resolve_modem_port()

* 0.1.0
Expand Down
25 changes: 12 additions & 13 deletions lib/candy_board_amt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,19 +123,18 @@ def close(self):
def resolve_modem_port():
if platform.system() != 'Linux':
return None
for p in glob.glob("/dev/tty*"):
port = SerialPort(p, 115200)
port.write("AT\r")
time.sleep(0.1)
ret = port.read_line() # echo back
if ret is None:
port.close()
continue
port.read_line() # empty
port.read_line() # empty
ret = port.read_line()
if ret == "OK":
return p
for t in ['/dev/ttyUSB*', '/dev/ttyACM*', '/dev/ttyAMA*']:
for p in glob.glob(t):
port = SerialPort(p, 115200)
port.write("AT\r")
time.sleep(0.1)
ret = port.read_line()
if ret is None:
port.close()
continue
ret = port.read_line()
if ret == "OK":
return p
return None

class SockServer(threading.Thread):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand

version = "0.1.1"
version = "0.1.2"

class PyTest(TestCommand):
def finalize_options(self):
Expand Down

0 comments on commit 7f58159

Please sign in to comment.