Adding checks for ISO OBD connections for UNABLE TO CONNECT and SEARCHING...
authorPaul Robinson <darkraver@gmail.com>
Tue, 6 Nov 2012 22:19:43 +0000 (22:19 +0000)
committerPaul Robinson <darkraver@gmail.com>
Tue, 6 Nov 2012 22:19:43 +0000 (22:19 +0000)
obd_io.py

index d444d0f..7816e45 100644 (file)
--- a/obd_io.py
+++ b/obd_io.py
@@ -183,6 +183,11 @@ class OBDPort:
                     continue
                     
                  if c == '\r' and len(buffer) > 0:
+                     if(buffer == "SEARCHING..."):
+                         buffer = ""
+                         continue
+                     if(buffer == "UNABLE TO CONNECT"):
+                         return None
                      break
                  
                  if buffer != "" or c != ">": #if something is in buffer, add everything