|
|
@ -151,14 +151,9 @@ bool usb_connect() { |
|
|
|
} else { return false; } |
|
|
|
} else { return false; } |
|
|
|
|
|
|
|
|
|
|
|
// get panda serial
|
|
|
|
// get panda serial
|
|
|
|
const char *serial_buf = panda->get_serial(); |
|
|
|
if (auto serial = panda->get_serial(); serial) { |
|
|
|
if (serial_buf) { |
|
|
|
params.write_db_value("PandaDongleId", serial->c_str(), serial->length()); |
|
|
|
size_t serial_sz = strnlen(serial_buf, 16); |
|
|
|
LOGW("panda serial: %s", serial->c_str()); |
|
|
|
|
|
|
|
|
|
|
|
params.write_db_value("PandaDongleId", serial_buf, serial_sz); |
|
|
|
|
|
|
|
LOGW("panda serial: %.*s", serial_sz, serial_buf); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
delete[] serial_buf; |
|
|
|
|
|
|
|
} else { return false; } |
|
|
|
} else { return false; } |
|
|
|
|
|
|
|
|
|
|
|
// power on charging, only the first time. Panda can also change mode and it causes a brief disconneciton
|
|
|
|
// power on charging, only the first time. Panda can also change mode and it causes a brief disconneciton
|
|
|
|