NeoM8 gps;
public override Task Initialize()
{
Resolver.Log.Info("Initializing ...");
gps = new NeoM8(Device, Device.PlatformOS.GetSerialPortName("COM1"), Device.Pins.D09, Device.Pins.D11);
gps.GgaReceived += (object sender, GnssPositionInfo location) =>
{
Resolver.Log.Info("*********************************************");
Resolver.Log.Info($"{location}");
Resolver.Log.Info("*********************************************");
};
gps.GllReceived += (object sender, GnssPositionInfo location) =>
{
Resolver.Log.Info("*********************************************");
Resolver.Log.Info($"{location}");
Resolver.Log.Info("*********************************************");
};
gps.GsaReceived += (object sender, ActiveSatellites activeSatellites) =>
{
Resolver.Log.Info("*********************************************");
Resolver.Log.Info($"{activeSatellites}");
Resolver.Log.Info("*********************************************");
};
gps.RmcReceived += (object sender, GnssPositionInfo positionCourseAndTime) =>
{
Resolver.Log.Info("*********************************************");
Resolver.Log.Info($"{positionCourseAndTime}");
Resolver.Log.Info("*********************************************");
};
gps.VtgReceived += (object sender, CourseOverGround courseAndVelocity) =>
{
Resolver.Log.Info("*********************************************");
Resolver.Log.Info($"{courseAndVelocity}");
Resolver.Log.Info("*********************************************");
};
gps.GsvReceived += (object sender, SatellitesInView satellites) =>
{
Resolver.Log.Info("*********************************************");
Resolver.Log.Info($"{satellites}");
Resolver.Log.Info("*********************************************");
};
return Task.CompletedTask;
}
public override Task Run()
{
gps.StartUpdating();
return Task.CompletedTask;
}