OSDP.Net 5.2.1
A .NET library for implementing the Open Supervised Device Protocol (OSDP)
Loading...
Searching...
No Matches
OSDP.Net.LineQuality.LineQualityResponder Class Referencesealed

The responder side of the OSDP Line Quality Test Procedure: answers echo requests at the dedicated test address and follows the controller through baud rate changes. More...

Public Member Functions

 LineQualityResponder (IRetunableOsdpConnection connection, byte address=LineQualityProtocol.TestAddress, ILoggerFactory loggerFactory=null)
 Initializes a line quality responder.
async Task RunAsync (CancellationToken token)
 Runs the responder until the token is cancelled.

Properties

TimeSpan AutoRevertTimeout = TimeSpan.FromSeconds(30) [get, set]
 Gets or sets how long the responder waits without a valid command before falling back to 9600 baud.
TimeSpan BaudRateSettleDelay = TimeSpan.FromMilliseconds(100) [get, set]
 Gets or sets how long to wait after a baud rate change acknowledgment has drained before retuning the port.
int CurrentBaudRate [get]
 Gets the baud rate the responder is currently answering at.

Events

EventHandler< LineQualityExchangeEventArgs > ExchangeCompleted
 Raised after each exchange, for progress display and diagnostics.
EventHandler< LineQualityBaudRateChangedEventArgs > BaudRateChanged
 Raised whenever the responder retunes, either because the controller asked it to or because the idle timeout returned it to the baseline.

Detailed Description

The responder side of the OSDP Line Quality Test Procedure: answers echo requests at the dedicated test address and follows the controller through baud rate changes.

This deliberately does not build on Device. A line quality responder does not implement osdp_POLL, osdp_ID, osdp_CAP, osdp_COMSET or secure channel, and it has to retune its own port mid-session, which the connection-listener architecture is not shaped for. Owning the receive loop keeps the baud rate change under this class's control.

Commands that fail their integrity check are met with silence rather than a NAK. The controller counts the resulting timeout, which is the honest outcome: a frame whose CRC failed cannot be trusted to have come from this address in the first place.

Definition at line 31 of file LineQualityResponder.cs.

Constructor & Destructor Documentation

◆ LineQualityResponder()

OSDP.Net.LineQuality.LineQualityResponder.LineQualityResponder ( IRetunableOsdpConnection connection,
byte address = LineQualityProtocol::TestAddress,
ILoggerFactory loggerFactory = null )
inline

Initializes a line quality responder.

Parameters
connectionThe serial connection to answer on. The responder takes over the connection and retunes it during baud rate changes.
addressAddress to answer at. Defaults to the dedicated test address 125.
loggerFactoryOptional logger factory.
Exceptions
ArgumentNullExceptionThe connection is null.

Definition at line 58 of file LineQualityResponder.cs.

References LineQualityResponder().

Referenced by LineQualityResponder().

Member Function Documentation

◆ RunAsync()

async Task OSDP.Net.LineQuality.LineQualityResponder.RunAsync ( CancellationToken token)
inline

Runs the responder until the token is cancelled.

Parameters
tokenToken used to stop the responder.

Definition at line 107 of file LineQualityResponder.cs.

Property Documentation

◆ AutoRevertTimeout

TimeSpan OSDP.Net.LineQuality.LineQualityResponder.AutoRevertTimeout = TimeSpan.FromSeconds(30)
getset

Gets or sets how long the responder waits without a valid command before falling back to 9600 baud.

Defaults to 30 seconds; set to Timeout.InfiniteTimeSpan to disable.

The specification requires only that a responder power up at 9600. Reverting on idle as well means a baud rate change the line cannot sustain recovers by itself, instead of needing someone to walk over and power cycle the device.

Definition at line 76 of file LineQualityResponder.cs.

◆ BaudRateSettleDelay

TimeSpan OSDP.Net.LineQuality.LineQualityResponder.BaudRateSettleDelay = TimeSpan.FromMilliseconds(100)
getset

Gets or sets how long to wait after a baud rate change acknowledgment has drained before retuning the port.

Defaults to the 100 ms the specification requires.

Definition at line 82 of file LineQualityResponder.cs.

◆ CurrentBaudRate

int OSDP.Net.LineQuality.LineQualityResponder.CurrentBaudRate
get

Gets the baud rate the responder is currently answering at.

Definition at line 85 of file LineQualityResponder.cs.

Event Documentation

◆ BaudRateChanged

EventHandler<LineQualityBaudRateChangedEventArgs> OSDP.Net.LineQuality.LineQualityResponder.BaudRateChanged

Raised whenever the responder retunes, either because the controller asked it to or because the idle timeout returned it to the baseline.

Section 8.3 of the test procedure asks a responder to indicate its current rate. Without this, a responder left on a high rate after an interrupted run is invisible, and the next controller that fails to find it has no way to tell why.

Definition at line 101 of file LineQualityResponder.cs.

◆ ExchangeCompleted

EventHandler<LineQualityExchangeEventArgs> OSDP.Net.LineQuality.LineQualityResponder.ExchangeCompleted

Raised after each exchange, for progress display and diagnostics.

Definition at line 90 of file LineQualityResponder.cs.


The documentation for this class was generated from the following file: