System.IO.Ports
Specifies the control protocol used in establishing a serial port communication for a object.
No control is used for the handshake.
Request-to-Send (RTS) hardware flow control is used. RTS signals that data is available for transmission. If the input buffer becomes full, the RTS line will be set to . The RTS line will be set to when more room becomes available in the input buffer.
Both the Request-to-Send (RTS) hardware control and the XON/XOFF software controls are used.
The XON/XOFF software control protocol is used. The XOFF control is sent to stop the transmission of data. The XON control is sent to resume the transmission. These software controls are used instead of Request to Send (RTS) and Clear to Send (CTS) hardware controls.
Specifies the parity bit for a object.
Sets the parity bit so that the count of bits set is an even number.
Leaves the parity bit set to 1.
No parity check occurs.
Sets the parity bit so that the count of bits set is an odd number.
Leaves the parity bit set to 0.
Specifies the type of character that was received on the serial port of the object.
A character was received and placed in the input buffer.
The end of file character was received and placed in the input buffer.
Provides data for the event.
Gets or sets the event type.
One of the values.
Represents the method that will handle the event of a object.
The sender of the event, which is the object.
A object that contains the event data.
Specifies errors that occur on the object.
The hardware detected a framing error.
A character-buffer overrun has occurred. The next character is lost.
An input buffer overflow has occurred. There is either no room in the input buffer, or a character was received after the end-of-file (EOF) character.
The hardware detected a parity error.
The application tried to transmit a character, but the output buffer was full.
Prepares data for the event.
Gets or sets the event type.
One of the values.
Represents the method that will handle the event of a object.
The sender of the event, which is the object.
A object that contains the event data.
Specifies the type of change that occurred on the object.
A break was detected on input.
The Carrier Detect (CD) signal changed state. This signal is used to indicate whether a modem is connected to a working phone line and a data carrier signal is detected.
The Clear to Send (CTS) signal changed state. This signal is used to indicate whether data can be sent over the serial port.
The Data Set Ready (DSR) signal changed state. This signal is used to indicate whether the device on the serial port is ready to operate.
A ring indicator was detected.
Provides data for the event.
Gets or sets the event type.
One of the values.
Represents the method that will handle the event of a object.
The source of the event, which is the object.
A object that contains the event data.
Represents a serial port resource.
Indicates that data has been received through a port represented by the object.
Indicates that an error has occurred with a port represented by a object.
Indicates that a non-data signal event has occurred on the port represented by the object.
Indicates that no time-out should occur.
Initializes a new instance of the class.
Initializes a new instance of the class using the specified object.
An interface to a container.
The specified port could not be found or opened.
Initializes a new instance of the class using the specified port name.
The port to use (for example, COM1).
The specified port could not be found or opened.
Initializes a new instance of the class using the specified port name and baud rate.
The port to use (for example, COM1).
The baud rate.
The specified port could not be found or opened.
Initializes a new instance of the class using the specified port name, baud rate, and parity bit.
The port to use (for example, COM1).
The baud rate.
One of the values.
The specified port could not be found or opened.
Initializes a new instance of the class using the specified port name, baud rate, parity bit, and data bits.
The port to use (for example, COM1).
The baud rate.
One of the values.
The data bits value.
The specified port could not be found or opened.
Initializes a new instance of the class using the specified port name, baud rate, parity bit, data bits, and stop bit.
The port to use (for example, COM1).
The baud rate.
One of the values.
The data bits value.
One of the values.
The specified port could not be found or opened.
Closes the port connection, sets the property to , and disposes of the internal object.
The port is in an invalid state.
-or-
An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid.
Discards data from the serial driver's receive buffer.
The port is in an invalid state.
-or-
An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid.
The stream is closed. This can occur because the method has not been called or the method has been called.
Discards data from the serial driver's transmit buffer.
The port is in an invalid state.
-or-
An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid.
The stream is closed. This can occur because the method has not been called or the method has been called.
Releases the unmanaged resources used by the and optionally releases the managed resources.
to release both managed and unmanaged resources; to release only unmanaged resources.
The port is in an invalid state.
-or-
An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid.
Gets an array of serial port names for the current computer.
The serial port names could not be queried.
An array of serial port names for the current computer.
Opens a new serial port connection.
Access is denied to the port.
-or-
The current process, or another process on the system, already has the specified COM port open either by a instance or in unmanaged code.
One or more of the properties for this instance are invalid. For example, the , , or properties are not valid values; the is less than or equal to zero; the or property is less than zero and is not .
The port name does not begin with "COM".
-or-
The file type of the port is not supported.
The port is in an invalid state.
-or-
An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid.
The specified port on the current instance of the is already open.
Reads a number of bytes from the input buffer and writes those bytes into a byte array at the specified offset.
The byte array to write the input to.
The offset in at which to write the bytes.
The maximum number of bytes to read. Fewer bytes are read if is greater than the number of bytes in the input buffer.
The buffer passed is .
The specified port is not open.
The or parameters are outside a valid region of the being passed. Either or is less than zero.
plus is greater than the length of the .
No bytes were available to read.
The number of bytes read.
Reads a number of characters from the input buffer and writes them into an array of characters at a given offset.
The character array to write the input to.
The offset in at which to write the characters.
The maximum number of characters to read. Fewer characters are read if is greater than the number of characters in the input buffer.
plus is greater than the length of the buffer.
-or-
is 1 and there is a surrogate character in the buffer.
The passed is .
The or parameters are outside a valid region of the being passed. Either or is less than zero.
The specified port is not open.
No characters were available to read.
The number of characters read.
Synchronously reads one byte from the input buffer.
The specified port is not open.
The operation did not complete before the time-out period ended.
-or-
No byte was read.
The byte, cast to an , or -1 if the end of the stream has been read.
Synchronously reads one character from the input buffer.
The specified port is not open.
The operation did not complete before the time-out period ended.
-or-
No character was available in the allotted time-out period.
The character that was read.
Reads all immediately available bytes, based on the encoding, in both the stream and the input buffer of the object.
The specified port is not open.
The contents of the stream and the input buffer of the object.
Reads up to the value in the input buffer.
The specified port is not open.
The operation did not complete before the time-out period ended.
-or-
No bytes were read.
The contents of the input buffer up to the first occurrence of a value.
Reads a string up to the specified in the input buffer.
A value that indicates where the read operation stops.
The length of the parameter is 0.
The parameter is .
The specified port is not open.
The operation did not complete before the time-out period ended.
The contents of the input buffer up to the specified .
Writes a specified number of bytes to the serial port using data from a buffer.
The byte array that contains the data to write to the port.
The zero-based byte offset in the parameter at which to begin copying bytes to the port.
The number of bytes to write.
The passed is .
The specified port is not open.
The or parameters are outside a valid region of the being passed. Either or is less than zero.
plus is greater than the length of the .
The operation did not complete before the time-out period ended.
Writes a specified number of characters to the serial port using data from a buffer.
The character array that contains the data to write to the port.
The zero-based byte offset in the parameter at which to begin copying bytes to the port.
The number of characters to write.
The passed is .
The specified port is not open.
The or parameters are outside a valid region of the being passed. Either or is less than zero.
plus is greater than the length of the .
The operation did not complete before the time-out period ended.
Writes the specified string to the serial port.
The string for output.
The specified port is not open.
is .
The operation did not complete before the time-out period ended.
Writes the specified string and the value to the output buffer.
The string to write to the output buffer.
The parameter is .
The specified port is not open.
The method could not write to the stream.
Gets the underlying object for a object.
The stream is closed. This can occur because the method has not been called or the method has been called.
The stream is in a .NET Compact Framework application and one of the following methods was called:
The .NET Compact Framework does not support the asynchronous model with base streams.
A object.
Gets or sets the serial baud rate.
The baud rate specified is less than or equal to zero, or is greater than the maximum allowable baud rate for the device.
The port is in an invalid state.
-or-
An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid.
The baud rate.
Gets or sets the break signal state.
The port is in an invalid state.
-or-
An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid.
The stream is closed. This can occur because the method has not been called or the method has been called.
if the port is in a break state; otherwise, .
Gets the number of bytes of data in the receive buffer.
The port is not open.
The number of bytes of data in the receive buffer.
Gets the number of bytes of data in the send buffer.
The port is in an invalid state.
The stream is closed. This can occur because the method has not been called or the method has been called.
The number of bytes of data in the send buffer.
Gets the state of the Carrier Detect line for the port.
The port is in an invalid state.
-or-
An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid.
The stream is closed. This can occur because the method has not been called or the method has been called.
if the carrier is detected; otherwise, .
Gets the state of the Clear-to-Send line.
The port is in an invalid state.
-or-
An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid.
The stream is closed. This can occur because the method has not been called or the method has been called.
if the Clear-to-Send line is detected; otherwise, .
Gets or sets the standard length of data bits per byte.
The port is in an invalid state.
-or-
An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid.
The data bits value is less than 5 or more than 8.
The data bits length.
Gets or sets a value indicating whether null bytes are ignored when transmitted between the port and the receive buffer.
The port is in an invalid state.
-or-
An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid.
The stream is closed. This can occur because the method has not been called or the method has been called.
if null bytes are ignored; otherwise . The default is .
Gets the state of the Data Set Ready (DSR) signal.
The port is in an invalid state.
-or-
An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid.
The stream is closed. This can occur because the method has not been called or the method has been called.
if a Data Set Ready signal has been sent to the port; otherwise, .
Gets or sets a value that enables the Data Terminal Ready (DTR) signal during serial communication.
The port is in an invalid state.
-or-
An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid.
to enable Data Terminal Ready (DTR); otherwise, . The default is .
Gets or sets the byte encoding for pre- and post-transmission conversion of text.
The property was set to .
The property was set to an encoding that is not , , , , one of the Windows single byte encodings, or one of the Windows double byte encodings.
An object. The default is .
Gets or sets the handshaking protocol for serial port transmission of data using a value from .
The port is in an invalid state.
-or-
An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid.
The value passed is not a valid value in the enumeration.
One of the values. The default is .
Gets a value indicating the open or closed status of the object.
The value passed is .
The value passed is an empty string ("").
if the serial port is open; otherwise, . The default is .
Gets or sets the value used to interpret the end of a call to the and methods.
The property value is empty.
The property value is .
A value that represents the end of a line. The default is a line feed ("\n" in C# or in Visual Basic).
Gets or sets the parity-checking protocol.
The port is in an invalid state.
-or-
An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid.
The value passed is not a valid value in the enumeration.
One of the enumeration values that represents the parity-checking protocol. The default is .
Gets or sets the byte that replaces invalid bytes in a data stream when a parity error occurs.
The port is in an invalid state.
-or-
An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid.
A byte that replaces invalid bytes.
Gets or sets the port for communications, including but not limited to all available COM ports.
The property was set to a value with a length of zero.
-or-
The property was set to a value that starts with "\\".
-or-
The port name was not valid.
The property was set to .
The specified port is open.
The communications port. The default is COM1.
Gets or sets the size of the input buffer.
The value set is less than or equal to zero.
The property was set while the stream was open.
The property was set to an odd integer value.
The buffer size, in bytes. The default value is 4096; the maximum value is that of a positive int, or 2147483647.
Gets or sets the number of milliseconds before a time-out occurs when a read operation does not finish.
The port is in an invalid state.
-or-
An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid.
The read time-out value is less than zero and not equal to .
The number of milliseconds before a time-out occurs when a read operation does not finish.
Gets or sets the number of bytes in the internal input buffer before a event occurs.
The value is less than or equal to zero.
The number of bytes in the internal input buffer before a event is fired. The default is 1.
Gets or sets a value indicating whether the Request to Send (RTS) signal is enabled during serial communication.
The value of the property was set or retrieved while the property is set to the value or the value.
The port is in an invalid state.
-or-
An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid.
to enable Request to Transmit (RTS); otherwise, . The default is .
Gets or sets the standard number of stopbits per byte.
The value is .
The port is in an invalid state.
-or-
An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid.
One of the values.
Gets or sets the size of the serial port output buffer.
The value is less than or equal to zero.
The property was set while the stream was open.
The property was set to an odd integer value.
The size of the output buffer. The default is 2048.
Gets or sets the number of milliseconds before a time-out occurs when a write operation does not finish.
The port is in an invalid state.
-or-
An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid.
The value is less than zero and not equal to .
The number of milliseconds before a time-out occurs. The default is .
Specifies the number of stop bits used on the object.
No stop bits are used. This value is not supported by the property.
One stop bit is used.
1.5 stop bits are used.
Two stop bits are used.