Browse Source

Add one retry to XBee

Signed-off-by: Sara Damiano <sdamiano@stroudcenter.org>
dependabot/github_actions/actions/checkout-4
Sara Damiano 1 year ago
parent
commit
5b83997877
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      src/TinyGsmClientXBee.h

+ 6
- 0
src/TinyGsmClientXBee.h View File

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


Loading…
Cancel
Save