private void HandleVtg(VtgStandardGpsMessage message, DateTime systemReceivedUtcDateTime) { LatestMovement = new MovementData( AdjustSystemUtc(systemReceivedUtcDateTime), message.CourseOverGround, message.SpeedInKnots, message.SpeedInKmPerH, message.PositioningMode); OnMovementData?.Invoke(this, new MovementDataEventArgs(LatestMovement)); }
private GpsManager(SerialDevice serialDevice) { _serialDevice = serialDevice; _serialDevice.WriteTimeout = TimeSpan.FromSeconds(1); _serialDevice.ReadTimeout = TimeSpan.FromSeconds(1); _serialDevice.BaudRate = 9600; _serialDevice.Parity = SerialParity.None; _serialDevice.StopBits = SerialStopBitCount.One; _serialDevice.DataBits = 8; _gpsMessageHandler = new GpsMessageHandler(_serialDevice); _gpsMessageHandler.OnCustomMessage += HandleCustomMessage; _gpsMessageHandler.OnStandardMessage += HandleStandardMessage; LatestPosition = new PositionData(AdjustedUtcNow, null, null, GgaFixStatus.Unknown, null, null, null, null, null, null); LatestMovement = new MovementData(AdjustedUtcNow, null, null, null, GpsPositioningMode.Unknown); }
public MovementDataEventArgs(MovementData movement) { Movement = movement; }