From 11436707406fb13c276455d27753cc520059cbf2 Mon Sep 17 00:00:00 2001 From: Marianpol Date: Fri, 11 Sep 2020 16:59:51 +0200 Subject: [PATCH] Missing import + missing snapshot data fix --- pyren/mod_ecu.py | 5 +++-- pyren/mod_ecu_mnemonic.py | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pyren/mod_ecu.py b/pyren/mod_ecu.py index 7f2bbe8..9431dc4 100755 --- a/pyren/mod_ecu.py +++ b/pyren/mod_ecu.py @@ -32,6 +32,7 @@ import sys import os import time import gc +import re os.chdir(os.path.dirname(os.path.realpath(sys.argv[0]))) @@ -536,7 +537,7 @@ class ECU: kb.set_getch_term() else: if mod_globals.opt_csv and (c in mod_globals.opt_usrkey): - csvline += ";" + c + csvline += ";" + pyren_encode(c) continue kb.set_normal_term() if mod_globals.opt_csv and csvf!=0: @@ -563,7 +564,7 @@ class ECU: clearScreen() continue if mod_globals.opt_csv and (c in mod_globals.opt_usrkey): - csvline += ";" + c + csvline += ";" + pyren_encode(c) continue kb.set_normal_term() if mod_globals.opt_csv and csvf!=0: diff --git a/pyren/mod_ecu_mnemonic.py b/pyren/mod_ecu_mnemonic.py index 438293d..d1c0b30 100755 --- a/pyren/mod_ecu_mnemonic.py +++ b/pyren/mod_ecu_mnemonic.py @@ -98,6 +98,9 @@ def get_SnapShotMnemonic(m, se, elm, dataids): dataId = did startByte = dataids[dataId].mnemolocations[m.name].startByte startBit = dataids[dataId].mnemolocations[m.name].startBit + + if dataId not in didDict: + didDict[dataId] = '0' * (int(dataids[dataId].dataBitLength)/8) hexval = getHexVal(m, startByte, startBit, didDict[dataId]) return hexval