Skip to content

Commit 29605c2

Browse files
committed
Add timer to HTTP_CLIENT_ON, same as MQTT_CLIENT_ON
1 parent c2e64ed commit 29605c2

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

Firmware/RTK_Everywhere/HTTP_Client.ino

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ void httpClientPrintStateSummary()
153153
// Print the HTTP Client status
154154
void httpClientPrintStatus()
155155
{
156-
systemPrint("MQTT Client ");
157-
mqttClientPrintStateSummary();
156+
systemPrint("HTTP Client ");
157+
httpClientPrintStateSummary();
158158
}
159159

160160
// Restart the HTTP client
@@ -285,8 +285,11 @@ void httpClientUpdate()
285285

286286
// Start the network
287287
case HTTP_CLIENT_ON: {
288-
if (networkUserOpen(NETWORK_USER_HTTP_CLIENT, NETWORK_TYPE_ACTIVE))
289-
httpClientSetState(HTTP_CLIENT_NETWORK_STARTED);
288+
if ((millis() - httpClientTimer) > httpClientConnectionAttemptTimeout)
289+
{
290+
if (networkUserOpen(NETWORK_USER_HTTP_CLIENT, NETWORK_TYPE_ACTIVE))
291+
httpClientSetState(HTTP_CLIENT_NETWORK_STARTED);
292+
}
290293
break;
291294
}
292295

0 commit comments

Comments
 (0)