private void SendSentence(NmeaSentence sentence) { if (_server != null) { Console.WriteLine($"Sending {sentence.ToReadableContent()}"); _server.SendSentence(sentence); } }
/// <inheritdoc /> public override void SendSentence(NmeaSinkAndSource source, NmeaSentence sentence) { lock (_lock) { if (_textWriter != null && _logFile != null) { // If talker and ID are the same, assume it's the same message if (_lastSentence.SentenceId != sentence.SentenceId && _lastSentence.TalkerId != sentence.TalkerId) { string msg = FormattableString.Invariant( $"{DateTime.UtcNow:s}|{source.InterfaceName}|${sentence.TalkerId}{sentence.SentenceId},{sentence.ToNmeaParameterList()}|{sentence.ToReadableContent()}"); _textWriter.WriteLine(msg); } if ((_logFile.Length > Configuration.MaxFileSize) && (Configuration.MaxFileSize != 0)) { StartNewFile(); } _lastSentence = sentence; } } }
private static void ParserOnNewSequence(NmeaSinkAndSource parser, NmeaSentence sentence) { Console.WriteLine(sentence.ToReadableContent()); }