SPI  1.2404.0
Secured Payment Interface
Public Member Functions | List of all members
Modularity::SPI::ReadCardData Class Reference

This class contains all the input data and output data of Device.ReadCard(). All data in this class is reachable through various methods which define the behaivor of the operation. More...

#include <ReadCardData.h>

Public Member Functions

SPILIBRARY_API ~ReadCardData ()
 Class desrstructor.
 
APIHandle GetReadCardDataHandle () const
 Handle get - reserved for internal useage.
 
Input parameters

Those methods should be called before Device.ReadCard is executed.

SPILIBRARY_API ReadCardData ()
 Class constructor.
 
SPILIBRARY_API void ReadMsr ()
 Enable MSR interface to read card.
 
SPILIBRARY_API void ReadMifare ()
 Enable NFC interface to read Mifare card. More...
 
SPILIBRARY_API void SetTimeout (TimeOutType Timeout)
 Set timeout for the request in seconds. The timeout is handeled on the device side and not on client side. If timeout occured SPI_TIME_OUT is returned from Device.ReadCard() deafult is 60 seconds.
 
SPILIBRARY_API void SetNonCancelable ()
 Disable/Hide cancel button on the device while polling for card

 
SPILIBRARY_API void SetDisplayMessage (std::vector< string > Msg)
 Set a vector of strings to be displayed on Device screen while polling for card All strings must be UTF-8 encoded.
 
SPILIBRARY_API void AddMifareProperty (string Key, string Value)
 Add Mifare property when Reading Mifare. More...
 
Output parameters

Those methods can be called after ReadCard is executed.

SPILIBRARY_API ReadCardEntry GetReadCardEntry () const
 If ReadCard retuns SPI_SUCCESS than a card was discovered in one of the enabled interfaces. More...
 
SPILIBRARY_API string GetTrack2 () const
 Get track2 of MSR card. More...
 
SPILIBRARY_API string GetCardId () const
 Get Card serial if card read using NFC. More...
 
SPILIBRARY_API string GetFileData () const
 Get data read from file for DESFire EV2. Data is in HEX-String. More...
 

Detailed Description

This class contains all the input data and output data of Device.ReadCard(). All data in this class is reachable through various methods which define the behaivor of the operation.

Definition at line 29 of file ReadCardData.h.

Member Function Documentation

◆ AddMifareProperty()

SPILIBRARY_API void Modularity::SPI::ReadCardData::AddMifareProperty ( string  Key,
string  Value 
)

Add Mifare property when Reading Mifare.

Parameters
[in]Keyto add as listed below
[in]Valueas listed below to each key. Integer values requieres "L" as suffix to value string. E.g: ("commType","2L")

The Following properties are supported:

  • type - String - Mandatory when ReadMifare() is enabled
    Value Description
    defireev2 Mifare DESFire EV2
    classic Mifare Classic (Only CID)
    ultralight Mifare Ultralight (Only CID)
  • expectedDataLen - Int - Mandatory for DESFire EV2
    The expected number of bytes that should be read from file. E.g: "4L"`
  • commType - String - Mandatory for DESFire EV2
    Value Description
    0 Plain
    1 MAC
    2 Encrypted
  • appId - HEX String - Mandatory for DESFire EV2
    E.g: "A12345"`
  • appKey - HEX String - Mandatory for DESFire EV2
    The application key for appId E.g: "00000000000000000000000000000123"`
  • appKeyNo - Int - Mandatory for DESFire EV2
    The application key index in the requeiered application E.g: "0L"`
  • appCryptoMethod - Int - Mandatory for DESFire EV2
    The application key cryptogtam method used
    Value Description
    0 None
    1 AES
    2 2TDEA
    3 3TDEA
  • fileNo - Int - Mandatory for DESFire EV2
    The file number in the application. E.g: "0L"`
  • fileType - Int - Mandatory for DESFire EV2
    The file type of fileNo.
    Value Description
    0 Std Data
    1 Backup Data
    2 Cyclic Record
    3 Linear Record
    4 Value

◆ GetCardId()

SPILIBRARY_API string Modularity::SPI::ReadCardData::GetCardId ( ) const

Get Card serial if card read using NFC.

Returns
Card Id as std::string

◆ GetFileData()

SPILIBRARY_API string Modularity::SPI::ReadCardData::GetFileData ( ) const

Get data read from file for DESFire EV2. Data is in HEX-String.

Returns
Data as std::string ( E.g: "ABCD1234")

◆ GetReadCardEntry()

SPILIBRARY_API ReadCardEntry Modularity::SPI::ReadCardData::GetReadCardEntry ( ) const

If ReadCard retuns SPI_SUCCESS than a card was discovered in one of the enabled interfaces.

Returns
ReadCardEntry

◆ GetTrack2()

SPILIBRARY_API string Modularity::SPI::ReadCardData::GetTrack2 ( ) const

Get track2 of MSR card.

Returns
Track2 as std::string

◆ ReadMifare()

SPILIBRARY_API void Modularity::SPI::ReadCardData::ReadMifare ( )

Enable NFC interface to read Mifare card.

See also
AddMifareProperty() to config the Mifare protocol

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