/// <summary>
        /// Add the NMEA data to the codec.
        /// </summary>
        /// <param name="data">NMEA data.</param>
        /// <param name="source">Ensemble source.</param>
        /// <returns>Negative value indicates an error.</returns>
        public int AddNmeaData(byte[] data, EnsembleSource source)
        {
            // Convert the data to ASCII
            string ascii = System.Text.ASCIIEncoding.ASCII.GetString(data);

            // Add data to codec
            _codec.AddNmeaData(ascii);

            log.Debug(string.Format("Add NMEA data: {0}", ascii));

            return(data.Length);
        }
Example #2
0
        /// <summary>
        /// Receive the GPS data and display it to the output.
        /// </summary>
        /// <param name="data"></param>
        public void ReceiveGpsSerialData(string data)
        {
            if (_adcpCodec != null)
            {
                // Add the data to the codec
                _adcpCodec.AddNmeaData(data);
            }

            // GPS Serial output
            GpsOutput += data;

            if (GpsOutput.Length > 1000)
            {
                GpsOutput = GpsOutput.Substring(GpsOutput.Length - 1000);
            }
        }