Skip to content

Commit

Permalink
Added support for NTRIP Rev1 servers
Browse files Browse the repository at this point in the history
  • Loading branch information
jheising committed Aug 16, 2024
1 parent 1b716ea commit a4e6e33
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 a4e6e33

Please sign in to comment.