Skip to content

Commit 930848e

Browse files
committed
GSMClient GSMSSLClient: squashme retry write
Additional retries on SSLCLient are needed for mqtt over tls
1 parent 2d97721 commit 930848e

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

libraries/GSM/src/GSMClient.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,12 @@
2626
namespace arduino {
2727

2828
class GSMClient : public AClient {
29+
private:
2930
NetworkInterface *getNetwork() {
3031
return GSM.getNetwork();
3132
}
3233

34+
public:
3335
size_t write(uint8_t b) {
3436
int ret = 0;
3537
do {

libraries/GSM/src/GSMSSLClient.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,25 @@ class GSMSSLClient : public arduino::ASslClient {
3232
NetworkInterface *getNetwork() {
3333
return GSM.getNetwork();
3434
}
35+
36+
public:
37+
size_t write(uint8_t b) {
38+
int ret = 0;
39+
do {
40+
ret = client->write(b);
41+
delay(0);
42+
} while (ret == 0 && status());
43+
return ret;
44+
}
45+
46+
size_t write(const uint8_t *buf, size_t size) {
47+
int ret = 0;
48+
do {
49+
ret = client->write(buf, size);
50+
delay(0);
51+
} while (ret == 0 && status());
52+
return ret;
53+
}
3554
};
3655

3756
}

0 commit comments

Comments
 (0)