For iOS Developer

The reader just a channel, it needs work with smart card to do secure authentication, identification or payment. Feitian are the hardware manufacturer, you need based on the reader to develop your application on iOS platform, here we will introduce how to use our SDK to manipulate Feitian reader, then use our APIs to communicate with your smart card to get data you want.

In normal process, if you want develop UI and App logic by your own, you need:

Use our API to develop your app

OR

Develop UI with iOS system frameworks, without using Feitian lib. Yes, you also can do it. Feitian implemented reader protocol totally based on CCID specification. For lightning connector reader, we use ExternalAccessory Framework and CoreBluetooth Framework respectively for lightning readers and bluetooth readers. If you are familiar with CCID specification, then you can write your own lib, and on other hand, we used ccid driver from open source, and open our lib source code on GITHUB.

Otherwise

If you want third part to help you to do everything, contact us ASAP.

The iOS SDK is the combo version, it supports below readers:

iR301-UC-LT, iR301-UD-LT, bR301, bR301BLE, bR500, more information, please go our website see more details.

Below is the interface support by iOS SDK:

Reader Name IR301 BR301 BR301BLE BR500
Lightning - USB
Bluetooth 3.0
Bluetooth 4.0

Definition

The following is a list of commonly used errors. Since different cards produce different errors they must map over to these error messages.

SCARD_S_SUCCESS
SCARD_E_INVALID_VALUE
SCARD_E_INVALID_PARAMETER
SCARD_E_INVALID_HANDLE
SCARD_E_INSUFFICIENT_BUFFER
SCARD_E_NO_SMARTCARD
SCARD_E_READER_UNAVAILABLE
SCARD_E_UNSUPPORTED_FEATURE
SCARD_F_COMM_ERROR
SCARD_E_NOT_TRANSACTED

API Reference

To using MFi certified reader, you need to add protocol string into your App Info.plist file, to add Supported external accessory protocols with Array.

below product needs to have protocol string

MFi certified Reader Accessory Protocol string Notice
bR301 Bluetooth 3.0(C18 Casing) com.ftsafe.bR301
iR301-UC-LT com.ftsafe.iR301
iR301-UD-LT com.ftsafe.iR301

PC/SC API

SCardEstablishContext

This function creates a communication context to the PC/SC Resource Manager. This must be the first function called in a PC/SC application.

Value of dwScope Meaning

SCARD_SCOPE_USER Not used
SCARD_SCOPE_TERMINAL Not used
SCARD_SCOPE_GLOBAL Not used
SCARD_SCOPE_SYSTEM Services on the local machine

Synopsis

#include <winscard.h>
LONG SCardEstablishContext(DWORD dwScope, 
/*@unused@*/ LPCVOID pvReserved1,
/*@unused@*/ LPCVOID pvReserved2,
LPSCARDCONTEXT phContext);

Parameters: 
dwScope          IN        Scope of the establishment
pvReserved1           unused
pvReserved2           unused
phContext     OUT   Returned reference to this connection

Returns:
SCARD_S_SUCCESS                  Successful
SCARD_E_INVALID_VALUE         Invalid scope type passed
SCARD_E_INVALID_PARAMETER   Invalid parameter 

Example:
SCARDCONTEXT     hContext;
LONG              rv;
rv = SCardEstablishContext(SCARD_SCOPE_SYSTEM, NULL, NULL, &hContext);

SCardListReaders

This function returns a list of currently available readers on the system. mszReaders is a pointer to a character string that is allocated by the application. If the application sends mszGroups and mszReaders as NULL then this function will return the size of the buffer needed to allocate in pcchReaders. The reader names is a multi-string and separated by a nul character (’\0’) and ended by a double null character. "Reader A\0Reader B\0\0".


Synopsis

#include <winscard.h>
LONG SCardListReaders(SCARDCONTEXT hContext,
/*@null@*/ /*@out@*/ LPCSTR mszGroups,
/*@null@*/ /*@out@*/ LPSTR mszReaders,
/*@out@*/ LPDWORD pcchReaders);

Parameters:
hContext     IN         Connection context to the PC/SC Resource Manager
mszGroups     IN         List of groups to list readers (not used)
mszReaders    OUT         Multi-string with list of readers
pcchReaders    OUT     Size of multi-string buffer including NULL’s

Returns:
SCARD_S_SUCCESS                 Successful
SCARD_E_INVALID_HANDLE            Invalid Scope Handle
SCARD_E_INSUFFICIENT_BUFFER         Reader buffer not large enough
SCARD_E_INVALID_PARAMETER        Invalid parameter

Example:
SCARDCONTEXT     hContext;
LPSTR             mszReaders;
DWORD            dwReaders;
LONG             rv;
rv = SCardEstablishContext(SCARD_SCOPE_SYSTEM, NULL, NULL, &hContext);
rv = SCardListReaders(hContext, NULL, NULL, &dwReaders);
mszReaders = malloc(sizeof(char)*dwReaders);
rv = SCardListReaders(hContext, NULL, mszReaders, &dwReaders);

SCardConnect

This function establishes a connection to the friendly name of the reader specified in szReader. The first connection will power up and perform a reset on the card. Value of dwShareMode Meaning SCARD_SHARE_SHARED This application will allow others to share the reader

SCARD_SHARE_EXCLUSIVE This application will NOT allow others to share the reader

SCARD_SHARE_DIRECT Direct control of the reader, even without a card

SCARD_SHARE_DIRECT can be used before using SCardControl() to send control commands to the reader even if a card is not present in the reader.

Value of dwPreferredProtocols Meaning

SCARD_PROTOCOL_T0 Use the T=0 protocol

SCARD_PROTOCOL_T1 Use the T=1 protocol

SCARD_PROTOCOL_RAW Use with memory type cards

dwPreferredProtocols is a bit mask of acceptable protocols for the connection. You can use (SCARD_PROTOCOL_T0 | SCARD_PROTOCOL_T1) if you do not have a preferred protocol.


Synopsis

#include <winscard.h>
LONG SCardConnect( SCARDCONTEXT hContext, 
LPCSTR szReader,
DWORD dwShareMode, 
DWORD dwPreferredProtocols, 
LPSCARDHANDLE phCard,
LPDWORD pdwActiveProtocol);

Parameters:
hContext                 IN         Connection context to the PC/SC Resource Manager
szReader                 IN         Reader name to connect to
dwShareMode          IN         Mode of connection type: exclusive or shared
dwPreferredProtocols     IN             Desired protocol use
phCard                 OUT      Handle to this connection
pdwActiveProtocol     OUT      Established protocol to this connection.

Returns:
SCARD_S_SUCCESS              Successful
SCARD_E_INVALID_HANDLE          Invalid hContext handle
SCARD_E_INVALID_PARAMETER   Invalid parameter
SCARD_E_NO_SMARTCARD          no smart card
SCARD_E_READER_UNAVAILABLE         Could not power up the reader or card
SCARD_E_UNSUPPORTED_FEATURE      Protocol not supported

Example:
SCARDCONTEXT     hContext;
SCARDHANDLE     hCard;
DWORD             dwActiveProtocol;
LONG             rv;
rv = SCardEstablishContext(SCARD_SCOPE_SYSTEM, NULL, NULL, &hContext);
rv = SCardConnect(hContext, "Reader X", SCARD_SHARE_SHARED,
SCARD_PROTOCOL_T0, &hCard, &dwActiveProtocol);

SCardStatus

This function returns the current status of the reader connected to by hCard. It’s friendly name will be stored in mszReaderNames. pcchReaderLen will be the size of the allocated buffer for mszReaderNames, while pcbAtrLen will be the size of the allocated buffer for pbAtr. If either of these is too small, the function will return with SCARD_E_INSUFFICIENT_BUFFER and the necessary size in pcchReaderLen and pcbAtrLen. The current state, and protocol will be stored in pdwState and pdwProtocol respectively. pdwState is a DWORD possibly OR’d with the following values:

Value of pdwState Meaning

SCARD_ABSENT There is no card in the reader

SCARD_PRESENT There is a card in the reader, but it has not been moved into position for use

SCARD_SWALLOWED There is a card in the reader in position for use. The card is not powered

SCARD_POWERED Power is being provided to the card, but the reader driver is unaware of the mode of the card

SCARD_NEGOTIABLE The card has been reset and is awaiting PTS negotiation

SCARD_SPECIFIC The card has been reset and specific communication protocols have been established

Value of pdwProtocol Meaning

SCARD_PROTOCOL_T0 Use the T=0 protocol

SCARD_PROTOCOL_T1 Use the T=1 protocol


Synopsis

#include <winscard.h>
LONG SCardStatus(SCARDHANDLE hCard, 
LPSTR mszReaderNames,
LPDWORD pcchReaderLen, 
LPDWORD pdwState,
LPDWORD pdwProtocol, 
LPBYTE pbAtr,
LPDWORD pcbAtrLen);

Parameters:
hCard             IN         Connection made from SCardConnect
mszReaderNames    IN OUT     Friendly name of this reader
pcchReaderLen    IN OUT     Size of the szReaderName multistring
pdwState         OUT     Current state of this reader
pdwProtocol         OUT     Current protocol of this reader
pbAtr             OUT     Current ATR of a card in this reader
pcbAtrLen         OUT     Length of ATR

Returns:
SCARD_S_SUCCESS               Successful
SCARD_E_INSUFFICIENT_BUFFER       Not enough allocated memory for mszReaderNames or for pbAtr

Example:
SCARDCONTEXT     hContext;
SCARDHANDLE     hCard;
DWORD             dwActiveProtocol;
DWORD             dwState, dwProtocol, dwAtrLen, dwReaderLen;
BYTE            pbAtr[MAX_ATR_SIZE];
rv = SCardEstablishContext(SCARD_SCOPE_SYSTEM, NULL, NULL, &hContext);
rv = SCardConnect(hContext, "Reader X", SCARD_SHARE_SHARED,
SCARD_PROTOCOL_T0, &hCard, &dwActiveProtocol);
dwAtrLen = sizeof(pbAtr);
rv=SCardStatus(hCard, NULL, &dwReaderLen, &dwState, &dwProtocol,pbAtr, &dwAtrLen);

SCardGetAttrib

This function get an attribute from the IFD Handler. The list of possible attributes is:

• SCARD_ATTR_ATR_STRING


Synopsis

#include <winscard.h>
LONG SCardGetAttrib(SCARDHANDLE hCard, 
DWORD dwAttrId,
LPBYTE pbAttr,
LPDWORD pcbAttrLen);

Parameters:
hCard         IN         Connection made from SCardConnect
dwAttrId     IN         Identifier for the attribute to get
pbAttr        OUT        Pointer to a buffer that receives the attribute
pcbAttrLen     IN/OUT     Length of the pbAttr buffer in bytes

Returns:
SCARD_S_SUCCESS                 Successful
SCARD_E_INVALID_HANDLE             Invalid hCard handle
SCARD_E_INVALID_PARAMETER         Invalid parameter
SCARD_E_INSUFFICIENT_BUFFER        receive buffer not large enough
SCARD_E_NOT_TRANSACTED         Data exchange not successful
SCARD_E_SHARING_VIOLATION         Someone else has exclusive rights
SCARD_E_READER_UNAVAILABLE     The reader has been removed

Example:
LONG             rv;
SCARDCONTEXT     hContext;
SCARDHANDLE     hCard;
DWORD             dwActiveProtocol;
unsigned char        pbAtr[MAX_ATR_SIZE];
DWORD             dwAtrLen;
rv = SCardEstablishContext(SCARD_SCOPE_SYSTEM, NULL, NULL, &hContext);
rv = SCardConnect(hContext, "Reader X", SCARD_SHARE_SHARED,
SCARD_PROTOCOL_RAW &hCard, &dwActiveProtocol);
rv = SCardGetAttrib(hCard, SCARD_ATTR_ATR_STRING, pbAtr, &dwAtrLen);

SCardTransmit

This function sends an APDU to the smart card contained in the reader connected to by SCardConnect(). The card responds from the APDU and stores this response in pbRecvBuffer and it’s length in SpcbRecvLength. SSendPci and SRecvPci are structures containing the following:

typedef struct {

DWORD dwProtocol; /* SCARD_PROTOCOL_T0 or SCARD_PROTOCOL_T1 */

DWORD cbPciLength; /* Length of this structure - not used */

} SCARD_IO_REQUEST;

Value of pioSendPci Meaning

SCARD_PCI_T0 Pre-defined T=0 PCI structure

SCARD_PCI_T1 Pre-defined T=1 PCI structure


Synopsis

#include <winscard.h>
LONG SCardTransmit(SCARDHANDLE hCard,
const SCARD_IO_REQUEST *pioSendPci,
LPCBYTE pbSendBuffer,
DWORD cbSendLength,
SCARD_IO_REQUEST *pioRecvPci, 
LPBYTE pbRecvBuffer,
LPDWORD pcbRecvLength);

Parameters:
hCard             IN         Connection made from SCardConnect
pioSendPci         IN/OUT     Structure of protocol information
pbSendBuffer     IN         APDU to send to the card
cbSendLength     IN         Length of the APDU
pioRecvPci         IN/OUT    Structure of protocol information
pbRecvBuffer         OUT        Response from the card
pcbRecvLength     IN/OUT    Length of the response

Returns:
SCARD_S_SUCCESS                    Successful
SCARD_E_INVALID_HANDLE             Invalid hCard handle
SCARD_E_INSUFFICIENT_BUFFER        receive buffer not large enough
SCARD_E_NOT_TRANSACTED          Data exchange not successful
SCARD_E_INVALID_PARAMETER         invalid parameter
SCARD_E_INVALID_VALUE             Invalid Protocol, reader name, etc

Example:
LONG             rv;
SCARDCONTEXT     hContext;
SCARDHANDLE     hCard;
DWORD             dwActiveProtocol, dwSendLength, dwRecvLength;
SCARD_IO_REQUEST     pioRecvPci;
BYTE     pbRecvBuffer[10];
BYTE     pbSendBuffer[] = { 0xC0, 0xA4, 0x00, 0x00, 0x02, 0x3F, 0x00 };
rv = SCardEstablishContext(SCARD_SCOPE_SYSTEM, NULL, NULL, &hContext);
rv = SCardConnect(hContext, "Reader X", SCARD_SHARE_SHARED,
SCARD_PROTOCOL_T0, &hCard, &dwActiveProtocol);
dwSendLength = sizeof(pbSendBuffer);
dwRecvLength = sizeof(pbRecvBuffer);
rv = SCardTransmit(hCard, SCARD_PCI_T0, pbSendBuffer, dwSendLength,
&pioRecvPci, pbRecvBuffer, &dwRecvLength);

SCardGetStatusChange

This function blocks execution until the current availability of the cards in a specific set of readers changes.

The caller supplies a list of readers to be monitored through an SCARD_READERSTATE array and the maximum amount of time, in seconds, that it is willing to wait for an action to occur on one of the listed readers. The function returns when there is a change in availability, having filled in the dwEventState members of the SCARD_READERSTATE structures appropriately.


Synopsis

#include <winscard.h>
LONG SCardGetStatusChange(SCARDCONTEXT hContext,
DWORD dwTimeout,
LPSCARD_READERSTATE rgReaderStates,
DWORD cReaders);

Parameters:
hContext             IN     Connection context to the PC/SC Resource Manager
dwTimeout              IN     Maximum waiting time (in miliseconds) for status change, zero (or INFINITE) for infinite
rgReaderStates         IN/OUT  Structures of readers with current states
cReaders            IN     Number of structures

Returns:

SCARD_S_SUCCESS             Successful
SCARD_E_READER_UNAVAILABLE     The reader is unavailable

Example:
SCARDCONTEXT         hContext;
SCARD_READERSTATE_A     rgReaderStates[1];
LONG     rv;
rv = SCardEstablishContext(SCARD_SCOPE_SYSTEM, NULL, NULL, &hContext);
rgReaderStates[0].szReader = "Reader X";
rgReaderStates[0].dwCurrentState = SCARD_STATE_UNAWARE;
rv = SCardGetStatusChange(hContext, INFINITE, rgReaderStates, 1);
printf("reader state: 0x%04X\n", rgReaderStates[0].dwEventState);

SCardDisconnect

This function terminates a connection to the connection made through SCardConnect.

dwDisposition can have the following values:

Value of dwDisposition Meaning

SCARD_LEAVE_CARD Do nothing

SCARD_RESET_CARD Reset the card (warm reset)

SCARD_UNPOWER_CARD Unpower the card (cold reset)

SCARD_EJECT_CARD Eject the card.


Synopsis

#include <winscard.h>
LONG SCardDisconnect(SCARDHANDLE hCard, 
DWORD dwDisposition);

Parameters:
hCard             IN         Connection made from SCardConnect
dwDisposition     IN         Reader function to execute

Returns:
 SCARD_S_SUCCESS Successful
 SCARD_E_INVALID_HANDLE Invalid hCard handle
 SCARD_E_INVALID_VALUE Invalid dwDisposition

Example:
SCARDCONTEXT hContext;
SCARDHANDLE hCard;
DWORD dwActiveProtocol;
LONG rv;
rv = SCardEstablishContext(SCARD_SCOPE_SYSTEM, NULL, NULL, &hContext);
rv = SCardConnect(hContext, "Reader X", SCARD_SHARE_SHARED,
SCARD_PROTOCOL_T0, &hCard, &dwActiveProtocol);
rv = SCardDisconnect(hCard, SCARD_UNPOWER_CARD);

SCardReleaseContext

This function destroys a communication context to the PC/SC Resource Manager. This must be the last function called in a PC/SC application, it will remove the registered notification and close the session.


Synopsis

#include <winscard.h>
LONG SCardReleaseContext(SCARDCONTEXT hContext);

Parameters:
hContext         IN    Connection context to be closed

Returns:
 SCARD_S_SUCCESS Successful
 SCARD_E_INVALID_HANDLE Invalid hContext handle

Example:
SCARDCONTEXT     hContext;
LONG             rv;
rv = SCardEstablishContext(SCARD_SCOPE_SYSTEM, NULL, NULL, &hContext);
rv = SCardReleaseContext(hContext);

General Functions

These APIs using to get reader general information, like the firmware version, serial number and specific ID, vendor name and so on.

FtGetDevVer

This function use to get firmware verson and hardware version of reader.


#include <ft301u.h>

LONG FtGetDevVer( SCARDCONTEXT hContext,char *firmwareRevision,

char *hardwareRevision);

Parameters:
hContext                IN        Connection context to the PC/SC Resource Manager
firmwareRevision        OUT        firmware revision 
hardwareRevision        OUT        hardware revision 

Returns:
SCARD_S_SUCCESS                 Successful
SCARD_F_COMM_ERROR         Get serial Num failed
SCARD_E_INVALID_PARAMETER   Invalid parameter

Example:
SCARDCONTEXT     hContext;
SCARDHANDLE     hCard;
DWORD             dwActiveProtocol;
LONG             rv;
Char                firmwareRevision[32] = {0};
Char                hardwareRevision[32] = {0};
rv = SCardEstablishContext(SCARD_SCOPE_SYSTEM, NULL, NULL, &hContext);
rv = FtGetDevVer (hContext, firmwareRevision, hardwareRevision);

FtGetLibVersion

This function use to get lib version.


#include <winscard.h>
void FtGetLibVersion (char *buffer);

Parameters:
buffer        OUT        lib version 

Example:
Char buffer[32] = {0};

FtGetLibVersion (buffer);

FtGetSerialNum

This function userd to get serial number of reader.

#include <winscard.h>
LONG FtGetSerialNum(unsigned int reader_index,
unsigned int  length,
char * buffer);

Parameters:
reader_index        IN        reader index
length            IN        length of buffer(>=8) 
buffer           OUT        Serial number 

Returns:
 SCARD_S_SUCCESS Successful
 SCARD_F_COMM_ERROR Get serial Num failed
 SCARD_E_INVALID_PARAMETER Invalid parameter

Example:
SCARDCONTEXT     hContext;
SCARDHANDLE     hCard;
DWORD             dwActiveProtocol;
LONG             rv;
Char                buffer[20] = {0};
rv = SCardEstablishContext(SCARD_SCOPE_SYSTEM, NULL, NULL, &hContext);
rv = SCardConnect(hContext, "Reader X", SCARD_SHARE_SHARED,
SCARD_PROTOCOL_T0, &hCard, &dwActiveProtocol);
rv = FtGetSerialNum(0, sizeof(buffer), buffer);

FtWriteFlash

This function userd to write data to flash.


#include <winscard.h>
LONG FtWriteFlash(unsigned int reader_index,
unsigned char bOffset, 
unsigned char blength,
unsigned char buffer[]);

Parameters:
reader_index        IN        reader index
bOffset            IN        Offset of flash to write 
blength            IN        The length of data
buffer           IN        The data for write 

Example:
SCARDCONTEXT     hContext;
SCARDHANDLE     hCard;
DWORD             dwActiveProtocol;
LONG             rv;
unsigned char buffer[255] ={0};
rv = SCardEstablishContext(SCARD_SCOPE_SYSTEM, NULL, NULL, &hContext);
rv = SCardConnect(hContext, "Reader X", SCARD_SHARE_SHARED,SCARD_PROTOCOL_T0, &hCard, &dwActiveProtocol);
for (int i=0; i< 255; i++) {
buffer[i]= i;
}
rv = FtWriteFlash(0, 0,255, buffer);

Returns:
SCARD_S_SUCCESS                 Successful
SCARD_F_COMM_ERROR         write data  failed
SCARD_E_INVALID_PARAMETER   Invalid parameter

FtReadFlash

This function use to read data from flash.

#include <winscard.h>
LONG FtReadFlash(unsigned int reader_index,
unsigned char bOffset, 
unsigned char blength,
unsigned char buffer[]);

Parameters:
reader_index        IN        reader index
bOffset            IN        Offset of flash to write 
blength            IN        The length of read data
buffer           OUT        The read data   

Example:
SCARDCONTEXT     hContext;
SCARDHANDLE      hCard;
DWORD              dwActiveProtocol;
LONG              rv;
unsigned char buffer[255] ={0};
rv = SCardEstablishContext(SCARD_SCOPE_SYSTEM, NULL, NULL, &hContext);
rv = SCardConnect(hContext, "Reader X", SCARD_SHARE_SHARED, SCARD_PROTOCOL_T0, &hCard, &dwActiveProtocol);
rv = FtReadFlash (0, 0,255, buffer);

Returns:
SCARD_S_SUCCESS                 Successful
SCARD_F_COMM_ERROR         write data failed
SCARD_E_INVALID_PARAMETER   Invalid parameter

FtSetTimeout

This function use to set timeout, the default time out is 6 s. When you using this function, the dwTimeout value must be higher than 1s. it's the transmission timeout value of between reader and card.


#include <winscard.h>
LONG FtSetTimeout (SCARDCONTEXT hContext,
DWORD dwTimeout)

Parameters:
SCARDCONTEXT        IN        Connection context to the PC/SC Resource Manager
DWORD            IN        dwTimeou  New transmission timeout value of between 301 and card (millisecond )  t (the unit value is “s”)



Example:
SCARDCONTEXT     hContext;
DWORD              dwTimeout;
LONG              rv;
unsigned char buffer[255] ={0};
rv = SCardEstablishContext(SCARD_SCOPE_SYSTEM, NULL, NULL, &hContext);
rv = SCardConnect(hContext, "Reader X", SCARD_SHARE_SHARED, SCARD_PROTOCOL_T0, &hCard, &dwActiveProtocol);
rv = FtSetTimeout (hContext, 6);

Returns:
SCARD_S_SUCCESS                 Successful
SCARD_F_COMM_ERROR         write data failed
SCARD_E_INVALID_PARAMETER   Invalid parameter

FtGetDeviceUID

When ‘FtGetDeviceUID' API is called, the UID which is stored in the smart card reader will be read out.


#include <winscard.h>
LONG FtGetDeviceUID(SCARDCONTEXT hContext, unsigned int  uidLength, char * uidBuffer);
Parameters:
hContext             IN     Connection context to the PC/SC Resource Manager
uidLength         IN     The length of UID, the UID is 8 bytes

uidBuffer            OUT  The buffer stored UID

Example:
Please refer to iOS demo code 


Returns:
SCARD_S_SUCCESS             Successful
SCARD_E_READER_UNAVAILABLE     The reader is unavailable
SCARD_F_COMM_ERR            communication error

FtGetAccessoryManufacturer

This function is used to get accessory manufacturer.


#include <winscard.h>
LONG FtGetAccessoryManufacturer(SCARDCONTEXT hContext, unsigned int * length,char * buffer);
Parameters:
hContext             IN         Connection context to the PC/SC Resource Manager
length             IN/OUT     The length of manufacturer
buffer            IN/OUT  The buffer stored manufacturer

Example:
Please refer to IOS demo code 

Returns:
SCARD_S_SUCCESS                 Successful
SCARD_E_READER_UNAVAILABLE     The reader is unavailable
SCARD_F_COMM_ERR                communication error

FtGetAccessoryModelName

This function is used to get accessory model name.


#include <winscard.h>
LONG FtGetAccessoryModelName(SCARDCONTEXT hContext, unsigned int * length,char * buffer);
Parameters:
hContext             IN         Connection context to the PC/SC Resource Manager
length             IN/OUT     The length of model name
buffer            IN/OUT  The buffer stored model name


Example:
Please refer to IOS demo code 

Returns:
SCARD_S_SUCCESS                 Successful
SCARD_E_READER_UNAVAILABLE     The reader is unavailable
SCARD_F_COMM_ERR                communication error

ReaderInterfaceDelegate

readerInterfaceDidChange

-(void)readerInterfaceDidChange:(BOOL)attached
Description:
To monitor the reader status’s delegation
Parameter:
attached        [OUT] TRUE means the reader has inserted,FALSE means the reader has plug-out
Example: Please refer in isCardAttached

cardInterfaceDidDetach

-(void)cardInterfaceDidDetach:(BOOL)attached
Describe:
The delegation is to monitor the card status
Parameter:
Attached   [OUT] Ture means the card has inserted, false means the card has removed out
Example:
Please refer in isCardAttached

if you found below error, make sure your name suffix is .mm, because our lib used C++ objects.

For iOS Developer