mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-06-27 08:52:05 +08:00
VW MQB: Fixes for network location detection (#22174)
* VW MQB: Fixes for network location detection * apply review suggestion Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com> * FP back to 100ms; VIN state poll at 50Hz Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
This commit is contained in:
@@ -61,7 +61,7 @@ void safety_setter_thread(Panda *panda) {
|
||||
LOGW("got CarVin %s", value_vin.c_str());
|
||||
break;
|
||||
}
|
||||
util::sleep_for(100);
|
||||
util::sleep_for(20);
|
||||
}
|
||||
|
||||
// VIN query done, stop listening to OBDII
|
||||
@@ -170,7 +170,7 @@ static Panda *usb_retry_connect() {
|
||||
LOGW("connected to board");
|
||||
return panda;
|
||||
}
|
||||
util::sleep_for(100);
|
||||
util::sleep_for(100);
|
||||
};
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -30,18 +30,18 @@ class CarInterface(CarInterfaceBase):
|
||||
if True: # pylint: disable=using-constant-test
|
||||
# Set global MQB parameters
|
||||
ret.safetyModel = car.CarParams.SafetyModel.volkswagen
|
||||
ret.enableBsm = 0x30F in fingerprint[0]
|
||||
ret.enableBsm = 0x30F in fingerprint[0] # SWA_01
|
||||
|
||||
if 0xAD in fingerprint[0]: # Getriebe_11
|
||||
ret.transmissionType = TransmissionType.automatic
|
||||
elif 0x187 in fingerprint[0]: # EV_Gearshift
|
||||
ret.transmissionType = TransmissionType.direct
|
||||
else: # No trans message at all, must be a true stick-shift manual
|
||||
else:
|
||||
ret.transmissionType = TransmissionType.manual
|
||||
|
||||
if 0x86 in fingerprint[1]: # LWI_01 seen on bus 1, we're wired to the CAN gateway
|
||||
if any(msg in fingerprint[1] for msg in [0x40, 0x86, 0xB2]): # Airbag_01, LWI_01, ESP_19
|
||||
ret.networkLocation = NetworkLocation.gateway
|
||||
else: # We're wired to the LKAS camera
|
||||
else:
|
||||
ret.networkLocation = NetworkLocation.fwdCamera
|
||||
|
||||
# Global tuning defaults, can be overridden per-vehicle
|
||||
|
||||
Reference in New Issue
Block a user