Remove android stuff

This commit is contained in:
marios8543 2024-05-01 12:57:36 +03:00
parent e30a0cda65
commit f25ef3718d
38 changed files with 738 additions and 1945 deletions

1664
main.py

File diff suppressed because it is too large Load Diff

View File

@ -140,7 +140,7 @@ def optParser():
options = parser.parse_args()
if not options.port and mod_globals.os != 'android':
if not options.port:
parser.print_help()
iterator = sorted(list(list_ports.comports()))
print("")

View File

@ -49,28 +49,17 @@ if mod_globals.os == 'nt':
print("\n\n\n\t\t\tGive me access to the Internet for download modules\n\n\n")
sys.exit()
colorama.init()
else:
# let's try android
try:
import androidhelper as android
mod_globals.os = 'android'
except:
try:
import android
mod_globals.os = 'android'
except:
pass
if mod_globals.os != 'android':
try:
import serial
from serial.tools import list_ports
#import ply
except ImportError:
print("\n\n\n\tPleas install additional modules")
print("\t\t>sudo easy_install pyserial")
#print "\t\t>sudo easy_install ply"
sys.exit()
try:
import serial
from serial.tools import list_ports
#import ply
except ImportError:
print("\n\n\n\tPleas install additional modules")
print("\t\t>sudo easy_install pyserial")
#print "\t\t>sudo easy_install ply"
sys.exit()
class DDT_MON():
@ -346,7 +335,7 @@ def optParser():
options = parser.parse_args()
if options.outfile=='' and not options.port and mod_globals.os != 'android':
if options.outfile=='' and not options.port:
parser.print_help()
iterator = sorted(list(list_ports.comports()))
print("")

View File

