You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
842 B
30 lines
842 B
from common.fingerprints import fingerprint
|
|
|
|
from .honda.interface import CarInterface as HondaInterface
|
|
|
|
try:
|
|
from .simulator.interface import CarInterface as SimInterface
|
|
except ImportError:
|
|
SimInterface = None
|
|
|
|
try:
|
|
from .simulator2.interface import CarInterface as Sim2Interface
|
|
except ImportError:
|
|
Sim2Interface = None
|
|
|
|
interfaces = {
|
|
"HONDA CIVIC 2016 TOURING": HondaInterface,
|
|
"ACURA ILX 2016 ACURAWATCH PLUS": HondaInterface,
|
|
"HONDA ACCORD 2016 TOURING": HondaInterface,
|
|
"HONDA CR-V 2016 TOURING": HondaInterface,
|
|
|
|
"simulator": SimInterface,
|
|
"simulator2": Sim2Interface
|
|
}
|
|
|
|
def get_car(logcan, sendcan=None):
|
|
candidate, fingerprints = fingerprint(logcan)
|
|
interface_cls = interfaces[candidate]
|
|
params = interface_cls.get_params(candidate, fingerprints)
|
|
|
|
return interface_cls(params, logcan, sendcan), params
|
|
|