1
1
2
2
3
3
#include " ArduinoCellular.h"
4
+ #include " ManagedTinyGsmClient.h"
4
5
5
6
#if defined(ARDUINO_ARCH_MBED)
6
7
#include " Watchdog.h"
@@ -166,19 +167,12 @@ int ArduinoCellular::getSignalQuality(){
166
167
return modem.getSignalQuality ();
167
168
}
168
169
169
- ManagedTinyGsmClient ArduinoCellular::getNetworkClient (){
170
+ TinyGsmClient ArduinoCellular::getNetworkClient (){
170
171
return ManagedTinyGsmClient (modem);
171
172
}
172
173
173
174
HttpClient 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 ();
182
176
return HttpClient (client, server, port);
183
177
}
184
178
@@ -189,7 +183,7 @@ HttpClient ArduinoCellular::getHTTPSClient(const char * server, const int port){
189
183
}
190
184
191
185
BearSSLClient ArduinoCellular::getSecureNetworkClient (){
192
- ManagedTinyGsmClient client = getNetworkClient ();
186
+ TinyGsmClient client = getNetworkClient ();
193
187
return BearSSLClient (client);
194
188
}
195
189
#endif
0 commit comments