Change the names of attribute libsensor API 13/287313/1
authorTaeminYeom <taemin.yeom@samsung.com>
Thu, 26 Jan 2023 07:27:26 +0000 (16:27 +0900)
committerTaeminYeom <taemin.yeom@samsung.com>
Thu, 26 Jan 2023 07:57:46 +0000 (16:57 +0900)
In libsensor, attribute APIs name will be changed
Previous attribute APIs are for getting or setting sensor listener attribute.
To distinguish between sensor listener attribute API and
sensor handle attribute API, change the names.

changed API

sensord_get_attribute_int -> sensord_listener_get_attribute_int
sensord_set_attribute_int -> sensord_listener_set_attribute_int

Change-Id: I992cb87e1dda47d06de46a9c40be9f6a0e701972
Signed-off-by: TaeminYeom <taemin.yeom@samsung.com>
src/api/api-sensor-internal.cpp
src/api/api-sensor.cpp

index 514b95f..afb7643 100644 (file)
@@ -35,7 +35,7 @@ int sensor_util_set_attribute_int(sensor_type_e type, sensor_attribute_e attr, i
                return handle;
        }
 
-       ret = sensord_set_attribute_int(handle, attr, value);
+       ret = sensord_listener_set_attribute_int(handle, attr, value);
        if (ret < 0) {
                return ret;
        }
@@ -66,7 +66,7 @@ int sensor_util_get_attribute_int(sensor_type_e type, sensor_attribute_e attr, i
                return handle;
        }
 
-       ret = sensord_get_attribute_int(handle, attr, value);
+       ret = sensord_listener_get_attribute_int(handle, attr, value);
        if (ret < 0) {
                return ret;
        }
index 6d5cda9..08814c9 100644 (file)
@@ -466,7 +466,7 @@ int sensor_listener_start(sensor_listener_h listener)
        if (!sensord_start(id, 0))
                return SENSOR_ERROR_OPERATION_FAILED;
 
-       if (sensord_set_attribute_int(id, SENSOR_ATTRIBUTE_PAUSE_POLICY, pause) < 0)
+       if (sensord_listener_set_attribute_int(id, SENSOR_ATTRIBUTE_PAUSE_POLICY, pause) < 0)
                return SENSOR_ERROR_OPERATION_FAILED;
 
        _D("success sensor_listener_start : id[%d]", id);
@@ -668,7 +668,7 @@ int sensor_listener_set_attribute_int(sensor_listener_h listener, sensor_attribu
 
        id = listener->id;
 
-       error = sensord_set_attribute_int(id, (int)attribute, (int)value);
+       error = sensord_listener_set_attribute_int(id, (int)attribute, (int)value);
 
        if (error == -EINVAL)
                return SENSOR_ERROR_INVALID_PARAMETER;
@@ -697,7 +697,7 @@ int sensor_listener_set_option(sensor_listener_h listener, sensor_option_e optio
 
        id = listener->id;
 
-       if (sensord_set_attribute_int(id, SENSOR_ATTRIBUTE_PAUSE_POLICY, CONVERT_OPTION_PAUSE_POLICY(option)) < 0)
+       if (sensord_listener_set_attribute_int(id, SENSOR_ATTRIBUTE_PAUSE_POLICY, CONVERT_OPTION_PAUSE_POLICY(option)) < 0)
                return SENSOR_ERROR_OPERATION_FAILED;
 
        listener->pause = CONVERT_OPTION_PAUSE_POLICY(option);