2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (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://www.apache.org/licenses/LICENSE-2.0
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.
21 #include <Commons/FunctionDefinition.h>
22 #include <Commons/FunctionDeclaration.h>
23 #include <Commons/Exception.h>
25 #include "plugin_config.h"
27 #define SECUREELEMENT_FEATURE_API_SECUREELEMENT "http://tizen.org/privilege/secureelement"
28 #define SECUREELEMENT_FEATURE_API_SE "http://tizen.org/privilege/se"
30 #define SECUREELEMENT_DEVICE_CAP_SECUREELEMENT "secureelement"
31 #define SECUREELEMENT_DEVICE_CAP_SE "se"
34 namespace SecureElement {
36 static WrtDeviceApis::Commons::FunctionMapping createSecureElementFunctions();
38 static WrtDeviceApis::Commons::FunctionMapping SecureElementFunctions =
39 createSecureElementFunctions();
41 DEFINE_FUNCTION_GETTER(SecureElement, SecureElementFunctions);
43 static WrtDeviceApis::Commons::FunctionMapping createSecureElementFunctions()
45 using namespace WrtDeviceApis::Commons;
50 ACE_CREATE_DEVICE_CAP(DEVICE_CAP_SECUREELEMENT, SECUREELEMENT_DEVICE_CAP_SECUREELEMENT);
51 ACE_CREATE_DEVICE_CAP(DEVICE_CAP_SE, SECUREELEMENT_DEVICE_CAP_SE);
53 ACE_CREATE_DEVICE_CAPS_LIST(DEVICE_LIST_SECUREELEMENT);
54 ACE_ADD_DEVICE_CAP(DEVICE_LIST_SECUREELEMENT, DEVICE_CAP_SECUREELEMENT);
55 ACE_ADD_DEVICE_CAP(DEVICE_LIST_SECUREELEMENT, DEVICE_CAP_SE);
60 ACE_CREATE_FEATURE(FEATURE_SECUREELEMENT, SECUREELEMENT_FEATURE_API_SECUREELEMENT);
61 ACE_CREATE_FEATURE(FEATURE_SE, SECUREELEMENT_FEATURE_API_SE);
63 ACE_CREATE_FEATURE_LIST(SECUREELEMENT_FEATURES_SECUREELEMENT);
64 ACE_ADD_API_FEATURE(SECUREELEMENT_FEATURES_SECUREELEMENT, FEATURE_SECUREELEMENT);
65 ACE_ADD_API_FEATURE(SECUREELEMENT_FEATURES_SECUREELEMENT, FEATURE_SE);
71 FunctionMapping SecureElementFunctions;
73 AceFunction seFunctions = ACE_CREATE_FUNCTION(
74 FUNCTION_SECUREELEMENT_FUNCTIONS,
75 SECUREELEMENT_FUNCTION_API_FUNCS,
76 SECUREELEMENT_FEATURES_SECUREELEMENT,
77 DEVICE_LIST_SECUREELEMENT);
79 SecureElementFunctions.insert(std::make_pair(
80 SECUREELEMENT_FUNCTION_API_FUNCS,
83 return SecureElementFunctions;
88 #undef SECUREELEMENT_FEATURE_API_SE
89 #undef SECUREELEMENT_FEATURE_API_SECUREELEMENT
90 #undef SECUREELEMENT_DEVICE_CAP_SE
91 #undef SECUREELEMENT_DEVICE_CAP_SECUREELEMENT