From 11ca91fadc68b6c28c53ead8e3268daed55dc406 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Wed, 23 Feb 2022 13:35:56 -0800 Subject: [PATCH] boardd: handle missing pandas old-commit-hash: 767bc1aa3b37b6bdc368629e0c91b87715eabc94 --- selfdrive/boardd/boardd.cc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/selfdrive/boardd/boardd.cc b/selfdrive/boardd/boardd.cc index e8ace77a1d..d7e1adf1eb 100644 --- a/selfdrive/boardd/boardd.cc +++ b/selfdrive/boardd/boardd.cc @@ -613,8 +613,17 @@ void boardd_main_thread(std::vector serials) { PubMaster pm({"pandaStates", "peripheralState"}); LOGW("attempting to connect"); - if (serials.size() == 0) serials = Panda::list(); - + if (serials.size() == 0) { + // connect to all + serials = Panda::list(); + + // exit if no pandas are connected + if (serials.size() == 0) { + LOGW("no pandas found, exiting"); + return; + } + } + // connect to all provided serials std::vector pandas; for (int i = 0; i < serials.size() && !do_exit; /**/) {