Tizen Native API
|
The Reader API provides functions to reader.
Required Header
#include <smartcard.h>
Related Features
This API is related with the following features:
- http://tizen.org/feature/network.secure_element
- http://tizen.org/feature/network.secure_element.ese
- http://tizen.org/feature/network.secure_element.uicc It is recommended to design feature related codes in your application for reliability.
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.
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. |
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] reader Handle to the reader
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
SMARTCARD_ERROR_NONE Successful SMARTCARD_ERROR_GENERAL A general error occurred SMARTCARD_ERROR_INVALID_PARAMETER Invalid function parameter SMARTCARD_ERROR_IO_ERROR I/O error SMARTCARD_ERROR_NOT_INITIALIZED Smartcard service not initialized SMARTCARD_ERROR_NOT_SUPPORTED Not supported SMARTCARD_ERROR_PERMISSION_DENIED Permission 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] reader Handle to the reader [out] reader_name The name of reader
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
SMARTCARD_ERROR_NONE Successful SMARTCARD_ERROR_GENERAL A general error occurred SMARTCARD_ERROR_INVALID_PARAMETER Invalid function parameter SMARTCARD_ERROR_NOT_INITIALIZED Smartcard service not initialized SMARTCARD_ERROR_NOT_SUPPORTED Not 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] reader Handle to the reader [out] is_present True 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_NONE Successful SMARTCARD_ERROR_GENERAL A general error occurred SMARTCARD_ERROR_INVALID_PARAMETER Invalid function parameter SMARTCARD_ERROR_NOT_INITIALIZED Smartcard service not initialized SMARTCARD_ERROR_NOT_SUPPORTED Not 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] reader Handle to the reader [out] session Handle to the session created for the given reader
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
SMARTCARD_ERROR_NONE Successful SMARTCARD_ERROR_GENERAL A general error occurred SMARTCARD_ERROR_INVALID_PARAMETER Invalid function parameter SMARTCARD_ERROR_IO_ERROR I/O error SMARTCARD_ERROR_NOT_INITIALIZED Smartcard service not initialized SMARTCARD_ERROR_NOT_SUPPORTED Not supported SMARTCARD_ERROR_PERMISSION_DENIED Permission denied
- See also:
- smartcard_get_readers()