mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-09-28 00:03:42 +08:00
ec8f036850
# Conflicts: # .github/workflows/selfdrive_tests.yaml # README.md # docs/CARS.md # opendbc_repo # panda # selfdrive/car/tests/test_car_interfaces.py # selfdrive/modeld/modeld.py # selfdrive/selfdrived/selfdrived.py # selfdrive/ui/translations/main_ar.ts # selfdrive/ui/translations/main_de.ts # selfdrive/ui/translations/main_es.ts # selfdrive/ui/translations/main_fr.ts # selfdrive/ui/translations/main_ja.ts # selfdrive/ui/translations/main_ko.ts # selfdrive/ui/translations/main_pt-BR.ts # selfdrive/ui/translations/main_th.ts # selfdrive/ui/translations/main_tr.ts # selfdrive/ui/translations/main_zh-CHS.ts # selfdrive/ui/translations/main_zh-CHT.ts # system/hardware/hardwared.py # system/updated/updated.py # tinygrad_repo # uv.lock
37 lines
916 B
C++
37 lines
916 B
C++
#pragma once
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include "common/params.h"
|
|
#include "selfdrive/pandad/panda.h"
|
|
|
|
void pandad_main_thread(std::vector<std::string> serials);
|
|
|
|
// deprecated devices
|
|
static const std::vector<cereal::PandaState::PandaType> SUPPORTED_PANDA_TYPES = {
|
|
cereal::PandaState::PandaType::RED_PANDA,
|
|
cereal::PandaState::PandaType::TRES,
|
|
cereal::PandaState::PandaType::CUATRO,
|
|
};
|
|
|
|
|
|
class PandaSafety {
|
|
public:
|
|
PandaSafety(const std::vector<Panda *> &pandas) : pandas_(pandas) {}
|
|
void configureSafetyMode(bool is_onroad);
|
|
bool getOffroadMode();
|
|
|
|
private:
|
|
void updateMultiplexingMode();
|
|
std::vector<std::string> fetchCarParams();
|
|
void setSafetyMode(const std::vector<std::string> ¶ms_string);
|
|
|
|
bool initialized_ = false;
|
|
bool log_once_ = false;
|
|
bool safety_configured_ = false;
|
|
bool prev_obd_multiplexing_ = false;
|
|
std::vector<Panda *> pandas_;
|
|
Params params_;
|
|
};
|