Update license file
[platform/core/connectivity/nfc-manager-neard.git] / src / clientlib / include / net_nfc_internal_se.h
1 /*
2  * Copyright (c) 2012, 2013 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  *     http://floralicense.org/license/
9  *
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.
15  */
16
17 #ifndef __NET_NFC_INTERNAL_SE_H__
18 #define __NET_NFC_INTERNAL_SE_H__
19
20 #include "net_nfc_typedef.h"
21
22 #ifdef __cplusplus
23 extern "C"
24 {
25 #endif
26
27 /**
28
29 @addtogroup NET_NFC_MANAGER_SECURE_ELEMENT
30 @{
31         This document is for the APIs reference document
32
33         NFC Manager defines are defined in <net_nfc_typedef.h>
34
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)
45 */
46
47 /**
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
51
52         \par Sync (or) Async: Sync
53         This is a Asynchronous API
54
55         @param[in]      se_type                 secure element type
56         @param[in]      trans_param             user data that will be delivered to callback
57
58         @return         return the result of the calling the function
59
60         @exception NET_NFC_INVALID_PARAM        not supported se_type
61 */
62 net_nfc_error_e net_nfc_set_secure_element_type(net_nfc_se_type_e se_type, void *trans_param);
63
64 /**
65         get current select se type.
66
67         \par Sync (or) Async: Async
68         This is a Asynchronous API
69
70         @param[in]      trans_param             user data that will be delivered to callback
71
72         @return         return the result of the calling the function
73 */
74 net_nfc_error_e net_nfc_get_secure_element_type(void *trans_param);
75
76 /**
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
80
81         \par Sync (or) Async: Async
82         This is a Asynchronous API
83
84         @param[in]      se_type                 secure element type
85         @param[in]      trans_param             user data that will be delivered to callback
86
87         @return         return the result of the calling the function
88
89         @exception NET_NFC_INVALID_PARAM        not supported se_type
90 */
91 net_nfc_error_e net_nfc_open_internal_secure_element(net_nfc_se_type_e se_type, void *trans_param);
92
93 /**
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
97
98         \par Sync (or) Async: Sync
99         This is a Asynchronous API
100
101         @param[in]      se_type                 secure element type
102         @param[out]     handle                  the handle of opened secure element
103
104         @return         return the result of the calling the function
105
106         @exception NET_NFC_INVALID_PARAM        not supported se_type
107 */
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);
109
110 /**
111         close opened secure element and change back to previous setting
112
113         \par Sync (or) Async: Async
114         This is a Asynchronous API
115
116         @param[in]      handle                  the handle of opened secure element
117         @param[in]      trans_param             user data that will be delivered to callback
118
119         @return         return the result of the calling the function
120
121         @exception NET_NFC_INVALID_PARAM        invalid secure element handle
122 */
123 net_nfc_error_e net_nfc_close_internal_secure_element(net_nfc_target_handle_h handle, void *trans_param);
124
125 /**
126         close opened secure element and change back to previous setting
127
128         \par Sync (or) Async: Sync
129         This is a Asynchronous API
130
131         @param[in]      handle                  the handle of opened secure element
132
133         @return         return the result of the calling the function
134
135         @exception NET_NFC_INVALID_PARAM        invalid secure element handle
136 */
137 net_nfc_error_e net_nfc_close_internal_secure_element_sync(net_nfc_target_handle_h handle);
138
139 /**
140         send apdu to opened secure element
141
142         \par Sync (or) Async: Async
143         This is a Asynchronous API
144
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
148
149         @return         return the result of the calling the function
150
151         @exception NET_NFC_INVALID_PARAM        invalid secure element handle
152         @exception NET_NFC_NULL_PARAM           data is null or empty
153 */
154 net_nfc_error_e net_nfc_send_apdu(net_nfc_target_handle_h handle, data_h apdu, void *trans_param);
155
156 /**
157         send apdu to opened secure element
158
159         \par Sync (or) Async: Async
160         This is a Asynchronous API
161
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
165
166         @return         return the result of the calling the function
167
168         @exception NET_NFC_INVALID_PARAM        invalid secure element handle or parameter
169         @exception NET_NFC_NULL_PARAM           data is null or empty
170 */
171 net_nfc_error_e net_nfc_send_apdu_sync(net_nfc_target_handle_h handle, data_h apdu, data_h *response);
172
173 /**
174         request atr of secure element
175
176         \par Sync (or) Async: Async
177         This is a Asynchronous API
178
179         @param[in]      handle                  the handle of opened secure element
180         @param[in]      trans_param             user data that will be delivered to callback
181
182         @return         return the result of the calling the function
183
184         @exception NET_NFC_INVALID_PARAM        invalid
185
186 */
187 net_nfc_error_e net_nfc_get_atr(net_nfc_target_handle_h handle, void *trans_param);
188
189 /**
190         request atr of secure element
191
192         \par Sync (or) Async: Sync
193         This is a Asynchronous API
194
195         @param[in]      handle                  the handle of opened secure element
196         @param[out]     atr                     Answer to reset of secure element
197
198         @return         return the result of the calling the function
199
200         @exception NET_NFC_INVALID_PARAM        invalid
201
202 */
203 net_nfc_error_e net_nfc_get_atr_sync(net_nfc_target_handle_h handle, data_h *atr);
204
205 #ifdef __cplusplus
206 }
207 #endif
208
209
210 #endif
211