11
22
33#include " ArduinoCellular.h"
4+ #include " ManagedTinyGsmClient.h"
45
56#if defined(ARDUINO_ARCH_MBED)
67 #include " Watchdog.h"
@@ -166,19 +167,12 @@ int ArduinoCellular::getSignalQuality(){
166167 return modem.getSignalQuality ();
167168}
168169
169- ManagedTinyGsmClient ArduinoCellular::getNetworkClient (){
170+ TinyGsmClient ArduinoCellular::getNetworkClient (){
170171 return ManagedTinyGsmClient (modem);
171172}
172173
173174HttpClient ArduinoCellular::getHTTPClient (const char * server, const int port){
174- ManagedTinyGsmClient client = getNetworkClient ();
175- if (!client.isValid ()) {
176- // Handle error: no available sockets
177- // Option 1: Return an invalid HttpClient (if supported)
178- // Option 2: Use a default/shared client (not recommended)
179- // Option 3: Wait and retry (could add a delay/retry mechanism)
180- // For now, we'll proceed but the connection will likely fail
181- }
175+ TinyGsmClient client = getNetworkClient ();
182176 return HttpClient (client, server, port);
183177}
184178
@@ -189,7 +183,7 @@ HttpClient ArduinoCellular::getHTTPSClient(const char * server, const int port){
189183}
190184
191185BearSSLClient ArduinoCellular::getSecureNetworkClient (){
192- ManagedTinyGsmClient client = getNetworkClient ();
186+ TinyGsmClient client = getNetworkClient ();
193187 return BearSSLClient (client);
194188}
195189#endif
0 commit comments