Tizen Native API

Functions

int smartcard_reader_get_name (int reader, char **reader_name)
 Returns the name of the given reader.
int smartcard_reader_is_secure_element_present (int reader, bool *is_present)
 Checks if a Secure Element is present in the given reader.
int smartcard_reader_open_session (int reader, int *session)
 Connects to a Secure Element in the given reader.
int smartcard_reader_close_sessions (int reader)
 Closes all the sessions opened on the given reader.

The Reader API provides functions to reader.

Required Header

#include <smartcard.h>

Related Features

This API is related with the following features:

You can check if a devrice supports the related features for this API by using System Information, thereby controlling the procedure of your application.

To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.

More details on featuring your application can be found from Feature Element.


Function Documentation

int smartcard_reader_close_sessions ( int  reader)

Closes all the sessions opened on the given reader.

All the channels opened by all these sessions will be closed.

Since :
2.3.1
Privilege Level:
public
Privilege:
http://tizen.org/privilege/secureelement
Parameters:
[in]readerHandle to the reader
Returns:
0 on success, otherwise a negative error value.
Return values:
SMARTCARD_ERROR_NONESuccessful
SMARTCARD_ERROR_GENERALA general error occurred
SMARTCARD_ERROR_INVALID_PARAMETERInvalid function parameter
SMARTCARD_ERROR_IO_ERRORI/O error
SMARTCARD_ERROR_NOT_INITIALIZEDSmartcard service not initialized
SMARTCARD_ERROR_NOT_SUPPORTEDNot supported
SMARTCARD_ERROR_PERMISSION_DENIEDPermission denied
See also:
smartcard_get_readers()
int smartcard_reader_get_name ( int  reader,
char **  reader_name 
)

Returns the name of the given reader.

Since :
2.3.1
Remarks:
reader_name must be released using free().
If the reader is a SIM reader, then its name must be "SIM[Slot]"
If the reader is a SD or micro SD reader, then its name must be "SD[slot]"
If the reader is a embedded SE reader, then its name must be "eSE[slot]"
Parameters:
[in]readerHandle to the reader
[out]reader_nameThe name of reader
Returns:
0 on success, otherwise a negative error value.
Return values:
SMARTCARD_ERROR_NONESuccessful
SMARTCARD_ERROR_GENERALA general error occurred
SMARTCARD_ERROR_INVALID_PARAMETERInvalid function parameter
SMARTCARD_ERROR_NOT_INITIALIZEDSmartcard service not initialized
SMARTCARD_ERROR_NOT_SUPPORTEDNot supported
See also:
smartcard_get_readers()
int smartcard_reader_is_secure_element_present ( int  reader,
bool *  is_present 
)

Checks if a Secure Element is present in the given reader.

Since :
2.3.1
Parameters:
[in]readerHandle to the reader
[out]is_presentTrue or false depending whether a secure element is present in the reader - undefined when an error is returned
Returns:
0 on success, otherwise a negative error value.
Return values:
SMARTCARD_ERROR_NONESuccessful
SMARTCARD_ERROR_GENERALA general error occurred
SMARTCARD_ERROR_INVALID_PARAMETERInvalid function parameter
SMARTCARD_ERROR_NOT_INITIALIZEDSmartcard service not initialized
SMARTCARD_ERROR_NOT_SUPPORTEDNot supported
See also:
smartcard_get_readers()
int smartcard_reader_open_session ( int  reader,
int *  session 
)

Connects to a Secure Element in the given reader.

Since :
2.3.1
Privilege Level:
public
Privilege:
http://tizen.org/privilege/secureelement
Parameters:
[in]readerHandle to the reader
[out]sessionHandle to the session created for the given reader
Returns:
0 on success, otherwise a negative error value.
Return values:
SMARTCARD_ERROR_NONESuccessful
SMARTCARD_ERROR_GENERALA general error occurred
SMARTCARD_ERROR_INVALID_PARAMETERInvalid function parameter
SMARTCARD_ERROR_IO_ERRORI/O error
SMARTCARD_ERROR_NOT_INITIALIZEDSmartcard service not initialized
SMARTCARD_ERROR_NOT_SUPPORTEDNot supported
SMARTCARD_ERROR_PERMISSION_DENIEDPermission denied
See also:
smartcard_get_readers()