Skip to content

Commit

Permalink
ntrip: Added support for NTRIP Rev1 servers
Browse files Browse the repository at this point in the history
  • Loading branch information
jheising authored and stephendade committed Aug 18, 2024
1 parent 1b716ea commit 5e5f3af
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions MAVProxy/modules/lib/ntrip.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ def read(self):
# Ignore non ascii characters in HTTP response
casterResponse = str(casterResponse, 'ascii', 'ignore')
header_lines = casterResponse.split("\r\n")
is_ntrip_rev1 = False
for line in header_lines:
if line == "":
self.found_header = True
Expand All @@ -165,7 +166,14 @@ def read(self):
raise NtripError("Mount Point does not exist")
elif line.find(" 200 OK") != -1:
# Request was valid
if line == "ICY 200 OK":
is_ntrip_rev1 = True
self.send_gga()

# NTRIP Rev1 allows for responses that do not contain headers and an extra blank line.
if is_ntrip_rev1 and not self.found_header:
self.found_header = True

return None
# normal data read
while True:
Expand Down

0 comments on commit 5e5f3af

Please sign in to comment.