Fix svace issue 70/114970/1
authorkj7.sung <kj7.sung@samsung.com>
Thu, 16 Feb 2017 03:13:33 +0000 (12:13 +0900)
committerkj7.sung <kj7.sung@samsung.com>
Thu, 16 Feb 2017 03:13:33 +0000 (12:13 +0900)
Change-Id: Ie888143e9b77aaa184a04d4b27b145a70265ff7b
Signed-off-by: kj7.sung <kj7.sung@samsung.com>
src/locations.c
test/location_test.c

index f0eb682e335792e8ada5861e4cb5039770ca2513..b8e1a8a323818a8e74f604acfa676929701f1dda 100755 (executable)
@@ -69,12 +69,11 @@ static LocationMethod __convert_LocationMethod(location_method_e method)
 
 static void __cb_service_updated(GObject *self, guint type, gpointer data, gpointer velocity, gpointer accuracy, gpointer userdata)
 {
-       LOCATIONS_LOGD("Callback function has been invoked. ");
        location_manager_s *handle = (location_manager_s *) userdata;
 
        if (type == SATELLITE_UPDATED && handle->user_cb[_LOCATIONS_EVENT_TYPE_SATELLITE]) {
                LocationSatellite *sat = (LocationSatellite *)data;
-               LOCATIONS_LOGD("Current satellite information: timestamp : %d, number of active : %d, number of inview : %d",
+               LOCATIONS_LOGD("callback invoked[TYPE_SATELLITE] timestamp : %d, number of active : %d, number of inview : %d",
                                                sat->timestamp, sat->num_of_sat_used, sat->num_of_sat_inview);
                ((gps_status_satellite_updated_cb) handle->user_cb[_LOCATIONS_EVENT_TYPE_SATELLITE])(sat->num_of_sat_used, sat->num_of_sat_inview,
                                                                                        sat->timestamp, handle->user_data[_LOCATIONS_EVENT_TYPE_SATELLITE]);
@@ -84,12 +83,14 @@ static void __cb_service_updated(GObject *self, guint type, gpointer data, gpoin
                LocationAccuracy *acc = (LocationAccuracy *) accuracy;
                ((location_changed_cb) handle->user_cb[_LOCATIONS_EVENT_TYPE_DISTANCE])(pos->latitude, pos->longitude, pos->altitude,
                                                                vel->speed, vel->direction, acc->horizontal_accuracy, pos->timestamp, handle->user_data[_LOCATIONS_EVENT_TYPE_DISTANCE]);
+               LOCATIONS_LOGD("callback invoked[TYPE_DISTANCE] timestamp : %d", pos->timestamp);
        } else {
 
                if (handle->user_cb[_LOCATIONS_EVENT_TYPE_POSITION] && (type & POSITION_UPDATED) != 0) {
                        LocationPosition *pos = (LocationPosition *) data;
                        ((location_position_updated_cb) handle->user_cb[_LOCATIONS_EVENT_TYPE_POSITION])(pos->latitude, pos->longitude, pos->altitude,
                                                                                        pos->timestamp, handle->user_data[_LOCATIONS_EVENT_TYPE_POSITION]);
+                       LOCATIONS_LOGD("callback invoked[TYPE_POSITION] timestamp : %d", pos->timestamp);
                }
 
                if (handle->user_cb[_LOCATIONS_EVENT_TYPE_VELOCITY] && (type & VELOCITY_UPDATED) != 0) {
@@ -104,6 +105,7 @@ static void __cb_service_updated(GObject *self, guint type, gpointer data, gpoin
                        LocationAccuracy *acc = (LocationAccuracy *) accuracy;
                        ((location_changed_cb) handle->user_cb[_LOCATIONS_EVENT_TYPE_POS_VEL])(pos->latitude, pos->longitude, pos->altitude,
                                                                        vel->speed, vel->direction, acc->horizontal_accuracy, pos->timestamp, handle->user_data[_LOCATIONS_EVENT_TYPE_POS_VEL]);
+                       LOCATIONS_LOGD("callback invoked[TYPE_POS_VEL] timestamp : %d", pos->timestamp);
                }
        }
 }
@@ -134,7 +136,7 @@ static void __cb_batch_updated(GObject *self, guint num_of_location, gpointer us
 
 static void __cb_service_enabled(GObject *self, guint status, gpointer userdata)
 {
-       LOCATIONS_LOGD("Invoked. status = %d", status);
+       LOCATIONS_LOGD("Invoked[service_enabled]. status = %d", status);
        location_manager_s *handle = (location_manager_s *) userdata;
        if (handle->user_cb[_LOCATIONS_EVENT_TYPE_SERVICE_STATE]) {
                ((location_service_state_changed_cb)
@@ -144,7 +146,7 @@ static void __cb_service_enabled(GObject *self, guint status, gpointer userdata)
 
 static void __cb_service_disabled(GObject *self, guint status, gpointer userdata)
 {
-       LOCATIONS_LOGD("Invoked. status = %d", status);
+       LOCATIONS_LOGD("Invoked[service_disabled]. status = %d", status);
        location_manager_s *handle = (location_manager_s *) userdata;
        if (handle->user_cb[_LOCATIONS_EVENT_TYPE_SERVICE_STATE]) {
                ((location_service_state_changed_cb)
index 75d69c7dcbd2550b87dfaf174b019bd2d6b46929..8bc6ad7314183e5ed1c376bd512c972aee79fec4 100755 (executable)
@@ -520,6 +520,9 @@ static int location_test()
                fprintf(stderr, "\n     Input position interval ==> ");
                ret = scanf("%d", &interval);
 
+               if (interval > 1000 && interval < -1000)
+                       interval = 1;
+
                int method = menu - 11;
                ret = location_manager_create(method, &manager);
                fprintf(stderr, "location_manager_create (method: %d): %d\n", method, ret);