sensord: add sensor api for avoiding build break 95/33095/1
authorKibak Yoon <kibak.yoon@samsung.com>
Mon, 5 Jan 2015 14:57:27 +0000 (23:57 +0900)
committerKibak Yoon <kibak.yoon@samsung.com>
Mon, 5 Jan 2015 14:58:14 +0000 (23:58 +0900)
Signed-off-by: Kibak Yoon <kibak.yoon@samsung.com>
Change-Id: Icb6934702fcef2c10e72c513d682caa1ed08c21e

src/libsensord/CMakeLists.txt
src/libsensord/client.cpp
src/libsensord/sensor.h [new file with mode: 0755]
src/libsensord/sensor_internal_deprecated.h

index 6eccd7b..50550ee 100755 (executable)
@@ -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/)
index de31c85..3132921 100755 (executable)
@@ -20,6 +20,7 @@
 #include <sf_common.h>
 #include <sensor_internal_deprecated.h>
 #include <sensor_internal.h>
+#include <sensor.h>
 #include <csensor_event_listener.h>
 #include <client_common.h>
 #include <vconf.h>
@@ -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 (executable)
index 0000000..2885a01
--- /dev/null
@@ -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 <sensor_internal.h>
+
+#endif
index dc4a8b3..c2fab32 100755 (executable)
@@ -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.