From b195c12d7ac60d3ae881a994da6d11101be9af5e Mon Sep 17 00:00:00 2001 From: mort5161 Date: Fri, 20 Mar 2015 12:39:23 -0700 Subject: [PATCH] Expose current serial port --- src/NmeaParser.WinDesktop/SerialPortDevice.cs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/NmeaParser.WinDesktop/SerialPortDevice.cs b/src/NmeaParser.WinDesktop/SerialPortDevice.cs index 1f0f386..2425eef 100644 --- a/src/NmeaParser.WinDesktop/SerialPortDevice.cs +++ b/src/NmeaParser.WinDesktop/SerialPortDevice.cs @@ -31,14 +31,28 @@ namespace NmeaParser private System.IO.Ports.SerialPort m_port; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The serial port. + /// port public SerialPortDevice(System.IO.Ports.SerialPort port) { + if (port == null) + throw new ArgumentNullException("port"); m_port = port; } + /// + /// Gets the active serial port. + /// + public System.IO.Ports.SerialPort Port + { + get + { + return m_port; + } + } + /// /// Creates the stream the NmeaDevice is working on top off. ///