|
OSDP.Net 5.2.1
A .NET library for implementing the Open Supervised Device Protocol (OSDP)
|
TCP server OSDP connection that allows a ControlPanel (ACU) to act as a TCP server, accepting connections from OSDP devices. More...
Public Member Functions | |||||
| TcpServerOsdpConnection (int portNumber, int baudRate, ILoggerFactory loggerFactory=null) | |||||
| Initializes a new instance of the TcpServerOsdpConnection class. | |||||
| override async Task | Open () | ||||
| Open the connection for communications. | |||||
| override Task | Close () | ||||
| Close the connection for communications. | |||||
| override async 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 () | ||||
Protected Member Functions | |
| override void | Dispose (bool disposing) |
| 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. | |
| Protected Member Functions inherited from OSDP.Net.Connections.OsdpConnection | |
| OsdpConnection (int baudRate) | |
| Creates an instance of OsdpConnection. | |
Properties | |
| override bool | IsOpen [get] |
| Is the connection open and ready to communicate. | |
| 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. | |
TCP server OSDP connection that allows a ControlPanel (ACU) to act as a TCP server, accepting connections from OSDP devices.
This class combines TCP listening and connection handling in a single IOsdpConnection implementation, making it suitable for use with ControlPanel instances that need to accept incoming device connections. For scenarios where devices (PDs) need to accept ACU connections, use TcpConnectionListener instead.
Definition at line 19 of file TcpServerOsdpConnection.cs.
|
inline |
Initializes a new instance of the TcpServerOsdpConnection class.
| portNumber | The TCP port number to listen on. |
| baudRate | The simulated baud rate for OSDP communication timing. |
| loggerFactory | Optional logger factory for diagnostic logging. |
Definition at line 32 of file TcpServerOsdpConnection.cs.
References TcpServerOsdpConnection().
Referenced by TcpServerOsdpConnection().
|
inline |
Close the connection for communications.
Implements OSDP.Net.Connections.IOsdpConnection.
Definition at line 73 of file TcpServerOsdpConnection.cs.
|
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 from OSDP.Net.Connections.OsdpConnection.
Definition at line 152 of file TcpServerOsdpConnection.cs.
References Close().
|
inline |
Open the connection for communications.
Implements OSDP.Net.Connections.IOsdpConnection.
Definition at line 49 of file TcpServerOsdpConnection.cs.
References Close().
|
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 112 of file TcpServerOsdpConnection.cs.
|
inline |
Definition at line 146 of file TcpServerOsdpConnection.cs.
|
inline |
Write to connection.
| buffer | Array of bytes to write |
Implements OSDP.Net.Connections.IOsdpConnection.
Definition at line 93 of file TcpServerOsdpConnection.cs.
|
get |
Is the connection open and ready to communicate.
Implements OSDP.Net.Connections.IOsdpConnection.
Definition at line 39 of file TcpServerOsdpConnection.cs.