pigeon init add max retry count

old-commit-hash: f7e276fcce39e5e27c10d0bfb003754ec463c788
This commit is contained in:
Willem Melching
2021-04-15 16:49:09 +02:00
parent ba9cc9b067
commit 548722a954
+5 -4
View File
@@ -64,7 +64,8 @@ bool Pigeon::send_with_ack(std::string cmd){
}
void Pigeon::init() {
while (!do_exit){
for (int i = 0; i < 10; i++){
if (do_exit) return;
LOGW("panda GPS start");
// power off pigeon
@@ -106,10 +107,10 @@ void Pigeon::init() {
if (!send_with_ack("\xB5\x62\x06\x01\x03\x00\x0A\x09\x01\x1E\x70"s)) continue;
if (!send_with_ack("\xB5\x62\x06\x01\x03\x00\x0A\x0B\x01\x20\x74"s)) continue;
break;
LOGW("panda GPS on");
return;
}
LOGW("panda GPS on");
LOGE("failed to initialize panda GPS");
}
void PandaPigeon::connect(Panda * p) {