ZylSerialPort.NET

SerialPort Members

SerialPort overview

Public Static (Shared) Methods

ASCIIByteArrayToString Converts ASCII byte array to string.
ByteArrayToDecimalString Converts byte array to decimal string representation.
ByteArrayToHexaString Converts byte array to hexadecimal string representation.
GetCDOverloaded. Returns the state of CD line from lineStatus parameter.
GetCTSOverloaded. Returns the state of CTS line from lineStatus parameter.
GetDSROverloaded. Returns the state of DSR line from lineStatus parameter.
GetExistingCommPorts Returns the existing serial ports of the system.
GetRINGOverloaded. Returns the state of RING line from lineStatus parameter.
SerialCommPortToString Converts SerialCommPort to string.
StringToASCIIByteArray Converts string to ASCII byte array.
StringToSerialCommPort Converts string to SerialCommPort.
StringToUnicodeByteArray Converts string to UTF16 byte array.
StringToUTF7ByteArray Converts string to UTF7 byte array.
StringToUTF8ByteArray Converts string to UTF8 byte array.
UnicodeByteArrayToString Converts UTF16 byte array to string.
UTF7ByteArrayToString Converts UTF7 byte array to string.
UTF8ByteArrayToString Converts UTF8 byte array to string.

Public Instance Constructors

SerialPort Overloaded. Initializes a new instance of the SerialPort class.

Public Instance Properties

BaudRate Baud rate at which the communications device operates.
ConnectedTo Returns the physical port where the component is connected to.
Container (inherited from Component)Gets the IContainer that contains the Component.
CustomBaudRate Custom baud rate value, used when BaudRate is set to brCustom.
DataWidth Number of bits in the bytes transmitted and received.
Delay Time interval between two receivings in milliseconds (frequency).
EnableDTROnOpen Enable/disable DTR when the port is open.
EnableRTSOnOpen Enable/disable RTS when the port is open.
HardwareFlowControl Hardware flow control of the serial port.
InputBuffer Recommended size of the device's internal input buffer, in bytes.
IsReceiving This property is false when the component is receiving data from the port, otherwise is false. Use this property to check if the component is inside a receiving process.
IsSending This property is true when the component is sending data to the port, otherwise is false. Use this property to check if the component is inside a sending process.
LineStatus Line status of the serial port.
NeedSynchronization Set this property to true for thread safety. The default value is false. Note: if you set it to true, you may experiment thread interblocking and lower speed.
OutputBuffer Recommended size of the device's internal output buffer, in bytes.
ParityBits Parity scheme to be used.
Port Physical name of the serial port.
Priority Priority of the receiver thread.
ReadIntervalTimeout Maximum time allowed to elapse between the arrival of two characters on the communications line, in milliseconds. During a ReadFile operation, the time period begins when the first character is received. If the interval between the arrival of any two characters exceeds this amount, the ReadFile operation is completed and any buffered data is returned. A value of zero indicates that interval time-outs are not used. A value of MAXDWORD, combined with zero values for both the ReadTotalTimeoutConstant and ReadTotalTimeoutMultiplier members, specifies that the read operation is to return immediately with the characters that have already been received, even if no characters have been received.
ReadTotalTimeoutConstant Constant used to calculate the total time-out period for read operations, in milliseconds. For each read operation, this value is added to the product of the ReadTotalTimeoutMultiplier member and the requested number of bytes. A value of zero for both the ReadTotalTimeoutMultiplier and ReadTotalTimeoutConstant members indicates that total time-outs are not used for read operations.
ReadTotalTimeoutMultiplier Multiplier used to calculate the total time-out period for read operations, in milliseconds. For each read operation, this value is multiplied by the requested number of bytes to be read.
Site (inherited from Component)Gets or sets the ISite of the Component.
SoftwareFlowControl Software flow control of the serial port.
StopBits Number of stop bits to be used.
WriteTotalTimeoutConstant Constant used to calculate the total time-out period for write operations, in milliseconds. For each write operation, this value is added to the product of the WriteTotalTimeoutMultiplier member and the number of bytes to be written. A value of zero for both the WriteTotalTimeoutMultiplier and WriteTotalTimeoutConstant members indicates that total time-outs are not used for write operations.
WriteTotalTimeoutMultiplier Multiplier used to calculate the total time-out period for write operations, in milliseconds. For each write operation, this value is multiplied by the number of bytes to be written.

Public Instance Methods

ClearInputBuffer clears input buffer
ClearOutputBuffer clears output buffer
Close Closes the serial port.
CreateObjRef (inherited from MarshalByRefObject)Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.
Dispose (inherited from Component)Overloaded. Releases all resources used by the Component.
Equals (inherited from Object)Determines whether the specified Object is equal to the current Object.
GetCDOverloaded. Returns the state of CD line.
GetCTSOverloaded. Returns the state of CTS line.
GetDSROverloaded. Returns the state of DSR line.
GetHashCode (inherited from Object)Serves as a hash function for a particular type. GetHashCode is suitable for use in hashing algorithms and data structures like a hash table.
GetLifetimeService (inherited from MarshalByRefObject)Retrieves the current lifetime service object that controls the lifetime policy for this instance.
GetRINGOverloaded. Returns the state of RING line.
GetType (inherited from Object)Gets the Type of the current instance.
InitializeLifetimeService (inherited from MarshalByRefObject)Obtains a lifetime service object to control the lifetime policy for this instance.
Open Opens the serial port.
SendASCIIString Sends an ASCII string to the serial port.
SendByteArray Sends a byte array to the serial port.
SendUnicodeString Sends a UTF16 string to the serial port.
SendUTF7String Sends a UTF7 string to the serial port.
SendUTF8String Sends a UTF8 string to the serial port.
SetBreak Sets break line.
SetDTR Sets DTR line.
SetRTS Sets RTS line.
SetXonXoff Sets XOnXoff state.
ToString (inherited from Component)Returns a String containing the name of the Component, if any. This method should not be overridden.

Public Instance Events

Connected Occures after the serial port is connected.
Disconnected Occures when the serial port is disconnected.
Disposed (inherited from Component)Adds an event handler to listen to the Disposed event on the component.
LineStatusChanged Occures when the line status of the serial port is changed.
Received Occures when data was received.
Sent Occures when data was sent.

Protected Instance Properties

CanRaiseEvents (inherited from Component)Gets a value indicating whether the component can raise an event.
DesignMode (inherited from Component)Gets a value that indicates whether the Component is currently in design mode.
Events (inherited from Component)Gets the list of event handlers that are attached to this Component.

Protected Instance Methods

DisposeOverloaded. Clean up any resources being used.
Finalize Destructor.
GetService (inherited from Component)Returns an object that represents a service provided by the Component or by its Container.
MemberwiseClone (inherited from MarshalByRefObject)Overloaded. Creates a shallow copy of the current MarshalByRefObject object.
MemberwiseClone (inherited from Object)Overloaded. Creates a shallow copy of the current Object.
OnConnected Raises the Connected event.
OnDisconnected Raises the Disconnected event.
OnLineStatusChanged Raises the LineStatusChanged event.
OnReceived Raises the Received event.
OnSent Raises the Sent event.

See Also

SerialPort Class | ZylSerialPort Namespace