libsensord: Disable deprecated sf_* APIs 82/59482/5
authorMu-Woong Lee <muwoong.lee@samsung.com>
Tue, 16 Feb 2016 04:06:42 +0000 (13:06 +0900)
committerMu-Woong Lee <muwoong.lee@samsung.com>
Tue, 8 Mar 2016 09:02:35 +0000 (18:02 +0900)
The functions just return -1.

Change-Id: I76a78ca9d2d84affbc43562fd3e37ec604e7525f
Signed-off-by: Mu-Woong Lee <muwoong.lee@samsung.com>
src/client/client.cpp
src/client/client_deprecated.cpp [new file with mode: 0644]

index 3ab4146..cef182c 100644 (file)
@@ -18,7 +18,6 @@
  */
 
 #include <sensor_common.h>
-#include <sensor_internal_deprecated.h>
 #include <sensor_internal.h>
 #include <sensor_event_listener.h>
 #include <sensor_client_info.h>
@@ -1151,94 +1150,3 @@ API bool sensord_get_data(int handle, unsigned int data_id, sensor_data_t* senso
        return true;
 
 }
-
-/* deprecated APIs */
-API int sf_connect(sensor_type_t sensor_type)
-{
-       sensor_t sensor;
-
-       sensor = sensord_get_sensor(sensor_type);
-
-       return sensord_connect(sensor);
-}
-
-API int sf_disconnect(int handle)
-{
-       return sensord_disconnect(handle) ? OP_SUCCESS : OP_ERROR;
-}
-
-API int sf_start(int handle, int option)
-{
-       return sensord_start(handle, option) ? OP_SUCCESS : OP_ERROR;
-}
-
-API int sf_stop(int handle)
-{
-       return sensord_stop(handle) ? OP_SUCCESS : OP_ERROR;
-}
-
-API int sf_register_event(int handle, unsigned int event_type, event_condition_t *event_condition, sensor_callback_func_t cb, void *user_data)
-{
-       unsigned int interval = BASE_GATHERING_INTERVAL;
-
-       if (event_condition != NULL) {
-               if ((event_condition->cond_op == CONDITION_EQUAL) && (event_condition->cond_value1 > 0))
-                       interval = event_condition->cond_value1;
-       }
-
-       return register_event(handle, event_type, interval, 0, SENSOR_LEGACY_CB, (void*) cb, user_data) ? OP_SUCCESS : OP_ERROR;
-}
-
-API int sf_unregister_event(int handle, unsigned int event_type)
-{
-       return sensord_unregister_event(handle, event_type) ? OP_SUCCESS : OP_ERROR;
-}
-
-API int sf_change_event_condition(int handle, unsigned int event_type, event_condition_t *event_condition)
-{
-       unsigned int interval = BASE_GATHERING_INTERVAL;
-
-       if (event_condition != NULL) {
-               if ((event_condition->cond_op == CONDITION_EQUAL) && (event_condition->cond_value1 > 0))
-                       interval = event_condition->cond_value1;
-       }
-
-       return sensord_change_event_interval(handle, event_type, interval) ? OP_SUCCESS : OP_ERROR;
-}
-
-API int sf_change_sensor_option(int handle, int option)
-{
-       return sensord_set_option(handle, option) ? OP_SUCCESS : OP_ERROR;
-}
-
-API int sf_send_sensorhub_data(int handle, const char* data, int data_len)
-{
-       return sensord_send_sensorhub_data(handle, data, data_len) ? OP_SUCCESS : OP_ERROR;
-}
-
-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;
-}
-
-API int sf_is_sensor_event_available(sensor_type_t sensor_type, unsigned int event_type)
-{
-       return 0;
-}
-
-API int sf_get_data_properties(unsigned int data_id, sensor_data_properties_t *return_data_properties)
-{
-       return 0;
-}
-
-API int sf_get_properties(sensor_type_t sensor_type, sensor_properties_t *return_properties)
-{
-       return 0;
-}
-
diff --git a/src/client/client_deprecated.cpp b/src/client/client_deprecated.cpp
new file mode 100644 (file)
index 0000000..38cf33f
--- /dev/null
@@ -0,0 +1,94 @@
+/*
+ * sensord
+ *
+ * Copyright (c) 2016 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.
+ *
+ */
+
+#include <sensor_internal_deprecated.h>
+
+#ifndef API
+#define API __attribute__((visibility("default")))
+#endif
+
+API int sf_connect(sensor_type_t sensor_type)
+{
+       return OP_ERROR;
+}
+
+API int sf_disconnect(int handle)
+{
+       return OP_ERROR;
+}
+
+API int sf_start(int handle, int option)
+{
+       return OP_ERROR;
+}
+
+API int sf_stop(int handle)
+{
+       return OP_ERROR;
+}
+
+API int sf_register_event(int handle, unsigned int event_type, event_condition_t *event_condition, sensor_callback_func_t cb, void *user_data)
+{
+       return OP_ERROR;
+}
+
+API int sf_unregister_event(int handle, unsigned int event_type)
+{
+       return OP_ERROR;
+}
+
+API int sf_change_event_condition(int handle, unsigned int event_type, event_condition_t *event_condition)
+{
+       return OP_ERROR;
+}
+
+API int sf_change_sensor_option(int handle, int option)
+{
+       return OP_ERROR;
+}
+
+API int sf_send_sensorhub_data(int handle, const char* data, int data_len)
+{
+       return OP_ERROR;
+}
+
+API int sf_get_data(int handle, unsigned int data_id, sensor_data_t* sensor_data)
+{
+       return OP_ERROR;
+}
+
+API int sf_check_rotation(unsigned long *rotation)
+{
+       return OP_ERROR;
+}
+
+API int sf_is_sensor_event_available(sensor_type_t sensor_type, unsigned int event_type)
+{
+       return OP_ERROR;
+}
+
+API int sf_get_data_properties(unsigned int data_id, sensor_data_properties_t *return_data_properties)
+{
+       return OP_ERROR;
+}
+
+API int sf_get_properties(sensor_type_t sensor_type, sensor_properties_t *return_properties)
+{
+       return OP_ERROR;
+}