tizen 2.3.1 release
[framework/web/wearable/wrt-plugins-tizen.git] / src / Sensor / plugin_config.cpp
1 //
2 // Tizen Web Device API
3 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17
18
19 #include <Commons/FunctionDefinition.h>
20 #include <Commons/FunctionDeclaration.h>
21 #include <Commons/Exception.h>
22 #include <map>
23
24 #include "plugin_config.h"
25
26 #define SENSOR_FEATURE_API_HEALTHINFO "http://tizen.org/privilege/healthinfo"
27 #define SENSOR_DEVICE_CAP_HEALTHINFO "healthinfo"
28
29 using namespace WrtDeviceApis::Commons;
30
31 namespace DeviceAPI {
32 namespace Sensor {
33
34 static FunctionMapping createSensorFunctions();
35 static FunctionMapping SensorFunctions = createSensorFunctions();
36
37 DEFINE_FUNCTION_GETTER(Sensor, SensorFunctions);
38
39 static FunctionMapping createSensorFunctions()
40 {
41     FunctionMapping sensorMapping;
42     // TODO: implement here
43
44     /**
45      * Device capabilities : healthinfo
46      */
47     ACE_CREATE_DEVICE_CAP(DEVICE_CAP_SENSOR_HEALTHINFO, SENSOR_DEVICE_CAP_HEALTHINFO);
48
49     ACE_CREATE_DEVICE_CAPS_LIST(EMPTY_DEVICE_LIST);
50
51     ACE_CREATE_DEVICE_CAPS_LIST(DEVICE_LIST_SENSOR_HEALTHINFO);
52     ACE_ADD_DEVICE_CAP(DEVICE_LIST_SENSOR_HEALTHINFO, DEVICE_CAP_SENSOR_HEALTHINFO);
53
54     /**
55      * Api Features
56      */
57     ACE_CREATE_FEATURE(FEATURE_SENSOR_HEALTHINFO, SENSOR_FEATURE_API_HEALTHINFO);
58
59     ACE_CREATE_FEATURE_LIST(SENSOR_FEATURES_SENSOR_HEALTHINFO);
60     ACE_ADD_API_FEATURE(SENSOR_FEATURES_SENSOR_HEALTHINFO, FEATURE_SENSOR_HEALTHINFO);
61
62     AceFunction sensorGetDefaultSensor = ACE_CREATE_FUNCTION(
63             FUNCTION_SENSOR_SERVICE_GET_DEFAULT_SENSOR,
64             SENSOR_SERVICE_API_GET_DEFAULT_SENSOR,
65             SENSOR_FEATURES_SENSOR_HEALTHINFO,
66             DEVICE_LIST_SENSOR_HEALTHINFO);
67
68     sensorMapping.insert(std::make_pair(
69                                SENSOR_SERVICE_API_GET_DEFAULT_SENSOR,
70                                sensorGetDefaultSensor));
71
72     return sensorMapping;
73 }
74
75 } // Sensor
76 } // DeviceAPI