From: Yunmi Ha Date: Tue, 20 Apr 2021 05:12:58 +0000 (+0900) Subject: Use system error instaed of sensor_error_e X-Git-Tag: accepted/tizen/unified/20210421.101145^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=94c68e97f9ac6d0b5357c5e41e9b522fa17c0b78;p=platform%2Fhal%2Fapi%2Fsensor.git Use system error instaed of sensor_error_e Change-Id: Ibea2e23204e1186533ee997bbf2509eae319b19b Signed-off-by: Yunmi Ha --- diff --git a/haltest/sensor-device.cpp b/haltest/sensor-device.cpp index 93089e4..58bd034 100644 --- a/haltest/sensor-device.cpp +++ b/haltest/sensor-device.cpp @@ -64,7 +64,7 @@ TEST_F(SENSOR_DEV, get_sensorsN) SKIP_NO_DEV() for (auto it = devices.begin(); it != devices.end(); ++it) { - EXPECT_EQ((*it)->get_sensors(nullptr), SENSOR_ERROR_INVALID_PARAMETER); + EXPECT_EQ((*it)->get_sensors(nullptr), -EINVAL); } } /* @@ -137,7 +137,7 @@ TEST_F(SENSOR_DEV, read_fdN) SKIP_NO_DEV(); for (auto it = devices.begin(); it != devices.end(); ++it) { - EXPECT_EQ((*it)->read_fd(nullptr), SENSOR_ERROR_INVALID_PARAMETER); + EXPECT_EQ((*it)->read_fd(nullptr), -EINVAL); } } */ @@ -166,8 +166,8 @@ TEST_F(SENSOR_DEV, get_dataN) SKIP_NO_DEV() for (auto it = devices.begin(); it != devices.end(); ++it) { - EXPECT_EQ((*it)->get_data(0, &data, &length), SENSOR_ERROR_INVALID_PARAMETER); - EXPECT_EQ((*it)->get_data(1, nullptr, &length), SENSOR_ERROR_INVALID_PARAMETER); - EXPECT_EQ((*it)->get_data(1, &data, nullptr), SENSOR_ERROR_INVALID_PARAMETER); + EXPECT_EQ((*it)->get_data(0, &data, &length), -EINVAL); + EXPECT_EQ((*it)->get_data(1, nullptr, &length), -EINVAL); + EXPECT_EQ((*it)->get_data(1, &data, nullptr), -EINVAL); } } diff --git a/include/hal-sensor-types.h b/include/hal-sensor-types.h index d373f6f..fcba0cd 100644 --- a/include/hal-sensor-types.h +++ b/include/hal-sensor-types.h @@ -20,7 +20,6 @@ #include #include #include -#include #define SENSOR_HAL_VERSION(maj, min) ((((maj)&0xFFFF) << 24) | ((min)&0xFFFF)) @@ -156,25 +155,6 @@ typedef enum { SENSOR_DEVICE_PPG, } sensor_device_type; -/** - * @brief Enumeration for errors. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - */ -typedef enum { - SENSOR_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */ - SENSOR_ERROR_IO_ERROR = TIZEN_ERROR_IO_ERROR, /**< I/O error */ - SENSOR_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */ - SENSOR_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED, /**< Not supported */ - SENSOR_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< Permission denied */ - SENSOR_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */ - SENSOR_ERROR_NO_DATA = TIZEN_ERROR_NO_DATA, /**< No data available - @if MOBILE (Since 3.0) @elseif WEARABLE (Since 2.3.2) @endif */ - SENSOR_ERROR_NOT_NEED_CALIBRATION = TIZEN_ERROR_SENSOR | 0x03, /**< Sensor doesn't need calibration */ - SENSOR_ERROR_OPERATION_FAILED = TIZEN_ERROR_SENSOR | 0x06, /**< Operation failed */ - SENSOR_ERROR_NOT_AVAILABLE = TIZEN_ERROR_SENSOR | 0x07, /**< The sensor is supported, but currently not available - @if MOBILE (Since 3.0) @elseif WEARABLE (Since 2.3.2) @endif */ -} sensor_error_e; - /* * A platform sensor handler is generated based on this handle * This id can be assigned from HAL developer. so it has to be unique in 1