/// <summary>
 /// Compare the ComPort object specified by argument matches with self.
 /// </summary>
 /// <param name="ComPort">ComPort object to compare.</param>
 /// <returns>If matches, returns true, otherwise returns false.</returns>
 public bool Equals(ComPort ComPort)
 {
     try
     {
         if (this.Name.Equals(ComPort.Name) && this.Device.Equals(ComPort.Device))
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     catch (NullReferenceException ex)
     {
         Console.WriteLine(ex.Message);
         return(false);
     }
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="ComPort">ComPort contains port name and its configuration.</param>
 public ComPortAccessSequenceRunner(ComPort ComPort)
 {
     this.SetComPort(ComPort);
 }
示例#3
0
        /// <summary>
        /// Open serial port specified by argument ComPort.
        /// The argument "ComPort is set to Property ComPort.
        /// </summary>
        /// <param name="ComPort">Serial port information to open.</param>
        /// <returns>Returns true if the port can open, else returns false.</returns>
        public bool Connect(ComPort ComPort)
        {
            this.ComPort = ComPort;

            return(this.Connect());
        }
示例#4
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="ComPort"></param>
 public ComPortAccess(ComPort ComPort)
 {
     this.ComPort = ComPort;
 }