/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Callback to be invoked on detection of user and device location.
+ * Callback to be invoked once for each user/device in location callback
+ * period set by ua_monitor_set_location_period()
* @since_tizen 6.5
*
* @remarks The @a monitor handle should not be released.
* @param[in] location The location handle.
* @param[in] user_data The user data passed in ua_monitor_start_location_detection()
*
+ * @see ua_monitor_set_location_period()
* @see ua_monitor_start_location_detection()
*/
typedef void (*ua_location_detected_cb)(
ua_location_h location,
void *user_data);
-
/**
* @}
*/
* @retval #UA_ERROR_NOT_SUPPORTED Not Supported
*
* @see ua_location_detected_cb()
+ * @see ua_monitor_set_location_period()
* @see ua_monitor_stop_location_detection()
*/
int ua_monitor_start_location_detection(
/**
* @internal
* @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Sets the location period.
+ * @brief Sets the location callback period in milli-seconds.
+ * If location period is not set, it will be automatically
+ * set to #UA_LOCATION_PERIOD_DEFAULT
* @since_tizen 6.5
*
* @param[in] monitor handle
* @post
*
*/
- ua_mac_type_e _ua_sensor_to_dev_type(ua_sensor_type_e type);
+ua_mac_type_e _ua_sensor_to_dev_type(ua_sensor_type_e type);
/**
* @ingroup CAPI_NETWORK_UA_MODULE
*/
void _ua_clear_sensor_list(void);
+/**
+ * @brief Clears location handle list.
+ * @since_tizen 6.5
+ *
+ * @exception
+ * @pre
+ * @post
+ */
+void _ua_clear_location_list(void);
+
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Updates location info.
_ua_clear_user_list();
_ua_clear_device_list();
_ua_clear_sensor_list();
+ _ua_clear_location_list();
}
/* LCOV_EXCL_START */
/* Start timer */
if (0 == location_cb_timer) {
- UA_INFO("Location detection started, start timer of %d seconds",
- (monitor->location_period)/1000);
- location_cb_timer = g_timeout_add_seconds(
- (monitor->location_period)/1000,
+ UA_INFO("Location detection started, start timer of "
+ "%d milli-seconds", (monitor->location_period));
+ location_cb_timer = g_timeout_add(
+ monitor->location_period,
_ua_monitor_send_location_cb, service_handle);
}
monitor->location_detection_started = FALSE;
monitor->location_detected_bitmask = 0;
- if (location_cb_timer)
+ if (0 != location_cb_timer) {
g_source_remove(location_cb_timer);
+ location_cb_timer = 0;
+ }
FUNC_EXIT;
return UA_ERROR_NONE;
return UA_ERROR_NONE;
}
-
int ua_monitor_set_brightness_threshold(ua_monitor_h handle,
int presence_threshold, int absence_threshold)
{
FUNC_EXIT;
return TRUE;
}
+
+static void __ua_free_ua_location_info_s(gpointer data)
+{
+ FUNC_ENTRY;
+ ua_location_info_s *location_info = (ua_location_info_s*)data;
+
+ if (!location_info)
+ return;
+ g_free(location_info);
+ FUNC_EXIT;
+}
+
+void _ua_clear_location_list(void)
+{
+ g_slist_free_full(ua_location_list, __ua_free_ua_location_info_s);
+ ua_location_list = NULL;
+}
check_if(NULL == g_ua_mon_h);
- ret = ua_monitor_set_location_period(g_ua_mon_h, 1000);
+ ret = ua_monitor_set_location_period(g_ua_mon_h, 500);
msg(" - ua_monitor_set_location_period() ret: [0x%X] [%s]",
ret, uat_get_error_str(ret));