|
|
|
@ -113,11 +113,11 @@ bool safety_setter_thread(std::vector<Panda *> pandas) { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// set to ELM327 with OBD multiplexing for fingerprinting
|
|
|
|
|
p.putBool("ObdMultiplexingEnabled", true); |
|
|
|
|
// set to ELM327 without OBD multiplexing for fingerprinting
|
|
|
|
|
p.putBool("ObdMultiplexingEnabled", false); |
|
|
|
|
for (int i = 0; i < pandas.size(); i++) { |
|
|
|
|
// const uint16_t safety_param = (i > 0) ? 1U : 0U;
|
|
|
|
|
pandas[i]->set_safety_model(cereal::CarParams::SafetyModel::ELM327, 0U); |
|
|
|
|
pandas[i]->set_safety_model(cereal::CarParams::SafetyModel::ELM327, 1U); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// openpilot can switch between multiplexing modes for different FW queries,
|
|
|
|
@ -127,14 +127,15 @@ bool safety_setter_thread(std::vector<Panda *> pandas) { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// bool obd_multiplexing_requested = p.getBool("ObdMultiplexingRequested");
|
|
|
|
|
std::string obd_multiplexing_requested = p.get("ObdMultiplexingRequested"); |
|
|
|
|
if (!obd_multiplexing_requested.isEmpty()) { |
|
|
|
|
const uint16_t safety_param = obd_multiplexing_requested == "1" ? 0U : 1U; |
|
|
|
|
bool obd_multiplexing_requested = p.getBool("ObdMultiplexingRequested"); |
|
|
|
|
// std::string obd_multiplexing_requested = p.get("ObdMultiplexingRequested");
|
|
|
|
|
// if (!obd_multiplexing_requested.isEmpty()) {
|
|
|
|
|
if (obd_multiplexing_requested != p.getBool("ObdMultiplexingEnabled")) { |
|
|
|
|
const uint16_t safety_param = obd_multiplexing_requested ? 0U : 1U; |
|
|
|
|
for (int i = 0; i < pandas.size(); i++) { |
|
|
|
|
pandas[i]->set_safety_model(cereal::CarParams::SafetyModel::ELM327, safety_param); |
|
|
|
|
} |
|
|
|
|
p.remove("ObdMultiplexingRequested", obd_multiplexing_requested); |
|
|
|
|
// p.remove("ObdMultiplexingRequested", obd_multiplexing_requested);
|
|
|
|
|
p.putBool("ObdMultiplexingEnabled", obd_multiplexing_requested); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|