|
OSDP.Net 5.2.1
A .NET library for implementing the Open Supervised Device Protocol (OSDP)
|
Base OSDP connection class. More...
Public Member Functions | |||||
| 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 () | ||||
Protected Member Functions | |
| OsdpConnection (int baudRate) | |
| Creates an instance of OsdpConnection. | |
| virtual void | Dispose (bool disposing) |
| Disposes the OsdpConnection instance. | |
Properties | |
| 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. | |
Base OSDP connection class.
Definition at line 10 of file OsdpConnection.cs.
|
inlineprotected |
Creates an instance of OsdpConnection.
| baudRate | Baud rate for OSDP comms |
Definition at line 18 of file OsdpConnection.cs.
References BaudRate.
|
abstract |
Close the connection for communications.
Implements OSDP.Net.Connections.IOsdpConnection.
Referenced by Dispose(), and OSDP.Net.Connections.OsdpConnectionListener.RegisterConnection().
|
inline |
|
inlineprotectedvirtual |
Disposes the OsdpConnection instance.
This method is responsible for releasing any resources used by the OsdpConnection instance. It calls the Close method to close the connection if it is open and sets the _disposedValue field to true to indicate that the instance has been disposed.
Reimplemented in OSDP.Net.Connections.TcpServerOsdpConnection.
Definition at line 63 of file OsdpConnection.cs.
References Close().
|
abstract |
Open the connection for communications.
Implements OSDP.Net.Connections.IOsdpConnection.
|
abstract |
Read from connection.
| buffer | Array of bytes to read |
| token | Cancellation token to end reading of bytes |
Implements OSDP.Net.Connections.IOsdpConnection.
|
abstract |
Write to connection.
| buffer | Array of bytes to write |
Implements OSDP.Net.Connections.IOsdpConnection.
|
getprotected set |
Speed of the connection.
The setter is protected because most connection types fix their rate at construction. Types that can retune a live connection, such as SerialPortOsdpConnection, expose a public method to do so.
Implements OSDP.Net.Connections.IOsdpConnection.
Definition at line 29 of file OsdpConnection.cs.
Referenced by OSDP.Net.Connections.ReadOnlySerialPortOsdpConnection.Open(), OSDP.Net.Connections.SerialPortOsdpConnection.Open(), OsdpConnection(), OSDP.Net.Connections.SerialPortOsdpConnection.SetBaudRate(), and OSDP.Net.Connections.SerialPortOsdpConnection.WaitForTransmitCompleteAsync().
|
getprotected set |
Is the connection open and ready to communicate.
Implements OSDP.Net.Connections.IOsdpConnection.
Definition at line 32 of file OsdpConnection.cs.
Referenced by OSDP.Net.Connections.ReadOnlySerialPortOsdpConnection.Close(), OSDP.Net.Connections.SerialPortOsdpConnection.Close(), OSDP.Net.Connections.ReadOnlySerialPortOsdpConnection.Open(), OSDP.Net.Connections.SerialPortOsdpConnection.Open(), and OSDP.Net.Connections.ReadOnlySerialPortOsdpConnection.ReadAsync().
|
getset |
Timeout value waiting for a reply.
Implements OSDP.Net.Connections.IOsdpConnection.
Definition at line 35 of file OsdpConnection.cs.