  
    while (!do_exit) {
      Panda *panda = usb_connect();
  
      // Send empty pandaState and try again
      if (panda == nullptr) {
        send_empty_panda_state(&pm);
        util::sleep_for(500);
        continue;
      }
  
 
</s> remove   PubMaster pm({"pandaState"});
 </s> add   PubMaster pm({"pandaState", "peripheralState"}); </s> remove     if (spoofing_started) {
      pandaState.ignition_line = 1;
    }
 </s> add   // Make sure CAN buses are live: safety_setter_thread does not work if Panda CAN are silent and there is only one other CAN node
  if (pandaState.safety_model == (uint8_t)(cereal::CarParams::SafetyModel::SILENT)) {
    panda->set_safety_model(cereal::CarParams::SafetyModel::NO_OUTPUT);
  } </s> remove   // run at 2hz
  while (!do_exit && panda->connected) {
    health_t pandaState = panda->get_state();
 </s> add   if (spoofing_started) {
    pandaState.ignition_line = 1;
  }
    // Send empty pandaState & peripheralState and try again
    if (panda == nullptr || peripheral_panda == nullptr) {
  
    while (!do_exit) {
      Panda *panda = usb_connect();
  
    // Send empty pandaState & peripheralState and try again
    if (panda == nullptr || peripheral_panda == nullptr) {
    // Send empty pandaState & peripheralState and try again
    if (panda == nullptr || peripheral_panda == nullptr) {
        send_empty_panda_state(&pm);
        util::sleep_for(500);
        continue;
      }
  
keep keep keep keep replace replace keep keep keep keep keep
 Split pandaState into peripheralState and pandaState (#22385)

* publish peripheralState from boardd

* refactor consumers

* rename thread

* peripheralState has panda type too

* add to process replay

* fix device build

* properly remove hardware unsupported alert

* latest peripheralState

* remove pandaState from thermal_monitor

* put that back

* add back harness check

* fix cloudlog

* needs pandaState

* Update selfdrive/thermald/tests/test_power_monitoring.py

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>

* dont conflate

* Update selfdrive/thermald/tests/test_power_monitoring.py

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>

* pigeon is peripheral

* cleanup

* less global

* comment

* move rtc to peripheral_control_thread

* better diff?

* whitespace

* get msg

* bump cereal

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com> 
selfdrive/boardd/boardd.cc