From: TaeminYeom Date: Thu, 15 Sep 2022 05:41:29 +0000 (+0900) Subject: Move libsensor header files into capi sensor for compatibility X-Git-Tag: accepted/tizen/unified/20220919.021608~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F67%2F281267%2F5;p=platform%2Fcore%2Fapi%2Fsensor.git Move libsensor header files into capi sensor for compatibility -sensor-deprecated.h -sensor-internal-deprecated.h change a header file not private (actually, it was not used as private) -sensor-types-private.h -> sensor-types.h change spec file not to include private header files in devel package Change-Id: I08b12e541a0cb76d89d096ed4ded892556172853 Signed-off-by: TaeminYeom --- diff --git a/CMakeLists.txt b/CMakeLists.txt index d7fc8d2..aa65f1d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,4 +26,8 @@ ADD_SUBDIRECTORY(src/api) ADD_SUBDIRECTORY(tests) ADD_SUBDIRECTORY(tools) -INSTALL(DIRECTORY include/ include/private/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor) +INSTALL(DIRECTORY include/ + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor + FILES_MATCHING + PATTERN "*-private.h" EXCLUDE + PATTERN "*.h") diff --git a/include/private/sensor-types-private.h b/include/private/sensor-types-private.h deleted file mode 100644 index 6e777c7..0000000 --- a/include/private/sensor-types-private.h +++ /dev/null @@ -1,314 +0,0 @@ -/* - * 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. - * - */ - -#ifndef __SENSOR_TYPES_H__ -#define __SENSOR_TYPES_H__ - -/* TODO: It is for compatibility with capi-system-sensor */ -#define __SENSOR_COMMON_H__ - -#include -#include -#include - -#ifdef __cplusplus -extern "C" -{ -#endif - -#ifndef OP_SUCCESS -#define OP_SUCCESS 0 -#endif -#ifndef OP_ERROR -#define OP_ERROR -1 -#endif -#ifndef OP_DEFAULT -#define OP_DEFAULT 1 -#endif -#ifndef OP_CONTINUE -#define OP_CONTINUE 2 -#endif -#ifndef NAME_MAX -#define NAME_MAX 256 -#endif - -#define URI_REGEX(CATEGORY) R"~(^http:\/\/[\w-]+(\.[\w-]+)*\/)~" CATEGORY R"~(\/(general|healthinfo)\/[\w-]+(\.[\w-]+)*(\/[\w-]+(\.[\w-]+)*)$)~" -#define SENSOR_URI_REGEX URI_REGEX("sensor") - -#define PREDEFINED_TYPE_URI "http://tizen.org/sensor/" - -#define PRIV_DELIMITER ";" -#define URI_DELIMITER "/" - -#define PRIVILEGE_HEALTHINFO_STR "healthinfo" -#define PRIVILEGE_HEALTHINFO_URI "http://tizen.org/privilege/healthinfo" - -#define PRIVILEGE_LOCATION_STR "location" -#define PRIVILEGE_LOCATION_URI "http://tizen.org/privilege/location" - -#define PRIVILEGE_PLATFORM_STR "platform" -#define PRIVILEGE_PLATFORM_URI "http://tizen.org/privilege/internal/default/platform" - -#define URI_PRIV_INDEX 4 -#define URI_SENSOR_TYPE_INDEX 5 - -#define SENSOR_TYPE_SHIFT 32 -#define SENSOR_EVENT_SHIFT 16 -#define SENSOR_INDEX_MASK 0xFFFFFFFF - -#define CONVERT_ID_TYPE(id) ((id) >> SENSOR_TYPE_SHIFT) -#define CONVERT_TYPE_EVENT(type) ((type) << SENSOR_EVENT_SHIFT | 0x1) - -#define MICROSECONDS(tv) ((tv.tv_sec * 1000000ll) + tv.tv_usec) - -#define SENSOR_UNKNOWN_TYPE "http://tizen.org/sensor/unknown" -#define SENSOR_UNKNOWN_NAME "Unknown" - -typedef int64_t sensor_id_t; -typedef void *sensor_t; - -typedef enum sensor_type_t { - UNKNOWN_SENSOR = -2, - ALL_SENSOR = -1, - ACCELEROMETER_SENSOR = 0, - GRAVITY_SENSOR, - LINEAR_ACCEL_SENSOR, - GEOMAGNETIC_SENSOR, - ROTATION_VECTOR_SENSOR, - ORIENTATION_SENSOR, - GYROSCOPE_SENSOR, - LIGHT_SENSOR, - PROXIMITY_SENSOR, - PRESSURE_SENSOR, - ULTRAVIOLET_SENSOR, - TEMPERATURE_SENSOR, - HUMIDITY_SENSOR, - HRM_SENSOR, - BIO_HRM_SENSOR = HRM_SENSOR, - HRM_LED_GREEN_SENSOR, - BIO_LED_GREEN_SENSOR = HRM_LED_GREEN_SENSOR, - HRM_LED_IR_SENSOR, - BIO_LED_IR_SENSOR = HRM_LED_IR_SENSOR, - HRM_LED_RED_SENSOR, - BIO_LED_RED_SENSOR = HRM_LED_RED_SENSOR, - GYROSCOPE_UNCAL_SENSOR, - GEOMAGNETIC_UNCAL_SENSOR, - GYROSCOPE_RV_SENSOR, - GEOMAGNETIC_RV_SENSOR, - - GYROSCOPE_ORIENTATION_SENSOR = 100, - GEOMAGNETIC_ORIENTATION_SENSOR = 105, - - SIGNIFICANT_MOTION_SENSOR = 0x100, //256 - - HRM_BATCH_SENSOR = 0x200, //512 - HRM_LED_GREEN_BATCH_SENSOR, - - HUMAN_PEDOMETER_SENSOR = 0x300, //768 - HUMAN_SLEEP_MONITOR_SENSOR, - HUMAN_SLEEP_DETECTOR_SENSOR, - SLEEP_DETECTOR_SENSOR = HUMAN_SLEEP_DETECTOR_SENSOR, - HUMAN_STRESS_MONITOR_SENSOR, - STRESS_MONITOR_SENSOR = HUMAN_STRESS_MONITOR_SENSOR, - - LIDAR_SENSOR = 1000, - - EXERCISE_WALKING_SENSOR = 0x400, //1024 - EXERCISE_RUNNING_SENSOR, - EXERCISE_HIKING_SENSOR, - EXERCISE_CYCLING_SENSOR, - EXERCISE_ELLIPTICAL_SENSOR, - EXERCISE_INDOOR_CYCLING_SENSOR, - EXERCISE_ROWING_SENSOR, - EXERCISE_STEPPER_SENSOR, - - DATA_JOURNAL_SENSOR = 0x500, - // 0x500~0x600 Reserved (1280 ~ 1536) - - EXTERNAL_EXERCISE_SENSOR = 0x800, //2048 - EXERCISE_SENSOR = EXTERNAL_EXERCISE_SENSOR, - - FUSION_SENSOR = 0x900, //2304 - AUTO_ROTATION_SENSOR, - AUTO_BRIGHTNESS_SENSOR, - MYOTEST_SENSOR, - - GESTURE_MOVEMENT_SENSOR = 0x1200, //4608 - GESTURE_WRIST_UP_SENSOR, - GESTURE_WRIST_DOWN_SENSOR, - GESTURE_MOVEMENT_STATE_SENSOR, - GESTURE_PICK_UP_SENSOR, - GESTURE_FACE_DOWN_SENSOR, - - ACTIVITY_TRACKER_SENSOR = 0x1A00, //6656 - ACTIVITY_LEVEL_MONITOR_SENSOR, - GPS_BATCH_SENSOR, - PPG_BATCH_SENSOR, - GPS_TIMESYNC_SENSOR, - - HRM_CTRL_SENSOR = 0x1A80, //6784 - REG_CTRL_SENSOR, - GPS_CTRL_SENSOR, - - WEAR_STATUS_SENSOR = 0x2000, //8192 - WEAR_ON_MONITOR_SENSOR, - NO_MOVE_DETECTOR_SENSOR, - RESTING_HR_SENSOR, - STEP_LEVEL_MONITOR_SENSOR, - EXERCISE_STANDALONE_SENSOR, - EXERCISE_COACH_SENSOR = EXERCISE_STANDALONE_SENSOR, - EXERCISE_HR_SENSOR, - WORKOUT_SENSOR, - AUTOSESSION_EXERCISE_SENSOR = WORKOUT_SENSOR, - CYCLE_MONITOR_SENSOR, - STAIR_TRACKER_SENSOR, - PRESSURE_INDICATOR_SENSOR, - PRESSURE_ALERT_SENSOR, - HR_CALORIE_SENSOR, - SWIMMING_TRACKER_SENSOR, - STRESS_TRACKER_SENSOR, - FAKE_MOTION_SENSOR, - GEOFENCE_SENSOR, - SWIMMING_OUTDOOR_SENSOR, - AUTO_SWIMMING_SENSOR, - INACTIVITY_DETECTOR_SENSOR, - HRM_BP_SENSOR, - ECG_SENSOR, - FALL_DETECTION_SENSOR, - - CONTEXT_SENSOR = 0x7000, //28,672 - MOTION_SENSOR, - PIR_SENSOR, - PIR_LONG_SENSOR, - DUST_SENSOR, - THERMOMETER_SENSOR, - PEDOMETER_SENSOR, - FLAT_SENSOR, - HRM_RAW_SENSOR, - BIO_SENSOR = HRM_RAW_SENSOR, - TILT_SENSOR, - RV_RAW_SENSOR, - GSR_SENSOR, - SIMSENSE_SENSOR, - PPG_SENSOR, - - CUSTOM_SENSOR = 0X9000, //36,864 -} sensor_type_t; - -typedef struct sensor_info2_t { - uint32_t id; - sensor_type_t type; - const char *uri; - const char *vendor; - float min_range; - float max_range; - float resolution; - int min_interval; - int max_interval; - int max_batch_count; - bool wakeup_supported; - const char *privilege; - void *reserved[8]; -} sensor_info2_t; - -typedef enum sensor_privilege_t { - SENSOR_PRIVILEGE_PUBLIC = 0, -} sensor_privilege_t; - -typedef struct sensor_event_t { - unsigned int event_type; - sensor_id_t sensor_id; - unsigned int data_length; - sensor_data_t *data; -} sensor_event_t; - -/* - * To prevent naming confliction as using same enums as sensor CAPI use - */ -#ifndef __SENSOR_H__ -enum sensor_option_t { - SENSOR_OPTION_DEFAULT = 0, - SENSOR_OPTION_ON_IN_SCREEN_OFF = 1, - SENSOR_OPTION_ON_IN_POWERSAVE_MODE = 2, - SENSOR_OPTION_ALWAYS_ON = SENSOR_OPTION_ON_IN_SCREEN_OFF | SENSOR_OPTION_ON_IN_POWERSAVE_MODE, - SENSOR_OPTION_END -}; - -typedef enum sensor_option_t sensor_option_e; -#endif - -enum sensord_attribute_e { - SENSORD_ATTRIBUTE_AXIS_ORIENTATION = 1, - SENSORD_ATTRIBUTE_PAUSE_POLICY, - SENSORD_ATTRIBUTE_INTERVAL = 0x10, - SENSORD_ATTRIBUTE_MAX_BATCH_LATENCY, - SENSORD_ATTRIBUTE_PASSIVE_MODE, - SENSORD_ATTRIBUTE_FLUSH, - // 0x50~0x80 Reserved -}; - -enum sensord_axis_e { - SENSORD_AXIS_DEVICE_ORIENTED = 1, - SENSORD_AXIS_DISPLAY_ORIENTED, -}; - -enum sensord_pause_e { - SENSORD_PAUSE_NONE = 0, - SENSORD_PAUSE_ON_DISPLAY_OFF = 1, - SENSORD_PAUSE_ON_POWERSAVE_MODE = 2, - SENSORD_PAUSE_ALL = 3, - SENSORD_PAUSE_END, -}; - -enum poll_interval_t { - POLL_100HZ_MS = 10, - POLL_50HZ_MS = 20, - POLL_25HZ_MS = 40, - POLL_20HZ_MS = 50, - POLL_10HZ_MS = 100, - POLL_5HZ_MS = 200, - POLL_1HZ_MS = 1000, - POLL_MAX_HZ_MS = 255000, -}; - -#define DEFAULT_INTERVAL POLL_10HZ_MS - -enum sensor_interval_t { - SENSOR_INTERVAL_FASTEST = POLL_100HZ_MS, - SENSOR_INTERVAL_NORMAL = POLL_5HZ_MS, -}; - -enum proxi_change_state { - PROXIMITY_STATE_NEAR = 0, - PROXIMITY_STATE_FAR = 1, -}; - -enum auto_rotation_state { - AUTO_ROTATION_DEGREE_UNKNOWN = 0, - AUTO_ROTATION_DEGREE_0, - AUTO_ROTATION_DEGREE_90, - AUTO_ROTATION_DEGREE_180, - AUTO_ROTATION_DEGREE_270, -}; - -#ifdef __cplusplus -} -#endif - -#endif /* __SENSOR_TYPES_H__ */ diff --git a/include/sensor-deprecated.h b/include/sensor-deprecated.h new file mode 100644 index 0000000..c81e2d1 --- /dev/null +++ b/include/sensor-deprecated.h @@ -0,0 +1,265 @@ +/* + * 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. + * + */ + +#ifndef __SENSOR_DEPRECATED_H__ +#define __SENSOR_DEPRECATED_H__ + +#ifdef __cplusplus +extern "C" +{ +#endif + +// Sensor Event Types +enum event_types_t { + ACCELEROMETER_RAW_DATA_EVENT = (ACCELEROMETER_SENSOR << 16) | 0x0001, + ACCELEROMETER_UNPROCESSED_DATA_EVENT = (ACCELEROMETER_SENSOR << 16) | 0x0002, + + GYROSCOPE_RAW_DATA_EVENT = (GYROSCOPE_SENSOR << 16) | 0x0001, + GYROSCOPE_UNPROCESSED_DATA_EVENT = (GYROSCOPE_SENSOR << 16) | 0x0002, + + GEOMAGNETIC_RAW_DATA_EVENT = (GEOMAGNETIC_SENSOR << 16) | 0x0001, + GEOMAGNETIC_UNPROCESSED_DATA_EVENT = (GEOMAGNETIC_SENSOR << 16) | 0x0002, + + PROXIMITY_CHANGE_STATE_EVENT = (PROXIMITY_SENSOR << 16) | 0x0001, + PROXIMITY_STATE_EVENT = (PROXIMITY_SENSOR << 16) | 0x0002, + PROXIMITY_DISTANCE_DATA_EVENT = (PROXIMITY_SENSOR << 16) | 0x0003, + + PRESSURE_RAW_DATA_EVENT = (PRESSURE_SENSOR << 16) | 0x0001, + + TEMPERATURE_RAW_DATA_EVENT = (TEMPERATURE_SENSOR << 16) | 0x0001, + + LIGHT_LUX_DATA_EVENT = (LIGHT_SENSOR << 16) | 0x0001, + LIGHT_LEVEL_DATA_EVENT = (LIGHT_SENSOR << 16) | 0x0002, + LIGHT_CHANGE_LEVEL_EVENT = (LIGHT_SENSOR << 16) | 0x0003, + + ROTATION_VECTOR_RAW_DATA_EVENT = (ROTATION_VECTOR_SENSOR << 16) | 0x0001, + + FACE_DOWN_RAW_DATA_EVENT = (GESTURE_FACE_DOWN_SENSOR << 16) | 0x0001, + + RV_RAW_RAW_DATA_EVENT = (RV_RAW_SENSOR << 16) | 0x0001, + + ULTRAVIOLET_RAW_DATA_EVENT = (ULTRAVIOLET_SENSOR << 16) | 0x0001, + + AUTO_ROTATION_CHANGE_STATE_EVENT = (AUTO_ROTATION_SENSOR << 16) | 0x0001, + + BIO_LED_RED_RAW_DATA_EVENT = (BIO_LED_RED_SENSOR << 16) | 0x0001, + + GAMING_RV_RAW_DATA_EVENT = (GYROSCOPE_RV_SENSOR << 16) | 0x0001, + + GEOMAGNETIC_RV_RAW_DATA_EVENT = (GEOMAGNETIC_RV_SENSOR << 16) | 0x0001, + + GRAVITY_RAW_DATA_EVENT = (GRAVITY_SENSOR << 16) | 0x0001, + + LINEAR_ACCEL_RAW_DATA_EVENT = (LINEAR_ACCEL_SENSOR << 16) | 0x0001, + + MOTION_ENGINE_EVENT_SNAP = (MOTION_SENSOR << 16) | 0x0001, + MOTION_ENGINE_EVENT_SHAKE = (MOTION_SENSOR << 16) | 0x0002, + MOTION_ENGINE_EVENT_DOUBLETAP = (MOTION_SENSOR << 16) | 0x0004, + MOTION_ENGINE_EVENT_PANNING = (MOTION_SENSOR << 16) | 0x0008, + MOTION_ENGINE_EVENT_TOP_TO_BOTTOM = (MOTION_SENSOR << 16) | 0x0010, + MOTION_ENGINE_EVENT_DIRECT_CALL = (MOTION_SENSOR << 16) | 0x0020, + MOTION_ENGINE_EVENT_TILT_TO_UNLOCK = (MOTION_SENSOR << 16) | 0x0040, + MOTION_ENGINE_EVENT_LOCK_EXECUTE_CAMERA = (MOTION_SENSOR << 16) | 0x0080, + MOTION_ENGINE_EVENT_SMART_ALERT = (MOTION_SENSOR << 16) | 0x0100, + MOTION_ENGINE_EVENT_TILT = (MOTION_SENSOR << 16) | 0x0200, + MOTION_ENGINE_EVENT_PANNING_BROWSE = (MOTION_SENSOR << 16) | 0x0400, + MOTION_ENGINE_EVENT_NO_MOVE = (MOTION_SENSOR << 16) | 0x0800, + MOTION_ENGINE_EVENT_SHAKE_ALWAYS_ON = (MOTION_SENSOR << 16) | 0x1000, + MOTION_ENGINE_EVENT_SMART_RELAY = (MOTION_SENSOR << 16) | 0x2000, + + ORIENTATION_RAW_DATA_EVENT = (ORIENTATION_SENSOR << 16) | 0x0001, + + TILT_RAW_DATA_EVENT = (TILT_SENSOR << 16) | 0x0001, + + GYROSCOPE_UNCAL_RAW_DATA_EVENT = (GYROSCOPE_UNCAL_SENSOR << 16) | 0x0001, + + FUSION_EVENT = (FUSION_SENSOR << 16) | 0x0001, + FUSION_GYROSCOPE_UNCAL_EVENT = (FUSION_SENSOR << 16) | 0x0002, + FUSION_CALIBRATION_NEEDED_EVENT = (FUSION_SENSOR << 16) | 0x0003, + FUSION_ORIENTATION_ENABLED = (FUSION_SENSOR << 16) | 0x0004, + FUSION_ROTATION_VECTOR_ENABLED = (FUSION_SENSOR << 16) | 0x0005, + FUSION_GAMING_ROTATION_VECTOR_ENABLED = (FUSION_SENSOR << 16) | 0x0006, + FUSION_GEOMAGNETIC_ROTATION_VECTOR_ENABLED = (FUSION_SENSOR << 16) | 0x0007, + FUSION_TILT_ENABLED = (FUSION_SENSOR << 16) | 0x0008, + FUSION_GYROSCOPE_UNCAL_ENABLED = (FUSION_SENSOR << 16) | 0x0009, +}; + +#define CALIBRATION_EVENT(sensor_type) (((sensor_type) << 16) | 0x2) + +#define ACCELEROMETER_EVENT_ROTATION_CHECK ((ACCELEROMETER_SENSOR << 16) | 0x0100) + +#define ACCELEROMETER_ORIENTATION_DATA_SET (ACCELEROMETER_SENSOR << 16) | 0x0002 +#define ACCELEROMETER_LINEAR_ACCELERATION_DATA_SET (ACCELEROMETER_SENSOR << 16) | 0x0004 +#define ACCELEROMETER_GRAVITY_DATA_SET (ACCELEROMETER_SENSOR << 16) | 0x0008 + +#define ACCELEROMETER_EVENT_GRAVITY_DATA_REPORT_ON_TIME (ACCELEROMETER_SENSOR << 16) | 0x0080 +#define ACCELEROMETER_EVENT_LINEAR_ACCELERATION_DATA_REPORT_ON_TIME (ACCELEROMETER_SENSOR << 16) | 0x0040 +#define ACCELEROMETER_EVENT_ORIENTATION_DATA_REPORT_ON_TIME (ACCELEROMETER_SENSOR << 16) | 0x0020 +#define GEOMAGNETIC_EVENT_ATTITUDE_DATA_REPORT_ON_TIME (GEOMAGNETIC_SENSOR << 16) | 0x0004 +#define ACCELEROMETER_EVENT_CALIBRATION_NEEDED 0x01 +#define ACCELEROMETER_EVENT_SET_WAKEUP 0x02 + +#define TEMPERATURE_BASE_DATA_SET TEMPERATURE_RAW_DATA_EVENT +#define TEMPERATURE_EVENT_RAW_DATA_REPORT_ON_TIME TEMPERATURE_RAW_DATA_EVENT + +#define ACCELEROMETER_BASE_DATA_SET ACCELEROMETER_RAW_DATA_EVENT +#define ACCELEROMETER_EVENT_RAW_DATA_REPORT_ON_TIME ACCELEROMETER_RAW_DATA_EVENT +#define ACCELEROMETER_EVENT_UNPROCESSED_DATA_REPORT_ON_TIME ACCELEROMETER_UNPROCESSED_DATA_EVENT + +#define GYRO_BASE_DATA_SET GYROSCOPE_RAW_DATA_EVENT +#define GYROSCOPE_EVENT_RAW_DATA_REPORT_ON_TIME GYROSCOPE_RAW_DATA_EVENT +#define GYROSCOPE_EVENT_UNPROCESSED_DATA_REPORT_ON_TIME GYROSCOPE_UNPROCESSED_DATA_EVENT + +#define PROXIMITY_BASE_DATA_SET PROXIMITY_CHANGE_STATE_EVENT +#define PROXIMITY_DISTANCE_BASE_DATA_SET PROXIMITY_STATE_EVENT +#define PROXIMITY_EVENT_CHANGE_STATE PROXIMITY_CHANGE_STATE_EVENT +#define PROXIMITY_EVENT_STATE_REPORT_ON_TIME PROXIMITY_STATE_EVENT +#define PROXIMITY_EVENT_DISTANCE_DATA_REPORT_ON_TIME PROXIMITY_DISTANCE_DATA_EVENT + +#define PRESSURE_BASE_DATA_SET PRESSURE_RAW_DATA_EVENT +#define PRESSURE_EVENT_RAW_DATA_REPORT_ON_TIME PRESSURE_RAW_DATA_EVENT + +#define GEOMAGNETIC_BASE_DATA_SET GEOMAGNETIC_RAW_DATA_EVENT +#define GEOMAGNETIC_RAW_DATA_SET GEOMAGNETIC_RAW_DATA_EVENT +#define GEOMAGNETIC_EVENT_RAW_DATA_REPORT_ON_TIME GEOMAGNETIC_RAW_DATA_EVENT +#define GEOMAGNETIC_EVENT_CALIBRATION_NEEDED GEOMAGNETIC_CALIBRATION_NEEDED_EVENT +#define GEOMAGNETIC_EVENT_UNPROCESSED_DATA_REPORT_ON_TIME GEOMAGNETIC_UNPROCESSED_DATA_EVENT + +#define AUTO_ROTATION_BASE_DATA_SET AUTO_ROTATION_CHANGE_STATE_EVENT +#define AUTO_ROTATION_EVENT_CHANGE_STATE AUTO_ROTATION_CHANGE_STATE_EVENT + +#define LIGHT_LUX_DATA_SET LIGHT_LUX_DATA_EVENT +#define LIGHT_BASE_DATA_SET LIGHT_LEVEL_DATA_EVENT +#define LIGHT_EVENT_LUX_DATA_REPORT_ON_TIME LIGHT_LUX_DATA_EVENT +#define LIGHT_EVENT_LEVEL_DATA_REPORT_ON_TIME LIGHT_LEVEL_DATA_EVENT +#define LIGHT_EVENT_CHANGE_LEVEL LIGHT_CHANGE_LEVEL_EVENT + +#define GRAVITY_BASE_DATA_SET GRAVITY_RAW_DATA_EVENT +#define GRAVITY_EVENT_RAW_DATA_REPORT_ON_TIME GRAVITY_RAW_DATA_EVENT + +#define ORIENTATION_BASE_DATA_SET ORIENTATION_RAW_DATA_EVENT +#define ORIENTATION_EVENT_RAW_DATA_REPORT_ON_TIME ORIENTATION_RAW_DATA_EVENT +#define ORIENTATION_EVENT_CALIBRATION_NEEDED ORIENTATION_CALIBRATION_NEEDED_EVENT + +#define LINEAR_ACCEL_BASE_DATA_SET LINEAR_ACCEL_RAW_DATA_EVENT +#define LINEAR_ACCEL_EVENT_RAW_DATA_REPORT_ON_TIME LINEAR_ACCEL_RAW_DATA_EVENT + +#define CONTEXT_BASE_DATA_SET CONTEXT_REPORT_EVENT +#define CONTEXT_EVENT_REPORT CONTEXT_REPORT_EVENT + +#define FACE_DOWN_BASE_DATA_SET FACE_DOWN_RAW_DATA_EVENT +#define FACE_DOWN_EVENT_RAW_DATA_REPORT_ON_TIME FACE_DOWN_RAW_DATA_EVENT + +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, +}; + +enum motion_snap_event { + MOTION_ENGIEN_SNAP_NONE = 0, + MOTION_ENGIEN_NEGATIVE_SNAP_X = 1, + MOTION_ENGIEN_POSITIVE_SNAP_X = 2, + MOTION_ENGIEN_NEGATIVE_SNAP_Y = 3, + MOTION_ENGIEN_POSITIVE_SNAP_Y = 4, + MOTION_ENGIEN_NEGATIVE_SNAP_Z = 5, + MOTION_ENGIEN_POSITIVE_SNAP_Z = 6, + MOTION_ENGIEN_SNAP_LEFT = MOTION_ENGIEN_NEGATIVE_SNAP_X, + MOTION_ENGIEN_SNAP_RIGHT = MOTION_ENGIEN_POSITIVE_SNAP_X, + MOTION_ENGINE_SNAP_NONE = 0, + MOTION_ENGINE_NEGATIVE_SNAP_X = 1, + MOTION_ENGINE_POSITIVE_SNAP_X = 2, + MOTION_ENGINE_NEGATIVE_SNAP_Y = 3, + MOTION_ENGINE_POSITIVE_SNAP_Y = 4, + MOTION_ENGINE_NEGATIVE_SNAP_Z = 5, + MOTION_ENGINE_POSITIVE_SNAP_Z = 6, + MOTION_ENGINE_SNAP_LEFT = MOTION_ENGINE_NEGATIVE_SNAP_X, + MOTION_ENGINE_SNAP_RIGHT = MOTION_ENGINE_POSITIVE_SNAP_X, +}; + +enum motion_shake_event { + MOTION_ENGIEN_SHAKE_NONE = 0, + MOTION_ENGIEN_SHAKE_DETECTION = 1, + MOTION_ENGIEN_SHAKE_CONTINUING = 2, + MOTION_ENGIEN_SHAKE_FINISH = 3, + MOTION_ENGINE_SHAKE_BREAK = 4, + MOTION_ENGINE_SHAKE_NONE = 0, + MOTION_ENGINE_SHAKE_DETECTION = 1, + MOTION_ENGINE_SHAKE_CONTINUING = 2, + MOTION_ENGINE_SHAKE_FINISH = 3, +}; + +enum motion_doubletap_event { + MOTION_ENGIEN_DOUBLTAP_NONE = 0, + MOTION_ENGIEN_DOUBLTAP_DETECTION = 1, + MOTION_ENGINE_DOUBLTAP_NONE = 0, + MOTION_ENGINE_DOUBLTAP_DETECTION = 1, +}; + +enum motion_top_to_bottom_event { + MOTION_ENGIEN_TOP_TO_BOTTOM_NONE = 0, + MOTION_ENGIEN_TOP_TO_BOTTOM_WAIT = 1, + MOTION_ENGIEN_TOP_TO_BOTTOM_DETECTION = 2, + MOTION_ENGINE_TOP_TO_BOTTOM_NONE = 0, + MOTION_ENGINE_TOP_TO_BOTTOM_WAIT = 1, + MOTION_ENGINE_TOP_TO_BOTTOM_DETECTION = 2, +}; + +enum motion_direct_call_event_t { + MOTION_ENGINE_DIRECT_CALL_NONE, + MOTION_ENGINE_DIRECT_CALL_DETECTION, +}; + +enum motion_smart_relay_event_t { + MOTION_ENGINE_SMART_RELAY_NONE, + MOTION_ENGINE_SMART_RELAY_DETECTION, +}; + +enum motion_tilt_to_unlock_event_t { + MOTION_ENGINE_TILT_TO_UNLOCK_NONE, + MOTION_ENGINE_TILT_TO_UNLOCK_DETECTION, +}; + +enum motion_lock_execute_camera_event_t { + MOTION_ENGINE_LOCK_EXECUTE_CAMERA_NONE, + MOTION_ENGINE_LOCK_EXECUTE_CAMERA_L_DETECTION, + MOTION_ENGINE_LOCK_EXECUTE_CAMERA_R_DETECTION, +}; + +enum motion_smart_alert_t { + MOTION_ENGINE_SMART_ALERT_NONE, + MOTION_ENGINE_SMART_ALERT_DETECTION, +}; + +enum motion_no_move_t { + MOTION_ENGINE_NO_MOVE_NONE, + MOTION_ENGINE_NO_MOVE_DETECTION, +}; + +#ifdef __cplusplus +} +#endif + +#endif //__SENSOR_DEPRECATED_H__ diff --git a/include/sensor-internal-deprecated.h b/include/sensor-internal-deprecated.h new file mode 100644 index 0000000..9031b2e --- /dev/null +++ b/include/sensor-internal-deprecated.h @@ -0,0 +1,158 @@ +/* + * sensord + * + * 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_INTERNAL_DEPRECATED__ +#define __SENSOR_INTERNAL_DEPRECATED__ + +#ifndef DEPRECATED +#define DEPRECATED __attribute__((deprecated)) +#endif + +#include +#include + +/*header for common sensor type*/ +#include +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + +typedef struct { + int cond_op; /* TODO: change it from int to condition_op_t */ + float cond_value1; +} event_condition_t; + +typedef struct { + size_t event_data_size; + void *event_data; +} sensor_event_data_t; + +typedef void (*sensor_callback_func_t)(unsigned int, sensor_event_data_t *, void *); +typedef sensor_callback_func_t sensor_legacy_cb_t; + +typedef struct { + int x; + int y; + int z; +} sensor_panning_data_t; + +/** + * @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. + * @param[in] sensor_type your desired sensor type + * @return if it succeed, it return handle value( >=0 ), otherwise negative value return + */ +DEPRECATED int sf_connect(sensor_type_t sensor_type); + +/** + * @fn int sf_disconnect(int handle) + * @brief This API disconnects an attached sensor from an application. Application must use the handle retuned after attaching the sensor. After detaching, the corresponding handle will be released. + * @param[in] handle received handle value by sf_connect() + * @return if it succeed, it return zero value, otherwise negative value return + */ +DEPRECATED int sf_disconnect(int handle); + +/** + * @fn int sf_start(int handle, int option) + * @brief This API sends a start command to sensor server. This intimates server that the client side is ready to handle data and start processing. The parameter option should be '0' for current usages. + * @param[in] handle received handle value by sf_connect() + * @param[in] option With SENSOR_OPTION_DEFAULT, it stops to sense when LCD is off, and with SENSOR_OPTION_ALWAYS_ON, it continues to sense even when LCD is off + * @return if it succeed, it return zero value, otherwise negative value return + */ +DEPRECATED int sf_start(int handle, int option); + +/** + * @fn int sf_stop(int handle) + * @brief This API sends a stop command to the Sensor server indicating that the data processing is stopped from application side for this time. + * @param[in] handle received handle value by sf_connect() + * @return if it succeed, it return zero value, otherwise negative value return + */ +DEPRECATED int sf_stop(int handle); + +/** + * @fn int sf_register_event(int handle, unsigned int event_type, event_conditon_t *event_condition, sensor_callback_func_t cb, void *user_data) + * @brief This API registers a user defined callback function with a connected sensor for a particular event. This callback function will be called when there is a change in the state of respective sensor. user_data will be the parameter used during the callback call. Callback interval can be adjusted using even_contion_t argument. + * @param[in] handle received handle value by sf_connect() + * @param[in] event_type your desired event_type to register it + * @param[in] event_condition input event_condition for special event. if you want to register without event_condition, just use a NULL value + * @param[in] cb your define callback function + * @param[in] user_data your option data that will be send when your define callback function called. if you don't have any option data, just use a NULL value + * @return if it succeed, it return zero value, otherwise negative value return + */ +DEPRECATED int sf_register_event(int handle, unsigned int event_type, event_condition_t *event_condition, sensor_callback_func_t cb, void *user_data); + +/** + * @fn int sf_unregister_event(int handle, unsigned int event_type) + * @brief This API de-registers a user defined callback function with a sensor registered with the specified handle. After unsubscribe, no event will be sent to the application. + * @param[in] handle received handle value by sf_connect() + * @param[in] event_type your desired event_type that you want to unregister event + * @return if it succeed, it return zero value, otherwise negative value return + */ +DEPRECATED int sf_unregister_event(int handle, unsigned int event_type); + +/** + * @fn int sf_get_data(int handle, unsigned int data_id, sensor_data_t* values) + * @brief This API gets raw data from a sensor with connecting the sensor-server. The type of sensor is supplied and return data is stored in the output parameter values []. + * @param[in] handle received handle value by sf_connect() + * @param[in] data_id predefined data_ID as every sensor in own header - sensor_xxx.h, enum xxx_data_id {} + * @param[out] values return values + * @return if it succeed, it return zero value, otherwise negative value return + */ +DEPRECATED int sf_get_data(int handle, unsigned int data_id, sensor_data_t* values); + +/** + * @fn int sf_change_event_condition(int handle, unsigned int event_type, event_condition_t *event_condition) + * @brief This API change a user defined callback function condition with a sensor registered with the specified handle. + * @param[in] handle received handle value by sf_connect() + * @param[in] event_type your desired event_type that you want to unregister event + * @param[in] event_condition your desired event condition that you want to change event + * @return if it succeed, it return zero value, otherwise negative value return + */ +DEPRECATED int sf_change_event_condition(int handle, unsigned int event_type, event_condition_t *event_condition); + +/** + * @fn int sf_change_sensor_option(int handle, int option) + * @brief This API change sensor option . + * @param[in] handle received handle value by sf_connect() + * @param[in] option your desired option that you want to turn on sensor during LCD OFF + * @return if it succeed, it return zero value, otherwise negative value return + */ + +DEPRECATED int sf_change_sensor_option(int handle, int option); + +/** + * @fn int sf_send_sensorhub_data(int handle, const char* buffer, int data_len) + * @brief This API sends data to sensorhub. + * @param[in] handle received handle by sf_connect() + * @param[in] data it holds data to send to sensorhub + * @param[in] data_len the length of data + * @return if it succeed, it returns zero, otherwise negative value + */ +DEPRECATED int sf_send_sensorhub_data(int handle, const char* data, int data_len); + +DEPRECATED int sf_check_rotation(unsigned long *rotation); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/sensor-internal.h b/include/sensor-internal.h index 8cd508a..3d1e68e 100644 --- a/include/sensor-internal.h +++ b/include/sensor-internal.h @@ -27,7 +27,9 @@ /*header for common sensor type*/ #include -#include +#include +#include +#include #include #define SENSOR_BATCH_LATENCY_DEFAULT UINT_MAX diff --git a/include/sensor-types.h b/include/sensor-types.h new file mode 100644 index 0000000..6e777c7 --- /dev/null +++ b/include/sensor-types.h @@ -0,0 +1,314 @@ +/* + * 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. + * + */ + +#ifndef __SENSOR_TYPES_H__ +#define __SENSOR_TYPES_H__ + +/* TODO: It is for compatibility with capi-system-sensor */ +#define __SENSOR_COMMON_H__ + +#include +#include +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + +#ifndef OP_SUCCESS +#define OP_SUCCESS 0 +#endif +#ifndef OP_ERROR +#define OP_ERROR -1 +#endif +#ifndef OP_DEFAULT +#define OP_DEFAULT 1 +#endif +#ifndef OP_CONTINUE +#define OP_CONTINUE 2 +#endif +#ifndef NAME_MAX +#define NAME_MAX 256 +#endif + +#define URI_REGEX(CATEGORY) R"~(^http:\/\/[\w-]+(\.[\w-]+)*\/)~" CATEGORY R"~(\/(general|healthinfo)\/[\w-]+(\.[\w-]+)*(\/[\w-]+(\.[\w-]+)*)$)~" +#define SENSOR_URI_REGEX URI_REGEX("sensor") + +#define PREDEFINED_TYPE_URI "http://tizen.org/sensor/" + +#define PRIV_DELIMITER ";" +#define URI_DELIMITER "/" + +#define PRIVILEGE_HEALTHINFO_STR "healthinfo" +#define PRIVILEGE_HEALTHINFO_URI "http://tizen.org/privilege/healthinfo" + +#define PRIVILEGE_LOCATION_STR "location" +#define PRIVILEGE_LOCATION_URI "http://tizen.org/privilege/location" + +#define PRIVILEGE_PLATFORM_STR "platform" +#define PRIVILEGE_PLATFORM_URI "http://tizen.org/privilege/internal/default/platform" + +#define URI_PRIV_INDEX 4 +#define URI_SENSOR_TYPE_INDEX 5 + +#define SENSOR_TYPE_SHIFT 32 +#define SENSOR_EVENT_SHIFT 16 +#define SENSOR_INDEX_MASK 0xFFFFFFFF + +#define CONVERT_ID_TYPE(id) ((id) >> SENSOR_TYPE_SHIFT) +#define CONVERT_TYPE_EVENT(type) ((type) << SENSOR_EVENT_SHIFT | 0x1) + +#define MICROSECONDS(tv) ((tv.tv_sec * 1000000ll) + tv.tv_usec) + +#define SENSOR_UNKNOWN_TYPE "http://tizen.org/sensor/unknown" +#define SENSOR_UNKNOWN_NAME "Unknown" + +typedef int64_t sensor_id_t; +typedef void *sensor_t; + +typedef enum sensor_type_t { + UNKNOWN_SENSOR = -2, + ALL_SENSOR = -1, + ACCELEROMETER_SENSOR = 0, + GRAVITY_SENSOR, + LINEAR_ACCEL_SENSOR, + GEOMAGNETIC_SENSOR, + ROTATION_VECTOR_SENSOR, + ORIENTATION_SENSOR, + GYROSCOPE_SENSOR, + LIGHT_SENSOR, + PROXIMITY_SENSOR, + PRESSURE_SENSOR, + ULTRAVIOLET_SENSOR, + TEMPERATURE_SENSOR, + HUMIDITY_SENSOR, + HRM_SENSOR, + BIO_HRM_SENSOR = HRM_SENSOR, + HRM_LED_GREEN_SENSOR, + BIO_LED_GREEN_SENSOR = HRM_LED_GREEN_SENSOR, + HRM_LED_IR_SENSOR, + BIO_LED_IR_SENSOR = HRM_LED_IR_SENSOR, + HRM_LED_RED_SENSOR, + BIO_LED_RED_SENSOR = HRM_LED_RED_SENSOR, + GYROSCOPE_UNCAL_SENSOR, + GEOMAGNETIC_UNCAL_SENSOR, + GYROSCOPE_RV_SENSOR, + GEOMAGNETIC_RV_SENSOR, + + GYROSCOPE_ORIENTATION_SENSOR = 100, + GEOMAGNETIC_ORIENTATION_SENSOR = 105, + + SIGNIFICANT_MOTION_SENSOR = 0x100, //256 + + HRM_BATCH_SENSOR = 0x200, //512 + HRM_LED_GREEN_BATCH_SENSOR, + + HUMAN_PEDOMETER_SENSOR = 0x300, //768 + HUMAN_SLEEP_MONITOR_SENSOR, + HUMAN_SLEEP_DETECTOR_SENSOR, + SLEEP_DETECTOR_SENSOR = HUMAN_SLEEP_DETECTOR_SENSOR, + HUMAN_STRESS_MONITOR_SENSOR, + STRESS_MONITOR_SENSOR = HUMAN_STRESS_MONITOR_SENSOR, + + LIDAR_SENSOR = 1000, + + EXERCISE_WALKING_SENSOR = 0x400, //1024 + EXERCISE_RUNNING_SENSOR, + EXERCISE_HIKING_SENSOR, + EXERCISE_CYCLING_SENSOR, + EXERCISE_ELLIPTICAL_SENSOR, + EXERCISE_INDOOR_CYCLING_SENSOR, + EXERCISE_ROWING_SENSOR, + EXERCISE_STEPPER_SENSOR, + + DATA_JOURNAL_SENSOR = 0x500, + // 0x500~0x600 Reserved (1280 ~ 1536) + + EXTERNAL_EXERCISE_SENSOR = 0x800, //2048 + EXERCISE_SENSOR = EXTERNAL_EXERCISE_SENSOR, + + FUSION_SENSOR = 0x900, //2304 + AUTO_ROTATION_SENSOR, + AUTO_BRIGHTNESS_SENSOR, + MYOTEST_SENSOR, + + GESTURE_MOVEMENT_SENSOR = 0x1200, //4608 + GESTURE_WRIST_UP_SENSOR, + GESTURE_WRIST_DOWN_SENSOR, + GESTURE_MOVEMENT_STATE_SENSOR, + GESTURE_PICK_UP_SENSOR, + GESTURE_FACE_DOWN_SENSOR, + + ACTIVITY_TRACKER_SENSOR = 0x1A00, //6656 + ACTIVITY_LEVEL_MONITOR_SENSOR, + GPS_BATCH_SENSOR, + PPG_BATCH_SENSOR, + GPS_TIMESYNC_SENSOR, + + HRM_CTRL_SENSOR = 0x1A80, //6784 + REG_CTRL_SENSOR, + GPS_CTRL_SENSOR, + + WEAR_STATUS_SENSOR = 0x2000, //8192 + WEAR_ON_MONITOR_SENSOR, + NO_MOVE_DETECTOR_SENSOR, + RESTING_HR_SENSOR, + STEP_LEVEL_MONITOR_SENSOR, + EXERCISE_STANDALONE_SENSOR, + EXERCISE_COACH_SENSOR = EXERCISE_STANDALONE_SENSOR, + EXERCISE_HR_SENSOR, + WORKOUT_SENSOR, + AUTOSESSION_EXERCISE_SENSOR = WORKOUT_SENSOR, + CYCLE_MONITOR_SENSOR, + STAIR_TRACKER_SENSOR, + PRESSURE_INDICATOR_SENSOR, + PRESSURE_ALERT_SENSOR, + HR_CALORIE_SENSOR, + SWIMMING_TRACKER_SENSOR, + STRESS_TRACKER_SENSOR, + FAKE_MOTION_SENSOR, + GEOFENCE_SENSOR, + SWIMMING_OUTDOOR_SENSOR, + AUTO_SWIMMING_SENSOR, + INACTIVITY_DETECTOR_SENSOR, + HRM_BP_SENSOR, + ECG_SENSOR, + FALL_DETECTION_SENSOR, + + CONTEXT_SENSOR = 0x7000, //28,672 + MOTION_SENSOR, + PIR_SENSOR, + PIR_LONG_SENSOR, + DUST_SENSOR, + THERMOMETER_SENSOR, + PEDOMETER_SENSOR, + FLAT_SENSOR, + HRM_RAW_SENSOR, + BIO_SENSOR = HRM_RAW_SENSOR, + TILT_SENSOR, + RV_RAW_SENSOR, + GSR_SENSOR, + SIMSENSE_SENSOR, + PPG_SENSOR, + + CUSTOM_SENSOR = 0X9000, //36,864 +} sensor_type_t; + +typedef struct sensor_info2_t { + uint32_t id; + sensor_type_t type; + const char *uri; + const char *vendor; + float min_range; + float max_range; + float resolution; + int min_interval; + int max_interval; + int max_batch_count; + bool wakeup_supported; + const char *privilege; + void *reserved[8]; +} sensor_info2_t; + +typedef enum sensor_privilege_t { + SENSOR_PRIVILEGE_PUBLIC = 0, +} sensor_privilege_t; + +typedef struct sensor_event_t { + unsigned int event_type; + sensor_id_t sensor_id; + unsigned int data_length; + sensor_data_t *data; +} sensor_event_t; + +/* + * To prevent naming confliction as using same enums as sensor CAPI use + */ +#ifndef __SENSOR_H__ +enum sensor_option_t { + SENSOR_OPTION_DEFAULT = 0, + SENSOR_OPTION_ON_IN_SCREEN_OFF = 1, + SENSOR_OPTION_ON_IN_POWERSAVE_MODE = 2, + SENSOR_OPTION_ALWAYS_ON = SENSOR_OPTION_ON_IN_SCREEN_OFF | SENSOR_OPTION_ON_IN_POWERSAVE_MODE, + SENSOR_OPTION_END +}; + +typedef enum sensor_option_t sensor_option_e; +#endif + +enum sensord_attribute_e { + SENSORD_ATTRIBUTE_AXIS_ORIENTATION = 1, + SENSORD_ATTRIBUTE_PAUSE_POLICY, + SENSORD_ATTRIBUTE_INTERVAL = 0x10, + SENSORD_ATTRIBUTE_MAX_BATCH_LATENCY, + SENSORD_ATTRIBUTE_PASSIVE_MODE, + SENSORD_ATTRIBUTE_FLUSH, + // 0x50~0x80 Reserved +}; + +enum sensord_axis_e { + SENSORD_AXIS_DEVICE_ORIENTED = 1, + SENSORD_AXIS_DISPLAY_ORIENTED, +}; + +enum sensord_pause_e { + SENSORD_PAUSE_NONE = 0, + SENSORD_PAUSE_ON_DISPLAY_OFF = 1, + SENSORD_PAUSE_ON_POWERSAVE_MODE = 2, + SENSORD_PAUSE_ALL = 3, + SENSORD_PAUSE_END, +}; + +enum poll_interval_t { + POLL_100HZ_MS = 10, + POLL_50HZ_MS = 20, + POLL_25HZ_MS = 40, + POLL_20HZ_MS = 50, + POLL_10HZ_MS = 100, + POLL_5HZ_MS = 200, + POLL_1HZ_MS = 1000, + POLL_MAX_HZ_MS = 255000, +}; + +#define DEFAULT_INTERVAL POLL_10HZ_MS + +enum sensor_interval_t { + SENSOR_INTERVAL_FASTEST = POLL_100HZ_MS, + SENSOR_INTERVAL_NORMAL = POLL_5HZ_MS, +}; + +enum proxi_change_state { + PROXIMITY_STATE_NEAR = 0, + PROXIMITY_STATE_FAR = 1, +}; + +enum auto_rotation_state { + AUTO_ROTATION_DEGREE_UNKNOWN = 0, + AUTO_ROTATION_DEGREE_0, + AUTO_ROTATION_DEGREE_90, + AUTO_ROTATION_DEGREE_180, + AUTO_ROTATION_DEGREE_270, +}; + +#ifdef __cplusplus +} +#endif + +#endif /* __SENSOR_TYPES_H__ */ diff --git a/packaging/capi-system-sensor.spec b/packaging/capi-system-sensor.spec index 1a0fbfe..1f82c04 100644 --- a/packaging/capi-system-sensor.spec +++ b/packaging/capi-system-sensor.spec @@ -109,7 +109,6 @@ find . -name '*.gcno' -exec cp --parents '{}' "$gcno_obj_dir" ';' %manifest packaging/capi-system-sensor.manifest %{_libdir}/pkgconfig/*.pc %{_includedir}/sensor/*.h -%{_includedir}/sensor/private/*.h %{_libdir}/libcapi-system-sensor.so %files test diff --git a/src/api/api-sensor-internal.cpp b/src/api/api-sensor-internal.cpp index 87b6d49..99a1ba6 100644 --- a/src/api/api-sensor-internal.cpp +++ b/src/api/api-sensor-internal.cpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/api/sensor-listener.cpp b/src/api/sensor-listener.cpp index ba2191f..224f25a 100644 --- a/src/api/sensor-listener.cpp +++ b/src/api/sensor-listener.cpp @@ -21,7 +21,7 @@ #include #include -#include +#include #include #include diff --git a/src/api/sensor-listener.h b/src/api/sensor-listener.h index 5310b82..bb49845 100644 --- a/src/api/sensor-listener.h +++ b/src/api/sensor-listener.h @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/api/sensor-provider.cpp b/src/api/sensor-provider.cpp index 2dd9832..a4693cd 100644 --- a/src/api/sensor-provider.cpp +++ b/src/api/sensor-provider.cpp @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/api/sensor-provider.h b/src/api/sensor-provider.h index 518e75b..6eb6bb8 100644 --- a/src/api/sensor-provider.h +++ b/src/api/sensor-provider.h @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/api/sensor-reader.cpp b/src/api/sensor-reader.cpp index 260882d..ca6c3f2 100644 --- a/src/api/sensor-reader.cpp +++ b/src/api/sensor-reader.cpp @@ -20,7 +20,7 @@ #include "sensor-reader.h" #include -#include +#include #include using namespace sensor; diff --git a/src/shared/command-types.h b/src/shared/command-types.h index dc43cfd..f0b5b27 100644 --- a/src/shared/command-types.h +++ b/src/shared/command-types.h @@ -20,7 +20,7 @@ #ifndef __COMMAND_TYPES_H__ #define __COMMAND_TYPES_H__ -#include +#include #include #define SENSOR_CHANNEL_PATH "/run/.sensord.socket" diff --git a/src/shared/sensor-info.cpp b/src/shared/sensor-info.cpp index 1e1ea2c..b1c612d 100644 --- a/src/shared/sensor-info.cpp +++ b/src/shared/sensor-info.cpp @@ -19,7 +19,7 @@ #include "sensor-info.h" -#include +#include #include #include diff --git a/src/shared/sensor-info.h b/src/shared/sensor-info.h index e54d7d6..dd816cd 100644 --- a/src/shared/sensor-info.h +++ b/src/shared/sensor-info.h @@ -24,7 +24,7 @@ #include #include #include -#include +#include namespace sensor { diff --git a/src/shared/sensor-utils.cpp b/src/shared/sensor-utils.cpp index 5f8aae3..018b275 100644 --- a/src/shared/sensor-utils.cpp +++ b/src/shared/sensor-utils.cpp @@ -29,7 +29,7 @@ #include #include -#include +#include #ifndef PATH_MAX #define PATH_MAX 256 diff --git a/src/shared/sensor-utils.h b/src/shared/sensor-utils.h index f460792..50be1ce 100644 --- a/src/shared/sensor-utils.h +++ b/src/shared/sensor-utils.h @@ -20,7 +20,7 @@ #ifndef __SENSOR_UTILS_H__ #define __SENSOR_UTILS_H__ -#include +#include #include #include