/// <summary> /// Create a new NMEA GPS object and attach to the specified serial port. /// </summary> /// <param name="port">Serial port attached to the GPS.</param> /// <param name="baudRate">Baud rate.</param> /// <param name="parity">Parity.</param> /// <param name="dataBits">Number of data bits.</param> /// <param name="stopBits">Number of stop bits.</param> public NMEA(IIODevice device, SerialPortName port, int baudRate, Parity parity, int dataBits, StopBits stopBits) { gps = new SerialTextFile(device, port, baudRate, parity, dataBits, stopBits, "\r\n"); gps.OnLineReceived += GpsOnLineReceived; }
/// <summary> /// Create a new NMEA GPS object and attach to the specified serial port. /// </summary> /// <param name="port">Serial port attached to the GPS.</param> /// <param name="baudRate">Baud rate.</param> /// <param name="parity">Parity.</param> /// <param name="dataBits">Number of data bits.</param> /// <param name="stopBits">Number of stop bits.</param> public NMEA(string port, int baudRate, ParityType parity, int dataBits, NumberOfStopBits stopBits) { _gps = new SerialTextFile(port, baudRate, parity, dataBits, stopBits, "\r\n"); _gps.OnLineReceived += _gps_OnLineReceived; }