Tizen Native API
7.0
|
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
- http://tizen.org/feature/network.secure_element.usb
It is recommended to design feature related codes in your application for reliability.
You can check if a device 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. | |
int | smartcard_reader_set_event_cb (smartcard_reader_event_cb cb, void *user_data) |
Sets a callback function for receiving reader event. | |
int | smartcard_reader_unset_event_cb (void) |
Unsets the reader event callback function. | |
Typedefs | |
typedef void(* | smartcard_reader_event_cb )(int reader, smartcard_reader_event_type_e event_type, void *user_data) |
Called when a smartcard reader event occurs. |
Typedef Documentation
typedef void(* smartcard_reader_event_cb)(int reader, smartcard_reader_event_type_e event_type, void *user_data) |
Called when a smartcard reader event occurs.
- Since :
- 3.0
- Parameters:
-
[in] reader The reader handle [in] event_type The reader event type [in] user_data The user data passed from the callback registration function
Enumeration Type Documentation
Enumerations for Smartcard reader event type.
- Since :
- 3.0
- Enumerator:
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_NOT_SUPPORTED Not supported SMARTCARD_ERROR_PERMISSION_DENIED Permission denied SMARTCARD_ERROR_INVALID_PARAMETER Invalid function parameter SMARTCARD_ERROR_GENERAL A general error occurred SMARTCARD_ERROR_IO_ERROR I/O error SMARTCARD_ERROR_NOT_INITIALIZED Smartcard service not initialized
- 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_NOT_SUPPORTED Not supported SMARTCARD_ERROR_INVALID_PARAMETER Invalid function parameter SMARTCARD_ERROR_GENERAL A general error occurred SMARTCARD_ERROR_NOT_INITIALIZED Smartcard service not initialized
- 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_NOT_SUPPORTED Not supported SMARTCARD_ERROR_INVALID_PARAMETER Invalid function parameter SMARTCARD_ERROR_GENERAL A general error occurred SMARTCARD_ERROR_NOT_INITIALIZED Smartcard service not initialized
- 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_NOT_SUPPORTED Not supported SMARTCARD_ERROR_PERMISSION_DENIED Permission denied SMARTCARD_ERROR_INVALID_PARAMETER Invalid function parameter SMARTCARD_ERROR_GENERAL A general error occurred SMARTCARD_ERROR_IO_ERROR I/O error SMARTCARD_ERROR_NOT_INITIALIZED Smartcard service not initialized
- See also:
- smartcard_get_readers()
int smartcard_reader_set_event_cb | ( | smartcard_reader_event_cb | cb, |
void * | user_data | ||
) |
Sets a callback function for receiving reader event.
- Since :
- 3.0
- Parameters:
-
[in] cb The reader event callback [in] user_data The user data
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
SMARTCARD_ERROR_NONE Successful SMARTCARD_ERROR_NOT_SUPPORTED Not supported SMARTCARD_ERROR_INVALID_PARAMETER Invalid function parameter SMARTCARD_ERROR_NOT_INITIALIZED Smartcard service not initialized
- See also:
- smartcard_reader_unset_event_cb()
int smartcard_reader_unset_event_cb | ( | void | ) |
Unsets the reader event callback function.
- Since :
- 3.0
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
SMARTCARD_ERROR_NONE Successful SMARTCARD_ERROR_NOT_SUPPORTED Not supported SMARTCARD_ERROR_NOT_INITIALIZED Smartcard service not initialized
- See also:
- smartcard_reader_set_event_cb()