From a555f8453327b9d4b75b17acca1ffd93590159dc Mon Sep 17 00:00:00 2001 From: Nico Wollenzin Date: Sat, 21 Dec 2013 23:49:14 +0100 Subject: [PATCH] added rfcomm capabilities added Bluetooth serial connections via rfcomm --- obd_utils.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/obd_utils.py b/obd_utils.py index 6452c7e7..272f72fa 100644 --- a/obd_utils.py +++ b/obd_utils.py @@ -32,7 +32,13 @@ def scanSerial(): s.close() # explicit close 'cause of delayed GC in java except serial.SerialException: pass - + for i in range(256): + try: #scan Bluetooth rfcomm bindings + s = serial.Serial("/dev/rfcomm"+str(i)) + available.append(s.portstr) + s.close() # explicit close 'cause of delayed GC in java + except serial.SerialException: + pass # ELM-USB shows up as /dev/tty.usbmodemXXXX, where XXXX is a changing hex string # on connection; so we have to search through all 64K options if len(platform.mac_ver()[0])!=0: #search only on MAC