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

Extended write (transparent mode) command data sent to a PD. More...

Inheritance diagram for OSDP.Net.Model.CommandData.ExtendedWrite:
OSDP.Net.Model.CommandData.CommandData OSDP.Net.Model.PayloadData

Public Member Functions

 ExtendedWrite (byte mode, byte pCommand, byte[] pData)
 Initializes a new instance of the ExtendedWrite 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 ExtendedWrite ParseData (ReadOnlySpan< byte > data)
 Parses the message payload bytes.
static ExtendedWrite ReadModeSetting ()
 Queries the PD for its current extended mode setting.
static ExtendedWrite ModeZeroConfiguration (bool enabled)
 Configures Mode 0 (enable or disable transparent mode).
static ExtendedWrite ModeOneConfiguration ()
 Switches the PD to Mode 1 (transparent APDU).
static ExtendedWrite ModeOnePassAPDUCommand (byte readerNumber, byte[] command)
 Passes a raw APDU to the smart card through the specified reader.
static ExtendedWrite ModeOneTerminateSmartCardConnection (byte readerNumber)
 Instructs the PD to terminate the smart card session on the specified reader.
static ExtendedWrite ModeOneSmartCardScan (byte readerNumber)
 Instructs the PD to scan for a smart card on the specified reader.

Properties

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

Extended write (transparent mode) command data sent to a PD.

Transparent mode allows an ACU to communicate with an ISO 7816-4 smart card through a PD's reader by tunneling raw APDU bytes over the OSDP link. The PD acts as a bridge between the ACU and the smart card.

Definition at line 17 of file ExtendedWrite.cs.

Constructor & Destructor Documentation

◆ ExtendedWrite()

OSDP.Net.Model.CommandData.ExtendedWrite.ExtendedWrite ( byte mode,
byte pCommand,
byte[] pData )
inline

Initializes a new instance of the ExtendedWrite class.

Parameters
modeExtended READ/WRITE mode (0 = configuration, 1 = transparent APDU).
pCommandCommand code whose meaning depends on mode .
pDataCommand-specific data.
Exceptions
ArgumentNullExceptionpData

Definition at line 26 of file ExtendedWrite.cs.

References Mode, PCommand, and PData.

Referenced by ModeOneConfiguration(), ModeOnePassAPDUCommand(), ModeOneSmartCardScan(), ModeOneTerminateSmartCardConnection(), ModeZeroConfiguration(), ParseData(), and ReadModeSetting().

Member Function Documentation

◆ BuildData()

override byte[] OSDP.Net.Model.CommandData.ExtendedWrite.BuildData ( )
inline

Definition at line 58 of file ExtendedWrite.cs.

References Mode, PCommand, and PData.

◆ ModeOnePassAPDUCommand()

ExtendedWrite OSDP.Net.Model.CommandData.ExtendedWrite.ModeOnePassAPDUCommand ( byte readerNumber,
byte[] command )
inlinestatic

Passes a raw APDU to the smart card through the specified reader.

Parameters
readerNumberThe reader number on the PD.
commandThe raw APDU bytes to send to the smart card.
Exceptions
ArgumentNullExceptioncommand

Definition at line 105 of file ExtendedWrite.cs.

References ExtendedWrite().

◆ ModeOneSmartCardScan()

ExtendedWrite OSDP.Net.Model.CommandData.ExtendedWrite.ModeOneSmartCardScan ( byte readerNumber)
static

Instructs the PD to scan for a smart card on the specified reader.

Parameters
readerNumberThe reader number on the PD.

References ExtendedWrite().

◆ ModeOneTerminateSmartCardConnection()

ExtendedWrite OSDP.Net.Model.CommandData.ExtendedWrite.ModeOneTerminateSmartCardConnection ( byte readerNumber)
static

Instructs the PD to terminate the smart card session on the specified reader.

Parameters
readerNumberThe reader number on the PD.

References ExtendedWrite().

◆ ModeZeroConfiguration()

ExtendedWrite OSDP.Net.Model.CommandData.ExtendedWrite.ModeZeroConfiguration ( bool enabled)
static

Configures Mode 0 (enable or disable transparent mode).

Parameters
enabledWhether Mode 0 is enabled.

References ExtendedWrite().

◆ ParseData()

ExtendedWrite OSDP.Net.Model.CommandData.ExtendedWrite.ParseData ( ReadOnlySpan< byte > data)
inlinestatic

Parses the message payload bytes.

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

Leniently handles short payloads so the PD does not NAK mid-handshake when an ACU sends a Mode-only or Mode+PCommand probe. Missing fields default to zero/empty.

Definition at line 72 of file ExtendedWrite.cs.

References ExtendedWrite().

Referenced by OSDP.Net.Device.EnqueuePollReply(), and OSDP.Net.Model.Packet.ParsePayloadData().

◆ ToString()

override string OSDP.Net.Model.CommandData.ExtendedWrite.ToString ( )
inline

Definition at line 130 of file ExtendedWrite.cs.

Property Documentation

◆ Code

override byte OSDP.Net.Model.CommandData.ExtendedWrite.Code
get

Definition at line 52 of file ExtendedWrite.cs.

◆ CommandType

override CommandType OSDP.Net.Model.CommandData.ExtendedWrite.CommandType
get

Definition at line 49 of file ExtendedWrite.cs.

◆ Mode

byte OSDP.Net.Model.CommandData.ExtendedWrite.Mode
get

Gets the extended READ/WRITE mode.

Definition at line 36 of file ExtendedWrite.cs.

Referenced by BuildData(), and ExtendedWrite().

◆ PCommand

byte OSDP.Net.Model.CommandData.ExtendedWrite.PCommand
get

Gets the mode-specific command code.

Definition at line 41 of file ExtendedWrite.cs.

Referenced by BuildData(), and ExtendedWrite().

◆ PData

byte [] OSDP.Net.Model.CommandData.ExtendedWrite.PData
get

Gets the command-specific data.

Definition at line 46 of file ExtendedWrite.cs.

Referenced by BuildData(), and ExtendedWrite().


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