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

An Echo Request (Command ID 0x01) from the Line Quality Test Procedure, section 3.5. More...

Inheritance diagram for OSDP.Net.LineQuality.EchoRequest:
OSDP.Net.Model.CommandData.CommandData OSDP.Net.Model.PayloadData

Public Member Functions

 EchoRequest (byte sequenceNumber, TestPattern pattern, int payloadLength)
 Initializes an Echo Request carrying freshly generated pattern data.
override ReadOnlySpan< byte > SecurityControlBlock ()
override byte[] BuildData ()
Public Member Functions inherited from OSDP.Net.Model.PayloadData
byte[] BuildData ()
 Converts the payload into a byte array to be sent over the wire.
ReadOnlySpan< byte > SecurityControlBlock ()
 Retrieves the security control block for a specific command data type.
virtual void CustomMessageUpdate (Span< byte > messageBuffer)
 Updates the message data before sending in the specified byte buffer.

Static Public Member Functions

static bool TryParse (ReadOnlySpan< byte > payload, out EchoRequest request)
 Attempts to parse an Echo Request from an osdp_MFG payload.

Properties

byte SequenceNumber [get]
 Gets the test sequence number, echoed back by the responder.
TestPattern Pattern [get]
 Gets the requested test pattern.
byte[] Data [get]
 Gets the test data carried by the request.
int DeclaredPayloadLength [get]
 Gets the payload length declared in the header, which may differ from the number of bytes actually present when a frame has been truncated.
bool IsLengthConsistent [get]
 Gets a value indicating whether the declared payload length matches the bytes present.
override CommandType CommandType [get]
override byte Code [get]
Properties inherited from OSDP.Net.Model.CommandData.CommandData
CommandType CommandType [get]
 Message command code.
Properties inherited from OSDP.Net.Model.PayloadData
byte Code [get]
 Gets the command or reply code byte value that represent the type of data.
virtual bool IsSecurityInitialization [get]
 Gets a value indicating whether the security initialization is performed by this payload.

Additional Inherited Members

Static Protected Member Functions inherited from OSDP.Net.Model.CommandData.CommandData
static T[] SplitData< T > (int size, Func< byte[], T > parseDataFunction, ReadOnlySpan< byte > payloadData)
 Splits data into multiple elements of type T based on a specified size.

Detailed Description

An Echo Request (Command ID 0x01) from the Line Quality Test Procedure, section 3.5.

The responder echoes the test data back so the controller can count what survived the wire.

Definition at line 12 of file EchoRequest.cs.

Constructor & Destructor Documentation

◆ EchoRequest()

OSDP.Net.LineQuality.EchoRequest.EchoRequest ( byte sequenceNumber,
TestPattern pattern,
int payloadLength )
inline

Initializes an Echo Request carrying freshly generated pattern data.

Parameters
sequenceNumberTest sequence number, rolling 0x00 to 0xFF. This is unrelated to the OSDP control byte sequence.
patternThe pattern to generate.
payloadLengthLength of test data, 0 to LineQualityProtocol.MaxPayloadLength.

Definition at line 22 of file EchoRequest.cs.

Referenced by TryParse().

Member Function Documentation

◆ BuildData()

override byte[] OSDP.Net.LineQuality.EchoRequest.BuildData ( )
inline

◆ TryParse()

bool OSDP.Net.LineQuality.EchoRequest.TryParse ( ReadOnlySpan< byte > payload,
out EchoRequest request )
inlinestatic

Attempts to parse an Echo Request from an osdp_MFG payload.

Parameters
payloadThe message payload, starting at the vendor code.
requestOn success, the parsed request.
Returns
true when the payload is a structurally valid line quality echo request.

A declared length that exceeds the bytes present, or that exceeds LineQualityProtocol.MaxPayloadLength, still parses. The caller decides whether that warrants a status code or a NAK, which it can determine from IsLengthConsistent and DeclaredPayloadLength.

Definition at line 90 of file EchoRequest.cs.

References OSDP.Net.LineQuality.LineQualityProtocol.EchoCommandId, OSDP.Net.LineQuality.LineQualityProtocol.EchoHeaderLength, EchoRequest(), and OSDP.Net.LineQuality.LineQualityProtocol.IsLineQualityVendorCode().

Property Documentation

◆ Code

override byte OSDP.Net.LineQuality.EchoRequest.Code
get

Definition at line 60 of file EchoRequest.cs.

◆ CommandType

override CommandType OSDP.Net.LineQuality.EchoRequest.CommandType
get

Definition at line 57 of file EchoRequest.cs.

◆ Data

byte [] OSDP.Net.LineQuality.EchoRequest.Data
get

Gets the test data carried by the request.

Definition at line 43 of file EchoRequest.cs.

Referenced by BuildData().

◆ DeclaredPayloadLength

int OSDP.Net.LineQuality.EchoRequest.DeclaredPayloadLength
get

Gets the payload length declared in the header, which may differ from the number of bytes actually present when a frame has been truncated.

Definition at line 49 of file EchoRequest.cs.

Referenced by BuildData().

◆ IsLengthConsistent

bool OSDP.Net.LineQuality.EchoRequest.IsLengthConsistent
get

Gets a value indicating whether the declared payload length matches the bytes present.

Definition at line 54 of file EchoRequest.cs.

◆ Pattern

TestPattern OSDP.Net.LineQuality.EchoRequest.Pattern
get

Gets the requested test pattern.

Definition at line 40 of file EchoRequest.cs.

Referenced by BuildData().

◆ SequenceNumber

byte OSDP.Net.LineQuality.EchoRequest.SequenceNumber
get

Gets the test sequence number, echoed back by the responder.

Definition at line 37 of file EchoRequest.cs.

Referenced by BuildData().


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