X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=include%2Flocations.h;h=60de8da7374f8374643373cfa8b7af60f65584b8;hb=HEAD;hp=0e489e128c995dda2181e3cb8fba1a7bf5a328fe;hpb=b87d7c0b888aa0712291accce3bab21073b62e0b;p=platform%2Fcore%2Fapi%2Flocation-manager.git diff --git a/include/locations.h b/include/locations.h index 0e489e1..60de8da 100755 --- a/include/locations.h +++ b/include/locations.h @@ -27,6 +27,7 @@ extern "C" { #endif + /** * @addtogroup CAPI_LOCATION_MANAGER_MODULE * @{ @@ -35,7 +36,7 @@ extern "C" { /** * @brief Enumeration for error code for Location manager. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @since_tizen 2.3 */ typedef enum { LOCATIONS_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */ @@ -54,7 +55,7 @@ typedef enum { /** * @brief Enumeration for Location method type. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @since_tizen 2.3 */ typedef enum { LOCATIONS_METHOD_NONE = -1, /**< Undefined method */ @@ -62,12 +63,13 @@ typedef enum { LOCATIONS_METHOD_GPS, /**< This method uses Global Positioning System */ LOCATIONS_METHOD_WPS, /**< This method uses WiFi Positioning System */ LOCATIONS_METHOD_PASSIVE, /**< This method can be used to passively receive location updates without power consumption (Since 3.0)*/ + LOCATIONS_METHOD_FUSED, /**< This method uses Fused location (Since 4.0) */ } location_method_e; /** * @brief Enumeration for Approximate accuracy level of given information. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @since_tizen 2.3 */ typedef enum { LOCATIONS_ACCURACY_NONE = 0, /**< Invalid data */ @@ -82,7 +84,7 @@ typedef enum { /** * @brief Enumeration for the state of the location service. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @since_tizen 2.3 */ typedef enum { LOCATIONS_SERVICE_DISABLED, /**< Service is disabled */ @@ -93,7 +95,7 @@ typedef enum { /** * @deprecated Deprecated since 3.0 * @brief Enumeration for the location service accessibility state. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @since_tizen 2.3 */ typedef enum { LOCATIONS_ACCESS_STATE_NONE, /**< Access state is not determined */ @@ -101,10 +103,18 @@ typedef enum { LOCATIONS_ACCESS_STATE_ALLOWED, /**< Access authorized */ } location_accessibility_state_e; +/** + * @brief Enumeration for the fused location service. + * @since_tizen 4.0 + */ +typedef enum { + LOCATIONS_FUSED_HIGH_ACCURACY = 0, /**< High accuracy */ + LOCATIONS_FUSED_BALANCED_POWER, /**< Balanced power */ +} location_fused_mode_e; /** * @brief The location manager handle. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @since_tizen 2.3 */ typedef struct location_manager_s *location_manager_h; @@ -115,6 +125,8 @@ typedef struct location_manager_s *location_manager_h; /* * Location Manager */ + + /** * @addtogroup CAPI_LOCATION_MANAGER_MODULE * @{ @@ -123,7 +135,7 @@ typedef struct location_manager_s *location_manager_h; /** * @brief Called at defined interval with updated position information. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @since_tizen 2.3 * @param[in] latitude The updated latitude [-90.0 ~ 90.0] (degrees) * @param[in] longitude The updated longitude [-180.0 ~ 180.0] (degrees) * @param[in] altitude The updated altitude (meters) @@ -138,7 +150,7 @@ typedef void(*location_position_updated_cb)(double latitude, double longitude, d /** * @brief Called at defined interval with updated velocity information. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @since_tizen 2.3 * @param[in] speed The updated speed (km/h) * @param[in] direction The updated direction (in degrees from the north) * @param[in] climb The updated climb (km/h) @@ -153,7 +165,7 @@ typedef void(*location_velocity_updated_cb)(double speed, double direction, doub /** * @brief Called at defined interval with updated location information. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @since_tizen 2.3 * @param[in] error #LOCATIONS_ERROR_NONE Successful * @param[in] latitude The updated latitude [-90.0 ~ 90.0] (degrees) * @param[in] longitude The updated longitude [-180.0 ~ 180.0] (degrees) @@ -171,7 +183,7 @@ typedef void(*location_updated_cb)(location_error_e error, double latitude, doub /** * @brief Called when the state of location service is changed from enabled to disabled or vice versa. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @since_tizen 2.3 * @param[in] state The service state * @param[in] user_data The user data passed from the callback registration function * @pre Either location_manager_start() or location_manager_stop() will invoke this callback if you register this callback using location_manager_set_service_state_changed_cb(). @@ -185,7 +197,7 @@ typedef void(*location_service_state_changed_cb)(location_service_state_e state, /** * @brief Called when the user-defined zones are entered or exited. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @since_tizen 2.3 * @param[in] state The boundary state * @param[in] latitude The updated latitude [-90.0 ~ 90.0] (degrees) * @param[in] longitude The updated longitude [-180.0 ~ 180.0] (degrees) @@ -202,7 +214,7 @@ typedef void(*location_zone_changed_cb)(location_boundary_state_e state, double /** * @brief Called when the state of location method is changed. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @since_tizen 2.3 * @param[in] method The method changed on setting * @param[in] enable The setting value changed * @param[in] user_data The user data passed from the callback registration function @@ -215,7 +227,7 @@ typedef void(*location_setting_changed_cb)(location_method_e method, bool enable /** * @brief Called once for each location bound. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @since_tizen 2.3 * @param[in] bounds The location bounds handle * @param[in] user_data The user data passed from the callback registration function * @return @c true to continue with the next iteration of the loop, @@ -228,7 +240,7 @@ typedef bool(*location_bounds_cb)(location_bounds_h bounds, void *user_data); /** * @brief Called at defined interval with updated location information. - * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif + * @since_tizen 2.4 * @param[in] latitude The updated latitude [-90.0 ~ 90.0] (degrees) * @param[in] longitude The updated longitude [-180.0 ~ 180.0] (degrees) * @param[in] altitude The updated altitude (meters) @@ -247,7 +259,7 @@ typedef void(*location_changed_cb)(double latitude, double longitude, double alt /** * @brief Called when the batch interval is expired. - * @since_tizen @if MOBILE 3.0 @elseif WEARABLE 2.3.2 @endif + * @since_tizen 2.3.2 * @param[in] num_of_location The number of location batch data * @param[in] user_data The user data passed from the callback registration function * @pre location_manager_start_batch() will invoke this callback if you register this callback using location_manager_set_location_batch_cb(). @@ -259,7 +271,7 @@ typedef void(*location_batch_cb)(int num_of_location, void *user_data); /** * @brief Gets iteratively to receive location batch data. - * @since_tizen @if MOBILE 3.0 @elseif WEARABLE 2.3.2 @endif + * @since_tizen 2.3.2 * @param[in] latitude The updated latitude [-90.0 ~ 90.0] (degrees) * @param[in] longitude The updated longitude [-180.0 ~ 180.0] (degrees) * @param[in] altitude The updated altitude (meters) @@ -271,7 +283,7 @@ typedef void(*location_batch_cb)(int num_of_location, void *user_data); * @param[in] user_data The user data passed from the callback registration function * @return @c true to continue with the next iteration of the loop, * otherwise @c false to break out of the loop - * @pre location_manager_foreach_location_batch() will invoke this callback + * @pre location_manager_foreach_location_batch() will invoke this callback. * @see location_manager_foreach_location_batch() */ typedef bool(*location_batch_get_location_cb)(double latitude, double longitude, double altitude, double speed, double direction, double horizontal, double vertical, time_t timestamp, void *user_data); @@ -279,7 +291,7 @@ typedef bool(*location_batch_get_location_cb)(double latitude, double longitude, /** * @brief Checks whether the given location method is available. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @since_tizen 2.3 * @remark The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section. * @param[in] method The location method to be checked * @return @c true if the specified location method is supported, @@ -295,7 +307,7 @@ bool location_manager_is_supported_method(location_method_e method); /** * @brief Checks whether the given location method is enabled or not on setting. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @since_tizen 2.3 * @param[in] method The location method to be checked * @param[out] enable The result value of checking the given location method * @return @c 0 on success, @@ -333,7 +345,7 @@ int location_manager_enable_method(const location_method_e method, const bool en /** * @brief Creates a new location manager. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @since_tizen 2.3 * @remarks You must release @a manager using location_manager_destroy(). * @param[in] method The location method * @param[out] manager The location manager handle that is newly created @@ -351,7 +363,7 @@ int location_manager_create(location_method_e method, location_manager_h *manage /** * @brief Releases the location manager. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @since_tizen 2.3 * @param[in] manager The location manager handle * @return @c 0 on success, * otherwise a negative error value @@ -365,18 +377,18 @@ int location_manager_destroy(location_manager_h manager); /** * @brief Requests to update current location once. - * @remarks Do not request to start the location service using the same manager handler - * Calling this function invokes a location service event. - * When the location service is updated, location_updated_cb - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @since_tizen 2.3 * @privlevel public * @privilege %http://tizen.org/privilege/location + * @remarks Do not request to start the location service using the same manager handler. + * Calling this function invokes a location service event. When the location service is updated, location_updated_cb. * @param[in] manager The location manager handle * @param[in] timeout Timeout to stop requesting single location after * @param[in] callback The location callback function to register * @param[in] user_data The user data to be passed to the callback function * @retval #LOCATIONS_ERROR_NONE Successful * @retval #LOCATIONS_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #LOCATIONS_ERROR_INCORRECT_METHOD Incorrect method * @retval #LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE Service not available * @retval #LOCATIONS_ERROR_NETWORK_FAILED Network failed * @retval #LOCATIONS_ERROR_GPS_SETTING_OFF GPS is not enabled @@ -389,7 +401,7 @@ int location_manager_request_single_location(location_manager_h manager, int tim /** * @brief Starts the location service. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @since_tizen 2.3 * @privlevel public * @privilege %http://tizen.org/privilege/location * @remarks There is no limit on number of location managers for which this function was called. @@ -430,7 +442,7 @@ int location_manager_start(location_manager_h manager); /** * @brief Stops the location service. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @since_tizen 2.3 * @remarks This function initiates the process of stopping the service. When the process is finished, callback set using * #location_manager_set_service_state_changed_cb() will be called, with #LOCATIONS_SERVICE_DISABLED as first argument. * When that happens, the service is stopped and the user is notified. @@ -452,7 +464,7 @@ int location_manager_stop(location_manager_h manager); /** * @brief Adds bounds for a given location manager. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @since_tizen 2.3 * @param[in] manager The location manager handle * @param[in] bounds The location bounds handle * @return @c 0 on success, @@ -470,7 +482,7 @@ int location_manager_add_boundary(location_manager_h manager, const location_bou /** * @brief Deletes bounds for a given location manager. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @since_tizen 2.3 * @param[in] manager The location manager handle * @param[in] bounds The location bounds handle * @return @c 0 on success, @@ -486,7 +498,7 @@ int location_manager_remove_boundary(location_manager_h manager, const location_ /** * @brief Retrieves all location bounds by invoking a specific callback for each location bounds - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @since_tizen 2.3 * @param[in] manager The location manager handle * @param[in] callback The iteration callback * @param[in] user_data The user data to be passed to the callback function @@ -505,7 +517,7 @@ int location_manager_foreach_boundary(location_manager_h manager, location_bound /** * @brief Gets the given location manager's method. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @since_tizen 2.3 * @param[in] manager The location manager handle * @param[out] method The location method * @return @c 0 on success, @@ -521,7 +533,7 @@ int location_manager_get_method(location_manager_h manager, location_method_e *m /** * @brief Gets the current position information. * @details The result contains the current altitude, latitude, and longitude with a measurement timestamp. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @since_tizen 2.3 * @privlevel public * @privilege %http://tizen.org/privilege/location * @param[in] manager The location manager handle @@ -545,7 +557,7 @@ int location_manager_get_position(location_manager_h manager, double *altitude, /** * @brief Gets the current position information. * @details The result contains the current altitude, latitude, longitude, climb, direction, speed, level, horizontal, and vertical with a measurement timestamp. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @since_tizen 2.3 * @privlevel public * @privilege %http://tizen.org/privilege/location * @param[in] manager The location manager handle @@ -575,7 +587,7 @@ int location_manager_get_location(location_manager_h manager, double *altitude, /** * @brief Gets the current velocity information. * @details The result contains the current climb, direction, and speed with a measurement timestamp. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @since_tizen 2.3 * @privlevel public * @privilege %http://tizen.org/privilege/location * @param[in] manager The location manager handle @@ -595,10 +607,9 @@ int location_manager_get_location(location_manager_h manager, double *altitude, */ int location_manager_get_velocity(location_manager_h manager, double *climb, double *direction, double *speed, time_t *timestamp); - /** * @brief Gets the current accuracy information. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @since_tizen 2.3 * @privlevel public * @privilege %http://tizen.org/privilege/location * @param[in] manager The location manager handle @@ -617,11 +628,29 @@ int location_manager_get_velocity(location_manager_h manager, double *climb, dou */ int location_manager_get_accuracy(location_manager_h manager, location_accuracy_level_e *level, double *horizontal, double *vertical); +/** + * @brief Gets the current velocity accuracy information. + * @since_tizen 6.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/location + * @param[in] manager The location manager handle + * @param[out] velocity_accuracy The velocity accuracy (m/s) + * @return @c 0 on success, + * otherwise a negative error value + * @retval #LOCATIONS_ERROR_NONE Successful + * @retval #LOCATIONS_ERROR_INVALID_PARAMETER Invalid argument + * @retval #LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE Service not available + * @retval #LOCATIONS_ERROR_GPS_SETTING_OFF GPS is not enabled + * @retval #LOCATIONS_ERROR_ACCESSIBILITY_NOT_ALLOWED The application does not have the privilege to call this method + * @retval #LOCATIONS_ERROR_NOT_SUPPORTED Not supported + * @pre The location service state must be #LOCATIONS_SERVICE_ENABLED with location_manager_start(). + */ +int location_manager_get_velocity_accuracy(location_manager_h manager, double *velocity_accuracy); /** * @brief Gets the last position information which is recorded. * @details The @a altitude, @a latitude, @a longitude, and @c timestamp values should be 0, if there is no record of any previous position information. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @since_tizen 2.3 * @privlevel public * @privilege %http://tizen.org/privilege/location * @param[in] manager The location manager handle @@ -635,7 +664,7 @@ int location_manager_get_accuracy(location_manager_h manager, location_accuracy_ * @retval #LOCATIONS_ERROR_INVALID_PARAMETER Invalid argument * @retval #LOCATIONS_ERROR_ACCESSIBILITY_NOT_ALLOWED The application does not have the privilege to call this method * @retval #LOCATIONS_ERROR_NOT_SUPPORTED Not supported - * @pre The location manager handle must be created by location_manager_create() + * @pre The location manager handle must be created by location_manager_create(). */ int location_manager_get_last_position(location_manager_h manager, double *altitude, double *latitude, double *longitude, time_t *timestamp); @@ -643,7 +672,7 @@ int location_manager_get_last_position(location_manager_h manager, double *altit /** * @brief Gets the last location information. * @details The @a altitude, @a latitude, @a longitude, @a climb, @a direction, @a speed, and @c timestamp values should be 0, if there is no record of any previous position information. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @since_tizen 2.3 * @privlevel public * @privilege %http://tizen.org/privilege/location * @param[in] manager The location manager handle @@ -671,7 +700,7 @@ int location_manager_get_last_location(location_manager_h manager, double *altit /** * @brief Gets the last velocity information which is recorded. * @details The @a climb, @a direction, and @a speed values should be @c 0, if there is no record of any previous velocity information. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @since_tizen 2.3 * @privlevel public * @privilege %http://tizen.org/privilege/location * @param[in] manager The location manager handle @@ -692,7 +721,7 @@ int location_manager_get_last_velocity(location_manager_h manager, double *climb /** * @brief Gets the last accuracy information which is recorded. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @since_tizen 2.3 * @privlevel public * @privilege %http://tizen.org/privilege/location * @param[in] manager The location manager handle @@ -713,7 +742,7 @@ int location_manager_get_last_accuracy(location_manager_h manager, location_accu /** * @deprecated Deprecated since 3.0 * @brief Gets the current application's location accessibility status. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @since_tizen 2.3 * @param[out] state The current location service accessibility status * @return @c 0 on success, * otherwise a negative error value @@ -727,7 +756,7 @@ int location_manager_get_accessibility_state(location_accessibility_state_e *sta /** * @brief Registers a callback function to be invoked at defined interval with updated position information. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @since_tizen 2.3 * @param[in] manager The location manager handle * @param[in] callback The callback function to register * @param[in] interval The interval [1 ~ 120] (seconds) @@ -737,7 +766,7 @@ int location_manager_get_accessibility_state(location_accessibility_state_e *sta * @retval #LOCATIONS_ERROR_NONE Successful * @retval #LOCATIONS_ERROR_INVALID_PARAMETER Invalid parameter * @retval #LOCATIONS_ERROR_NOT_SUPPORTED Not supported - * @post location_position_updated_cb() will be invoked + * @post location_position_updated_cb() will be invoked. * @see location_manager_unset_position_updated_cb() * @see location_position_updated_cb() */ @@ -746,7 +775,7 @@ int location_manager_set_position_updated_cb(location_manager_h manager, locatio /** * @brief Unregisters the callback function. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @since_tizen 2.3 * @param[in] manager The location manager handle * @return @c 0 on success, * otherwise a negative error value @@ -760,7 +789,7 @@ int location_manager_unset_position_updated_cb(location_manager_h manager); /** * @brief Registers a callback function to be invoked at defined interval with updated velocity information. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @since_tizen 2.3 * @param[in] manager The location manager handle * @param[in] callback The callback function to register * @param[in] interval The interval [1 ~ 120] (seconds) @@ -770,7 +799,7 @@ int location_manager_unset_position_updated_cb(location_manager_h manager); * @retval #LOCATIONS_ERROR_NONE Successful * @retval #LOCATIONS_ERROR_INVALID_PARAMETER Invalid parameter * @retval #LOCATIONS_ERROR_NOT_SUPPORTED Not supported - * @post location_velocity_updated_cb() will be invoked + * @post location_velocity_updated_cb() will be invoked. * @see location_manager_unset_velocity_updated_cb() * @see location_velocity_updated_cb() */ @@ -779,7 +808,7 @@ int location_manager_set_velocity_updated_cb(location_manager_h manager, locatio /** * @brief Unregisters the callback function. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @since_tizen 2.3 * @param[in] manager The location manager handle * @return @c 0 on success, * otherwise a negative error value @@ -793,7 +822,7 @@ int location_manager_unset_velocity_updated_cb(location_manager_h manager); /** * @brief Registers a callback function to be invoked when the location service state is changed. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @since_tizen 2.3 * @param[in] manager The location manager handle * @param[in] callback The callback function to register * @param[in] user_data The user data to be passed to the callback function @@ -802,7 +831,7 @@ int location_manager_unset_velocity_updated_cb(location_manager_h manager); * @retval #LOCATIONS_ERROR_NONE Successful * @retval #LOCATIONS_ERROR_INVALID_PARAMETER Invalid parameter * @retval #LOCATIONS_ERROR_NOT_SUPPORTED Not supported - * @post location_service_state_changed_cb() will be invoked + * @post location_service_state_changed_cb() will be invoked. * @see location_manager_unset_service_state_changed_cb() * @see location_service_state_changed_cb() * @see location_manager_start() @@ -814,7 +843,7 @@ int location_manager_set_service_state_changed_cb(location_manager_h manager, lo /** * @brief Unregisters the callback function. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @since_tizen 2.3 * @param[in] manager The location manager handle * @return @c 0 on success, * otherwise a negative error value @@ -828,7 +857,7 @@ int location_manager_unset_service_state_changed_cb(location_manager_h manager); /** * @brief Registers a callback function to be invoked when the previously set boundary area is entered or left. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @since_tizen 2.3 * @param[in] manager The location manager handle * @param[in] callback The callback function to register * @param[in] user_data The user data to be passed to the callback function @@ -838,7 +867,7 @@ int location_manager_unset_service_state_changed_cb(location_manager_h manager); * @retval #LOCATIONS_ERROR_INVALID_PARAMETER Invalid parameter * @retval #LOCATIONS_ERROR_NOT_SUPPORTED Not supported * @pre location_manager_add_boundary() is called before. - * @post location_zone_changed_cb() will be invoked + * @post location_zone_changed_cb() will be invoked. * @see location_manager_unset_zone_changed_cb() * @see location_zone_changed_cb() */ @@ -847,7 +876,7 @@ int location_manager_set_zone_changed_cb(location_manager_h manager, location_zo /** * @brief Unregisters the callback function. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @since_tizen 2.3 * @param[in] manager The location manager handle * @return @c 0 on success, * otherwise a negative error value @@ -861,7 +890,7 @@ int location_manager_unset_zone_changed_cb(location_manager_h manager); /** * @brief Registers a callback function to be invoked when the location setting is changed. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @since_tizen 2.3 * @param[in] method The method to observe * @param[in] callback The callback function to register * @param[in] user_data The user data to be passed to the callback function @@ -869,8 +898,9 @@ int location_manager_unset_zone_changed_cb(location_manager_h manager); * otherwise a negative error value * @retval #LOCATIONS_ERROR_NONE Successful * @retval #LOCATIONS_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #LOCATIONS_ERROR_INCORRECT_METHOD Incorrect method * @retval #LOCATIONS_ERROR_NOT_SUPPORTED Not supported - * @post location_setting_changed_cb() will be invoked + * @post location_setting_changed_cb() will be invoked. * @see location_manager_unset_setting_changed_cb() * @see location_setting_changed_cb() */ @@ -879,12 +909,13 @@ int location_manager_set_setting_changed_cb(location_method_e method, location_s /** * @brief Unregisters the callback function. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @since_tizen 2.3 * @param[in] method The method to observe * @return @c 0 on success, * otherwise a negative error value * @retval #LOCATIONS_ERROR_NONE Successful * @retval #LOCATIONS_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #LOCATIONS_ERROR_INCORRECT_METHOD Incorrect method * @retval #LOCATIONS_ERROR_NOT_SUPPORTED Not supported * @see location_manager_set_setting_changed_cb() */ @@ -893,7 +924,7 @@ int location_manager_unset_setting_changed_cb(location_method_e method); /** * @brief Gets the distance in meters between two locations. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @since_tizen 2.3 * @param[in] start_latitude The starting latitude [-90.0 ~ 90.0] (degrees) * @param[in] start_longitude The starting longitude [-180.0 ~ 180.0] (degrees) * @param[in] end_latitude The ending latitude [-90.0 ~ 90.0] (degrees) @@ -910,7 +941,7 @@ int location_manager_get_distance(double start_latitude, double start_longitude, /** * @brief Registers a callback function to be invoked at minimum interval or minimum distance with updated position information. - * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif + * @since_tizen 2.4 * @param[in] manager The location manager handle * @param[in] callback The callback function to register * @param[in] interval The minimum interval between position updates [1 ~ 120] (seconds) @@ -921,7 +952,7 @@ int location_manager_get_distance(double start_latitude, double start_longitude, * @retval #LOCATIONS_ERROR_NONE Successful * @retval #LOCATIONS_ERROR_INVALID_PARAMETER Invalid parameter * @retval #LOCATIONS_ERROR_NOT_SUPPORTED Not supported - * @post location_changed_cb() will be invoked + * @post location_changed_cb() will be invoked. * @see location_manager_unset_distance_based_location_changed_cb() * @see location_changed_cb() */ @@ -930,7 +961,7 @@ int location_manager_set_distance_based_location_changed_cb(location_manager_h m /** * @brief Unregisters the callback function. - * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif + * @since_tizen 2.4 * @param[in] manager The location manager handle * @return @c 0 on success, * otherwise a negative error value @@ -944,7 +975,7 @@ int location_manager_unset_distance_based_location_changed_cb(location_manager_h /** * @brief Registers a callback function to be invoked at defined interval with updated location information. - * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif + * @since_tizen 2.4 * @param[in] manager The location manager handle * @param[in] callback The callback function to register * @param[in] interval The interval [1 ~ 120] (seconds) @@ -954,7 +985,7 @@ int location_manager_unset_distance_based_location_changed_cb(location_manager_h * @retval #LOCATIONS_ERROR_NONE Successful * @retval #LOCATIONS_ERROR_INVALID_PARAMETER Invalid parameter * @retval #LOCATIONS_ERROR_NOT_SUPPORTED Not supported - * @post location_changed_cb() will be invoked + * @post location_changed_cb() will be invoked. * @see location_manager_unset_location_changed_cb() * @see location_changed_cb() */ @@ -963,7 +994,7 @@ int location_manager_set_location_changed_cb(location_manager_h manager, locatio /** * @brief Unregisters the callback function. - * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif + * @since_tizen 2.4 * @param[in] manager The location manager handle * @return @c 0 on success, * otherwise a negative error value @@ -977,18 +1008,20 @@ int location_manager_unset_location_changed_cb(location_manager_h manager); /** * @brief Registers a callback function to be invoked when batch_period is expired. - * @since_tizen @if MOBILE 3.0 @elseif WEARABLE 2.3.2 @endif + * @since_tizen 2.3.2 * @remarks The batch_period should be greater than or equal to the batch_interval. + * In addition, sometimes the period may not work as you intended, the maximum permissible value for batch_period is device specific. * @param[in] manager The location manager handle * @param[in] callback The callback function to register * @param[in] batch_interval The batch sampling interval [1 ~ 255] (seconds) * @param[in] batch_period The batch period [1 ~ 60000] (seconds) + * @param[in] user_data The user data to be passed to the callback function * @return @c 0 on success, * otherwise a negative error value * @retval #LOCATIONS_ERROR_NONE Successful * @retval #LOCATIONS_ERROR_INVALID_PARAMETER Invalid parameter * @retval #LOCATIONS_ERROR_NOT_SUPPORTED Not supported - * @post location_batch_cb() will be invoked + * @post location_batch_cb() will be invoked. * @see location_manager_start_batch() * @see location_batch_cb() * @see location_manager_unset_location_batch_cb() @@ -998,7 +1031,7 @@ int location_manager_set_location_batch_cb(location_manager_h manager, location_ /** * @brief Unregisters the callback function. - * @since_tizen @if MOBILE 3.0 @elseif WEARABLE 2.3.2 @endif + * @since_tizen 2.3.2 * @param[in] manager The location manager handle * @return @c 0 on success, * otherwise a negative error value @@ -1014,7 +1047,7 @@ int location_manager_unset_location_batch_cb(location_manager_h manager); * @brief Starts the location batch service. * @details Calling this function starts location batch service, location_batch_cb() will be invoked every @a batch_period seconds. * After that, you can obtain all locations with location_manager_foreach_location_batch(). - * @since_tizen @if MOBILE 3.0 @elseif WEARABLE 2.3.2 @endif + * @since_tizen 2.3.2 * @privlevel public * @privilege %http://tizen.org/privilege/location * @remarks Calling this function invokes a location service event. When the location service is enabled, the service state change callback @@ -1041,7 +1074,7 @@ int location_manager_start_batch(location_manager_h manager); /** * @brief Stops the location batch service. - * @since_tizen @if MOBILE 3.0 @elseif WEARABLE 2.3.2 @endif + * @since_tizen 2.3.2 * @remarks This function initiates the process of stopping the service. When the process is finished, callback set using * #location_manager_set_service_state_changed_cb() will be called, with #LOCATIONS_SERVICE_DISABLED as the first argument. * @param[in] manager The location manager handle @@ -1061,31 +1094,33 @@ int location_manager_stop_batch(location_manager_h manager); /** * @brief Retrieves all location information by invoking a specific callback for each location data. - * @since_tizen @if MOBILE 3.0 @elseif WEARABLE 2.3.2 @endif + * @since_tizen 2.3.2 * @privlevel public * @privilege %http://tizen.org/privilege/location * @param[in] manager The location manager handle * @param[in] callback The iteration callback function - * @param[in] user_data The user data passed from the callback registration function + * @param[in] user_data The user data to be passed to the callback function * @return @c 0 on success, * otherwise a negative error value * @retval #LOCATIONS_ERROR_NONE Successful * @retval #LOCATIONS_ERROR_INVALID_PARAMETER Invalid parameter * @retval #LOCATIONS_ERROR_ACCESSIBILITY_NOT_ALLOWED The application does not have the privilege to call this method * @retval #LOCATIONS_ERROR_NOT_SUPPORTED Not supported - * @pre location_manager_foreach_location_batch() is available after location_batch_cb() is invoked - * @post location_batch_get_location_cb() will be invoked + * @pre location_manager_foreach_location_batch() is available after location_batch_cb() is invoked. + * @post location_batch_get_location_cb() will be invoked. * @see location_manager_start_batch() * @see location_batch_cb() * @see location_batch_get_location_cb() */ int location_manager_foreach_location_batch(location_manager_h manager, location_batch_get_location_cb callback, void *user_data); + /** * @brief Checks whether the mock location is enabled. * @since_tizen 3.0 * @param[out] enabled Indicates whether the mock location is enabled - * @return 0 on success, otherwise a negative error value + * @return @c 0 on success, + * otherwise a negative error value * @retval #LOCATIONS_ERROR_NONE Successful * @retval #LOCATIONS_ERROR_INVALID_PARAMETER Invalid parameter * @retval #LOCATIONS_ERROR_NOT_SUPPORTED Not supported @@ -1095,12 +1130,15 @@ int location_manager_foreach_location_batch(location_manager_h manager, location */ int location_manager_is_enabled_mock_location(bool *enabled); + /** * @brief Enables mock location. + * @details The mock location is a testing function to make location API and callback deliver a mock location + * set by location_manager_set_mock_location() instead of real positioning data even in the other applications. * @since_tizen 3.0 - * @remarks You can enable the mock location when developer mode is enabled. * @privlevel public * @privilege %http://tizen.org/privilege/location + * @remarks The mock location can only be enabled if developer mode is enabled. * @param[in] enable The value to set * @return @c 0 on success, * otherwise a negative error value @@ -1108,9 +1146,9 @@ int location_manager_is_enabled_mock_location(bool *enabled); * @retval #LOCATIONS_ERROR_SETTING_OFF MOCK location is not enabled * @retval #LOCATIONS_ERROR_ACCESSIBILITY_NOT_ALLOWED Permission denied * @retval #LOCATIONS_ERROR_NOT_SUPPORTED Not supported - * @see location_manager_is_enabled_method() - * @see location_manager_create() + * @see location_manager_is_enabled_mock_location() * @see location_manager_set_mock_location() + * @see location_manager_clear_mock_location() */ int location_manager_enable_mock_location(const bool enable); @@ -1136,9 +1174,9 @@ int location_manager_enable_mock_location(const bool enable); * @retval #LOCATIONS_ERROR_SETTING_OFF MOCK location is not enabled * @retval #LOCATIONS_ERROR_ACCESSIBILITY_NOT_ALLOWED The application does not have the privilege to call this method * @retval #LOCATIONS_ERROR_NOT_SUPPORTED Not supported - * @see location_manager_is_enabled_method() - * @see location_manager_enable_mock_location() * @see location_manager_create() + * @see location_manager_is_enabled_mock_location() + * @see location_manager_enable_mock_location() * @see location_manager_clear_mock_location() */ int location_manager_set_mock_location(location_manager_h manager, const double latitude, const double longitude, const double altitude, const double speed, const double direction, const double accuracy); @@ -1158,30 +1196,48 @@ int location_manager_set_mock_location(location_manager_h manager, const double * @retval #LOCATIONS_ERROR_ACCESSIBILITY_NOT_ALLOWED The application does not have the privilege to call this method * @retval #LOCATIONS_ERROR_SETTING_OFF MOCK location is not enabled * @retval #LOCATIONS_ERROR_NOT_SUPPORTED Not supported - * @see location_manager_is_enabled_method() - * @see location_manager_enable_mock_location() * @see location_manager_create() + * @see location_manager_is_enabled_mock_location() + * @see location_manager_enable_mock_location() * @see location_manager_set_mock_location() */ int location_manager_clear_mock_location(location_manager_h manager); +/** + * @brief Changes behavior of the location source selection in the fused location method. + * @since_tizen 4.0 + * @param[in] manager The location manager handle + * @param[in] mode The fused mode. + * @return @c 0 on success, otherwise a negative error value + * @retval #LOCATIONS_ERROR_NONE Successful + * @retval #LOCATIONS_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #LOCATIONS_ERROR_INCORRECT_METHOD Incorrect method + * @retval #LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE The service is not available + * @retval #LOCATIONS_ERROR_NOT_SUPPORTED Not supported + * @see location_manager_create() + */ +int location_manager_set_fused_mode(location_manager_h manager, location_fused_mode_e mode); + /** * @} */ + /* * GPS Status & Satellites */ + /** * @addtogroup CAPI_LOCATION_GPS_STATUS_MODULE * @{ */ + /** * @brief Called once for each satellite in range. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @since_tizen 2.3 * @param[in] azimuth The azimuth of the satellite (degrees) * @param[in] elevation The elevation of the satellite (meters) * @param[in] prn The PRN of the satellite @@ -1199,12 +1255,12 @@ typedef bool(*gps_status_get_satellites_cb)(unsigned int azimuth, unsigned int e /** * @brief Called at defined interval with updated satellite information. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @since_tizen 2.3 * @param[out] num_of_active The last number of active satellites * @param[out] num_of_inview The last number of satellites in view * @param[out] timestamp The last timestamp (time when measurement took place or @c 0 if valid) * @param[in] user_data The user data passed from the call registration function - * @pre location_manager_start() will invoke this callback if you register this callback using location_manager_set_position_updated_cb() + * @pre location_manager_start() will invoke this callback if you register this callback using location_manager_set_position_updated_cb(). * @see location_manager_start() * @see location_manager_set_position_updated_cb() */ @@ -1213,7 +1269,7 @@ typedef void(*gps_status_satellite_updated_cb)(int num_of_active, int num_of_inv /** * @brief Gets the GPS NMEA data. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @since_tizen 2.3 * @remarks This call is valid only for location managers with #LOCATIONS_METHOD_GPS method. * You must release @a nmea using @c free(). * @param[in] manager The location manager handle @@ -1233,7 +1289,7 @@ int gps_status_get_nmea(location_manager_h manager, char **nmea); /** * @brief Gets the information of satellites. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @since_tizen 2.3 * @privlevel public * @privilege %http://tizen.org/privilege/location * @remarks This call is valid only for location managers with #LOCATIONS_METHOD_GPS method. @@ -1257,7 +1313,7 @@ int gps_status_get_satellite(location_manager_h manager, int *num_of_active, int /** * @brief Registers a callback function to be invoked at defined interval with updated satellite information. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @since_tizen 2.3 * @privlevel public * @privilege %http://tizen.org/privilege/location * @param[in] manager The location manager handle @@ -1270,7 +1326,7 @@ int gps_status_get_satellite(location_manager_h manager, int *num_of_active, int * @retval #LOCATIONS_ERROR_INVALID_PARAMETER Invalid parameter * @retval #LOCATIONS_ERROR_ACCESSIBILITY_NOT_ALLOWED The application does not have the privilege to call this method * @retval #LOCATIONS_ERROR_NOT_SUPPORTED Not supported - * @post gps_status_satellite_updated_cb() will be invoked + * @post gps_status_satellite_updated_cb() will be invoked. * @see gps_status_unset_satellite_updated_cb() * @see gps_status_satellite_updated_cb() * @see gps_status_get_satellite() @@ -1283,7 +1339,7 @@ int gps_status_set_satellite_updated_cb(location_manager_h manager, gps_status_s /** * @brief Unregisters the callback function. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @since_tizen 2.3 * @param[in] manager The location manager handle * @return @c 0 on success, * otherwise a negative error value @@ -1297,7 +1353,7 @@ int gps_status_unset_satellite_updated_cb(location_manager_h manager); /** * @brief Invokes the callback function for each satellite. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @since_tizen 2.3 * @privlevel public * @privilege %http://tizen.org/privilege/location * @remarks This function is valid only for location managers with the #LOCATIONS_METHOD_GPS method. @@ -1312,8 +1368,8 @@ int gps_status_unset_satellite_updated_cb(location_manager_h manager); * @retval #LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE Service not available * @retval #LOCATIONS_ERROR_ACCESSIBILITY_NOT_ALLOWED The application does not have the privilege to call this method * @retval #LOCATIONS_ERROR_NOT_SUPPORTED Not supported - * @pre The location service state must be #LOCATIONS_SERVICE_ENABLED with location_manager_start() - * @pre The gps_status_satellite_updated_cb must be set with gps_status_set_satellite_updated_cb() + * @pre The location service state must be #LOCATIONS_SERVICE_ENABLED with location_manager_start(). + * @pre The gps_status_satellite_updated_cb must be set with gps_status_set_satellite_updated_cb(). * @post It invokes gps_status_get_satellites_cb(). * @see gps_status_get_satellite() * @see gps_status_get_satellites_cb() @@ -1323,7 +1379,7 @@ int gps_status_foreach_satellites_in_view(location_manager_h manager, gps_status /** * @brief Gets the last information of satellites. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @since_tizen 2.3 * @privlevel public * @privilege %http://tizen.org/privilege/location * @remarks This call is valid only for location managers with #LOCATIONS_METHOD_GPS method. @@ -1339,8 +1395,8 @@ int gps_status_foreach_satellites_in_view(location_manager_h manager, gps_status * @retval #LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE Service not available * @retval #LOCATIONS_ERROR_ACCESSIBILITY_NOT_ALLOWED The application does not have the privilege to call this method * @retval #LOCATIONS_ERROR_NOT_SUPPORTED Not supported - * @pre The location service state must be #LOCATIONS_SERVICE_ENABLED with location_manager_start() - * @pre The gps_status_satellite_updated_cb must be set with gps_status_set_satellite_updated_cb() + * @pre The location service state must be #LOCATIONS_SERVICE_ENABLED with location_manager_start(). + * @pre The gps_status_satellite_updated_cb must be set with gps_status_set_satellite_updated_cb(). * @see gps_status_foreach_satellites_in_view() */ int gps_status_get_last_satellite(location_manager_h manager, int *num_of_active, int *num_of_inview, time_t *timestamp); @@ -1348,7 +1404,7 @@ int gps_status_get_last_satellite(location_manager_h manager, int *num_of_active /** * @brief Invokes the callback function for each last satellite which is recorded. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @since_tizen 2.3 * @privlevel public * @privilege %http://tizen.org/privilege/location * @remarks This function is valid only for location managers with the #LOCATIONS_METHOD_GPS method. @@ -1363,8 +1419,8 @@ int gps_status_get_last_satellite(location_manager_h manager, int *num_of_active * @retval #LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE Service not available * @retval #LOCATIONS_ERROR_ACCESSIBILITY_NOT_ALLOWED The application does not have the privilege to call this method * @retval #LOCATIONS_ERROR_NOT_SUPPORTED Not supported - * @pre The location service state must be #LOCATIONS_SERVICE_ENABLED with location_manager_start() - * @pre The gps_status_satellite_updated_cb must be set with gps_status_set_satellite_updated_cb() + * @pre The location service state must be #LOCATIONS_SERVICE_ENABLED with location_manager_start(). + * @pre The gps_status_satellite_updated_cb must be set with gps_status_set_satellite_updated_cb(). * @post It invokes gps_status_get_satellites_cb(). * @see gps_status_get_last_satellite() * @see gps_status_get_satellites_cb()