2 // Tizen Web Device API
3 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
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
9 // http://www.apache.org/licenses/LICENSE-2.0
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.
19 #include <Commons/FunctionDefinition.h>
20 #include <Commons/FunctionDeclaration.h>
21 #include <Commons/Exception.h>
24 #include "plugin_config.h"
26 #define SENSOR_FEATURE_API_HEALTHINFO "http://tizen.org/privilege/healthinfo"
27 #define SENSOR_DEVICE_CAP_HEALTHINFO "healthinfo"
29 using namespace WrtDeviceApis::Commons;
34 static FunctionMapping createSensorFunctions();
35 static FunctionMapping SensorFunctions = createSensorFunctions();
37 DEFINE_FUNCTION_GETTER(Sensor, SensorFunctions);
39 static FunctionMapping createSensorFunctions()
41 FunctionMapping sensorMapping;
42 // TODO: implement here
45 * Device capabilities : healthinfo
47 ACE_CREATE_DEVICE_CAP(DEVICE_CAP_SENSOR_HEALTHINFO, SENSOR_DEVICE_CAP_HEALTHINFO);
49 ACE_CREATE_DEVICE_CAPS_LIST(EMPTY_DEVICE_LIST);
51 ACE_CREATE_DEVICE_CAPS_LIST(DEVICE_LIST_SENSOR_HEALTHINFO);
52 ACE_ADD_DEVICE_CAP(DEVICE_LIST_SENSOR_HEALTHINFO, DEVICE_CAP_SENSOR_HEALTHINFO);
57 ACE_CREATE_FEATURE(FEATURE_SENSOR_HEALTHINFO, SENSOR_FEATURE_API_HEALTHINFO);
59 ACE_CREATE_FEATURE_LIST(SENSOR_FEATURES_SENSOR_HEALTHINFO);
60 ACE_ADD_API_FEATURE(SENSOR_FEATURES_SENSOR_HEALTHINFO, FEATURE_SENSOR_HEALTHINFO);
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);
68 sensorMapping.insert(std::make_pair(
69 SENSOR_SERVICE_API_GET_DEFAULT_SENSOR,
70 sensorGetDefaultSensor));