Skip to content

Commit 492d7a8

Browse files
committed
Update Example16_NTRIPClient_WithGGA.ino
1 parent f8e2a7a commit 492d7a8

File tree

1 file changed

+1
-46
lines changed

1 file changed

+1
-46
lines changed

examples/ZED-F9P/Example16_NTRIPClient_WithGGA/Example16_NTRIPClient_WithGGA.ino

Lines changed: 1 addition & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ void beginClient()
278278
lastReceivedRTCM_ms = millis();
279279

280280
//Push RTCM to GNSS module over I2C
281-
myGNSS.pushRawData(rtcmData, rtcmCount, false);
281+
myGNSS.pushRawData(rtcmData, rtcmCount);
282282
Serial.print(F("RTCM pushed to ZED: "));
283283
Serial.println(rtcmCount);
284284
}
@@ -297,51 +297,6 @@ void beginClient()
297297
ntripClient.print("\r\n");
298298

299299
ggaTransmitComplete = true;
300-
301-
//Wait for response
302-
unsigned long timeout = millis();
303-
while (ntripClient.available() == 0)
304-
{
305-
if (millis() - timeout > 5000)
306-
{
307-
Serial.println(F("Caster timed out!"));
308-
ntripClient.stop();
309-
return;
310-
}
311-
delay(10);
312-
}
313-
314-
//Check reply
315-
bool connectionSuccess = false;
316-
char response[512];
317-
int responseSpot = 0;
318-
while (ntripClient.available())
319-
{
320-
if (responseSpot == sizeof(response) - 1)
321-
break;
322-
323-
response[responseSpot++] = ntripClient.read();
324-
if (strstr(response, "200") != nullptr) //Look for '200 OK'
325-
connectionSuccess = true;
326-
if (strstr(response, "401") != nullptr) //Look for '401 Unauthorized'
327-
{
328-
Serial.println(F("Hey - your credentials look bad! Check you caster username and password."));
329-
connectionSuccess = false;
330-
}
331-
}
332-
response[responseSpot] = '\0';
333-
334-
if (connectionSuccess == false)
335-
{
336-
Serial.print(F("Failed to connect to "));
337-
Serial.println(casterHost);
338-
return;
339-
}
340-
else
341-
{
342-
Serial.print(F("Caster responded with: "));
343-
Serial.println(response);
344-
}
345300
}
346301

347302
//Close socket if we don't have new data for 10s

0 commit comments

Comments
 (0)