* The geofence type property of geofence manager (#geofence_type_e) specified the type of virtual perimeter.
*
* The status property describes the current state and duration of a geofence.
- * state (#geofence_state_e) can be uncertain, in, or out.
+ * State (#geofence_state_e) can be uncertain, in, or out.
*
* @section CAPI_GEOFENCE_MANAGER_MODULE_FEATURE Related Features
* This API is related with the following features:\n
*
* To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.\n
*
- * More details on featuring your application can be found from <a href="../org.tizen.mobile.native.appprogramming/html/ide_sdk_tools/feature_element.htm"><b>Feature Element</b>.</a>
+ * More details on featuring your application can be found from <a href="https://developer.tizen.org/development/tools/native-tools/manifest-text-editor#feature"><b>Feature Element</b>.</a>
*
*/
* Geo-fence defines a virtual perimeter for a real-world geographic area.
* If you create a geofence, you can trigger some activities when a device enters(or exits) the geofences defined by you.
*
- * You can create a geofence with the information of Geopoint, WiFi, or BT.
+ * You can create a geofence with the information of Geopoint, Wi-Fi, or BT.
*
- * 1. Geopoint: Gefence is specified by cooridinates (Latitude and Longitude) and Radius\n
+ * 1. Geopoint: Geofence is specified by coordinates (Latitude and Longitude) and Radius\n
* 2. WIFI: Geofence is specified by BSSID of Wi-Fi access point\n
* 3. BT: Geofence is specified by Bluetooth address\n
*
*
* To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.\n
*
- * More details on featuring your application can be found from <a href="../org.tizen.mobile.native.appprogramming/html/ide_sdk_tools/feature_element.htm"><b>Feature Element</b>.</a>
+ * More details on featuring your application can be found from <a href="https://developer.tizen.org/development/tools/native-tools/manifest-text-editor#feature"><b>Feature Element</b>.</a>
*
*/
typedef void(*geofence_state_changed_cb)(int geofence_id, geofence_state_e state, void *user_data);
/**
+ * @brief Called when a proximity state of device is changed.
+ * @since_tizen 3.0
+ * @param[in] geofence_id The specified geofence id
+ * @param[in] state The proximity state
+ * @param[in] provider The proximity provider
+ * @param[in] user_data The user data passed from callback registration function
+ * @pre geofence_manager_start() will invoke this callback if you register this callback using geofence_manager_set_geofence_proximity_state_changed_cb().
+ * @see geofence_proximity_state_e
+ * @see geofence_proximity_provider_e
+ * @see geofence_manager_start()
+ * @see geofence_manager_set_geofence_proximity_state_changed_cb()
+ */
+typedef void(*geofence_proximity_state_changed_cb)(int geofence_id, geofence_proximity_state_e state, geofence_proximity_provider_e provider, void *user_data);
+
+/**
* @brief Called when the some event occurs in geofence and place such as add, update, etc..
* @details The events of public geofence is also received if there are public geofences.
*
* @param[in] error The error code for the particular action
* @param[in] manage The result code for the particular place and geofence management
* @param[in] user_data The user data passed from callback registration function
- * @pre geofence_manager_start() will invoke this callback if you register this callback using geofence_manager_set_geofence_state_changed_cb()
+ * @pre geofence_manager_start() will invoke this callback if you register this callback using geofence_manager_set_geofence_event_cb()
* @see geofence_manage_e
* @see geofence_manager_start()
- * @see geofence_manager_set_geofence_state_changed_cb()
+ * @see geofence_manager_set_geofence_event_cb()
*/
typedef void(*geofence_event_cb)(int place_id, int geofence_id, geofence_manager_error_e error, geofence_manage_e manage, void *user_data);
* @pre geofence_manager_foreach_geofence_list() and geofence_manager_foreach_place_geofence_list() will invoke this callback if you specify this callback using geofence_manager_foreach_geofence_list().
* @see geofence_manager_foreach_geofence_list()
* @see geofence_manager_foreach_place_geofence_list()
- * @see geofence_manager_add()
+ * @see geofence_manager_add_fence()
*/
typedef bool(*geofence_manager_fence_cb)(int geofence_id, geofence_h fence, int fence_index, int fence_cnt, void *user_data);
* @param[out] supported @c true if geofence service is supported, otherwise @c false
* @return 0 on success, otherwise a negative error value
* @retval #GEOFENCE_MANAGER_ERROR_NONE Successful
+ * @retval #GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED Not supported
* @see geofence_manager_create()
*/
int geofence_manager_is_supported(bool *supported);
* @param[out] manager A geofence manager handle to be newly created on success
* @return 0 on success, otherwise a negative error value
* @retval #GEOFENCE_MANAGER_ERROR_NONE Successful
- * @retval #GEOFENCE_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #GEOFENCE_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
* @retval #GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER Illegal argument
* @retval #GEOFENCE_MANAGER_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
+ * @retval #GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED Not supported
* @retval #GEOFENCE_MANAGER_ERROR_NOT_INITIALIZED Not initialized
- * @retval #GEOFENCE_MANAGER_ERROR_EXCEPTION Exception occurred
+ * @retval #GEOFENCE_MANAGER_ERROR_EXCEPTION Exception occurred
* @see geofence_manager_destroy()
*/
int geofence_manager_create(geofence_manager_h *manager);
* @retval #GEOFENCE_MANAGER_ERROR_NONE Successful
* @retval #GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER Illegal argument
* @retval #GEOFENCE_MANAGER_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
- * @retval #GEOFENCE_MANAGER_ERROR_EXCEPTION Exception occurred
+ * @retval #GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED Not supported
+ * @retval #GEOFENCE_MANAGER_ERROR_EXCEPTION Exception occurred
* @pre geofence_manager_stop() is called before.
* @see geofence_manager_create()
* @see geofence_manager_stop()
* @retval #GEOFENCE_MANAGER_ERROR_NONE Successful
* @retval #GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER Illegal argument
* @retval #GEOFENCE_MANAGER_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
+ * @retval #GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED Not supported
* @retval #GEOFENCE_MANAGER_ERROR_EXCEPTION Exception occurred
* @retval #GEOFENCE_MANAGER_ERROR_GEOFENCE_ACCESS_DENIED Access to specified geofence is denied
* @see geofence_manager_stop()
* @retval #GEOFENCE_MANAGER_ERROR_NONE Successful
* @retval #GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER Illegal argument
* @retval #GEOFENCE_MANAGER_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
+ * @retval #GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED Not supported
* @retval #GEOFENCE_MANAGER_ERROR_NOT_INITIALIZED Not initialized
* @retval #GEOFENCE_MANAGER_ERROR_EXCEPTION Exception occurred
* @retval #GEOFENCE_MANAGER_ERROR_GEOFENCE_ACCESS_DENIED Access to specified geofence is denied
* @retval #GEOFENCE_MANAGER_ERROR_NONE Successful
* @retval #GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER Illegal argument
* @retval #GEOFENCE_MANAGER_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
+ * @retval #GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED Not supported
* @retval #GEOFENCE_MANAGER_ERROR_NOT_INITIALIZED Not initialized
* @retval #GEOFENCE_MANAGER_ERROR_EXCEPTION Exception occurred
* @see geofence_manager_update_place()
* @retval #GEOFENCE_MANAGER_ERROR_NONE Successful
* @retval #GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER Illegal argument
* @retval #GEOFENCE_MANAGER_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
+ * @retval #GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED Not supported
* @retval #GEOFENCE_MANAGER_ERROR_NOT_INITIALIZED Not initialized
* @retval #GEOFENCE_MANAGER_ERROR_EXCEPTION Exception occurred
* @retval #GEOFENCE_MANAGER_ERROR_PLACE_ACCESS_DENIED Access to specified place is denied
* @retval #GEOFENCE_MANAGER_ERROR_NONE Successful
* @retval #GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER Illegal argument
* @retval #GEOFENCE_MANAGER_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
+ * @retval #GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED Not supported
* @retval #GEOFENCE_MANAGER_ERROR_NOT_INITIALIZED Not initialized
* @retval #GEOFENCE_MANAGER_ERROR_EXCEPTION Exception occurred
* @retval #GEOFENCE_MANAGER_ERROR_PLACE_ACCESS_DENIED Access to specified place is denied
* @retval #GEOFENCE_MANAGER_ERROR_NONE Successful
* @retval #GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER Illegal argument
* @retval #GEOFENCE_MANAGER_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
+ * @retval #GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED Not supported
* @retval #GEOFENCE_MANAGER_ERROR_NOT_INITIALIZED Not initialized
* @retval #GEOFENCE_MANAGER_ERROR_EXCEPTION Exception occurred
* @see geofence_manager_remove_fence()
* @retval #GEOFENCE_MANAGER_ERROR_NONE Successful
* @retval #GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER Illegal argument
* @retval #GEOFENCE_MANAGER_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
+ * @retval #GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED Not supported
* @retval #GEOFENCE_MANAGER_ERROR_NOT_INITIALIZED Not initialized
* @retval #GEOFENCE_MANAGER_ERROR_EXCEPTION Exception occurred
* @retval #GEOFENCE_MANAGER_ERROR_GEOFENCE_ACCESS_DENIED Access to specified geofence is denied
* @return 0 on success, otherwise a negative error value
* @retval #GEOFENCE_MANAGER_ERROR_NONE Successful
* @retval #GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER Illegal argument
+ * @retval #GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED Not supported
* @post This function invokes geofence_state_changed_cb().
* @see geofence_manager_unset_geofence_state_changed_cb()
* @see geofence_state_changed_cb()
* @return 0 on success, otherwise a negative error value
* @retval #GEOFENCE_MANAGER_ERROR_NONE Successful
* @retval #GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER Illegal argument
+ * @retval #GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED Not supported
* @see geofence_state_changed_cb()
*/
int geofence_manager_unset_geofence_state_changed_cb(geofence_manager_h manager);
* @return 0 on success, otherwise a negative error value
* @retval #GEOFENCE_MANAGER_ERROR_NONE Successful
* @retval #GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER Illegal argument
+ * @retval #GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED Not supported
* @post This function invokes geofence_event_cb().
* @see geofence_manager_unset_geofence_event_cb()
*/
* @return 0 on success, otherwise a negative error value
* @retval #GEOFENCE_MANAGER_ERROR_NONE Successful
* @retval #GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER Illegal argument
+ * @retval #GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED Not supported
* @see geofence_event_cb()
*/
int geofence_manager_unset_geofence_event_cb(geofence_manager_h manager);
/**
+ * @brief Registers a callback function to be invoked when a proximity state of device is changed.
+ * @details The proximity state is measured from registered position regardless of the geofence boundary.
+ * @since_tizen 3.0
+ * @param[in] manager The geofence manager handle
+ * @param[in] callback The callback function to register
+ * @param[in] user_data The user data to be passed to the callback function
+ * @return 0 on success, otherwise a negative error value
+ * @retval #GEOFENCE_MANAGER_ERROR_NONE Successful
+ * @retval #GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER Illegal argument
+ * @retval #GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED Not supported
+ * @post This function invokes geofence_proximity_state_changed_cb().
+ * @see geofence_manager_unset_geofence_proximity_state_changed_cb()
+ */
+int geofence_manager_set_geofence_proximity_state_changed_cb(geofence_manager_h manager, geofence_proximity_state_changed_cb callback, void *user_data);
+
+/**
+ * @brief Unregisters the callback function.
+ * @since_tizen 3.0
+ * @param[in] manager The geofence manager handle
+ * @return 0 on success, otherwise a negative error value
+ * @retval #GEOFENCE_MANAGER_ERROR_NONE Successful
+ * @retval #GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER Illegal argument
+ * @retval #GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED Not supported
+ * @see geofence_manager_set_geofence_proximity_state_changed_cb()
+ */
+int geofence_manager_unset_geofence_proximity_state_changed_cb(geofence_manager_h manager);
+
+/**
* @brief Retrieves a list of fences registered in the specified geofence manager.
* @since_tizen 2.4
* @privlevel public
* @retval #GEOFENCE_MANAGER_ERROR_NONE Successful
* @retval #GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER Illegal argument
* @retval #GEOFENCE_MANAGER_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
+ * @retval #GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED Not supported
* @retval #GEOFENCE_MANAGER_ERROR_DATABASE Database error
* @post This function invokes geofence_manager_fence_cb().
* @see geofence_manager_fence_cb()
- * @see geofence_manager_add()
+ * @see geofence_manager_add_fence()
*/
int geofence_manager_foreach_geofence_list(geofence_manager_h manager, geofence_manager_fence_cb callback, void *user_data);
* @since_tizen 2.4
* @privlevel public
* @privilege %http://tizen.org/privilege/location
+ * @param[in] manager The geofence manager handle
* @param[in] place_id The place id
* @param[in] callback The callback function to deliver each fence of the specified place
* @param[in] user_data The user data to be passed to the callback function
* @retval #GEOFENCE_MANAGER_ERROR_NONE Successful
* @retval #GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER Illegal argument
* @retval #GEOFENCE_MANAGER_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
+ * @retval #GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED Not supported
* @retval #GEOFENCE_MANAGER_ERROR_DATABASE Database error
* @retval #GEOFENCE_MANAGER_ERROR_PLACE_ACCESS_DENIED Access to specified place is denied
* @post This function invokes geofence_manager_fence_cb().
- * @see geofence_manager_fence_at_place_cb()
+ * @see geofence_manager_fence_cb()
* @see geofence_manager_add_place()
*/
int geofence_manager_foreach_place_geofence_list(geofence_manager_h manager, int place_id, geofence_manager_fence_cb callback, void *user_data);
/**
- * @brief Retrieves a list of place registered in the specified geofence manager.
+ * @brief Retrieves a list of places registered in the specified geofence manager.
* @since_tizen 2.4
* @privlevel public
* @privilege %http://tizen.org/privilege/location
* @retval #GEOFENCE_MANAGER_ERROR_NONE Successful
* @retval #GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER Illegal argument
* @retval #GEOFENCE_MANAGER_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
+ * @retval #GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED Not supported
* @retval #GEOFENCE_MANAGER_ERROR_DATABASE Database error
* @post This function invokes geofence_manager_place_cb().
* @see geofence_manager_place_cb()
* @retval #GEOFENCE_MANAGER_ERROR_NONE Successful
* @retval #GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER Illegal argument
* @retval #GEOFENCE_MANAGER_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
- * @retval #GEOFENCE_MANAGER_ERROR_INVALI_ID
+ * @retval #GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED Not supported
+ * @retval #GEOFENCE_MANAGER_ERROR_INVALID_ID Invalid geofence ID
* @retval #GEOFENCE_MANAGER_ERROR_DATABASE Database error
* @retval #GEOFENCE_MANAGER_ERROR_PLACE_ACCESS_DENIED Access to specified place is denied
* @see geofence_manager_add_place()
* @return 0 on success, otherwise a negative error value
* @retval #GEOFENCE_MANAGER_ERROR_NONE Successful
* @retval #GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER Illegal argument
+ * @retval #GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED Not supported
* @retval #GEOFENCE_MANAGER_ERROR_EXCEPTION Exception occurred
* @retval #GEOFENCE_MANAGER_ERROR_PLACE_ACCESS_DENIED Access to specified place is denied
* @see geofence_create_bluetooth()
* @return 0 on success, otherwise a negative error value
* @retval #GEOFENCE_MANAGER_ERROR_NONE Successful
* @retval #GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER Illegal argument
+ * @retval #GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED Not supported
* @retval #GEOFENCE_MANAGER_ERROR_EXCEPTION Exception occurred
* @retval #GEOFENCE_MANAGER_ERROR_PLACE_ACCESS_DENIED Access to specified place is denied
* @see geofence_create_geopoint()
* @return 0 on success, otherwise a negative error value
* @retval #GEOFENCE_MANAGER_ERROR_NONE Successful
* @retval #GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER Illegal argument
+ * @retval #GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED Not supported
* @retval #GEOFENCE_MANAGER_ERROR_EXCEPTION Exception occurred
* @retval #GEOFENCE_MANAGER_ERROR_PLACE_ACCESS_DENIED Access to specified place is denied
* @see geofence_create_geopoint()
* @return 0 on success, otherwise a negative error value
* @retval #GEOFENCE_MANAGER_ERROR_NONE Successful
* @retval #GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER Illegal argument
+ * @retval #GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED Not supported
* @see geofence_create_geopoint()
* @see geofence_create_bluetooth()
* @see geofence_create_wifi()
* @return 0 on success, otherwise a negative error value
* @retval #GEOFENCE_MANAGER_ERROR_NONE Successful
* @retval #GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER Illegal argument
+ * @retval #GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED Not supported
* @see geofence_get_geopoint()
* @see geofence_get_radius()
* @see geofence_get_bssid()
* @return 0 on success, otherwise a negative error value
* @retval #GEOFENCE_MANAGER_ERROR_NONE Successful
* @retval #GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER Illegal argument
+ * @retval #GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED Not supported
* @see geofence_create_geopoint()
* @see geofence_create_bluetooth()
* @see geofence_create_wifi()
* @return 0 on success, otherwise a negative error value
* @retval #GEOFENCE_MANAGER_ERROR_NONE Successful
* @retval #GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER Illegal argument.
+ * @retval #GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED Not supported
* @see geofence_get_longitude()
* @see geofence_get_radius()
* @see geofence_get_address()
* @return 0 on success, otherwise a negative error value
* @retval #GEOFENCE_MANAGER_ERROR_NONE Successful
* @retval #GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER Illegal argument
+ * @retval #GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED Not supported
* @see geofence_get_latitude()
* @see geofence_get_radius()
* @see geofence_get_address()
* @return 0 on success, otherwise a negative error value
* @retval #GEOFENCE_MANAGER_ERROR_NONE Successful
* @retval #GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER Illegal argument
+ * @retval #GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED Not supported
* @see geofence_get_latitude()
* @see geofence_get_longitude()
* @see geofence_get_address()
* @return 0 on success, otherwise a negative error value
* @retval #GEOFENCE_MANAGER_ERROR_NONE Successful
* @retval #GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER Illegal argument
+ * @retval #GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED Not supported
* @see geofence_get_latitude()
* @see geofence_get_longitude()
* @see geofence_get_radius()
* @return 0 on success, otherwise a negative error value
* @retval #GEOFENCE_MANAGER_ERROR_NONE Successful
* @retval #GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER Illegal argument
+ * @retval #GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED Not supported
* @see geofence_get_type()
* @see geofence_create_bluetooth()
* @see geofence_create_wifi()
* @return 0 on success, otherwise a negative error value
* @retval #GEOFENCE_MANAGER_ERROR_NONE Successful
* @retval #GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER Illegal argument
+ * @retval #GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED Not supported
* @see geofence_get_type()
* @see geofence_create_bluetooth()
* @see geofence_create_wifi()
* @retval #GEOFENCE_MANAGER_ERROR_NONE Successful
* @retval #GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER Illegal argument
* @retval #GEOFENCE_MANAGER_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
+ * @retval #GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED Not supported
* @retval #GEOFENCE_MANAGER_ERROR_GEOFENCE_ACCESS_DENIED Access to specified geofence is denied
* @see geofence_status_destroy()
* @see geofence_manager_start()
* @return 0 on success, otherwise a negative error value
* @retval #GEOFENCE_MANAGER_ERROR_NONE Successful
* @retval #GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER Illegal argument
+ * @retval #GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED Not supported
* @see geofence_status_create()
* @see geofence_status_get_state()
* @see geofence_status_get_duration()
* @return 0 on success, otherwise a negative error value
* @retval #GEOFENCE_MANAGER_ERROR_NONE Successful
* @retval #GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER Illegal argument
+ * @retval #GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED Not supported
* @see geofence_status_get_duration()
*/
int geofence_status_get_state(geofence_status_h status, geofence_state_e *state);
* @return 0 on success, otherwise a negative error value
* @retval #GEOFENCE_MANAGER_ERROR_NONE Successful
* @retval #GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER Illegal argument
+ * @retval #GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED Not supported
* @see geofence_status_get_state()
*/
int geofence_status_get_duration(geofence_status_h status, int *seconds);
/**
+ * @brief Enumeration for the state of proximity.
+ * @since_tizen 3.0
+ */
+typedef enum {
+ GEOFENCE_PROXIMITY_STATE_UNCERTAIN = 0, /**< Uncertain state of proximity */
+ GEOFENCE_PROXIMITY_STATE_FAR, /**< Far state of proximity */
+ GEOFENCE_PROXIMITY_STATE_NEAR, /**< Near state of proximity */
+ GEOFENCE_PROXIMITY_STATE_IMMEDIATE, /**< Immediate state of proximity */
+} geofence_proximity_state_e;
+
+/**
+ * @brief Enumeration for the provider of proximity.
+ * @since_tizen 3.0
+ */
+typedef enum {
+ GEOFENCE_PROXIMITY_PROVIDER_LOCATION = 0, /**< Proximity is specified by geospatial coordinate */
+ GEOFENCE_PROXIMITY_PROVIDER_WIFI, /**< Proximity is specified by Wi-Fi access point */
+ GEOFENCE_PROXIMITY_PROVIDER_BLUETOOTH, /**< Proximity is specified by Bluetooth device */
+ GEOFENCE_PROXIMITY_PROVIDER_BLE, /**< Proximity is specified by Bluetooth low energy device */
+ GEOFENCE_PROXIMITY_PROVIDER_SENSOR, /**< Proximity is specified by Sensor */
+} geofence_proximity_provider_e;
+
+/**
* @brief Enumeration for geofence type.
* @since_tizen 2.4
*/
typedef enum {
GEOFENCE_TYPE_GEOPOINT = 1, /**< Geofence is specified by geospatial coordinate */
GEOFENCE_TYPE_WIFI, /**< Geofence is specified by Wi-Fi access point */
- GEOFENCE_TYPE_BT, /**< Geofence is specified by Blutetooth device */
+ GEOFENCE_TYPE_BT, /**< Geofence is specified by Bluetooth device */
} geofence_type_e;
/**
#sbs-git:slp/api/geofence-manager capi-geofence-manager 0.1.0 d1ee09a32e8bc0e9ed48ece37c641a7393c086c5
Name: capi-geofence-manager
Summary: A Geofence Manager library in Tizen Native API
-Version: 0.3.1
+Version: 0.3.2
Release: 1
Group: Location/Libraries
License: Apache-2.0
((geofence_event_cb) handle->user_event_cb)(place_id, geofence_id, error, action, handle->user_data);
}
+static void __cb_fence_proximity(GObject *self, guint geofence_id, geofence_proximity_state_e state, geofence_proximity_provider_e provider, gpointer userdata)
+{
+ GEOFENCE_LOGD("geofence_id: %d, proximity_state: %d, proximity_provider: %d", geofence_id, state, provider);
+ geofence_manager_s *handle = (geofence_manager_s *) userdata;
+ GList *fence_list = g_list_first(tracking_list);
+
+ while (fence_list) {
+ if (GPOINTER_TO_INT(fence_list->data) == geofence_id) {
+ if (handle->user_proximity_cb) {
+ ((geofence_proximity_state_changed_cb) handle->user_proximity_cb)(geofence_id, state, provider, handle->user_data);
+ break;
+ }
+ }
+ fence_list = g_list_next(fence_list);
+ }
+}
+
static int __set_callback(geofence_manager_h manager, void *callback, void *user_data)
{
GEOFENCE_LOGD("__set_callback");
return GEOFENCE_MANAGER_ERROR_NONE;
}
+static int __set_proximity_callback(geofence_manager_h manager, void *callback, void *user_data)
+{
+ GEOFENCE_LOGD("__set_proximity_callback");
+ GEOFENCE_NULL_ARG_CHECK(manager);
+ GEOFENCE_NULL_ARG_CHECK(callback);
+
+ geofence_manager_s *handle = (geofence_manager_s *) manager;
+ handle->user_proximity_cb = callback;
+ handle->user_data = user_data;
+
+ return GEOFENCE_MANAGER_ERROR_NONE;
+}
+
+static int __unset_proximity_callback(geofence_manager_h manager)
+{
+ GEOFENCE_LOGD("__unset_proximity_callback");
+ GEOFENCE_NULL_ARG_CHECK(manager);
+
+ geofence_manager_s *handle = (geofence_manager_s *) manager;
+ handle->user_proximity_cb = NULL;
+ handle->user_data = NULL;
+
+ return GEOFENCE_MANAGER_ERROR_NONE;
+}
+
static bool __is_fence_started(int fence_id)
{
GEOFENCE_LOGD("__is_fence_started");
handle->sig_id[_GEOFENCE_SIGNAL_ZONE_OUT] = g_signal_connect(handle->object, "zone-out", G_CALLBACK(__cb_zone_out), handle);
if (!handle->sig_id[_GEOFENCE_SIGNAL_EVENT])
handle->sig_id[_GEOFENCE_SIGNAL_EVENT] = g_signal_connect(handle->object, "geofence-event", G_CALLBACK(__cb_fence_evt), handle);
+ if (!handle->sig_id[_GEOFENCE_SIGNAL_PROXIMITY])
+ handle->sig_id[_GEOFENCE_SIGNAL_PROXIMITY] = g_signal_connect(handle->object, "geofence-proximity", G_CALLBACK(__cb_fence_proximity), handle);
ret = geofence_ielement_create(GEOFENCE_IELEMENT(handle->object));
if (ret != GEOFENCE_MANAGER_ERROR_NONE) {
GEOFENCE_LOGD("geofence_manager_remove_geofence");
if (__is_geofence_feature_enabled() == false)
- return GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED;
+ return GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED;
GEOFENCE_NULL_ARG_CHECK(manager);
GEOFENCE_CHECK_CONDITION(geofence_id > 0, GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER, "GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER");
GEOFENCE_LOGD("geofence_manager_remove_place");
if (__is_geofence_feature_enabled() == false)
- return GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED;
+ return GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED;
GEOFENCE_NULL_ARG_CHECK(manager);
GEOFENCE_CHECK_CONDITION(place_id > 0, GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER, "GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER");
GEOFENCE_LOGD("geofence_manager_remove_place");
if (__is_geofence_feature_enabled() == false)
- return GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED;
+ return GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED;
GEOFENCE_NULL_ARG_CHECK(manager);
GEOFENCE_NULL_ARG_CHECK(place_name);
GEOFENCE_LOGD("geofence_manager_set_geofence_state_changed_cb");
if (__is_geofence_feature_enabled() == false)
- return GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED;
+ return GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED;
GEOFENCE_NULL_ARG_CHECK(manager);
return __set_callback(manager, callback, user_data);
}
+EXPORT_API int geofence_manager_set_geofence_proximity_state_changed_cb(geofence_manager_h manager, geofence_proximity_state_changed_cb callback, void *user_data)
+{
+ GEOFENCE_LOGD("geofence_manager_set_geofence_proximity_state_changed_cb");
+
+ if (__is_geofence_feature_enabled() == false)
+ return GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED;
+
+ GEOFENCE_NULL_ARG_CHECK(manager);
+
+ return __set_proximity_callback(manager, callback, user_data);
+}
+
EXPORT_API int geofence_manager_set_geofence_event_cb(geofence_manager_h manager, geofence_event_cb callback, void *user_data)
{
GEOFENCE_LOGD("geofence_manager_set_geofence_event_cb");
if (__is_geofence_feature_enabled() == false)
- return GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED;
+ return GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED;
GEOFENCE_NULL_ARG_CHECK(manager);
GEOFENCE_LOGD("geofence_manager_unset_geofence_state_changed_cb");
if (__is_geofence_feature_enabled() == false)
- return GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED;
+ return GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED;
GEOFENCE_NULL_ARG_CHECK(manager);
return __unset_callback(manager);
}
+EXPORT_API int geofence_manager_unset_geofence_proximity_state_changed_cb(geofence_manager_h manager)
+{
+ GEOFENCE_LOGD("geofence_manager_unset_geofence_proximity_state_changed_cb");
+
+ if (__is_geofence_feature_enabled() == false)
+ return GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED;
+
+ GEOFENCE_NULL_ARG_CHECK(manager);
+
+ return __unset_proximity_callback(manager);
+}
+
EXPORT_API int geofence_manager_unset_geofence_event_cb(geofence_manager_h manager)
{
GEOFENCE_LOGD("geofence_manager_unset_geofence_event_cb");
if (__is_geofence_feature_enabled() == false)
- return GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED;
+ return GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED;
GEOFENCE_NULL_ARG_CHECK(manager);
GEOFENCE_LOGD(">>> Start");
if (__is_geofence_feature_enabled() == false)
- return GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED;
+ return GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED;
GEOFENCE_NULL_ARG_CHECK(manager);
GEOFENCE_NULL_ARG_CHECK(callback);
GEOFENCE_LOGD(">>> Start");
if (__is_geofence_feature_enabled() == false)
- return GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED;
+ return GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED;
GEOFENCE_NULL_ARG_CHECK(manager);
GEOFENCE_NULL_ARG_CHECK(callback);
GEOFENCE_LOGD(">>> Start");
if (__is_geofence_feature_enabled() == false)
- return GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED;
+ return GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED;
GEOFENCE_NULL_ARG_CHECK(manager);
GEOFENCE_NULL_ARG_CHECK(callback);
GEOFENCE_LOGD("geofence_manager_create_geopoint");
if (__is_geofence_feature_enabled() == false)
- return GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED;
+ return GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED;
GEOFENCE_NULL_ARG_CHECK(fence);
GEOFENCE_NULL_ARG_CHECK(address);
GEOFENCE_LOGD("geofence_create_bluetooth");
if (__is_geofence_feature_enabled() == false)
- return GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED;
+ return GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED;
GEOFENCE_NULL_ARG_CHECK(fence);
GEOFENCE_NULL_ARG_CHECK(bssid);
GEOFENCE_LOGD("geofence_create_wifi");
if (__is_geofence_feature_enabled() == false)
- return GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED;
+ return GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED;
GEOFENCE_NULL_ARG_CHECK(fence);
GEOFENCE_NULL_ARG_CHECK(bssid);
EXPORT_API int geofence_destroy(geofence_h fence)
{
if (__is_geofence_feature_enabled() == false)
- return GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED;
+ return GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED;
GEOFENCE_NULL_ARG_CHECK(fence);
geofence_parameter_free((geofence_s *)fence);
EXPORT_API int geofence_get_type(geofence_h fence, geofence_type_e *type)
{
if (__is_geofence_feature_enabled() == false)
- return GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED;
+ return GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED;
GEOFENCE_NULL_ARG_CHECK(fence);
GEOFENCE_NULL_ARG_CHECK(type);
EXPORT_API int geofence_get_place_id(geofence_h fence, int *place_id)
{
if (__is_geofence_feature_enabled() == false)
- return GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED;
+ return GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED;
GEOFENCE_NULL_ARG_CHECK(fence);
GEOFENCE_NULL_ARG_CHECK(place_id);
EXPORT_API int geofence_get_latitude(geofence_h fence, double *latitude)
{
if (__is_geofence_feature_enabled() == false)
- return GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED;
+ return GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED;
GEOFENCE_NULL_ARG_CHECK(fence);
GEOFENCE_NULL_ARG_CHECK(latitude);
EXPORT_API int geofence_get_longitude(geofence_h fence, double *longitude)
{
if (__is_geofence_feature_enabled() == false)
- return GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED;
+ return GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED;
GEOFENCE_NULL_ARG_CHECK(fence);
GEOFENCE_NULL_ARG_CHECK(longitude);
EXPORT_API int geofence_get_radius(geofence_h fence, int *radius)
{
if (__is_geofence_feature_enabled() == false)
- return GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED;
+ return GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED;
GEOFENCE_NULL_ARG_CHECK(fence);
GEOFENCE_NULL_ARG_CHECK(radius);
EXPORT_API int geofence_get_address(geofence_h fence, char **address)
{
if (__is_geofence_feature_enabled() == false)
- return GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED;
+ return GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED;
GEOFENCE_NULL_ARG_CHECK(fence);
GEOFENCE_NULL_ARG_CHECK(address);
EXPORT_API int geofence_get_bssid(geofence_h fence, char **bssid)
{
if (__is_geofence_feature_enabled() == false)
- return GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED;
+ return GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED;
GEOFENCE_NULL_ARG_CHECK(fence);
GEOFENCE_NULL_ARG_CHECK(bssid);
EXPORT_API int geofence_get_ssid(geofence_h fence, char **ssid)
{
if (__is_geofence_feature_enabled() == false)
- return GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED;
+ return GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED;
GEOFENCE_NULL_ARG_CHECK(fence);
GEOFENCE_NULL_ARG_CHECK(ssid);
EXPORT_API int geofence_status_create(int geofence_id, geofence_status_h *status)
{
if (__is_geofence_feature_enabled() == false)
- return GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED;
+ return GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED;
GEOFENCE_NULL_ARG_CHECK(status);
GEOFENCE_CHECK_CONDITION(geofence_id > 0, GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER, "GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER");
EXPORT_API int geofence_status_destroy(geofence_status_h status)
{
if (__is_geofence_feature_enabled() == false)
- return GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED;
+ return GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED;
GEOFENCE_NULL_ARG_CHECK(status);
EXPORT_API int geofence_status_get_state(geofence_status_h status, geofence_state_e *state)
{
if (__is_geofence_feature_enabled() == false)
- return GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED;
+ return GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED;
GEOFENCE_NULL_ARG_CHECK(status);
GEOFENCE_NULL_ARG_CHECK(state);
EXPORT_API int geofence_status_get_duration(geofence_status_h status, int *seconds)
{
if (__is_geofence_feature_enabled() == false)
- return GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED;
+ return GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED;
GEOFENCE_NULL_ARG_CHECK(status);
GEOFENCE_NULL_ARG_CHECK(seconds);
enum {
ZONE_IN,
ZONE_OUT,
+ GEOFENCE_PROXIMITY,
GEOFENCE_EVENT,
LAST_SIGNAL
};
}
}
-void geofence_signaling(GeofenceObject *obj,
- guint32 signals[LAST_SIGNAL],
- guint geofence_id,
- guint state)
+void geofence_signaling(GeofenceObject *obj, guint32 signals[LAST_SIGNAL], guint geofence_id, guint state)
{
GEOFENCE_LOGD("geofence_signaling");
}
}
+void geofence_proximity_signaling(GeofenceObject *obj, guint32 signals[LAST_SIGNAL], guint geofence_id, guint proximity_state, guint provider)
+{
+ GEOFENCE_LOGD("geofence_proxmity_signaling");
+
+ g_return_if_fail(obj);
+ g_return_if_fail(signals);
+ g_return_if_fail(proximity_state);
+
+ g_signal_emit(obj, signals[GEOFENCE_PROXIMITY], 0, geofence_id, proximity_state, provider, NULL);
+}
+
void geofence_event_signaling(GeofenceObject *obj,
guint32 signals[LAST_SIGNAL],
guint place_id,
geofence_signaling(userdata, signals, geofence_id, state);
}
+static void _proximity_cb(int geofence_id, int proximity_state, int provider, gpointer userdata)
+{
+ GEOFENCE_LOGD("_proximity_cb");
+ g_return_if_fail(userdata);
+ GeofenceInternalPrivate *priv = GET_PRIVATE(userdata);
+ g_return_if_fail(priv);
+ GEOFENCE_LOGD("geofence id [%d] proximity_state [%d]", geofence_id, proximity_state);
+ geofence_proximity_signaling(userdata, signals, geofence_id, proximity_state, provider);
+}
+
static void _geofence_event_cb(int place_id, int geofence_id, int error, int state, gpointer userdata)
{
GEOFENCE_LOGD("_geofence_event_cb");
int ret = GEOFENCE_MANAGER_ERROR_NONE;
if (gIsCreated == 0) {
- ret = priv->mod->ops.create(priv->mod->handler, _state_cb, _geofence_event_cb, self);
+ ret = priv->mod->ops.create(priv->mod->handler, _state_cb, _proximity_cb, _geofence_event_cb, self);
if (ret != GEOFENCE_MANAGER_ERROR_NONE) {
GEOFENCE_LOGE("Fail to create. Error[%d]", ret);
}
G_TYPE_NONE, 1,
G_TYPE_UINT);
+ signals[GEOFENCE_PROXIMITY] = g_signal_new("geofence-proximity",
+ G_TYPE_FROM_CLASS(klass),
+ G_SIGNAL_RUN_FIRST |
+ G_SIGNAL_NO_RECURSE,
+ G_STRUCT_OFFSET(GeofenceInternalClass, geofence_event),
+ NULL, NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_NONE, 3,
+ G_TYPE_UINT,
+ G_TYPE_UINT,
+ G_TYPE_UINT);
+
signals[GEOFENCE_EVENT] = g_signal_new("geofence-event",
G_TYPE_FROM_CLASS(klass),
G_SIGNAL_RUN_FIRST |
void (* zone_in)(guint geofence_id);
void (* zone_out)(guint geofence_id);
+ void (* geofence_proximity)(guint geofence_id, guint proximity_state, guint provider);
void (* geofence_event)(guint place_id, guint geofence_id, guint error, guint state);
};
typedef enum {
_GEOFENCE_SIGNAL_ZONE_IN,
_GEOFENCE_SIGNAL_ZONE_OUT,
+ _GEOFENCE_SIGNAL_PROXIMITY,
_GEOFENCE_SIGNAL_EVENT,
_GEOFENCE_SIGNAL_NUM
} _geofence_signal_e;
typedef struct _geofence_manager_s {
GeofenceObject *object;
const void *user_cb;
+ const void *user_proximity_cb;
const void *user_event_cb;
void *user_data;
gulong sig_id[_GEOFENCE_SIGNAL_NUM];
*/
typedef void (*GeofenceModCB)(int fence_id, int state, gpointer userdata);
+typedef void (*GeofenceModProximityCB)(int fence_id, int proximity_state, int provider, gpointer userdata);
+
typedef void (*GeofenceModEventCB)(int place_id, int fence_id, int error, int state, gpointer userdata);
/**
* @brief This represents APIs declared in a Geofence plug-in for Geofence modules.
*/
typedef struct {
- int (*create)(void *handle, GeofenceModCB geofence_cb, GeofenceModEventCB geofence_event_cb, void *userdata);
+ int (*create)(void *handle, GeofenceModCB geofence_cb, GeofenceModProximityCB geofence_proximity_cb, GeofenceModEventCB geofence_event_cb, void *userdata);
int (*destroy)(void *handle);
int (*enable_service)(void *handle, int fence_id, bool enable);
int (*start_geofence)(void *handle, int fence_id);