Fused disabled when sensor is unavailable 66/139666/1 accepted/tizen/unified/20170720.164924 submit/tizen/20170720.053555
authorkj7.sung <kj7.sung@samsung.com>
Thu, 20 Jul 2017 05:03:12 +0000 (14:03 +0900)
committerkj7.sung <kj7.sung@samsung.com>
Thu, 20 Jul 2017 05:03:12 +0000 (14:03 +0900)
Change-Id: I487d078796b1eabf3ec14064501797c0d0184d34
Signed-off-by: kj7.sung <kj7.sung@samsung.com>
lbs-server/src/fused.c
lbs-server/src/lbs_server.c
module/nps_module.c
packaging/lbs-server.spec

index c08ec02326ab98dbfc3090e24c339b7b5b030d03..fe7fc2662d75e78509c19f97860898c5a3141bae 100644 (file)
@@ -49,6 +49,7 @@ typedef union {
 typedef struct {
        _fl_status                      status;
        gboolean                        enabled;
+       gboolean                        is_active_sensor[SENSOR_SOURCE_NUM];
        fl_location                     last_location;
        _fl_sensor                      sensor[SENSOR_SOURCE_NUM];
        fl_sensory_flags        attached_sensors;
index c36b98c985c2cf14f5bf6b6d3734b94cbcaeeee9..9ad241f7a5deb0d143e11bed8fa114e53dcf003a 100644 (file)
@@ -261,7 +261,9 @@ static void nps_update_position(lbs_server_s *lbs_server, NpsManagerPositionExt
 
        LOG_NPS(DBG_LOW, "time:%d", lbs_server->pos.timestamp);
 
+#ifdef TIZEN_DEVICE
        send_wps_position_to_fused_engine(pos.timestamp, pos.latitude, pos.longitude, pos.hor_accuracy, pos.ver_accuracy);
+#endif
 
        lbs_server_emit_position_changed(lbs_server->lbs_dbus_server, LBS_SERVER_METHOD_NPS,
                                        lbs_server->pos.fields, lbs_server->pos.timestamp, lbs_server->pos.latitude,
@@ -1242,6 +1244,7 @@ static void shutdown(gpointer userdata, gboolean *shutdown_arr)
 #endif
 }
 
+#ifdef TIZEN_DEVICE
 static void fused_update_position_cb(fl_location *location, gpointer user_data)
 {
        LOG_FUSED_FUNC;
@@ -1262,6 +1265,7 @@ static void fused_update_position_cb(fl_location *location, gpointer user_data)
                                location->pos.latitude, location->pos.longitude, location->pos.altitude,
                                location->vel.speed, location->vel.direction, location->vel.climb, accuracy);
 }
+#endif
 
 static void gps_update_position_cb(pos_data_t *pos, gps_error_t error, void *user_data)
 {
@@ -1288,8 +1292,10 @@ static void gps_update_position_cb(pos_data_t *pos, gps_error_t error, void *use
 
        gps_set_position(pos);
 
+#ifdef TIZEN_DEVICE
        send_gps_position_to_fused_engine(pos->timestamp, pos->latitude, pos->longitude, pos->altitude,
                        pos->speed, pos->bearing, pos->hor_accuracy, pos->ver_accuracy);
+#endif
 
        lbs_server_emit_position_changed(lbs_server->lbs_dbus_server, LBS_SERVER_METHOD_GPS, fields, pos->timestamp,
                                        pos->latitude, pos->longitude, pos->altitude, pos->speed, pos->bearing, 0.0, accuracy);
@@ -1444,7 +1450,9 @@ static void lbs_server_init(lbs_server_s *lbs_server)
        lbs_server->optimized_batch_array[LBS_BATCH_PERIOD] = MAX_BATCH_PERIOD;
 #endif
 
+#ifdef TIZEN_DEVICE
        location_fused_init(fused_update_position_cb, lbs_server);
+#endif
 }
 
 static void nps_get_last_position(lbs_server_s *lbs_server)
@@ -1653,7 +1661,9 @@ int main(int argc, char **argv)
 
        LOG_GPS(DBG_LOW, "lbs_server deamon Stop....");
 
+#ifdef TIZEN_DEVICE
        location_fused_deinit();
+#endif
 
        gps_deinit_log();
 
index eface12defc775edfe3b81cb4c2cb60f70e40061..24a2af1be0749ad0ea842d4b159cb704e3ec250e 100644 (file)
@@ -85,10 +85,11 @@ static void position_callback(GVariant *param, void *user_data)
 
        g_variant_get(param, "(iiidddddd@(idd))", &method, &fields, &timestamp, &latitude, &longitude, &altitude, &speed, &direction, &climb, &accuracy);
 
-       MOD_NPS_LOGD("method: %d", method);
        if (method != LBS_CLIENT_METHOD_NPS) {
-               if (method != LBS_CLIENT_METHOD_MOCK)
+               if (method != LBS_CLIENT_METHOD_MOCK) {
+                       MOD_NPS_LOGD("Method is not LBS_CLIENT_METHOD_NPS: %d", method);
                        return;
+               }
        }
 
        g_variant_get(accuracy, "(idd)", &level, &horizontal, &vertical);
@@ -104,7 +105,6 @@ static void position_callback(GVariant *param, void *user_data)
 
        vel = location_velocity_new(timestamp, speed, direction, climb);
        acc = location_accuracy_new(LOCATION_ACCURACY_LEVEL_DETAILED, horizontal, vertical);
-       MOD_NPS_LOGD("method(%d)", method);
 
        module->pos_cb(TRUE, pos, vel, acc, module->userdata);
 
index c9fa15ae23cb61c4da06b61d11ad97b8c5e90962..15f764c0b5603ae0232a2b85acd594850c2191b2 100644 (file)
@@ -1,6 +1,6 @@
 Name:    lbs-server
 Summary: LBS Server for Tizen
-Version: 1.2.1
+Version: 1.2.2
 Release: 1
 Group:   Location/Service
 License: Apache-2.0