2 * Copyright (c) 2016 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
21 #include <tizen_type.h>
24 #include "rrs_error.h"
27 * @ingroup CAPI_RRS_MODULE
28 * @defgroup CAPI_RRS_MAIN_MODULE General
31 * @brief This file contains functions related to RRS API.
32 * @addtogroup CAPI_RRS_MAIN_MODULE
34 * @brief This provides APIs related to RRS
44 * @brief Handle of the RRS.
45 * @details The RRS handle can be obtained via call of rrs_create().
48 * @remarks To release the handle use rrs_destroy().
53 * // Usage of RRS in the app
59 * // Do something with RRS
60 * // Destroy schema and data when no more needed
74 * @brief Enumerations of resources, supported by RRS
77 typedef enum _rrs_resource_e {
78 RRS_RESOURCE_NONE = 0, /**< Invalid sensor */
79 RRS_RESOURCE_DISCOVERY = 1, /**< Discovery resource */
80 RRS_RESOURCE_ACCELEROMETER, /**< Accelerometer sensor */
81 RRS_RESOURCE_PROXIMITY, /**< Proximity sensor */
82 RRS_RESOURCE_AUTO_ROTATION, /**< Auto rotation sensor */
83 RRS_RESOURCE_HRM, /**< Bio HRM sensor */
84 RRS_RESOURCE_HRM_LED_GREEN, /**< Bio LED green sensor */
85 RRS_RESOURCE_HRM_LED_RED, /**< Bio LED RED sensor */
86 RRS_RESOURCE_HRM_LED_IR, /**< Bio LED IR sensor */
87 RRS_RESOURCE_GYROSCOPE, /**< Gyroscope sensor */
88 RRS_RESOURCE_MAGNETOMETER, /**< Geomagnetic sensor */
89 RRS_RESOURCE_LIGHT, /**< Light sensor */
90 RRS_RESOURCE_PRESSURE, /**< Pressure sensor */
91 RRS_RESOURCE_TEMPERATURE, /**< Temperature sensor */
92 RRS_RESOURCE_HUMIDITY, /**< Humidity sensor */
93 RRS_RESOURCE_UV, /**< Ultraviolet sensor */
94 RRS_RESOURCE_ORIENTATION, /**< Orientation sensor */
95 RRS_RESOURCE_GRAVITY, /**< Gravity sensor */
96 RRS_RESOURCE_LINEAR_ACCELERATION,/**< Linear acceleration sensor */
97 RRS_RESOURCE_ROTATION_VECTOR, /**< Rotation vector sensor */
98 RRS_RESOURCE_GYROSCOPE_ROTATION_VECTOR, /**< Gyroscope Rotation Vector sensor */
99 RRS_RESOURCE_GEOMAGNETIC_ROTATION_VECTOR, /**< Geomagnetic Rotation Vector sensor */
100 RRS_RESOURCE_UNCALIBRATED_GYROSCOPE, /**< Uncalibrated gyroscope sensor */
101 RRS_RESOURCE_UNCALIBRATED_MAGNETOMETER, /**< Uncalibrated geomagnetic sensor */
106 * @brief Creates an RRS and assigns it with a handle.
107 * @details This function creates an RRS and issues a new handle for it.
108 * \n The handle is used to discover resources.
111 * @remarks @a rrs handle must be released using rrs_destroy().
113 * @param[out] rrs A handle of the newly created RRS
114 * @return 0 on success, otherwise a negative error value
115 * @retval #RRS_ERROR_NONE Successful
116 * @retval #RRS_ERROR_OUT_OF_MEMORY Out of memory
117 * @retval #RRS_ERROR_INVALID_PARAMETER Invalid parameter
118 * @retval #RRS_ERROR_PERMISSION_DENIED Permission Denied
122 int rrs_create(rrs_h *rrs);
126 * @brief Destroys the RRS handle.
127 * @details This function releases the RRS handle.
130 * @param[in] rrs The RRS handle to destroy
131 * @return 0 on success, otherwise a negative error value
132 * @retval #RRS_ERROR_NONE Successful
133 * @retval #RRS_ERROR_INVALID_PARAMETER Invalid parameter
134 * @retval #RRS_ERROR_NOT_SUPPORTED Not supported
136 * @pre Call rrs_create() to create RRS and get its handle.
140 int rrs_destroy(const rrs_h rrs);
150 #endif /* _RRS_MAIN_H_ */