Skip to content

Commit

Permalink
Add one retry to XBee
Browse files Browse the repository at this point in the history
Signed-off-by: Sara Damiano <sdamiano@stroudcenter.org>
  • Loading branch information
SRGDamia1 committed Jun 23, 2023
1 parent ef1a7e0 commit 5b83997
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/TinyGsmClientXBee.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 5b83997

Please sign in to comment.