Fix: return failure when PhoneAPI times out (#3136)

* Add debug options for RP2040

* Rename: "observed" should be plural: "observables"

* PhoneAPI: return failure on timeout
In `onNotify()`, when disconnected, PhoneAPI removed itself from the list of observers that was looped through in `notifyObservers()`. We should exit that loop in that case.
This commit is contained in:
GUVWAF
2024-01-28 14:53:39 +01:00
committed by GitHub
parent d604a76c73
commit 417feee47f
7 changed files with 28 additions and 19 deletions

View File

@@ -108,8 +108,9 @@ void MeshService::loop()
(void)sendQueueStatusToPhone(qs, 0, 0);
}
if (oldFromNum != fromNum) { // We don't want to generate extra notifies for multiple new packets
fromNumChanged.notifyObservers(fromNum);
oldFromNum = fromNum;
int result = fromNumChanged.notifyObservers(fromNum);
if (result == 0) // If any observer returns non-zero, we will try again
oldFromNum = fromNum;
}
}