예제 #1
0
파일: NmeaSimulator.cs 프로젝트: dotnet/iot
 private void SendSentence(NmeaSentence sentence)
 {
     if (_server != null)
     {
         Console.WriteLine($"Sending {sentence.ToReadableContent()}");
         _server.SendSentence(sentence);
     }
 }
예제 #2
0
        /// <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;
                }
            }
        }
예제 #3
0
파일: SimpleParser.cs 프로젝트: dotnet/iot
 private static void ParserOnNewSequence(NmeaSinkAndSource parser, NmeaSentence sentence)
 {
     Console.WriteLine(sentence.ToReadableContent());
 }