Search for negative response in single frame fix

This commit is contained in:
Marianpol 2021-04-21 21:32:21 +02:00
parent 648cbe530a
commit 65220fbf6a

View File

@ -2064,6 +2064,9 @@ class ELM:
paramToSend += dataids.keys()[lvl] paramToSend += dataids.keys()[lvl]
cmd = frameLength + '22' + paramToSend + '1' cmd = frameLength + '22' + paramToSend + '1'
resp = self.send_raw(cmd) resp = self.send_raw(cmd)
for s in resp.split('\n'):
if s.strip().startswith('037F'):
return False
else: # send multiframe command for more than 3 dataids else: # send multiframe command for more than 3 dataids
# Some modules can return NO DATA if multi frame command is sent after some no activity time # Some modules can return NO DATA if multi frame command is sent after some no activity time
# Sending anything before main command usually helps that command to be accepted # Sending anything before main command usually helps that command to be accepted
@ -2076,11 +2079,11 @@ class ELM:
paramToSend += dataids.keys()[lvl] paramToSend += dataids.keys()[lvl]
cmd = '22' + paramToSend cmd = '22' + paramToSend
resp = self.send_cmd(cmd) resp = self.send_cmd(cmd)
if not any(s in resp for s in ['?', 'NR']): if any(s in resp for s in ['?', 'NR']):
self.performanceModeLevel = level return False
return True
self.performanceModeLevel = level
return False return True
def getRefreshRate(self): def getRefreshRate(self):
refreshRate = 0 refreshRate = 0