|
OSDP.Net 5.2.1
A .NET library for implementing the Open Supervised Device Protocol (OSDP)
|
Read-only serial port connection for passive monitoring of OSDP traffic. More...
Public Member Functions | |||||
| ReadOnlySerialPortOsdpConnection (string portName, int baudRate) | |||||
| Initializes a new instance of the ReadOnlySerialPortOsdpConnection class. | |||||
| override Task | Open () | ||||
| Open the connection for communications. | |||||
| override Task | Close () | ||||
| Close the connection for communications. | |||||
| override Task | WriteAsync (byte[] buffer) | ||||
Write to connection.
| |||||
| override async Task< int > | ReadAsync (byte[] buffer, CancellationToken token) | ||||
Read from connection.
| |||||
| override string | ToString () | ||||
| Public Member Functions inherited from OSDP.Net.Connections.OsdpConnection | |||||
| Task | Close () | ||||
| Close the connection for communications. | |||||
| Task | Open () | ||||
| Open the connection for communications. | |||||
| Task< int > | ReadAsync (byte[] buffer, CancellationToken token) | ||||
Read from connection.
| |||||
| Task | WriteAsync (byte[] buffer) | ||||
Write to connection.
| |||||
| void | Dispose () | ||||
Additional Inherited Members | |
| Protected Member Functions inherited from OSDP.Net.Connections.OsdpConnection | |
| OsdpConnection (int baudRate) | |
| Creates an instance of OsdpConnection. | |
| virtual void | Dispose (bool disposing) |
| Disposes the OsdpConnection instance. | |
| Properties inherited from OSDP.Net.Connections.OsdpConnection | |
| int | BaudRate [get, protected set] |
| Speed of the connection. | |
| virtual bool | IsOpen [get, protected set] |
| Is the connection open and ready to communicate. | |
| TimeSpan | ReplyTimeout = TimeSpan.FromMilliseconds(200) [get, set] |
| Timeout value waiting for a reply. | |
Read-only serial port connection for passive monitoring of OSDP traffic.
This connection only supports reading data and will throw NotSupportedException for write operations.
Definition at line 12 of file ReadOnlySerialPortOsdpConnection.cs.
|
inline |
Initializes a new instance of the ReadOnlySerialPortOsdpConnection class.
| portName | Name of the serial port (e.g., "COM3"). |
| baudRate | The baud rate for the serial connection. |
| ArgumentNullException | Thrown when portName is null. |
Definition at line 23 of file ReadOnlySerialPortOsdpConnection.cs.
|
inline |
Close the connection for communications.
Implements OSDP.Net.Connections.IOsdpConnection.
Definition at line 50 of file ReadOnlySerialPortOsdpConnection.cs.
References OSDP.Net.Connections.OsdpConnection.IsOpen.
|
inline |
Open the connection for communications.
Implements OSDP.Net.Connections.IOsdpConnection.
Definition at line 29 of file ReadOnlySerialPortOsdpConnection.cs.
References OSDP.Net.Connections.OsdpConnection.BaudRate, and OSDP.Net.Connections.OsdpConnection.IsOpen.
|
inline |
Read from connection.
| buffer | Array of bytes to read |
| token | Cancellation token to end reading of bytes |
Implements OSDP.Net.Connections.IOsdpConnection.
Definition at line 74 of file ReadOnlySerialPortOsdpConnection.cs.
References OSDP.Net.Connections.OsdpConnection.IsOpen.
|
inline |
Definition at line 92 of file ReadOnlySerialPortOsdpConnection.cs.
|
inline |
Write to connection.
| buffer | Array of bytes to write |
| NotSupportedException | This connection is read-only and does not support write operations. |
Implements OSDP.Net.Connections.IOsdpConnection.
Definition at line 67 of file ReadOnlySerialPortOsdpConnection.cs.