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

An extended read (transparent mode) reply. More...

Inheritance diagram for OSDP.Net.Model.ReplyData.ExtendedRead:
OSDP.Net.Model.PayloadData

Public Member Functions

 ExtendedRead (byte mode, byte pReply, byte[] pData)
 Initializes a new instance of the ExtendedRead class.
override ReadOnlySpan< byte > SecurityControlBlock ()
override byte[] BuildData ()
override string ToString ()
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 ExtendedRead ParseData (ReadOnlySpan< byte > data)
 Parses the message payload bytes.
static ExtendedRead ModeZeroSettingReport (byte currentMode, bool enabled)
 Builds a Mode-0 setting report reply (response to CommandData.ExtendedWrite.ReadModeSetting).
static ExtendedRead CardPresent (byte readerNumber)
 Builds an unsolicited card-present notification on the specified reader.
static ExtendedRead ApduResponse (byte readerNumber, byte[] response)
 Builds a Mode-1 APDU response reply.
static ExtendedRead SessionTerminated (byte readerNumber)
 Builds a Mode-1 smart-card session-terminated reply.

Properties

byte Mode [get]
 Gets the extended READ/WRITE mode.
byte PReply [get]
 Gets the mode-specific reply code.
byte[] PData [get]
 Gets the reply data.
override byte Code [get]
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.

Detailed Description

An extended read (transparent mode) reply.

Transparent mode uses paired XWR/XRD messages to tunnel ISO 7816-4 smart-card APDUs across the OSDP link. This class is the PD-side reply payload and can be both built (PD sending) and parsed (ACU receiving).

Definition at line 16 of file ExtendedRead.cs.

Constructor & Destructor Documentation

◆ ExtendedRead()

OSDP.Net.Model.ReplyData.ExtendedRead.ExtendedRead ( byte mode,
byte pReply,
byte[] pData )
inline

Initializes a new instance of the ExtendedRead class.

Parameters
modeExtended READ/WRITE mode (0 = configuration, 1 = transparent APDU).
pReplyMode-specific reply code.
pDataReply data.
Exceptions
ArgumentNullExceptionpData

Definition at line 25 of file ExtendedRead.cs.

References Mode, PData, and PReply.

Referenced by ApduResponse(), CardPresent(), ModeZeroSettingReport(), ParseData(), and SessionTerminated().

Member Function Documentation

◆ ApduResponse()

ExtendedRead OSDP.Net.Model.ReplyData.ExtendedRead.ApduResponse ( byte readerNumber,
byte[] response )
inlinestatic

Builds a Mode-1 APDU response reply.

Parameters
readerNumberThe reader number on the PD.
responseThe APDU response bytes returned from the smart card.
Exceptions
ArgumentNullExceptionresponse

Definition at line 101 of file ExtendedRead.cs.

References ExtendedRead().

◆ BuildData()

override byte[] OSDP.Net.Model.ReplyData.ExtendedRead.BuildData ( )
inline

Definition at line 54 of file ExtendedRead.cs.

References Mode, PData, and PReply.

◆ CardPresent()

ExtendedRead OSDP.Net.Model.ReplyData.ExtendedRead.CardPresent ( byte readerNumber)
static

Builds an unsolicited card-present notification on the specified reader.

Parameters
readerNumberThe reader number on the PD.

References ExtendedRead().

◆ ModeZeroSettingReport()

ExtendedRead OSDP.Net.Model.ReplyData.ExtendedRead.ModeZeroSettingReport ( byte currentMode,
bool enabled )
static

Builds a Mode-0 setting report reply (response to CommandData.ExtendedWrite.ReadModeSetting).

Parameters
currentModeThe PD's currently configured transparent mode (0 or 1).
enabledWhether transparent mode is enabled.

References ExtendedRead().

◆ ParseData()

ExtendedRead OSDP.Net.Model.ReplyData.ExtendedRead.ParseData ( ReadOnlySpan< byte > data)
inlinestatic

Parses the message payload bytes.

Parameters
dataMessage payload as bytes.
Returns
An instance of ExtendedRead representing the message payload.

Leniently handles short payloads: the smart-card flow legitimately produces replies shorter than two bytes during PD state transitions (e.g., while scanning for a card), so missing fields default to zero/empty rather than throwing.

Definition at line 72 of file ExtendedRead.cs.

References ExtendedRead().

Referenced by OSDP.Net.ControlPanel.ExtendedWriteData(), and OSDP.Net.Model.Packet.ParsePayloadData().

◆ SessionTerminated()

ExtendedRead OSDP.Net.Model.ReplyData.ExtendedRead.SessionTerminated ( byte readerNumber)
static

Builds a Mode-1 smart-card session-terminated reply.

Parameters
readerNumberThe reader number on the PD.

References ExtendedRead().

◆ ToString()

override string OSDP.Net.Model.ReplyData.ExtendedRead.ToString ( )
inline

Definition at line 119 of file ExtendedRead.cs.

Property Documentation

◆ Code

override byte OSDP.Net.Model.ReplyData.ExtendedRead.Code
get

Definition at line 48 of file ExtendedRead.cs.

◆ Mode

byte OSDP.Net.Model.ReplyData.ExtendedRead.Mode
get

Gets the extended READ/WRITE mode.

Definition at line 35 of file ExtendedRead.cs.

Referenced by BuildData(), and ExtendedRead().

◆ PData

byte [] OSDP.Net.Model.ReplyData.ExtendedRead.PData
get

Gets the reply data.

Definition at line 45 of file ExtendedRead.cs.

Referenced by BuildData(), and ExtendedRead().

◆ PReply

byte OSDP.Net.Model.ReplyData.ExtendedRead.PReply
get

Gets the mode-specific reply code.

Definition at line 40 of file ExtendedRead.cs.

Referenced by BuildData(), and ExtendedRead().


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