2 * Copyright (c) 2012, 2013 Samsung Electronics Co., Ltd.
4 * Licensed under the Flora License, Version 1.1 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://floralicense.org/license/
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef __NET_NFC_INTERNAL_SE_H__
18 #define __NET_NFC_INTERNAL_SE_H__
20 #include "net_nfc_typedef.h"
29 @addtogroup NET_NFC_MANAGER_SECURE_ELEMENT
31 This document is for the APIs reference document
33 NFC Manager defines are defined in <net_nfc_typedef.h>
35 @li @c #net_nfc_set_secure_element_type set secure element type
36 @li @c #net_nfc_get_secure_element_type get current selected secure element
37 @li @c #net_nfc_open_internal_secure_element open selected secure element
38 @li @c #net_nfc_open_internal_secure_element_sync open selected secure element (synchronous)
39 @li @c #net_nfc_close_internal_secure_element close selected secure element
40 @li @c #net_nfc_close_internal_secure_element_sync close selected secure element (synchronous)
41 @li @c #net_nfc_send_apdu send apdu to opened secure element
42 @li @c #net_nfc_send_apdu_sync send apdu to opened secure element (synchronous)
43 @li @c #net_nfc_get_atr request atr of secure element
44 @li @c #net_nfc_get_atr_sync request atr of secure element (synchronous)
48 set secure element type. secure element will be a UICC or ESE.
49 only one secure element is selected in a time.
50 external reader can communicate with secure element by emitting RF
52 \par Sync (or) Async: Sync
53 This is a Asynchronous API
55 @param[in] se_type secure element type
56 @param[in] trans_param user data that will be delivered to callback
58 @return return the result of the calling the function
60 @exception NET_NFC_INVALID_PARAM not supported se_type
62 net_nfc_error_e net_nfc_set_secure_element_type(net_nfc_se_type_e se_type, void *trans_param);
65 get current select se type.
67 \par Sync (or) Async: Async
68 This is a Asynchronous API
70 @param[in] trans_param user data that will be delivered to callback
72 @return return the result of the calling the function
74 net_nfc_error_e net_nfc_get_secure_element_type(void *trans_param);
77 open and initialize the type of secure element.
78 if the type of secure element is selected, then change mode as MODE OFF
79 to prevent to be detected by external reader
81 \par Sync (or) Async: Async
82 This is a Asynchronous API
84 @param[in] se_type secure element type
85 @param[in] trans_param user data that will be delivered to callback
87 @return return the result of the calling the function
89 @exception NET_NFC_INVALID_PARAM not supported se_type
91 net_nfc_error_e net_nfc_open_internal_secure_element(net_nfc_se_type_e se_type, void *trans_param);
94 open and initialize the type of secure element.
95 if the type of secure element is selected, then change mode as MODE OFF
96 to prevent to be detected by external reader
98 \par Sync (or) Async: Sync
99 This is a Asynchronous API
101 @param[in] se_type secure element type
102 @param[out] handle the handle of opened secure element
104 @return return the result of the calling the function
106 @exception NET_NFC_INVALID_PARAM not supported se_type
108 net_nfc_error_e net_nfc_open_internal_secure_element_sync(net_nfc_se_type_e se_type, net_nfc_target_handle_h *handle);
111 close opened secure element and change back to previous setting
113 \par Sync (or) Async: Async
114 This is a Asynchronous API
116 @param[in] handle the handle of opened secure element
117 @param[in] trans_param user data that will be delivered to callback
119 @return return the result of the calling the function
121 @exception NET_NFC_INVALID_PARAM invalid secure element handle
123 net_nfc_error_e net_nfc_close_internal_secure_element(net_nfc_target_handle_h handle, void *trans_param);
126 close opened secure element and change back to previous setting
128 \par Sync (or) Async: Sync
129 This is a Asynchronous API
131 @param[in] handle the handle of opened secure element
133 @return return the result of the calling the function
135 @exception NET_NFC_INVALID_PARAM invalid secure element handle
137 net_nfc_error_e net_nfc_close_internal_secure_element_sync(net_nfc_target_handle_h handle);
140 send apdu to opened secure element
142 \par Sync (or) Async: Async
143 This is a Asynchronous API
145 @param[in] handle the handle of opened secure element
146 @param[in] apdu apdu command to send
147 @param[in] trans_param user data that will be delivered to callback
149 @return return the result of the calling the function
151 @exception NET_NFC_INVALID_PARAM invalid secure element handle
152 @exception NET_NFC_NULL_PARAM data is null or empty
154 net_nfc_error_e net_nfc_send_apdu(net_nfc_target_handle_h handle, data_h apdu, void *trans_param);
157 send apdu to opened secure element
159 \par Sync (or) Async: Async
160 This is a Asynchronous API
162 @param[in] handle the handle of opened secure element
163 @param[in] apdu apdu command to send
164 @param[out] response result of apdu
166 @return return the result of the calling the function
168 @exception NET_NFC_INVALID_PARAM invalid secure element handle or parameter
169 @exception NET_NFC_NULL_PARAM data is null or empty
171 net_nfc_error_e net_nfc_send_apdu_sync(net_nfc_target_handle_h handle, data_h apdu, data_h *response);
174 request atr of secure element
176 \par Sync (or) Async: Async
177 This is a Asynchronous API
179 @param[in] handle the handle of opened secure element
180 @param[in] trans_param user data that will be delivered to callback
182 @return return the result of the calling the function
184 @exception NET_NFC_INVALID_PARAM invalid
187 net_nfc_error_e net_nfc_get_atr(net_nfc_target_handle_h handle, void *trans_param);
190 request atr of secure element
192 \par Sync (or) Async: Sync
193 This is a Asynchronous API
195 @param[in] handle the handle of opened secure element
196 @param[out] atr Answer to reset of secure element
198 @return return the result of the calling the function
200 @exception NET_NFC_INVALID_PARAM invalid
203 net_nfc_error_e net_nfc_get_atr_sync(net_nfc_target_handle_h handle, data_h *atr);