From 217c8a4878748fdead8cd868ce5814ec3b9c5e65 Mon Sep 17 00:00:00 2001 From: Mu-Woong Lee Date: Tue, 16 Feb 2016 13:06:42 +0900 Subject: [PATCH] libsensord: Disable deprecated sf_* APIs The functions just return -1. Change-Id: I76a78ca9d2d84affbc43562fd3e37ec604e7525f Signed-off-by: Mu-Woong Lee --- src/client/client.cpp | 92 --------------------------------------- src/client/client_deprecated.cpp | 94 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 94 insertions(+), 92 deletions(-) create mode 100644 src/client/client_deprecated.cpp diff --git a/src/client/client.cpp b/src/client/client.cpp index 3ab4146..cef182c 100644 --- a/src/client/client.cpp +++ b/src/client/client.cpp @@ -18,7 +18,6 @@ */ #include -#include #include #include #include @@ -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 index 0000000..38cf33f --- /dev/null +++ b/src/client/client_deprecated.cpp @@ -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 + +#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; +} -- 2.7.4