diff --git a/src/TinyGsmClientXBee.h b/src/TinyGsmClientXBee.h index 00b413b..c157194 100644 --- a/src/TinyGsmClientXBee.h +++ b/src/TinyGsmClientXBee.h @@ -1546,6 +1546,12 @@ class TinyGsmXBee : public TinyGsmModem, 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; }