Check for positive response, check for littleendian
This commit is contained in:
parent
3138414533
commit
63af3e9909
@ -65,7 +65,10 @@ def get_mnemonic( m, se, elm, raw = 0 ):
|
|||||||
hexval = hexval.replace(" ","")
|
hexval = hexval.replace(" ","")
|
||||||
|
|
||||||
if raw:
|
if raw:
|
||||||
|
if resp.startswith(m.positive):
|
||||||
return hexval
|
return hexval
|
||||||
|
else:
|
||||||
|
return 'ERROR'
|
||||||
|
|
||||||
#shift and mask
|
#shift and mask
|
||||||
val = (int(hexval,16)>>rshift)&(2**bits-1)
|
val = (int(hexval,16)>>rshift)&(2**bits-1)
|
||||||
|
@ -375,11 +375,24 @@ def run( elm, ecu, command, data ):
|
|||||||
|
|
||||||
for paramkey in params.keys():
|
for paramkey in params.keys():
|
||||||
if params[paramkey] == "Mileage":
|
if params[paramkey] == "Mileage":
|
||||||
|
mnemonics = ecu.get_ref_id(identsList[paramkey]).mnemolist[0]
|
||||||
identValue = ecu.get_id(identsList[paramkey], 1)
|
identValue = ecu.get_id(identsList[paramkey], 1)
|
||||||
params[paramkey] = "{0:0{1}X}".format(mileage,len(identValue))
|
hexval = "{0:0{1}X}".format(mileage,len(identValue))
|
||||||
|
if ecu.Mnemonics[mnemonics].littleEndian == '1':
|
||||||
|
a = hexval
|
||||||
|
b = ''
|
||||||
|
if not len(a) % 2:
|
||||||
|
for i in range(0,len(a),2):
|
||||||
|
b = a[i:i+2]+b
|
||||||
|
hexval = b
|
||||||
|
params[paramkey] = hexval
|
||||||
|
|
||||||
command, paramToSend = getValuesFromEcu(params)
|
command, paramToSend = getValuesFromEcu(params)
|
||||||
|
|
||||||
|
if "ERROR" in paramToSend:
|
||||||
|
raw_input("Data downloading went wrong. Aborting.")
|
||||||
|
return
|
||||||
|
|
||||||
clearScreen()
|
clearScreen()
|
||||||
|
|
||||||
print
|
print
|
||||||
@ -439,6 +452,10 @@ def run( elm, ecu, command, data ):
|
|||||||
|
|
||||||
command, paramToSend = getValuesFromEcu(params)
|
command, paramToSend = getValuesFromEcu(params)
|
||||||
|
|
||||||
|
if "ERROR" in paramToSend:
|
||||||
|
raw_input("Data downloading went wrong. Aborting.")
|
||||||
|
return
|
||||||
|
|
||||||
clearScreen()
|
clearScreen()
|
||||||
|
|
||||||
print
|
print
|
||||||
@ -483,6 +500,10 @@ def run( elm, ecu, command, data ):
|
|||||||
|
|
||||||
command, paramToSend = getValuesFromEcu(params)
|
command, paramToSend = getValuesFromEcu(params)
|
||||||
|
|
||||||
|
if "ERROR" in paramToSend:
|
||||||
|
raw_input("Data downloading went wrong. Aborting.")
|
||||||
|
return
|
||||||
|
|
||||||
clearScreen()
|
clearScreen()
|
||||||
|
|
||||||
print
|
print
|
||||||
|
Loading…
x
Reference in New Issue
Block a user