extern "C" {
#endif
+
/**
* @addtogroup CAPI_LOCATION_MANAGER_MODULE
* @{
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;
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.
/*
* Location Manager
*/
+
+
/**
* @addtogroup CAPI_LOCATION_MANAGER_MODULE
* @{
* @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);
/**
* @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
* @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
*/
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
*/
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.
* @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);
* @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()
*/
* @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()
*/
* @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()
* @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()
*/
* 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()
*/
* 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()
*/
* @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()
*/
* @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()
*/
* @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
* @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()
* @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
*/
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
* @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);
* @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);
* @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
* @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()
*/
* @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()
* @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()
* @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);
* @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()