|
BSL430.NET
1.2.1
|
Interface for accessing serial based streams. More...
Public Member Functions | |
| string [] | GetPortNames () |
| Gets an array of serial port names for the current computer. More... | |
| PortDescription [] | GetPortDescriptions () |
| Gets an array of serial port names and descriptions for the current computer. More... | |
| void | DiscardInBuffer () |
| Discards the input queue buffer of the driver. More... | |
| void | DiscardOutBuffer () |
| Discards the output queue buffer of the driver. More... | |
| void | GetPortSettings () |
| Gets the port settings and updates the properties of the object. More... | |
| void | SetPortSettings () |
| Writes the settings of the serial port as set in this object. More... | |
| void | Open () |
| Opens the serial port specified by PortName. More... | |
| void | Close () |
| Closes the serial port. More... | |
| SerialBuffer | CreateSerialBuffer (int readBuffer, int writeBuffer) |
| Creates the serial buffer suitable for monitoring. More... | |
| void | StartMonitor (SerialBuffer buffer, string name) |
| Start the monitor thread, that will watch over the serial port. More... | |
Properties | |
| string | Version [get] |
| Gets the version of the implementation in use. More... | |
| string | PortName [get, set] |
| Gets or sets the port device path. More... | |
| int | BaudRate [get, set] |
| Gets or sets the baud rate. More... | |
| int | DataBits [get, set] |
| Gets or sets the data bits. More... | |
| Parity | Parity [get, set] |
| Gets or sets the parity. More... | |
| StopBits | StopBits [get, set] |
| Gets or sets the stop bits. More... | |
| bool | DiscardNull [get, set] |
| Gets or sets a value if null bytes should be discarded or not. More... | |
| byte | ParityReplace [get, set] |
| Gets or sets the parity replace byte. More... | |
| bool | TxContinueOnXOff [get, set] |
| Gets or sets a value indicating whether transmission should still be sent when the input buffer is full and if the XOff character has been sent. More... | |
| int | XOffLimit [get, set] |
| Gets or sets the XOff limit input when the XOff character should be sent. More... | |
| int | XOnLimit [get, set] |
| Gets or sets the XOn limit when the input buffer is below when the XOn character should be sent. More... | |
| bool | BreakState [get, set] |
| Gets or sets the break state of the serial port. More... | |
| int | DriverInQueue [get, set] |
| Gets or sets the driver input queue size. More... | |
| int | DriverOutQueue [get, set] |
| Gets or sets the driver output queue size. More... | |
| int | BytesToRead [get] |
| Gets the number of bytes in the input queue of the driver not yet read (not any managed buffers). More... | |
| int | BytesToWrite [get] |
| Gets the number of bytes in the output buffer of the driver still to write (not any managed buffers). More... | |
| bool | CDHolding [get] |
| Gets the state of the Carrier Detect pin on the serial port. More... | |
| bool | CtsHolding [get] |
| Gets the state of the Clear To Send pin on the serial port. More... | |
| bool | DsrHolding [get] |
| Gets the state of the Data Set Ready pin on the serial port. More... | |
| bool | RingHolding [get] |
| Gets the state of the Ring Indicator pin on the serial port. More... | |
| bool | DtrEnable [get, set] |
| Gets or sets the Data Terminal Ready pin of the serial port. More... | |
| bool | RtsEnable [get, set] |
| Gets or sets the Request To Send pin of the serial port. More... | |
| Handshake | Handshake [get, set] |
| Gets or sets the handshake to use on the serial port. More... | |
| bool | IsOpen [get] |
| Gets a value indicating whether the serial port has been opened. More... | |
| bool | IsRunning [get] |
| Gets a value indicating whether the thread for monitoring the serial port is running. More... | |
Events | |
| EventHandler< SerialDataReceivedEventArgs > | DataReceived |
| Occurs when data is received, or the EOF character is detected by the driver. More... | |
| EventHandler< SerialErrorReceivedEventArgs > | ErrorReceived |
| Occurs when an error condition is detected. More... | |
| EventHandler< SerialPinChangedEventArgs > | PinChanged |
| Occurs when modem pin changes are detected. More... | |
Interface for accessing serial based streams.
| void RJCP.IO.Ports.Native.INativeSerial.Close | ( | ) |
Closes the serial port.
Closing the serial port invalidates actions that can be done to the serial port, but it does not prevent the serial port from being reopened
Implemented in RJCP.IO.Ports.Native.WinNativeSerial, and RJCP.IO.Ports.Native.UnixNativeSerial.
| SerialBuffer RJCP.IO.Ports.Native.INativeSerial.CreateSerialBuffer | ( | int | readBuffer, |
| int | writeBuffer | ||
| ) |
Creates the serial buffer suitable for monitoring.
| readBuffer | The read buffer size to allocate. |
| writeBuffer | The write buffer size to allocate. |
Implemented in RJCP.IO.Ports.Native.WinNativeSerial, and RJCP.IO.Ports.Native.UnixNativeSerial.
| void RJCP.IO.Ports.Native.INativeSerial.DiscardInBuffer | ( | ) |
Discards the input queue buffer of the driver.
Implemented in RJCP.IO.Ports.Native.WinNativeSerial, and RJCP.IO.Ports.Native.UnixNativeSerial.
| void RJCP.IO.Ports.Native.INativeSerial.DiscardOutBuffer | ( | ) |
Discards the output queue buffer of the driver.
Implemented in RJCP.IO.Ports.Native.WinNativeSerial, and RJCP.IO.Ports.Native.UnixNativeSerial.
| PortDescription [] RJCP.IO.Ports.Native.INativeSerial.GetPortDescriptions | ( | ) |
Gets an array of serial port names and descriptions for the current computer.
This method uses the Windows Management Interface to obtain its information. Therefore, the list may be different to the list obtained using the GetPortNames() method which uses other techniques.
On Windows 7, this method shows to return normal COM ports, but not those associated with a modem driver.
Implemented in RJCP.IO.Ports.Native.UnixNativeSerial, and RJCP.IO.Ports.Native.WinNativeSerial.
| string [] RJCP.IO.Ports.Native.INativeSerial.GetPortNames | ( | ) |
Gets an array of serial port names for the current computer.
Implemented in RJCP.IO.Ports.Native.UnixNativeSerial, and RJCP.IO.Ports.Native.WinNativeSerial.
| void RJCP.IO.Ports.Native.INativeSerial.GetPortSettings | ( | ) |
Gets the port settings and updates the properties of the object.
Implemented in RJCP.IO.Ports.Native.WinNativeSerial, and RJCP.IO.Ports.Native.UnixNativeSerial.
| void RJCP.IO.Ports.Native.INativeSerial.Open | ( | ) |
Opens the serial port specified by PortName.
Opening the serial port does not set any settings (such as baud rate, etc.)
Implemented in RJCP.IO.Ports.Native.WinNativeSerial, and RJCP.IO.Ports.Native.UnixNativeSerial.
| void RJCP.IO.Ports.Native.INativeSerial.SetPortSettings | ( | ) |
Writes the settings of the serial port as set in this object.
Implemented in RJCP.IO.Ports.Native.WinNativeSerial, and RJCP.IO.Ports.Native.UnixNativeSerial.
| void RJCP.IO.Ports.Native.INativeSerial.StartMonitor | ( | SerialBuffer | buffer, |
| string | name | ||
| ) |
Start the monitor thread, that will watch over the serial port.
| buffer | The buffer structure that should be used to read data into and write data from. |
| name | The name of the thread to use. |
Implemented in RJCP.IO.Ports.Native.WinNativeSerial, and RJCP.IO.Ports.Native.UnixNativeSerial.
|
getset |
Gets or sets the baud rate.
The baud rate.
|
getset |
Gets or sets the break state of the serial port.
true if in the break state; otherwise, false.
|
get |
Gets the number of bytes in the input queue of the driver not yet read (not any managed buffers).
The number of bytes in the driver queue for reading. If this value is not supported, zero is returned.
|
get |
Gets the number of bytes in the output buffer of the driver still to write (not any managed buffers).
The number of bytes in the driver queue for writing. If this value is not supported, zero is returned.
|
get |
Gets the state of the Carrier Detect pin on the serial port.
true if carrier detect pin is active; otherwise, false.
|
get |
Gets the state of the Clear To Send pin on the serial port.
true if the clear to send pin is active; otherwise, false.
|
getset |
Gets or sets the data bits.
The data bits.
|
getset |
Gets or sets a value if null bytes should be discarded or not.
true if null bytes should be discarded; otherwise, false.
|
getset |
Gets or sets the driver input queue size.
The driver input queue size.
This method is typically available with Windows API only.
|
getset |
Gets or sets the driver output queue size.
The driver output queue size.
This method is typically available with Windows API only.
|
get |
Gets the state of the Data Set Ready pin on the serial port.
true if data set ready pin is active; otherwise, false.
|
getset |
Gets or sets the Data Terminal Ready pin of the serial port.
true if data terminal pin is active; otherwise, false.
This pin only has an effect if handshaking for DTR/DTS is disabled.
|
getset |
Gets or sets the handshake to use on the serial port.
The handshake mode to use on the serial port.
|
get |
Gets a value indicating whether the serial port has been opened.
true if this instance is open; otherwise, false.
This property only indicates if the port has been opened and that the internal handle is valid.
|
get |
Gets a value indicating whether the thread for monitoring the serial port is running.
true if this instance is running; otherwise, false.
This property differs slightly from IsOpen, as this returns status if the monitoring thread for reading/writing data is actually running. If the thread is not running for whatever reason, we can expect no data updates in the buffer provided to StartMonitor(SerialBuffer, string).
|
getset |
Gets or sets the parity.
The parity.
|
getset |
Gets or sets the parity replace byte.
The byte to use on parity errors.
|
getset |
Gets or sets the port device path.
The port device path.
|
get |
Gets the state of the Ring Indicator pin on the serial port.
true if ring indicator state is active; otherwise, false.
|
getset |
Gets or sets the Request To Send pin of the serial port.
true if [RTS enable]; otherwise, false.
This pin only has an effect if the handshaking for RTS/CTS is disabled.
|
getset |
Gets or sets the stop bits.
The stop bits.
|
getset |
Gets or sets a value indicating whether transmission should still be sent when the input buffer is full and if the XOff character has been sent.
true if transmission should continue after the input buffer is within XOffLimit bytes of being full and the driver has sent the XOff character; otherwise, false that transmission should stop and only continue when the input buffer is within XOnLimit bytes of being empty and the driver has sent the XOn character.
|
get |
Gets the version of the implementation in use.
The version of the implementation in use.
|
getset |
Gets or sets the XOff limit input when the XOff character should be sent.
The XOff buffer limit.
|
getset |
Gets or sets the XOn limit when the input buffer is below when the XOn character should be sent.
The XOn buffer limit.
| EventHandler<SerialDataReceivedEventArgs> RJCP.IO.Ports.Native.INativeSerial.DataReceived |
Occurs when data is received, or the EOF character is detected by the driver.
| EventHandler<SerialErrorReceivedEventArgs> RJCP.IO.Ports.Native.INativeSerial.ErrorReceived |
Occurs when an error condition is detected.
| EventHandler<SerialPinChangedEventArgs> RJCP.IO.Ports.Native.INativeSerial.PinChanged |
Occurs when modem pin changes are detected.
1.8.15