From f5233e40534dc427d1419d30d21f5bb2d59ae147 Mon Sep 17 00:00:00 2001 From: pennam Date: Thu, 31 Oct 2024 08:54:19 +0100 Subject: [PATCH] GSMClient: retry write --- libraries/GSM/src/GSMClient.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/libraries/GSM/src/GSMClient.h b/libraries/GSM/src/GSMClient.h index f29292fb9..4e1b52a35 100644 --- a/libraries/GSM/src/GSMClient.h +++ b/libraries/GSM/src/GSMClient.h @@ -29,6 +29,24 @@ class GSMClient : public AClient { NetworkInterface *getNetwork() { return GSM.getNetwork(); } + + size_t write(uint8_t b) { + int ret = 0; + do { + ret = client->write(b); + delay(0); + } while (ret == 0 && status()); + return ret; + } + + size_t write(const uint8_t *buf, size_t size) { + int ret = 0; + do { + ret = client->write(buf, size); + delay(0); + } while (ret == 0 && status()); + return ret; + } }; }