Merge branch 'master' of https://gitlab.com/py_ren/pyren into master
This commit is contained in:
commit
00bd189fad
86
pyren/macro/init.txt
Normal file
86
pyren/macro/init.txt
Normal file
@ -0,0 +1,86 @@
|
|||||||
|
#
|
||||||
|
#
|
||||||
|
# Initialisation macros for mod_term
|
||||||
|
#
|
||||||
|
#
|
||||||
|
|
||||||
|
$addr = 7A
|
||||||
|
$txa = 7E0
|
||||||
|
$rxa = 7E8
|
||||||
|
|
||||||
|
# reset elm
|
||||||
|
reset_elm {
|
||||||
|
at ws
|
||||||
|
$prompt = ELM
|
||||||
|
}
|
||||||
|
|
||||||
|
# general CAN init
|
||||||
|
init_can {
|
||||||
|
reset_elm #macro
|
||||||
|
at e1
|
||||||
|
at s0
|
||||||
|
at h0
|
||||||
|
at l0
|
||||||
|
at al
|
||||||
|
at caf0
|
||||||
|
at cfc0
|
||||||
|
at sh $txa
|
||||||
|
at cra $rxa
|
||||||
|
at fc sh $txa
|
||||||
|
at fc sd 30 00 00
|
||||||
|
at fc sm 1
|
||||||
|
$prompt = CAN
|
||||||
|
}
|
||||||
|
|
||||||
|
# CAN 250 init
|
||||||
|
can250 {
|
||||||
|
init_can
|
||||||
|
at st ff
|
||||||
|
at at 0
|
||||||
|
at sp 8
|
||||||
|
at at 1
|
||||||
|
$prompt = CAN250
|
||||||
|
}
|
||||||
|
|
||||||
|
# CAN 500 init
|
||||||
|
can500 {
|
||||||
|
init_can
|
||||||
|
at st ff
|
||||||
|
at at 0
|
||||||
|
at sp 6
|
||||||
|
at at 1
|
||||||
|
$prompt = CAN500
|
||||||
|
}
|
||||||
|
|
||||||
|
# general ISO init
|
||||||
|
init_iso {
|
||||||
|
reset_elm #macro
|
||||||
|
at e1
|
||||||
|
at l1
|
||||||
|
at d1
|
||||||
|
at sh 81 $addr f1
|
||||||
|
at sw 96
|
||||||
|
at wm 81 $addr f1 3E
|
||||||
|
#at wm 82 $addr f1 3E01
|
||||||
|
at ib10
|
||||||
|
at st ff
|
||||||
|
at at 0
|
||||||
|
$prompt = KL
|
||||||
|
}
|
||||||
|
|
||||||
|
# K-Line slow init
|
||||||
|
slow {
|
||||||
|
init_iso
|
||||||
|
at sp 4
|
||||||
|
at at 1
|
||||||
|
$prompt = SLOW
|
||||||
|
}
|
||||||
|
|
||||||
|
# K-Line fast init
|
||||||
|
fast {
|
||||||
|
init_iso
|
||||||
|
at sp 5
|
||||||
|
at at 1
|
||||||
|
$prompt = FAST
|
||||||
|
}
|
||||||
|
|
@ -465,7 +465,7 @@ class Port:
|
|||||||
continue
|
continue
|
||||||
self.buff += byte
|
self.buff += byte
|
||||||
tc = time.time ()
|
tc = time.time ()
|
||||||
if 'ELM' or 'STN' in self.buff:
|
if ('ELM' in self.buff) or ('STN' in self.buff):
|
||||||
break
|
break
|
||||||
if (tc - tb) > 1:
|
if (tc - tb) > 1:
|
||||||
print "ERROR - rate not supported. Let's go back."
|
print "ERROR - rate not supported. Let's go back."
|
||||||
|
@ -645,7 +645,7 @@ class ScanEcus:
|
|||||||
ttrrsp = rrsp.replace(' ','')
|
ttrrsp = rrsp.replace(' ','')
|
||||||
if not all(c in string.hexdigits for c in ttrrsp): return False
|
if not all(c in string.hexdigits for c in ttrrsp): return False
|
||||||
|
|
||||||
while base+6<=len(row) and (int(row[base+3])*3+2)<=len(rrsp):
|
while base+6<=len(row):
|
||||||
if row[base]!=req:
|
if row[base]!=req:
|
||||||
req = row[base]
|
req = row[base]
|
||||||
rrsp = self.elm.cmd(req)[3:]
|
rrsp = self.elm.cmd(req)[3:]
|
||||||
@ -655,6 +655,9 @@ class ScanEcus:
|
|||||||
|
|
||||||
if len( req )/2==3: rrsp = rrsp[3:]
|
if len( req )/2==3: rrsp = rrsp[3:]
|
||||||
|
|
||||||
|
if int(row[base+3])*3+2 > len(rrsp):
|
||||||
|
return False
|
||||||
|
|
||||||
byte = int(rrsp[int(row[base+3])*3:int(row[base+3])*3+2],16)
|
byte = int(rrsp[int(row[base+3])*3:int(row[base+3])*3+2],16)
|
||||||
mask = int(row[base+4],16)
|
mask = int(row[base+4],16)
|
||||||
val = int(row[base+5],16)
|
val = int(row[base+5],16)
|
||||||
@ -691,8 +694,8 @@ class ScanEcus:
|
|||||||
if row['stdType']=='UDS':
|
if row['stdType']=='UDS':
|
||||||
rerr = self.elm.cmd('1902AF') #get errors UDS
|
rerr = self.elm.cmd('1902AF') #get errors UDS
|
||||||
|
|
||||||
if len(row['stopDiagReq'])>0:
|
#if len(row['stopDiagReq'])>0:
|
||||||
self.elm.cmd(row['stopDiagReq']) #close session
|
# self.elm.cmd(row['stopDiagReq']) #close session
|
||||||
|
|
||||||
self.elm.cmd("at at 1") #enable adaptive timing
|
self.elm.cmd("at at 1") #enable adaptive timing
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user