@ -33,7 +33,7 @@ parser.add_argument(
options = parser.parse_args()
if not options.port and mod_globals.os != 'android':
if not options.port:
parser.print_help()
try:

View File

@ -125,21 +125,10 @@ cmdb = '''
os.chdir(os.path.dirname(os.path.realpath(sys.argv[0])))
try:
import androidhelper as android
mod_globals.os = 'android'
except:
try:
import android
mod_globals.os = 'android'
except:
pass
if mod_globals.os != 'android':
try:
import serial
from serial.tools import list_ports
except ImportError:
sys.exit()
import serial
from serial.tools import list_ports
except ImportError:
sys.exit()
from mod_elm import ELM

View File

@ -18,21 +18,10 @@ import pyren3
os.chdir(os.path.dirname(os.path.realpath(sys.argv[0])))
try:
import androidhelper as android
mod_globals.os = 'android'
except:
try:
import android
mod_globals.os = 'android'
except:
pass
if mod_globals.os != 'android':
try:
import serial
from serial.tools import list_ports
except ImportError:
sys.exit()
import serial
from serial.tools import list_ports
except ImportError:
sys.exit()
from mod_elm import ELM
from mod_scan_ecus import ScanEcus

View File

@ -12,21 +12,10 @@ import pyren3
os.chdir(os.path.dirname(os.path.realpath(sys.argv[0])))
try:
import androidhelper as android
mod_globals.os = 'android'
except:
try:
import android
mod_globals.os = 'android'
except:
pass
if mod_globals.os != 'android':
try:
import serial
from serial.tools import list_ports
except ImportError:
sys.exit()
import serial
from serial.tools import list_ports
except ImportError:
sys.exit()
from mod_elm import ELM
from mod_scan_ecus import ScanEcus
@ -148,57 +137,57 @@ def main():
print(pyren_encode(string))
tot += str(num); tot += '\n'
print()
if mod_globals.os != 'android':
print(pyren_encode('Listening to CAN. Please wait a bit...'))
elm.cmd('at z')
elm.cmd("at e1")
elm.cmd("at l1")
elm.cmd("at h1")
elm.cmd("at d1")
elm.cmd("at caf0")
elm.cmd("at sp 6")
elm.cmd("at al")
elm.portTimeout = 1
elm.cmd("at cf 5C5")
elm.cmd("at cm 7FF")
elm.cmd("at cra 5C5")
resp = elm.cmd("atma")
elm.cmd("at")
for l in resp.split('\n'):
if l.upper().startswith('5C5'):
kmt = l[9:18].replace(' ','')
tot += "%-10s : " % "Frame 5C5"
tot = tot + str(int(kmt,16)); tot += '\n'
break
elm.cmd("at cf 715")
elm.cmd("at cm 7FF")
elm.cmd("at cra 715")
elm.portTimeout = 5
resp = elm.cmd("atma")
elm.portTimeout = 1
elm.cmd("at")
for l in resp.split('\n'):
if l.upper().startswith('715'):
kmt = l[6:15].replace(' ','')
tot += "%-10s : " % "Frame 715"
tot = tot + str(int(kmt,16)); tot += '\n'
break
print(pyren_encode('Listening to CAN. Please wait a bit...'))
elm.cmd('at z')
elm.cmd("at e1")
elm.cmd("at l1")
elm.cmd("at h1")
elm.cmd("at d1")
elm.cmd("at caf0")
elm.cmd("at sp 6")
elm.cmd("at al")
elm.portTimeout = 1
elm.cmd("at cf 5FD")
elm.cmd("at cm 7FF")
elm.cmd("at cra 5FD")
elm.portTimeout = 5
resp = elm.cmd("atma")
elm.portTimeout = 1
elm.cmd("at")
for l in resp.split('\n'):
if l.upper().startswith('5FD'):
kmt = l[6:15].replace(' ','')
tot += "%-10s : " % "Frame 5FD"
tot = tot + str(int(kmt,16)); tot += '\n'
break
elm.cmd("at cf 5C5")
elm.cmd("at cm 7FF")
elm.cmd("at cra 5C5")
resp = elm.cmd("atma")
elm.cmd("at")
for l in resp.split('\n'):
if l.upper().startswith('5C5'):
kmt = l[9:18].replace(' ','')
tot += "%-10s : " % "Frame 5C5"
tot = tot + str(int(kmt,16)); tot += '\n'
break
elm.cmd("at cf 715")
elm.cmd("at cm 7FF")
elm.cmd("at cra 715")
elm.portTimeout = 5
resp = elm.cmd("atma")
elm.portTimeout = 1
elm.cmd("at")
for l in resp.split('\n'):
if l.upper().startswith('715'):
kmt = l[6:15].replace(' ','')
tot += "%-10s : " % "Frame 715"
tot = tot + str(int(kmt,16)); tot += '\n'
break
elm.cmd("at cf 5FD")
elm.cmd("at cm 7FF")
elm.cmd("at cra 5FD")
elm.portTimeout = 5
resp = elm.cmd("atma")
elm.portTimeout = 1
elm.cmd("at")
for l in resp.split('\n'):
if l.upper().startswith('5FD'):
kmt = l[6:15].replace(' ','')
tot += "%-10s : " % "Frame 5FD"
tot = tot + str(int(kmt,16)); tot += '\n'
break
#print tot
elm.lastMessage = tot

View File

@ -90,27 +90,15 @@ if mod_globals.os == 'nt':
import serial
import colorama
colorama.init()
else:
# let's try android
try:
import androidhelper as android
mod_globals.os = 'android'
except:
try:
import android
mod_globals.os = 'android'
except:
pass
if mod_globals.os != 'android':
try:
import serial
from serial.tools import list_ports
#import ply
except ImportError:
print("\n\n\n\tPleas install additional modules")
print("\t\t>sudo easy_install pyserial")
sys.exit()
try:
import serial
from serial.tools import list_ports
#import ply
except ImportError:
print("\n\n\n\tPleas install additional modules")
print("\t\t>sudo easy_install pyserial")
sys.exit()
from mod_elm import ELM
from mod_scan_ecus import ScanEcus

View File

@ -1,85 +0,0 @@
#
#
# 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
}

View File

@ -1,15 +0,0 @@
# Cornering_Inhibition ON/OFF
$addr = 27
can500 # init can macro
delay 1
# open session
session 10C0
# configuration
xor_bits 0425 4 4 80 80

View File

@ -1,15 +0,0 @@
# DRLInhibitByFlasher ON/OFF
$addr = 27
can500 # init can macro
delay 1
# open session
session 10C0
# configuration
xor_bits 0054 4 4 80 80

View File

@ -1,10 +0,0 @@
# Day running light off
$addr = 26
init_can_500 # init can macro
10C0
3BA01800
exit

View File

@ -1,9 +0,0 @@
# Car wipers manual control, not managed by rain sensor
$addr = 26
init_can_500 # init can macro
10C0
3BA01200
exit

View File

@ -1,23 +0,0 @@
#Accoustics for R2_08_v3_81
$addr = 13
init_can_500 # init can macro
delay 2
# open session
10C0
#Phone acoustic parameters
2E2B250101705AC7400401701800029402950064E0A00073C0003333030B00005AA10000000810082E2D38DD6A86000000000FFF00310004B0239C31E6E0B775239C6798E6E039961F941E0E3D36B70CD6A096531E0E76B1FF80B76A37F6CA7D3EB7412E37F6403B070461FD7F40FFFF07043B0061FD900000000000000502950000747EC3402C00CCCC0003027F8DCEFFFF000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
#Accoustic Driver
2E2B2B3E9B522F0001FFFAFDDA0164FE002C973E9B511E0001FFF4FDD302CCFC00164C00003E9B732D0001FFF4FE7803E0FE002C973E9B5B490001FFECFE1104FFFC00164C0000000040000001000000004000C0004000000040000001000000004000C0004000000040000001000000004000C0004000000040000001000000004000C00040000000400040000001000000004000C0004000400040000001000000004000C0004000400040000001000000004000C0004000400040000001000000004000C000400000002D43400000010000FFE9006FFF8021043FE8400000010000FFD200EFFF0014F63FDA40000001FFFFFFB5018EFE001C223FBE400000010044FF7D0044FF8041C23F0140000001FFE2FE1507A1F80024513DB440000001FF88FBBE0D0EF00024C900003D5B40000001FE33FB362B9EE000182B3DD740000001FEB6FC2E262BC0000EC836A140000001F0F8F1D166ABC0001F234F8C400000010BC6FC463076E000547B3FE440000001004BFFCB0122FF005FD73FE640000001FFFFFFCE03B8FE0017BE00002C4740000001000000004000C00040003FEC400000010000FFD90167FF00166C3FF5400000010000FFEC0052FF8017093DC940000001FF98FBD30BC3F0001CFF00003DB040000001FEE1FBA01F18F0001B043E1040000001FED3FC6B26CAE00013293FBE400000010044FF7D0044FF8041C23B1940000001F81BF7B36709B0000FB900000600060006000600200000000001000020000000000100002000000000010000200000000001000000000000003F00000000003F16A700000001000016A7000000010000
#Accoustic Whole car
2E2B2C3E9B522F0001FFFAFDDA0164FE002C973E9B511E0001FFF4FDD302CCFC00164C00003E9B732D0001FFF4FE7803E0FE002C973E9B5B490001FFECFE1104FFFC00164C0000000040000001000000004000C0004000000040000001000000004000C0004000000040000001000000004000C0004000000040000001000000004000C00040000000400040000001000000004000C0004000400040000001000000004000C0004000400040000001000000004000C0004000400040000001000000004000C000400000002D43400000010000FFE9006FFF8021043FE8400000010000FFD200EFFF0014F63FDA40000001FFFFFFB5018EFE001C223FBE400000010044FF7D0044FF8041C23F0140000001FFE2FE1507A1F80024513DB440000001FF88FBBE0D0EF00024C900003D5B40000001FE33FB362B9EE000182B3DD740000001FEB6FC2E262BC0000EC836A140000001F0F8F1D166ABC0001F234F8C400000010BC6FC463076E000547B3FE440000001004BFFCB0122FF005FD73FE640000001FFFFFFCE03B8FE0017BE00002C4740000001000000004000C00040003FEC400000010000FFD90167FF00166C3FF5400000010000FFEC0052FF8017093DC940000001FF98FBD30BC3F0001CFF00003DB040000001FEE1FBA01F18F0001B043E1040000001FED3FC6B26CAE00013293FBE400000010044FF7D0044FF8041C23B1940000001F81BF7B36709B0000FB900000600060006000600200000000001000020000000000100002000000000010000200000000001000000000000003F00000000003F16A700000001000016A7000000010000
#Radio reception
2E2B2D00011E1422241A14280D0A081F0F020206020408300301010001001430121220121400800100640A050F011402080A043C0F0F140F321E3250050F0009120A8CE10A5A5A0384300101063C961401C80000050000000100000000
exit

View File

@ -1,81 +0,0 @@
# QR25 Idle speed correction
$addr = 7A
init_can_500 # init can macro
# check ECU
exit_if_not 83 26 8 FF 44
exit_if_not 83 26 17 FF 43
:checkeng
goto_if 1201 5 4 FFFF 0000 runeng
goto engisrun
:runeng
cls
#
# Run ENGINE
#
if_key q end
wait 1
goto checkeng
:engisrun
cls
var lastResponse = $lastResponse
#
# Idle Speed
#
value 1201 5 4 FFFF 25 0 2
#
# ECU is running
#
# Select correction
#
# Press:
# 0 reset
# 1 +25
# 2 +50
# 3 +75
# 4 +100
#
# q for Exit
#
if_key 0 key0
if_key 1 key1
if_key 2 key2
if_key 3 key3
if_key 4 key4
if_key q end
wait 1
goto engisrun
:key0
3B0200
goto engisrun
:key1
3B0202
goto engisrun
:key2
3B0204
goto engisrun
:key3
3B0206
goto engisrun
:key4
3B0208
goto engisrun
:end
exit

View File

@ -1,18 +0,0 @@
# Repair script for rlink2 black screen
$addr = 13
init_can_500 # init can macro
1003
# check if it is rlink2
exit_if_not F18A 6 4 FFFFFF 434150
# HIGH 1 768x1024
2E2303032802131303003C000004500014001E001E040011C5002C006967
wait 2
# reload rlink2
1101
exit

View File

@ -1,18 +0,0 @@
# Repair script for rlink2 black screen
$addr = 13
init_can_500 # init can macro
1003
# check if it is rlink2
exit_if_not F18A 6 4 FFFFFF 434150
# HIGH 2 768x1024
2E2303032802131303003C000004500014001E001E040014E8002C006967
wait 2
# reload rlink2
1101
exit

View File

@ -1,18 +0,0 @@
# Repair script for rlink2 black screen
$addr = 13
init_can_500 # init can macro
1003
# check if it is rlink2
exit_if_not F18A 6 4 FFFFFF 434150
# MID 1 480x800
2E230301F404080801E03C0000039D000A0005006E03200AD7022C006967
wait 2
# reload rlink2
1101
exit

View File

@ -1,18 +0,0 @@
# Repair script for rlink2 black screen
$addr = 13
init_can_500 # init can macro
1003
# check if it is rlink2
exit_if_not F18A 6 4 FFFFFF 434150
# MID 2 480x800
2E2303020D02082301E03C000004200080000A007603200D05062C006967
wait 2
# reload rlink2
1101
exit

View File

@ -1,18 +0,0 @@
# Enable AndroidAuto and CarPlay on R-Link2
$addr = 13
init_can_500 # init can macro
1003
# check if it is rlink2
exit_if_not F18A 6 4 FFFFFF 434150
set_bits 2130 10 5 60 60
wait 2
# reload rlink2
1101
exit

View File

@ -1,17 +0,0 @@
# Rotate R-Link2 screen
$addr = 13
init_can_500 # init can macro
1003
exit_if_not F18A 6 4 FFFFFF 434150
xor_bits 2130 10 4 10 10
wait 2
# reload rlink2
1101
exit

View File

@ -1,19 +0,0 @@
# Phone_acoustic and SPVR for RadNav 3.3 and 7.0
$addr = 13
init_can_500 # init can macro
delay 2
1003
# SPVR
2E213105B8000122030000000000000002000000000000000042534420535345204261736963205369676E616C70726F63657373696E672044617461204352433A3058393931363830373720000000000000000000000000000000000200000000000A0D0A10000000000000000C0000000B0000000100000001000000010000000000000000000000D00000001E100D0A5353455F4D41494E5F436F6E66696700380000000606060606030403030303030303030303030304030303030403030303030303030303030303030303030303030306060303030603030303FB01000100401F8000000001000000000000000200000002000000020000000200000001000000000000000100000000000000010000000100000001000000030000000000000001000000010000000100000003000000000000000100000001000000000000000200000001000000010000000100000001000000020000000000000001000000000000000100000001000000020000000200000000000000010000000100000002000000010000000100A00F010000000100000000000000000001000000010000000100000002000000000A0D0AC5010000000A0D0A0F00000000000000040000000B000000010000000100000001000000000000000000000018000000030F0D0A5353455F4147435F436F6E666967000C000000050505050505050505050505480000A8FD00001CF39001E8032003E80374FF74FFC800C800000A0D0AB4090000000A0D0A1300000000000000010000000B00000001000000010000000100000000000000000000000C00000062100D0A5353455F414E414C5F4D6963436F6E66696700040000000505030314792879280000000000000000000A0D0A42010000000A0D0A1300000000000000010000000B00000001000000010000000100000000000000000000000C00000066100D0A5353455F414E414C5F526566436F6E66696700040000000505030314007D007D00000000FA000000000A0D0AF4010000000A0D0A0E000000000000000E0000000B000000010000000100000001000000000000000000000008000000D10E0D0A5353455F4E525F436F6E6669670004000000050505051818FC0000112B73FF000A0D0AC2020000000A0D0A1000000000000000010000000B00000001000000010000000100000000000000000000001E000000900F0D0A5353455F4E525F4E66436F6E666967000F0000000505050505050505050505050505055A18FCF4011405D4FE00000000000001000000000064000000881C16FD30F8000A0D0A38070000000A0D0A1500000000000000000000000200000001000000010000001C000000000000000000000070000000DA110D0A5353455F524543565F46696C746572466C6F617400000000400000D0410000A040D36A783F378EECBFF3C6613F861BECBF6A175B3FAB78833F7A53E1BF11AA683F7A53E1BF899B6F3F48C37D3F0343C6BF77DC6C3F0343C6BFBE9F6A3FE4DA843F4A43CDBE1843393F4A43CDBE23F9423FF6EE8B3F4017DD3E50195F3EDECB053F1591613E000A0D0A22310000000A0D0A1300000000000000040000000B00000001000000010000000100000000000000000000001800000037100D0A5353455F524543565F414743436F6E666967000C0000000505050505050505050505054800000000000000005802E8032003E80374FF74FFC800C800000A0D0AC9060000000A0D0A1100000000000000020000000B000000010000000100000001000000000000000000000018000000CE0F0D0A5353455F53594E54485F436F6E6669670007000000030303030305052001000000FF7F00000100000064000000F2060000A00FD007000A0D0A62040000000A0D0A1200000000000000000000000500000001000000010000000F00000000000000000000001E00000014100D0A5353455F53594E54485F45514E6F646573002800FA001AFC5E01C8006400F401C80018FC1C02C8002C01C4095802F001000A0D0ABF090000999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
# Phone acoustic
2E211806F6000122030000000000000002000000000000000042534420535345204261736963205369676E616C70726F63657373696E672044617461204352433A3058464245463842463020000000000000000000000000000000000200000000000A0D0A10000000000000000C0000000B0000000100000001000000010000000000000000000000D00000001E100D0A5353455F4D41494E5F436F6E66696700380000000606060606030403030303030303030303030304030303030403030303030303030303030303030303030303030306060303030603030303FB01000100401F8000000001000000000000000200000002000000020000000200000002000000000000000200000000000000010000000100000001000000030000000000000001000000010000000100000003000000000000000100000001000000000000000200000001000000020000000100000001000000020000000000000001000000000000000100000001000000020000000200000000000000010000000100000002000000010000000100A00F010000000100000000000000000001000000010000000100000002000000000A0D0AC8010000000A0D0A0F00000000000000060000000B0000000100000001000000010000000000000000000000A20000008D0F0D0A5353455F4145435F436F6E66696700500000000505050505050505050505050505050505050505050505050505050505050505050505050305050505050505050505050505050505050505050505050505050505050505050505050505050505050505DE44000100BA03A6FD56FF30FF56FF62FF30FF82FF2B01B8FF930BCAFF2B0162FF0E07D00730FF30FF3EFF3EFF4DFF55029600B0FF2C014C1D2E01D10FE803E80300F430F8A1FF43D05A0000000E07D0075A02E80203F10600B4045A02B404D007B404E803D0075A02B4045A02B40445FDCD00CDFCCD00CD049AFFBC0244FD2AFF660006EEC0F1C0E030F890E817F835FF1A030000BA03D4FE64002E01D10F00003A00000A0D0A45450000000A0D0A0F00000000000000040000000B000000010000000100000001000000000000000000000018000000030F0D0A5353455F4147435F436F6E666967000C000000050505050505050505050505480000A8FD00008CF19001E8032003E80374FF74FFC800C800000A0D0A220A0000000A0D0A1300000000000000010000000B00000001000000010000000100000000000000000000000C00000062100D0A5353455F414E414C5F4D6963436F6E66696700040000000505030314792879280000000000000000000A0D0A42010000000A0D0A1300000000000000010000000B00000001000000010000000100000000000000000000000C00000066100D0A5353455F414E414C5F526566436F6E66696700040000000505030314007D007D74000000FA000000000A0D0A68020000000A0D0A0E000000000000000E0000000B000000010000000100000001000000000000000000000008000000D10E0D0A5353455F4E525F436F6E6669670004000000050505051850FB0000112B73FF000A0D0AF9020000000A0D0A1000000000000000010000000B00000001000000010000000100000000000000000000001E000000900F0D0A5353455F4E525F4E66436F6E666967000F0000000505050505050505050505050505055A50FBF4011405000000000000000001000000000064000000881C16FD30F8000A0D0A9D050000000A0D0A1500000000000000000000000200000001000000010000001C000000000000000000000070000000DA110D0A5353455F524543565F46696C746572466C6F617400000000400000D0410000A04071916F3F6C78B2BF1BBD0E3F02B7AEBF5FD1053FFCFB903FB56CDDBF6153433FB56CDDBF8C4B653F2F8B8D3F349DC5BFB01E473F349DC5BF0D35623F779D613F37AA3FBF986B393F37AA3FBFFF081B3FF12EC73FA66429BF444FA23EAA25223D72F92F3E000A0D0A2B2F0000000A0D0A1300000000000000040000000B00000001000000010000000100000000000000000000001800000037100D0A5353455F524543565F414743436F6E666967000C000000050505050505050505050505485802A8FD000000005802E8032003E80374FF74FFC800C800000A0D0AC8080000000A0D0A1100000000000000020000000B000000010000000100000001000000000000000000000018000000CE0F0D0A5353455F53594E54485F436F6E6669670007000000030303030305052001000000FF7F00000100000064000000F2060000A00FD007000A0D0A62040000000A0D0A1200000000000000000000000500000001000000010000000F00000000000000000000001E00000014100D0A5353455F53594E54485F45514E6F646573002800FA0018FC5E01C8006600F401C80018FC1C02C8002D01C4095802F801000A0D0AC8090000999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
# reload rlink2
1101
exit

File diff suppressed because one or more lines are too long

View File

@ -1,7 +0,0 @@
# terminal
$addr = 7A
init_can_500 # init can macro
session 10C0

View File

@ -11,21 +11,14 @@ db_dir_list = [
".",
".."
]
android_dir_list = [
"/mnt/sdcard/pyren"
]
def find_DBs():
global db_dir_list
global android_dir_list
clip_found = False
ddt_found = False
if mod_globals.os == 'android':
db_dir_list = db_dir_list + android_dir_list
for clip_dir in db_dir_list:
if os.path.exists(os.path.join(clip_dir, 'Vehicles')) and \
os.path.exists(os.path.join(clip_dir, 'Location')) and \
@ -42,13 +35,6 @@ def find_DBs():
clip_found = True
break
if mod_globals.os == 'android':
if not clip_found:
print("ERROR: CLIP DB not found")
exit()
else:
return
for ddt_dir in db_dir_list:
if os.path.exists(os.path.join(ddt_dir, 'DDT2000data', 'ecus')):
mod_globals.ddt_arc = ""
@ -71,8 +57,7 @@ def find_DBs():
print('CLIP DB :',mod_globals.cliproot)
if ddt_found:
print('DDT DB :',mod_globals.ddtroot)
if mod_globals.os != 'android':
mod_globals.opt_ddt = True
mod_globals.opt_ddt = True
#check cache version
verfilename = "./cache/version3.txt"
@ -144,8 +129,7 @@ def get_file_from_clip( filename ):
else:
mode = 'r'
if (mod_globals.os == 'android'
or mod_globals.clip_arc != ''):
if mod_globals.clip_arc != '':
mode = 'r'
if mod_globals.clip_arc=='':

View File

@ -56,29 +56,14 @@ if mod_globals.os == 'nt':
except ImportError:
pip.main(['install', 'pyserial'])
else:
# let's try android
try:
import androidhelper as android
mod_globals.os = 'android'
except:
try:
import android
mod_globals.os = 'android'
except:
pass
if mod_globals.os != 'android':
try:
import serial
from serial.tools import list_ports
# import ply
except ImportError:
print("\n\n\n\tPleas install additional modules")
print("\t\t>sudo easy_install pyserial")
sys.exit()
try:
import serial
from serial.tools import list_ports
# import ply
except ImportError:
print("\n\n\n\tPleas install additional modules")
print("\t\t>sudo easy_install pyserial")
sys.exit()
from mod_elm import ELM
from mod_optfile import *
@ -247,7 +232,7 @@ def optParser():
options = parser.parse_args()
if not options.port and mod_globals.os != 'android':
if not options.port:
parser.print_help()
iterator = sorted(list(list_ports.comports()))
print("")

View File

@ -27,16 +27,15 @@ from mod_elm import AllowedList
os.chdir(os.path.dirname(os.path.realpath(sys.argv[0])))
import mod_globals
if mod_globals.os != 'android':
import mod_ddt_screen
try:
# Python2
import tkinter as tk
import tkinter.ttk
except ImportError:
# Python3
import tkinter as tk
import tkinter.ttk as ttk
import mod_ddt_screen
try:
# Python2
import tkinter as tk
import tkinter.ttk
except ImportError:
# Python3
import tkinter as tk
import tkinter.ttk as ttk
eculist = None

View File

@ -8,8 +8,7 @@ import mod_db_manager
from operator import itemgetter
from copy import deepcopy
if mod_globals.os != 'android':
import serial
import serial
try:
import pickle as pickle

View File

@ -1289,4 +1289,4 @@ def find_real_ecuid( eid ):
eid = eid.upper().replace('FG','')
eid = eid.upper().replace('.XML','')
return eid, fastinit, slowinit, protocol, candst, startDiagReq
return eid, fastinit, slowinit, protocol, candst, startDiagReq

View File

@ -112,10 +112,7 @@ def get_default_std_a( df, mn, se, elm, calc, getDTCmnemo ):
interpretation = ''
description = df[dtc].label
if mod_globals.os=='android':
defstr = "%-6s(DTC%-6s) %-41s %-6s %-10s"%(df[dtc].agcdRef,dtc+status,description,interpretation,isAlive)
else:
defstr = "%-6s(DTC%-6s) %-50s %-6s %-10s"%(df[dtc].agcdRef,dtc+status,description,interpretation,isAlive)
defstr = "%-6s(DTC%-6s) %-50s %-6s %-10s"%(df[dtc].agcdRef,dtc+status,description,interpretation,isAlive)
hlpstr = ''
if len(df[dtc].helps):
@ -225,10 +222,7 @@ def get_default_std_b( df, mn, se, elm, calc, getDTCmnemo ):
description = df[dtc].label
if mod_globals.os=='android':
defstr = "DTC%-6s (%s) %-41s %-6s %-10s"%(dtc+dtcType,df[dtc].agcdRef,description,interpretation,isAlive)
else:
defstr = "DTC%-6s (%s) %-50s %-6s %-10s"%(dtc+dtcType,df[dtc].agcdRef,description,interpretation,isAlive)
defstr = "DTC%-6s (%s) %-50s %-6s %-10s"%(dtc+dtcType,df[dtc].agcdRef,description,interpretation,isAlive)
stBitsDef = ['warningIndicatorRequested',
'testNotCompletedThisOperationCycle',
@ -333,10 +327,7 @@ def get_default_failflag( df, mn, se, elm, calc ):
interpretation = ""
description = df[dtc].label
if mod_globals.os=='android':
defstr = "%-6s %-41s %-6s %-10s"%(df[dtc].agcdRef,description,interpretation,isAlive)
else:
defstr = "%-6s %-50s %-6s %-10s"%(df[dtc].agcdRef,description,interpretation,isAlive)
defstr = "%-6s %-50s %-6s %-10s"%(df[dtc].agcdRef,description,interpretation,isAlive)
hlpstr = ''
if len(df[dtc].helps):

View File

@ -20,10 +20,7 @@ def get_identification( id, mn, se, elm, calc, raw = False ):
if id.type=='CSTRING' and type(id.value) is str:
id.value = id.value #.decode('ascii', 'ignore')
######
if mod_globals.os=='android':
return "%-6s %-40s %-20s"%(id.codeMR,id.label,id.value), id.helps, id.value
else:
return "%-6s %-50s %-20s"%(id.codeMR,id.label,id.value), id.helps, id.value
return "%-6s %-50s %-20s"%(id.codeMR,id.label,id.value), id.helps, id.value
class ecu_identification:

View File

@ -42,10 +42,7 @@ def get_parameter( pr, mn, se, elm, calc, dataids = {} ):
tmpmin = ''
tmpmax = ''
if mod_globals.os=='android':
return "%-6s %-41s %8s %-5s"%(pr.codeMR,pr.label,pr.value,pr.unit), pr.helps, csv_data
else:
return "%-6s %-50s %5s %10s %-10s %-5s"%(pr.codeMR,pr.label,tmpmin,pr.value,pr.unit,tmpmax), pr.helps, csv_data
return "%-6s %-50s %5s %10s %-10s %-5s"%(pr.codeMR,pr.label,tmpmin,pr.value,pr.unit,tmpmax), pr.helps, csv_data
class ecu_parameter:

View File

@ -28,12 +28,8 @@ def get_state( st, mn, se, elm, calc, dataids = {} ):
else:
csv_val = str(st.value)
if mod_globals.os=='android':
st.value = " "*(8-len(st.value)//2) + str(st.value)
return "%-6s %-41s %-16s"%(st.codeMR,st.label,st.value), st.helps, csv_val
else:
st.value = " "*(16-len(st.value)//2) + str(st.value)
return "%-6s %-50s %-20s"%(st.codeMR,st.label,st.value), st.helps, csv_val
st.value = " "*(16-len(st.value)//2) + str(st.value)
return "%-6s %-50s %-20s"%(st.codeMR,st.label,st.value), st.helps, csv_val
class ecu_state:

View File

@ -14,21 +14,8 @@ import socket
from datetime import datetime
from collections import OrderedDict
try:
import androidhelper as android
mod_globals.os = 'android'
except:
try:
import android
mod_globals.os = 'android'
except:
pass
if mod_globals.os != 'android':
import serial # sudo easy_install pyserial
from serial.tools import list_ports
import serial # sudo easy_install pyserial
from serial.tools import list_ports
# List of commands which may require to open another Developer session (option --dev)
DevList = ['27', '28', '2E', '30', '31', '32', '34', '35', '36', '37', '3B', '3D']
@ -176,7 +163,7 @@ class Port:
upPortName = upPortName.replace(':','').replace('.','')
MAC = ':'.join (a + b for a, b in zip (upPortName[::2], upPortName[1::2]))
if mod_globals.os != 'android' and MAC:
if MAC:
try:
self.macaddr = portName
self.channel = 1
@ -203,30 +190,6 @@ class Port:
print(" \n\nERROR: Can't connect to WiFi ELM\n\n")
mod_globals.opt_demo = True
sys.exit()
elif mod_globals.os == 'android' and ( portName == 'bt' or MAC != None ):
self.portType = 2
self.droid = android.Android ()
if self.droid:
print('SL4A loaded')
print( 'BT is enabled:', self.droid.toggleBluetoothState (True).result)
print( 'BT discovery canceled:', self.droid.bluetoothDiscoveryCancel().result)
retry = 0
while 1:
time.sleep(1)
retry = retry + 1
try:
if MAC == None:
self.btcid = self.droid.bluetoothConnect ('00001101-0000-1000-8000-00805F9B34FB').result
else:
self.btcid = self.droid.bluetoothConnect (uuid='00001101-0000-1000-8000-00805F9B34FB', address=MAC).result
except:
pass
print( 'Try ',retry, ":", self.btcid )
if self.btcid != None and len(self.btcid) > 10: #uuid length greater then 10
break
if retry > 5:
print( " \n\nERROR: Can't connect to BT adapter" )
exit()
else:
self.portName = portName
self.portType = 0

View File

@ -274,49 +274,29 @@ class ScanEcus:
listecu = []
if mod_globals.os == 'android':
if mod_globals.opt_scan:
print(pyren_encode( "\n %-40s %s" % ("Name","Warn") ))
else:
print(pyren_encode( "\n %-40s %s" % ("Name","Type") ))
for row in self.detectedEcus:
if families[row['idf']] in list(mod_globals.language_dict.keys()):
fmlyn = mod_globals.language_dict[families[row['idf']]]
if mod_globals.opt_scan:
line = "%-40s %s" % (fmlyn,row['rerr'])
else:
line = "%-40s %s" % (fmlyn,row['stdType'])
else:
if mod_globals.opt_scan:
line = "%-40s %s" % (row['doc'].strip(),row['rerr'])
else:
line = "%-40s %s" % (row['doc'].strip(),row['stdType'])
listecu.append( line )
if mod_globals.opt_scan:
print(pyren_encode( "\n %-7s %-6s %-5s %-40s %s" % ("Addr","Family","Index","Name","Warn") ))
else:
if mod_globals.opt_scan:
print(pyren_encode( "\n %-7s %-6s %-5s %-40s %s" % ("Addr","Family","Index","Name","Warn") ))
else:
print(pyren_encode( "\n %-7s %-6s %-5s %-40s %s" % ("Addr","Family","Index","Name","Type") ))
for row in self.detectedEcus:
if 'idf' not in list(row.keys()):
row['idf'] = ''
if row['dst'] not in list(m_elm.dnat.keys()):
m_elm.dnat[row['dst']] = '000'
m_elm.snat[row['dst']] = '000'
if row['idf'] in list(families.keys()) and families[row['idf']] in list(mod_globals.language_dict.keys()):
fmlyn = mod_globals.language_dict[families[row['idf']]]
if mod_globals.opt_scan:
line = "%-2s(%3s) %-6s %-5s %-40s %s" % (row['dst'], m_elm.dnat[row['dst']], row['idf'],row['ecuname'],fmlyn,row['rerr'])
else:
line = "%-2s(%3s) %-6s %-5s %-40s %s" % (row['dst'], m_elm.dnat[row['dst']], row['idf'],row['ecuname'],fmlyn,row['stdType'])
print(pyren_encode( "\n %-7s %-6s %-5s %-40s %s" % ("Addr","Family","Index","Name","Type") ))
for row in self.detectedEcus:
if 'idf' not in list(row.keys()):
row['idf'] = ''
if row['dst'] not in list(m_elm.dnat.keys()):
m_elm.dnat[row['dst']] = '000'
m_elm.snat[row['dst']] = '000'
if row['idf'] in list(families.keys()) and families[row['idf']] in list(mod_globals.language_dict.keys()):
fmlyn = mod_globals.language_dict[families[row['idf']]]
if mod_globals.opt_scan:
line = "%-2s(%3s) %-6s %-5s %-40s %s" % (row['dst'], m_elm.dnat[row['dst']], row['idf'],row['ecuname'],fmlyn,row['rerr'])
else:
if mod_globals.opt_scan:
line = "%-2s(%3s) %-6s %-5s %-40s %s" % (row['dst'], m_elm.dnat[row['dst']], row['idf'],row['ecuname'],row['doc'].strip(),row['rerr'])
else:
line = "%-2s(%3s) %-6s %-5s %-40s %s" % (row['dst'], m_elm.dnat[row['dst']], row['idf'],row['ecuname'],row['doc'].strip(),row['stdType'])
listecu.append( line )
line = "%-2s(%3s) %-6s %-5s %-40s %s" % (row['dst'], m_elm.dnat[row['dst']], row['idf'],row['ecuname'],fmlyn,row['stdType'])
else:
if mod_globals.opt_scan:
line = "%-2s(%3s) %-6s %-5s %-40s %s" % (row['dst'], m_elm.dnat[row['dst']], row['idf'],row['ecuname'],row['doc'].strip(),row['rerr'])
else:
line = "%-2s(%3s) %-6s %-5s %-40s %s" % (row['dst'], m_elm.dnat[row['dst']], row['idf'],row['ecuname'],row['doc'].strip(),row['stdType'])
listecu.append( line )
listecu.append( "Rescan errors" )
listecu.append( "<Exit>" )

View File

@ -45,28 +45,14 @@ if mod_globals.os == 'nt':
print("\n\n\n\t\t\tGive me access to the Internet for download modules\n\n\n")
sys.exit()
colorama.init()
else:
# let's try android
try:
import androidhelper as android
mod_globals.os = 'android'
except:
try:
import android
mod_globals.os = 'android'
except:
pass
if mod_globals.os != 'android':
try:
import serial
from serial.tools import list_ports
except ImportError:
print("\n\n\n\tPleas install additional modules")
print("\t\t>sudo easy_install pyserial")
sys.exit()
try:
import serial
from serial.tools import list_ports
except ImportError:
print("\n\n\n\tPleas install additional modules")
print("\t\t>sudo easy_install pyserial")
sys.exit()
def init_macro():
global macro
@ -260,7 +246,7 @@ def optParser():
options = parser.parse_args()
if not options.port and mod_globals.os != 'android':
if not options.port:
parser.print_help()
iterator = sorted(list(list_ports.comports()))
print("")
@ -285,73 +271,6 @@ def optParser():
debug_mode = options.dbg
class FileChooser():
lay = '''<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<RelativeLayout
android:id="@+id/launcher"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/tx_folder"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginTop="20dp"
android:text="Folder"/>
<Spinner
android:id="@+id/sp_folder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/tx_folder"/>
<TextView
android:id="@+id/tx_macro"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginTop="20dp"
android:layout_below="@+id/sp_folder"
android:text="Macro" />
<Spinner
android:id="@+id/sp_macro"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/tx_macro"/>
<Button
android:id="@+id/bt_exit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginTop="50dp"
android:layout_below="@id/sp_macro"
android:text="Exit" />
<Button
android:id="@+id/bt_start"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="50dp"
android:layout_marginLeft="100dp"
android:layout_below="@id/sp_macro"
android:layout_toRightOf="@id/bt_exit"
android:text="Start" />
</RelativeLayout>
</ScrollView>
</RelativeLayout>'''
droid = None
folderList = []
macroList = []
@ -385,48 +304,27 @@ class FileChooser():
def choose(self):
try:
import androidhelper as android
mod_globals.os = 'android'
except:
try:
import android
mod_globals.os = 'android'
except:
pass
# Python2
import tkinter as tk
import tkinter.ttk
import tkinter.filedialog as filedialog
except ImportError:
# Python3
import tkinter as tk
import tkinter.ttk as ttk
import tkinter.filedialog as filedialog
if mod_globals.os != 'android':
try:
# Python2
import tkinter as tk
import tkinter.ttk
import tkinter.filedialog as filedialog
except ImportError:
# Python3
import tkinter as tk
import tkinter.ttk as ttk
import tkinter.filedialog as filedialog
root = tk.Tk()
root.withdraw()
root = tk.Tk()
root.withdraw()
my_filetypes = [('command files', '.cmd')]
my_filetypes = [('command files', '.cmd')]
fname = filedialog.askopenfilename(parent=root,
initialdir="./macro",
title="Please select a file:",
filetypes=my_filetypes)
fname = filedialog.askopenfilename(parent=root,
initialdir="./macro",
title="Please select a file:",
filetypes=my_filetypes)
return fname
else:
try:
self.droid = android.Android()
self.droid.fullShow(self.lay)
self.folderList.insert(0,'./macro/')
self.droid.fullSetList("sp_folder", self.folderList)
return self.eventloop()
finally:
self.droid.fullDismiss()
return fname
def play_macro(mname, elm):
global macro

View File

@ -266,10 +266,7 @@ def pyren_decode( inp ):
# return inp.decode(sys.stdout.encoding, errors='replace')
def pyren_decode_i( inp ):
if mod_globals.os == 'android':
return inp.decode('utf-8', errors='ignore')
else:
return inp.decode(sys.stdout.encoding, errors='ignore')
return inp.decode(sys.stdout.encoding, errors='ignore')
def clearScreen():
# https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences

View File

@ -28,28 +28,17 @@ if mod_globals.os == 'nt':
print("\n\n\n\t\t\tGive me access to the Internet for download modules\n\n\n")
sys.exit()
colorama.init()
else:
# let's try android
try:
import androidhelper as android
mod_globals.os = 'android'
except:
try:
import android
mod_globals.os = 'android'
except:
pass
if mod_globals.os != 'android':
try:
import serial
from serial.tools import list_ports
#import ply
except ImportError:
print("\n\n\n\tPleas install additional modules")
print("\t\t>sudo easy_install pyserial")
#print "\t\t>sudo easy_install ply"
sys.exit()
try:
import serial
from serial.tools import list_ports
#import ply
except ImportError:
print("\n\n\n\tPleas install additional modules")
print("\t\t>sudo easy_install pyserial")
#print "\t\t>sudo easy_install ply"
sys.exit()
import mod_utils
import mod_ddt_utils
@ -222,7 +211,7 @@ def optParser():
options = parser.parse_args()
if not options.port and mod_globals.os != 'android':
if not options.port:
parser.print_help()
iterator = sorted(list(list_ports.comports()))
print("")