EXPORT_API int location_manager_clear_mock_location(location_manager_h manager)
{
LOCATIONS_NOT_SUPPORTED_CHECK(__is_location_supported());
+ LOCATIONS_NULL_ARG_CHECK(manager);
+
location_manager_s *handle = (location_manager_s *) manager;
int ret = LOCATION_ERROR_NONE;
int enabled;
ret = location_is_enabled_method(LOCATION_METHOD_MOCK, &enabled);
if (ret == LOCATIONS_ERROR_NONE) {
if (enabled == 0) {
- return __convert_error_code(LOCATIONS_ERROR_SETTING_OFF);
+ return __convert_error_code(LOCATION_ERROR_SETTING_OFF);
}
} else {
return __convert_error_code(ret);
}
}
-static void __setting_cb(location_method_e method, bool enable, void *user_data)
+static void _setting_cb(location_method_e method, bool enable, void *user_data)
{
fprintf(stderr, "method[%d], enable[%d]\n", method, enable);
}
+void _satellite_updated_cb(int num_of_active, int num_of_inview, time_t timestamp, void *user_data)
+{
+ fprintf(stderr, "-------------------------- satellite updated --------------------------\n");
+ fprintf(stderr, "num_of_active[%d] num_of_inview[%d] timestamp[%ld]\n", num_of_active, num_of_inview, timestamp);
+
+ test_timer = g_timeout_add_seconds(1, wait_test, NULL);
+}
+
static void print_location_status()
{
fprintf(stderr, "==== LOCATION Setting state =====\n");
int ret = 0;
fprintf(stderr, "==== LOCATION Setting changed =====\n");
- location_manager_set_setting_changed_cb(LOCATIONS_METHOD_HYBRID, __setting_cb, NULL);
+ location_manager_set_setting_changed_cb(LOCATIONS_METHOD_HYBRID, _setting_cb, NULL);
fprintf(stderr, "method[%d], enable[%d]\n", method, enable);
ret = location_manager_enable_method(method, enable);
int method = menu - 1;
ret = location_manager_create(method, &manager);
fprintf(stderr, "location_manager_create (method: %d): %d\n", method, ret);
+
ret = location_manager_start(manager);
fprintf(stderr, "start: %d\n", ret);
+
+ if (method == LOCATIONS_METHOD_GPS) {
+ ret = gps_status_set_satellite_updated_cb(manager, _satellite_updated_cb, 1, &manager);
+ fprintf(stderr, "gps_status_set_satellite_updated_cb: %d\n", ret);
+ }
break;
}
case 4:
ret = location_manager_unset_position_updated_cb(manager);
fprintf(stderr, "unset_position_updated_cb: %d\n", ret);
+ ret = gps_status_unset_satellite_updated_cb(manager);
+ fprintf(stderr, "gps_status_unset_satellite_updated_cb: %d\n", ret);
+
ret = location_manager_destroy(manager);
fprintf(stderr, "destroy: %d\n", ret);
manager = NULL;