Merge commit 'a555f8453327b9d4b75b17acca1ffd93590159dc'
authorTamber Penketh <tamber@furryhelix.co.uk>
Wed, 6 Jun 2018 19:23:42 +0000 (20:23 +0100)
committerTamber Penketh <tamber@furryhelix.co.uk>
Wed, 6 Jun 2018 19:23:42 +0000 (20:23 +0100)
Also ignore 'file not found' in the same search.

1  2 
obd_utils.py

diff --cc obd_utils.py
@@@ -50,12 -32,13 +50,25 @@@ def scanSerial()
          s.close()   # explicit close 'cause of delayed GC in java
        except serial.SerialException:
          pass
 -        pass        
 +      except OSError, e:
 +          if e.errno == 2:
 +              pass
 +          else:
 +              raise
 +
+     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
++      except OSError, e:
++          if e.errno == 2:
++              pass
++          else:
++              raise
++
      # 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