From: Kibak Yoon Date: Mon, 5 Jan 2015 14:57:27 +0000 (+0900) Subject: sensord: add sensor api for avoiding build break X-Git-Tag: submit/tizen/20150113.012540~32^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F95%2F33095%2F1;p=platform%2Fcore%2Fsystem%2Fsensord.git sensord: add sensor api for avoiding build break Signed-off-by: Kibak Yoon Change-Id: Icb6934702fcef2c10e72c513d682caa1ed08c21e --- diff --git a/src/libsensord/CMakeLists.txt b/src/libsensord/CMakeLists.txt index 6eccd7b..50550ee 100755 --- a/src/libsensord/CMakeLists.txt +++ b/src/libsensord/CMakeLists.txt @@ -50,6 +50,7 @@ configure_file(${PROJECT_NAME}.pc.in ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME} #install(DIRECTORY include/ DESTINATION ${INCLUDEDIR} FILES_MATCHING PATTERN "*.h") install(TARGETS ${PROJECT_NAME} DESTINATION ${LIBDIR} COMPONENT RuntimeLibraries) +install(FILES sensor.h DESTINATION ${INCLUDEDIR}/sensor/) install(FILES sensor_internal_deprecated.h DESTINATION ${INCLUDEDIR}/sensor/) install(FILES sensor_internal.h DESTINATION ${INCLUDEDIR}/sensor/) install(FILES poller.h DESTINATION ${INCLUDEDIR}/sensor/) diff --git a/src/libsensord/client.cpp b/src/libsensord/client.cpp index de31c85..3132921 100755 --- a/src/libsensord/client.cpp +++ b/src/libsensord/client.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -381,6 +382,12 @@ API int sf_get_data(int handle, unsigned int data_id, sensor_data_t* sensor_data return sensord_get_data(handle, data_id, sensor_data) ? OP_SUCCESS : OP_ERROR; } +API int sf_check_rotation(unsigned long *rotation) +{ + rotation = 0; + return 0; +} + static bool get_sensor_list(void) { static cmutex l; diff --git a/src/libsensord/sensor.h b/src/libsensord/sensor.h new file mode 100755 index 0000000..2885a01 --- /dev/null +++ b/src/libsensord/sensor.h @@ -0,0 +1,25 @@ +/* + * libsensord + * + * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef __SENSOR_IN_H__ +#define __SENSOR_IN_H__ + +#include + +#endif diff --git a/src/libsensord/sensor_internal_deprecated.h b/src/libsensord/sensor_internal_deprecated.h index dc4a8b3..c2fab32 100755 --- a/src/libsensord/sensor_internal_deprecated.h +++ b/src/libsensord/sensor_internal_deprecated.h @@ -69,6 +69,22 @@ typedef struct { int z; } sensor_panning_data_t; +#define ACCELEROMETER_EVENT_ROTATION_CHECK ((ACCELEROMETER_SENSOR << 16) | 0x0001) + +enum accelerometer_rotate_state { + ROTATION_UNKNOWN = 0, + ROTATION_LANDSCAPE_LEFT = 1, + ROTATION_PORTRAIT_TOP = 2, + ROTATION_PORTRAIT_BTM = 3, + ROTATION_LANDSCAPE_RIGHT = 4, + ROTATION_EVENT_0 = 2, + ROTATION_EVENT_90 = 1, + ROTATION_EVENT_180 = 3, + ROTATION_EVENT_270 = 4, +}; + +int sf_check_rotation(unsigned long *rotation); + /** * @fn int sf_connect(sensor_type_t sensor) * @brief This API connects a sensor type to respective sensor. The application calls with the type of the sensor (ex. ACCELEROMETER_SENSOR) and on basis of that server takes decision of which plug-in to be connected. Once sensor connected application can proceed for data processing. This API returns a positive handle which should be used by application to communicate on sensor type.