|
OSDP.Net 5.2.1
A .NET library for implementing the Open Supervised Device Protocol (OSDP)
|
Represents a Peripheral Device (PD) that communicates over the OSDP protocol. More...
Classes | |
| class | DeviceComSetUpdatedEventArgs |
| Event arguments for DeviceComSetUpdated event, which is raised whenever ACU requests the device to update its address and/or baud rate. More... | |
Public Member Functions | |
| Device (DeviceConfiguration config, ILoggerFactory loggerFactory=null) | |
| Represents a Peripheral Device (PD) that communicates over the OSDP protocol. | |
| void | Dispose () |
| async Task | StartListening (IOsdpConnectionListener connectionListener) |
| Starts listening for commands from the ACU through the specified connection listener. | |
| async Task | StopListening () |
| Stops listening for OSDP messages on the device. | |
| void | EnqueuePollReply (PayloadData reply) |
| Enqueues a reply into the pending poll reply queue. | |
Protected Member Functions | |
| virtual void | Dispose (bool disposing) |
| Disposes the Device instance. | |
| virtual PayloadData | HandleIdReport () |
| Handles the ID Report Request command received from the OSDP device. | |
| virtual PayloadData | HandleExtendedIdReport () |
| Handles the Extended ID Report Request command received from the OSDP device. | |
| virtual PayloadData | HandleTextOutput (ReaderTextOutput commandPayload) |
| Handles the text output command received from the OSDP device. | |
| virtual PayloadData | HandleBuzzerControl (ReaderBuzzerControl commandPayload) |
| Handles the reader buzzer control command received from the OSDP device. | |
| virtual PayloadData | HandleOutputControl (OutputControls commandPayload) |
| Handles the output controls command received from the OSDP device. | |
| virtual PayloadData | HandleDeviceCapabilities () |
| Handles the device capabilities request command received from the OSDP device. | |
| virtual PayloadData | HandlePivData (GetPIVData commandPayload) |
| Handles the get PIV data command received from the OSDP device. | |
| virtual PayloadData | HandleManufacturerCommand (ManufacturerSpecific commandPayload) |
| Handles the manufacturer-specific command received from the OSDP device. | |
| virtual PayloadData | HandleExtendedWrite (ExtendedWrite commandPayload) |
| Handles the extended write (transparent mode) command received from the ACU. | |
| virtual PayloadData | HandleKeepActive (KeepReaderActive commandPayload) |
| Handles the keep active command received from the OSDP device. | |
| virtual PayloadData | HandleAbortRequest () |
| Handles the abort request command received from the OSDP device. | |
| virtual PayloadData | HandleFileTransfer (FileTransferFragment commandPayload) |
| Handles the file transfer command received from the OSDP device. | |
| virtual PayloadData | HandleMaxReplySize (ACUReceiveSize commandPayload) |
| Handles the maximum ACU receive size command received from the OSDP device. | |
| virtual PayloadData | HandleKeySettings (EncryptionKeyConfiguration commandPayload) |
| If deriving PD class is intending to support secure connections, it MUST override this method to provide its own means of persisting a newly set security key which was sent by the ACU. | |
| virtual PayloadData | HandleBiometricMatch (BiometricTemplateData commandPayload) |
| Handles the biometric match command received from the OSDP device. | |
| virtual PayloadData | HandleBiometricRead (BiometricReadData commandPayload) |
| Handles the biometric read command received from the OSDP device. | |
| virtual PayloadData | HandleCommunicationSet (CommunicationConfiguration commandPayload) |
| If deriving PD class is intending to support updating the communication settings, it MUST override this method to provide its own means of persisting a new baud rate and address which was sent by the ACU. | |
| virtual PayloadData | HandleReaderLEDControl (ReaderLedControls commandPayload) |
| Handles the reader LED controls command received from the OSDP device. | |
| virtual PayloadData | HandleReaderStatusReport () |
| Handles the reader status command received from the OSDP device. | |
| virtual PayloadData | HandleOutputStatusReport () |
| Handles the output status command received from the OSDP device. | |
| virtual PayloadData | HandleInputStatusReport () |
| Handles the input status command received from the OSDP device. | |
| virtual PayloadData | HandleLocalStatusReport () |
| Handles the reader local status command received from the OSDP device. | |
Properties | |
| bool | IsConnected [get] |
| Gets a value indicating whether the device is currently connected. | |
Events | |
| EventHandler< DeviceComSetUpdatedEventArgs > | DeviceComSetUpdated |
| Gets raised whenever osdp_ComSet command is successfully processed, and there is a change in either device address or baud rate. | |
|
inline |
|
inline |
|
inlineprotectedvirtual |
Disposes the Device instance.
This method is responsible for releasing any resources used by the Device instance.
Definition at line 78 of file Device.cs.
References StopListening().
| void OSDP.Net.Device.EnqueuePollReply | ( | PayloadData | reply | ) |
Enqueues a reply into the pending poll reply queue.
| reply | The reply to enqueue. |
References OSDP.Net.Messages.Abort, OSDP.Net.Messages.BioMatch, OSDP.Net.Messages.BioRead, OSDP.Net.Messages.BuzzerControl, OSDP.Net.Messages.CommunicationSet, OSDP.Net.Messages.DeviceCapabilities, OSDP.Net.Messages.ExtendedWrite, OSDP.Net.Messages.FileTransfer, HandleAbortRequest(), HandleBiometricMatch(), HandleBiometricRead(), HandleBuzzerControl(), HandleDeviceCapabilities(), HandleExtendedWrite(), HandleFileTransfer(), HandleInputStatusReport(), HandleKeepActive(), HandleLocalStatusReport(), HandleManufacturerCommand(), HandleMaxReplySize(), HandleOutputControl(), HandleOutputStatusReport(), HandlePivData(), HandleReaderLEDControl(), HandleReaderStatusReport(), HandleTextOutput(), OSDP.Net.Messages.IdReport, OSDP.Net.Messages.InputStatus, OSDP.Net.Messages.IncomingMessage.IsDataCorrect, OSDP.Net.Messages.KeepActive, OSDP.Net.Messages.KeySet, OSDP.Net.Messages.LEDControl, OSDP.Net.Messages.LocalStatus, OSDP.Net.Messages.ManufacturerSpecific, OSDP.Net.Messages.MaxReplySize, OSDP.Net.Messages.OutputControl, OSDP.Net.Messages.OutputStatus, OSDP.Net.Model.CommandData.ACUReceiveSize.ParseData(), OSDP.Net.Model.CommandData.BiometricReadData.ParseData(), OSDP.Net.Model.CommandData.BiometricTemplateData.ParseData(), OSDP.Net.Model.CommandData.CommunicationConfiguration.ParseData(), OSDP.Net.Model.CommandData.EncryptionKeyConfiguration.ParseData(), OSDP.Net.Model.CommandData.ExtendedWrite.ParseData(), OSDP.Net.Model.CommandData.FileTransferFragment.ParseData(), OSDP.Net.Model.CommandData.GetPIVData.ParseData(), OSDP.Net.Model.CommandData.KeepReaderActive.ParseData(), OSDP.Net.Model.CommandData.ManufacturerSpecific.ParseData(), OSDP.Net.Model.CommandData.OutputControls.ParseData(), OSDP.Net.Model.CommandData.ReaderBuzzerControl.ParseData(), OSDP.Net.Model.CommandData.ReaderLedControls.ParseData(), OSDP.Net.Model.CommandData.ReaderTextOutput.ParseData(), OSDP.Net.Messages.IncomingMessage.Payload, OSDP.Net.Messages.PivData, OSDP.Net.Messages.Poll, OSDP.Net.Messages.ReaderStatus, OSDP.Net.Messages.TextOutput, and OSDP.Net.Messages.IncomingMessage.Type.
|
inlineprotectedvirtual |
Handles the abort request command received from the OSDP device.
Definition at line 372 of file Device.cs.
Referenced by EnqueuePollReply().
|
inlineprotectedvirtual |
Handles the biometric match command received from the OSDP device.
| commandPayload | The biometric match command payload. |
Definition at line 442 of file Device.cs.
Referenced by EnqueuePollReply().
|
inlineprotectedvirtual |
Handles the biometric read command received from the OSDP device.
| commandPayload | The biometric read command payload. |
Definition at line 452 of file Device.cs.
Referenced by EnqueuePollReply().
|
inlineprotectedvirtual |
Handles the reader buzzer control command received from the OSDP device.
| commandPayload | The incoming reader buzzer control command payload. |
Definition at line 295 of file Device.cs.
Referenced by EnqueuePollReply().
|
inlineprotectedvirtual |
If deriving PD class is intending to support updating the communication settings, it MUST override this method to provide its own means of persisting a new baud rate and address which was sent by the ACU.
NOTE: The consumer will need to listen to the DeviceComSetUpdated event. It allows it to reinitialize the connection after successfully sending the reply.
| commandPayload | The requested communication settings command payload. |
|
inlineprotectedvirtual |
Handles the device capabilities request command received from the OSDP device.
Definition at line 314 of file Device.cs.
Referenced by EnqueuePollReply().
|
inlineprotectedvirtual |
Handles the Extended ID Report Request command received from the OSDP device.
This method is called when an osdp_ID command is received with data byte 0x01. The response should be an ExtendedDeviceIdentification containing TLV-encoded device information.
|
inlineprotectedvirtual |
Handles the extended write (transparent mode) command received from the ACU.
| commandPayload | The incoming extended write command payload. |
Transparent mode tunnels ISO 7816-4 smart-card APDUs through a PD reader over the OSDP link. The default implementation NAKs with UnknownCommandCode; PDs that support transparent mode should override and return an ExtendedRead payload. To push an unsolicited XRD (e.g., card-present notification) call EnqueuePollReply with an ExtendedRead instance.
Definition at line 353 of file Device.cs.
Referenced by EnqueuePollReply().
|
inlineprotectedvirtual |
Handles the file transfer command received from the OSDP device.
| commandPayload | The incoming file transfer fragment command message. |
The base implementation NAKs, declaring that this PD accepts no file transfers. See OSDP v2.2.2 subclause 6.26.
Definition at line 391 of file Device.cs.
References OSDP.Net.Model.CommandData.FileTransferFragment.ToString().
Referenced by EnqueuePollReply().
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
Handles the input status command received from the OSDP device.
Definition at line 549 of file Device.cs.
Referenced by EnqueuePollReply().
|
inlineprotectedvirtual |
Handles the keep active command received from the OSDP device.
| commandPayload | The incoming keep active command payload. |
Definition at line 363 of file Device.cs.
Referenced by EnqueuePollReply().
|
inlineprotectedvirtual |
If deriving PD class is intending to support secure connections, it MUST override this method to provide its own means of persisting a newly set security key which was sent by the ACU.
The base Device class will automatically pick up the new key for future connections if this function returns a successful Ack response. NOTE: Any existing connections will continue to use the previous key. It is up to the ACU to drop a connection and reconnect if it wishes to do so
| commandPayload | The key settings command payload. |
|
inlineprotectedvirtual |
Handles the reader local status command received from the OSDP device.
Definition at line 558 of file Device.cs.
Referenced by EnqueuePollReply().
|
inlineprotectedvirtual |
Handles the manufacturer-specific command received from the OSDP device.
| commandPayload | The incoming manufacturer-specific command payload. |
Definition at line 334 of file Device.cs.
Referenced by EnqueuePollReply().
|
inlineprotectedvirtual |
Handles the maximum ACU receive size command received from the OSDP device.
| commandPayload | The ACU maximum receive size command payload. |
Definition at line 402 of file Device.cs.
Referenced by EnqueuePollReply().
|
inlineprotectedvirtual |
Handles the output controls command received from the OSDP device.
| commandPayload | The incoming output controls a command payload. |
Definition at line 305 of file Device.cs.
Referenced by EnqueuePollReply().
|
inlineprotectedvirtual |
Handles the output status command received from the OSDP device.
Definition at line 540 of file Device.cs.
Referenced by EnqueuePollReply().
|
inlineprotectedvirtual |
Handles the get PIV data command received from the OSDP device.
| commandPayload | The incoming get PIV data command payload. |
Definition at line 324 of file Device.cs.
Referenced by EnqueuePollReply().
|
inlineprotectedvirtual |
Handles the reader LED controls command received from the OSDP device.
| commandPayload | The reader LED controls a command payload. |
Definition at line 522 of file Device.cs.
Referenced by EnqueuePollReply().
|
inlineprotectedvirtual |
Handles the reader status command received from the OSDP device.
Definition at line 531 of file Device.cs.
Referenced by EnqueuePollReply().
|
inlineprotectedvirtual |
Handles the text output command received from the OSDP device.
| commandPayload | The incoming reader text output command payload. |
Definition at line 285 of file Device.cs.
Referenced by EnqueuePollReply().
|
inline |
|
inline |
|
get |
| EventHandler<DeviceComSetUpdatedEventArgs> OSDP.Net.Device.DeviceComSetUpdated |
Gets raised whenever osdp_ComSet command is successfully processed, and there is a change in either device address or baud rate.
Because baud rate is configured on the OSDP connection/server that is passed down into the Device class, it is up to the consumer of the Device class (i.e., whatever code that creates that class in the first place) to properly handle this event and re-initialize the Device with the correct connection settings.
NOTE: In addition to this event, there's also HandleCommunicationSet which the deriving class MUST override if it is to support osdp_ComSet properly. The overriding allows the device to validate and accept/reject the command parameters which occurs prior to this event