      goto fail;
    }
  
    // get hw UID/serial
    ret = control_read(0xc3, 0, 0, uid, uid_len);
    if (ret == uid_len) {
      std::stringstream stream;
      for (int i = 0; i < uid_len; i++) {
        stream << std::hex << std::setw(2) << std::setfill('0') << int(uid[i]);
      }
 
</s> remove   return spi_transfer_retry(0, (uint8_t *) &packet, sizeof(packet), NULL, 0);
 </s> add   return spi_transfer_retry(0, (uint8_t *) &packet, sizeof(packet), NULL, 0, timeout); </s> remove const int SPI_MAX_RETRIES = 5;
const int SPI_ACK_TIMEOUT = 50; // milliseconds
 </s> add const int SPI_ACK_TIMEOUT = 500; // milliseconds </s> remove   LockEx lock(spi_fd, hw_lock);
 </s> add  </s> remove   int spi_transfer_retry(uint8_t endpoint, uint8_t *tx_data, uint16_t tx_len, uint8_t *rx_data, uint16_t max_rx_len);
 </s> add   int spi_transfer_retry(uint8_t endpoint, uint8_t *tx_data, uint16_t tx_len, uint8_t *rx_data, uint16_t max_rx_len, unsigned int timeout);
  ret = control_read(0xc3, 0, 0, uid, uid_len, 1000);
      goto fail;
    }
  
    // get hw UID/serial
  ret = control_read(0xc3, 0, 0, uid, uid_len, 1000);
    if (ret == uid_len) {
      std::stringstream stream;
      for (int i = 0; i < uid_len; i++) {
        stream << std::hex << std::setw(2) << std::setfill('0') << int(uid[i]);
      }
keep keep keep keep replace keep keep keep keep keep
 boardd: handle nack on tx buffer full (#28241)

* boardd: handle nack on tx buffer full

* print pandaStates

* rx buffer too small

* connect timeout

---------

Co-authored-by: Comma Device <device@comma.ai> 
selfdrive/boardd/spi.cc