Skip to content

Commit

Permalink
CommsNTRIP: add a checkbox to select NTRIP v1.0 for older caster
Browse files Browse the repository at this point in the history
Casters using RTKLib are still using NTRIP V1.0 so a checkbox allow to support them
  • Loading branch information
khancyr authored and meee1 committed Sep 12, 2023
1 parent fdb080e commit e5a2524
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 39 deletions.
14 changes: 10 additions & 4 deletions ExtLibs/Comms/CommsNTRIP.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public class CommsNTRIP : CommsBase, ICommsSerial, IDisposable

public double lat = 0;
public double lng = 0;
public bool ntrip_v1 = false;
private IPEndPoint RemoteIpEndPoint = new IPEndPoint(IPAddress.Any, 0);
private Uri remoteUri;

Expand Down Expand Up @@ -362,10 +363,15 @@ private void doConnect()
+ "User-Agent: NTRIP MissionPlanner/1.0\r\n"
+ auth
+ "Connection: close\r\n\r\n";

sw.Write(linev2);

log.Info(linev2);
if (ntrip_v1)
{
sw.Write(linev1);
log.Info(linev1);
} else
{
sw.Write(linev2);
log.Info(linev2);
}

sw.Flush();

Expand Down
13 changes: 13 additions & 0 deletions GCSViews/ConfigurationView/ConfigSerialInjectGPS.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions GCSViews/ConfigurationView/ConfigSerialInjectGPS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,13 @@ public void DoConnect()
((CommsNTRIP) comPort).lng = MainV2.comPort.MAV.cs.PlannedHomeLocation.Lng;
((CommsNTRIP) comPort).alt = MainV2.comPort.MAV.cs.PlannedHomeLocation.Alt;
}
if (check_sendntripv1.Checked)
{
((CommsNTRIP)comPort).ntrip_v1 = true;
} else
{
((CommsNTRIP)comPort).ntrip_v1 = false;
}

chk_sendgga.Enabled = false;
chk_ubloxautoconfig.Checked = false;
Expand Down
Loading

0 comments on commit e5a2524

Please sign in to comment.