2023-09-27 15:45:31 -07:00
|
|
|
#pragma once
|
|
|
|
|
2023-11-17 23:53:40 +00:00
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
2025-01-29 09:09:58 +00:00
|
|
|
#include "common/params.h"
|
2024-06-11 01:36:40 +00:00
|
|
|
#include "selfdrive/pandad/panda.h"
|
2023-09-27 15:45:31 -07:00
|
|
|
|
2024-06-11 01:36:40 +00:00
|
|
|
void pandad_main_thread(std::vector<std::string> serials);
|
2025-01-29 09:09:58 +00:00
|
|
|
|
|
|
|
class PandaSafety {
|
|
|
|
public:
|
|
|
|
PandaSafety(const std::vector<Panda *> &pandas) : pandas_(pandas) {}
|
|
|
|
void configureSafetyMode();
|
|
|
|
|
|
|
|
private:
|
|
|
|
void updateMultiplexingMode();
|
|
|
|
std::string fetchCarParams();
|
|
|
|
void setSafetyMode(const 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_;
|
|
|
|
};
|