Add one retry to XBee

Signed-off-by: Sara Damiano <sdamiano@stroudcenter.org>
This commit is contained in:
Sara Damiano
2023-06-23 11:49:59 -04:00
parent ef1a7e08a1
commit 5b83997877

View File

@@ -1546,6 +1546,12 @@ class TinyGsmXBee : public TinyGsmModem<TinyGsmXBee>,
sendAT(cmd, newValue);
// return false if we attempted to change but failed
if (waitResponse(timeout_ms) != 1) { return false; }
// check if we succeeded in staging a change and retry once
sendAT(cmd);
if (readResponseInt() != newValue) {
sendAT(cmd, newValue);
if (waitResponse(timeout_ms) != 1) { return false; }
}
// return true if we succeeded in staging a change
return true;
}