- fix for k-line (duster scan)
This commit is contained in:
PyRen 2018-11-25 17:52:55 +00:00
parent e75932ded3
commit b67761782f
2 changed files with 8 additions and 7 deletions

View File

@ -1826,6 +1826,7 @@ class ELM:
self.startSession = "" self.startSession = ""
self.lastCMDtime = 0 self.lastCMDtime = 0
self.lastinitrsp = "" self.lastinitrsp = ""
self.notSupportedCommands = {}
if self.lf != 0: if self.lf != 0:
tmstr = datetime.now ().strftime ("%x %H:%M:%S.%f")[:-3] tmstr = datetime.now ().strftime ("%x %H:%M:%S.%f")[:-3]
@ -1838,6 +1839,8 @@ class ELM:
def set_iso_addr(self, addr, ecu): def set_iso_addr(self, addr, ecu):
self.notSupportedCommands = {}
if self.currentprotocol == "iso" and self.currentaddress == addr and self.currentsubprotocol == ecu['protocol']: if self.currentprotocol == "iso" and self.currentaddress == addr and self.currentsubprotocol == ecu['protocol']:
return return

View File

@ -224,7 +224,7 @@ class ScanEcus:
self.elm.close_protocol() self.elm.close_protocol()
#scan KWP ecud #scan KWP ecud
if mod_globals.opt_can2: if not mod_globals.opt_can2:
self.elm.init_iso() self.elm.init_iso()
for row in sorted(self.detectedEcus, key=lambda k: int(k['idf'])): for row in sorted(self.detectedEcus, key=lambda k: int(k['idf'])):
if (row['pin']=='iso' and if (row['pin']=='iso' and
@ -702,8 +702,7 @@ class ScanEcus:
rerrPositive = "" rerrPositive = ""
if "ERROR" not in rsp and "ERROR" not in self.elm.lastinitrsp.upper(): if "ERROR" not in rsp and "ERROR" not in self.elm.lastinitrsp.upper():
self.elm.start_session(row['startDiagReq']) #open session self.elm.start_session(row['startDiagReq']) #open session
#if len(row['startDiagReq'])>0:
# self.elm.cmd(row['startDiagReq']) #open session
rrsp = self.elm.cmd(row['ids'][0]) #get identification data rrsp = self.elm.cmd(row['ids'][0]) #get identification data
self.elm.cmd("at st fa") #set timeout to 1 second self.elm.cmd("at st fa") #set timeout to 1 second
@ -795,11 +794,10 @@ class ScanEcus:
def scan_iso( self, row ): def scan_iso( self, row ):
rrsp = '' rrsp = ''
rerr = ''
rerr = '0' rerr = '0'
if self.elm.lf!=0: if self.elm.lf!=0:
self.elm.lf.write("#check: "+row['ecuname']+" Addr:"+row['dst']+" Protocol:"+row['protocol']+"\n") self.elm.lf.write("#check: "+row['ecuname']+" Addr:"+row['dst']+" Protocol:"+row['protocol']+" ids:" + row['ids'][0] + "\n")
self.elm.lf.flush() self.elm.lf.flush()
for r in self.reqres: for r in self.reqres: