ID Chip Reader
reader.h File Reference

Header file for IC Card Reader Access functions. More...

#include "config.h"

Go to the source code of this file.

Macros

#define UTILS_READER_H_
 
#define UNKOWN_ERROR   1
 
#define RCS500_LCLE_ERROR   2
 
#define RCS500_P1P2_ERROR   3
 
#define RCS500_INS_ERROR   4
 
#define RCS500_CLA_ERROR   5
 
#define RCS500_MAC_ERROR   8
 
#define SMPL_ESC_KEY   0x1B
 
#define APP_ERROR   -1
 
#define APP_CANCEL   -2
 
#define APP_SUCCESS   0
 

Functions

long InitializeReader (void)
 Initialize IC Card Reader. More...
 
void DisconnectReader (void)
 Release Reader resources. More...
 
long DetectFeliCaCard (void)
 Detect FeliCa Card. More...
 
void CancelDetectFelicaCard (void)
 Cancel Detect Felica Card operation. More...
 
long DisconnectFeliCaCard (void)
 Release FeliCa card connection. More...
 
long TransmitDataToCard (unsigned char cmdBuf[], unsigned long cmdLen, unsigned char resBuf[], unsigned long *resLen)
 Transmit APDU command packets to FeliCa Card. More...
 

Detailed Description

Header file for IC Card Reader Access functions.

Author
Copyright 2013 Sony Corporation
Date
2013/10/31

This header file provides an API for accessing and interacting with an IC Card Reader.

Macro Definition Documentation

◆ APP_CANCEL

#define APP_CANCEL   -2

◆ APP_ERROR

#define APP_ERROR   -1

◆ APP_SUCCESS

#define APP_SUCCESS   0

◆ RCS500_CLA_ERROR

#define RCS500_CLA_ERROR   5

◆ RCS500_INS_ERROR

#define RCS500_INS_ERROR   4

◆ RCS500_LCLE_ERROR

#define RCS500_LCLE_ERROR   2

◆ RCS500_MAC_ERROR

#define RCS500_MAC_ERROR   8

◆ RCS500_P1P2_ERROR

#define RCS500_P1P2_ERROR   3

◆ SMPL_ESC_KEY

#define SMPL_ESC_KEY   0x1B

◆ UNKOWN_ERROR

#define UNKOWN_ERROR   1

◆ UTILS_READER_H_

#define UTILS_READER_H_

Function Documentation

◆ CancelDetectFelicaCard()

void CancelDetectFelicaCard ( void  )

Cancel Detect Felica Card operation.

This function cancels the ongoing detection of a Felica card in case it is needed to stop waiting for a card to be detected.

◆ DetectFeliCaCard()

long DetectFeliCaCard ( void  )

Detect FeliCa Card.

This function blocks until a FeliCa card has detected or ESC Key has pressed.

Returns
APP_SUCCESS if successful, otherwise APP_ERROR.

◆ DisconnectFeliCaCard()

long DisconnectFeliCaCard ( void  )

Release FeliCa card connection.

This function releases the connection with the detected FeliCa card.

Returns
APP_SUCCESS if successful, otherwise APP_ERROR.

◆ DisconnectReader()

void DisconnectReader ( void  )

Release Reader resources.

This function releases the resources associated with the IC Card Reader.

◆ InitializeReader()

long InitializeReader ( void  )

Initialize IC Card Reader.

This function initializes the IC Card Reader and prepares it for use.

Returns
APP_SUCCESS if successful, otherwise APP_ERROR.

◆ TransmitDataToCard()

long TransmitDataToCard ( unsigned char  cmdBuf[],
unsigned long  cmdLen,
unsigned char  resBuf[],
unsigned long *  resLen 
)

Transmit APDU command packets to FeliCa Card.

This function sends the provided command packets to the detected FeliCa card and receives the response in the provided buffer.

Parameters
cmdBuf[]Buffer containing the command packets to be sent.
cmdLenLength of the command buffer.
resBuf[]Buffer to store the received response from the card.
resLenPointer to a variable that will store the length of the received response.
Returns
APP_SUCCESS if successful, otherwise APP_ERROR.