sync : svace, robustness test 61/100061/1 accepted/tizen_3.0.m2_mobile accepted/tizen_3.0.m2_wearable tizen_3.0.m2 accepted/tizen/3.0.m2/mobile/20170104.125139 accepted/tizen/3.0.m2/wearable/20170104.125743 accepted/tizen/3.0/common/20161128.091410 accepted/tizen/3.0/ivi/20161128.083311 accepted/tizen/3.0/mobile/20161128.083125 accepted/tizen/3.0/wearable/20161128.083237 submit/tizen_3.0.m2/20170104.093750 submit/tizen_3.0/20161125.042105
authorkj7.sung <kj7.sung@samsung.com>
Fri, 25 Nov 2016 04:28:47 +0000 (13:28 +0900)
committerkj7.sung <kj7.sung@samsung.com>
Fri, 25 Nov 2016 04:28:47 +0000 (13:28 +0900)
Change-Id: I69e552072cdd014074fe8a12988708c8ba23428c
Signed-off-by: kj7.sung <kj7.sung@samsung.com>
lbs-server/src/server.c
module/nps_module.c
packaging/lbs-server.changes
packaging/lbs-server.spec

index 54f349c4bb110d135651c55e7df2019d90effcc3..d09fe83303f4bd6306e9b0b022ebf3615311747c 100644 (file)
@@ -466,18 +466,20 @@ int get_nmea_from_server(int *timestamp, char **nmea_data)
        return TRUE;
 }
 
-static void _gps_plugin_handler_init(gps_server_t *server, char *module_name)
+static gboolean _gps_plugin_handler_init(gps_server_t *server, char *module_name)
 {
        if (module_name == NULL) {
                LOG_GPS(DBG_ERR, "Fail : module_name is NULL");
-               return;
+               return FALSE;
        }
 
        server->gps_plugin.handle = NULL;
        server->gps_plugin.name = (char *)malloc(strlen(module_name) + 1);
-       g_return_if_fail(server->gps_plugin.name);
+       g_return_val_if_fail(server->gps_plugin.name, FALSE);
 
        g_strlcpy(server->gps_plugin.name, module_name, strlen(module_name) + 1);
+
+       return TRUE;
 }
 
 static void _gps_plugin_handler_deinit(gps_server_t *server)
@@ -1209,8 +1211,13 @@ int initialize_server(int argc, char **argv)
        server = _initialize_gps_data();
        if (server == NULL)
                return -1;
+
        check_plugin_module(module_name);
-       _gps_plugin_handler_init(server, module_name);
+       if (!_gps_plugin_handler_init(server, module_name)) {
+               LOG_GPS(DBG_ERR, "Fail to init plugin handle");
+               return -1;
+       }
+
        _gps_get_nmea_replay_mode(server);
        _gps_notify_params(server);
 
index 145357b63be2560fecd9993d52a9ab3c6079370a..7a35f42fb040a56b515edfc0c8e58ff475021b02 100644 (file)
@@ -240,34 +240,43 @@ static int get_last_position(gpointer handle, LocationPosition **position, Locat
                        snprintf(location, sizeof(location), "%s", str);
                        free(str);
 
+                       index = 0;
                        last_location[index] = (char *)strtok_r(location, ";", &last);
-                       while (last_location[index++] != NULL) {
-                               if (index == MAX_NPS_LOC_ITEM)
+                       while (last_location[index] != NULL) {
+                               switch (index) {
+                               case 0:
+                                       latitude = strtod(last_location[index], NULL);
+                                       break;
+                               case 1:
+                                       longitude = strtod(last_location[index], NULL);
+                                       break;
+                               case 2:
+                                       altitude = strtod(last_location[index], NULL);
+                                       break;
+                               case 3:
+                                       speed = strtod(last_location[index], NULL);
+                                       break;
+                               case 4:
+                                       direction = strtod(last_location[index], NULL);
+                                       break;
+                               case 5:
+                                       hor_accuracy = strtod(last_location[index], NULL);
+                                       break;
+                               default:
                                        break;
+                               }
+                               if (++index == MAX_NPS_LOC_ITEM) break;
                                last_location[index] = (char *)strtok_r(NULL, ";", &last);
                        }
-
-                       if (index != MAX_NPS_LOC_ITEM) {
-                               MOD_NPS_LOGD("Error item index");
-                               return LOCATION_ERROR_NOT_AVAILABLE;
-                       }
-                       index = 0;
-                       latitude = strtod(last_location[index++], NULL);
-                       longitude = strtod(last_location[index++], NULL);
-                       altitude = strtod(last_location[index++], NULL);
-                       speed = strtod(last_location[index++], NULL);
-                       direction = strtod(last_location[index++], NULL);
-                       hor_accuracy = strtod(last_location[index], NULL);
                }
        }
 
-       level = LOCATION_ACCURACY_LEVEL_STREET;
-
        if (timestamp)
                status = LOCATION_STATUS_3D_FIX;
        else
                return LOCATION_ERROR_NOT_AVAILABLE;
 
+       level = LOCATION_ACCURACY_LEVEL_STREET;
        *position = location_position_new((guint) timestamp, latitude, longitude, altitude, status);
        *velocity = location_velocity_new((guint) timestamp, speed, direction, 0.0);
        *accuracy = location_accuracy_new(level, hor_accuracy, -1.0);
index b93d284ac562c89eade4694c9825cacd65588aee..91d2a3514eadf93f4a17971fe0ae3992f7907fb0 100644 (file)
@@ -1,3 +1,9 @@
+[Version]      lbs-server_1.0.10
+[Date]         21 Nov 2016
+[Changes]      Fix to robustness test
+[Developer]    Kyoungjun Sung <kj7.sung@samsung.com>
+
+================================================================================
 [Version]      lbs-server_1.0.9
 [Date]         28 Oct 2016
 [Changes]      Dynamic interval table for multi handle
index 88da610f0c468b2126f0746514c0de5956bd2fff..bc9e1bf8704251ba3790288b39848e1cacb2a0c5 100644 (file)
@@ -1,6 +1,6 @@
 Name:    lbs-server
 Summary: LBS Server for Tizen
-Version: 1.0.9
+Version: 1.0.10
 Release: 1
 Group:   Location/Service
 License: Apache-2.0