Skip to content

Commit e31bea3

Browse files
authored
Merge pull request #927 from shrlnm/master
Fix for ELM writing timeout
2 parents 0868a18 + 642b00e commit e31bea3

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

elm.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,7 @@ def set_can_timeout(self, value):
801801
val = value // 4
802802
if val > 255:
803803
val = 255
804-
val = hex(val)[2:].upper()
804+
val = hex(val)[2:].upper().zfill(2)
805805
self.cmd("AT ST %s" % val)
806806

807807
def send_cmd(self, command):
@@ -961,8 +961,11 @@ def send_can_cfc0(self, command):
961961
Fn = len(raw_command) # Number of frames
962962

963963
if Fn > 1 or len(raw_command[0]) > 15:
964-
# set elm timeout to 300ms for first response
965-
self.send_raw('AT ST 4B')
964+
if options.cantimeout > 0:
965+
self.set_can_timeout( options.cantimeout )
966+
else:
967+
# set elm timeout to 300ms for first response
968+
self.send_raw('AT ST 4B')
966969

967970
while Fc < Fn:
968971
# enable responses

0 commit comments

Comments
 (0)