Click or drag to resize
SerialPortInUseException Class
Exception thrown when a serial port method is already in progress and a second attempt is made to use the serial port.
Inheritance Hierarchy

Namespace: ASCOM.Utilities.Exceptions
Assembly: ASCOM.Utilities (in ASCOM.Utilities.dll) Version: 6.0.0.0 (6.2.0.2774)
Syntax
[SerializableAttribute]
public class SerialPortInUseException : HelperException

The SerialPortInUseException type exposes the following members.

Constructors
  NameDescription
Public methodSerialPortInUseException(String)
Create a new exception with message
Public methodSerialPortInUseException(SerializationInfo, StreamingContext)
Serialise the exception
Public methodSerialPortInUseException(String, Exception)
Create a new exception with message
Top
Properties
  NameDescription
Public propertyData
Gets a collection of key/value pairs that provide additional user-defined information about the exception.
(Inherited from Exception.)
Public propertyHelpLink
Gets or sets a link to the help file associated with this exception.
(Inherited from Exception.)
Public propertyInnerException
Gets the Exception instance that caused the current exception.
(Inherited from Exception.)
Public propertyMessage
Gets a message that describes the current exception.
(Inherited from Exception.)
Public propertySource
Gets or sets the name of the application or the object that causes the error.
(Inherited from Exception.)
Public propertyStackTrace
Gets a string representation of the immediate frames on the call stack.
(Inherited from Exception.)
Public propertyTargetSite
Gets the method that throws the current exception.
(Inherited from Exception.)
Top
Methods
  NameDescription
Public methodGetBaseException
When overridden in a derived class, returns the Exception that is the root cause of one or more subsequent exceptions.
(Inherited from Exception.)
Public methodGetObjectData
When overridden in a derived class, sets the SerializationInfo with information about the exception.
(Inherited from Exception.)
Public methodGetType
Gets the runtime type of the current instance.
(Inherited from Exception.)
Public methodToString
Creates and returns a string representation of the current exception.
(Inherited from Exception.)
Top
Remarks
This exception is only thrown after 5 attempts, each with a 1 second timeout, have been made to acquire the serial port. It may indicate that you have more than one thread attempting to access the serial port and that you have not synchronised these within your application. The serial port can only handle one transaction at a time e.g. Serial.Receive or Serial.Transmit etc.
See Also