1. Denver Ivan Gazo
  2. FingerCommLib

Commits

Denver Ivan Gazo  committed 82efd70

Add a new constructor

  • Participants
  • Parent commits 1d252d9
  • Branches default

Comments (0)

Files changed (1)

File FingerCommLib/FingerCommLib.cs

View file
     {
         #region Fields
 
-        SerialPort ComPort = new SerialPort("COM1", 19200, Parity.None, 8, StopBits.One);
+        SerialPort ComPort;
         int userNumber;
         UserPrivilege priviledge;
 
 
         public FingerCommLib()
         {
+            ComPort = new SerialPort("COM1", 19200, Parity.None, 8, StopBits.One);
+            ComPort.DataReceived += new SerialDataReceivedEventHandler(ComPort_DataReceived);
+            ComPort.Open();
+        }
+
+        public FingerCommLib(string port)
+        {
+            ComPort = new SerialPort(port, 19200, Parity.None, 8, StopBits.One);
             ComPort.DataReceived += new SerialDataReceivedEventHandler(ComPort_DataReceived);
             ComPort.Open();
         }