Skip to content

Commit 1fbea4d

Browse files
[AtModem] Fix HTTP init retry mechanism SIM7672 (#1219)
1 parent cdfa65f commit 1fbea4d

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

devices/AtModem/Http/Sim7672HttpClient.cs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,22 @@ internal override HttpResponseMessage SendInternal(HttpRequestMessage request)
9090
int index;
9191
int retries = 5;
9292

93+
Retry:
9394
// We init, if already init, try to deiniti and reinit
9495
response = Modem.Channel.SendCommand($"AT+HTTPINIT");
9596
if (!response.Success)
9697
{
97-
Modem.Channel.SendCommand($"AT+HTTPTERM");
98-
Modem.Channel.SendCommand($"AT+HTTPINIT");
98+
// Give it another try
99+
if (retries-- > 0)
100+
{
101+
Thread.Sleep(250);
102+
Modem.Channel.SendCommand($"AT+HTTPTERM");
103+
goto Retry;
104+
}
105+
106+
return result;
99107
}
100108

101-
Retry:
102109
if (request.RequestUri.Scheme == "https")
103110
{
104111
// This is to read the current configuration, we don't need it now.

0 commit comments

Comments
 (0)