summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjomui <jongmun.woo@samsung.com>2016-02-23 17:53:32 +0900
committerjomui <jongmun.woo@samsung.com>2016-02-23 17:53:56 +0900
commit35769c89740a5fde3b60e6de8bd589ee64b50e13 (patch)
tree21ebca3bed3e050980be1f45c9eef749faa764b1
parent8aaa7e86b0419db6de37963989f6ab54d581ae28 (diff)
downloadgeofence-server-35769c89740a5fde3b60e6de8bd589ee64b50e13.tar.gz
geofence-server-35769c89740a5fde3b60e6de8bd589ee64b50e13.tar.bz2
geofence-server-35769c89740a5fde3b60e6de8bd589ee64b50e13.zip
Signed-off-by: jomui <jongmun.woo@samsung.com> Change-Id: I090202da3db1eeeea029ab38cef20c5fe46f6f71
-rw-r--r--geofence-server/src/geofence_server.c54
-rw-r--r--packaging/geofence-server.spec2
2 files changed, 26 insertions, 30 deletions
diff --git a/geofence-server/src/geofence_server.c b/geofence-server/src/geofence_server.c
index a46ed12..eafbcc5 100644
--- a/geofence-server/src/geofence_server.c
+++ b/geofence-server/src/geofence_server.c
@@ -1015,7 +1015,6 @@ static void geofence_network_evt_cb(net_event_info_t *event_cb, void *user_data)
FUNC_ENTRANCE_SERVER;
GeofenceServer *geofence_server = (GeofenceServer *) user_data;
g_return_if_fail(geofence_server);
- net_wifi_state_t network_state = WIFI_UNKNOWN;
int ret = -1;
int wps_state = 0;
int gps_state = 0;
@@ -1026,36 +1025,33 @@ static void geofence_network_evt_cb(net_event_info_t *event_cb, void *user_data)
vconf_get_int(VCONFKEY_LOCATION_NETWORK_ENABLED, &wps_state);
vconf_get_int(VCONFKEY_LOCATION_ENABLED, &gps_state);
if (__is_support_wps() == true && geofence_server->running_geopoint_cnt > 0) {
- ret = net_get_wifi_state(&network_state, (net_profile_name_t*)event_cb->ProfileName);
- if (ret == 0) {
- if (network_state == WIFI_OFF) {
- LOGI_GEOFENCE("WIFI is OFF");
- /* In Tizen device(Kiran) WPS is not supported if WIFI is switched off */
- __stop_wps_positioning(geofence_server);
- __stop_wps_alarms(geofence_server);
- if (geofence_server->loc_gps_started_by_wps == true) {
- __stop_gps_positioning(geofence_server); /*Stop the gps if it was started by wps*/
- __stop_gps_alarms(geofence_server);
- geofence_server->loc_gps_started_by_wps = false;
+ if (__isWifiOn() == false) {
+ LOGI_GEOFENCE("WIFI is OFF");
+ /* In Tizen device(Kiran) WPS is not supported if WIFI is switched off */
+ __stop_wps_positioning(geofence_server);
+ __stop_wps_alarms(geofence_server);
+ if (geofence_server->loc_gps_started_by_wps == true) {
+ __stop_gps_positioning(geofence_server); /*Stop the gps if it was started by wps*/
+ __stop_gps_alarms(geofence_server);
+ geofence_server->loc_gps_started_by_wps = false;
+ }
+ if (gps_state == 1) {
+ ret = __start_gps_positioning(geofence_server, __geofence_standalone_gps_position_changed_cb);
+ if (ret != FENCE_ERR_NONE) {
+ LOGE_GEOFENCE("Fail to start standalone gps positioning. Error[%d]", ret);
}
- if (gps_state == 1) {
- ret = __start_gps_positioning(geofence_server, __geofence_standalone_gps_position_changed_cb);
+ }
+ } else {
+ if (__isDataConnected() == true) {/*&& wps_state == 1) {*/
+ LOGI_GEOFENCE("DATA CONNECTION IS TRUE");
+ if (wps_state == 1) {
+ LOGI_GEOFENCE("WPS STATE IS 1");
+ __stop_gps_positioning(geofence_server); /* Stop the gps which is running as wps can be used*/
+ __stop_gps_alarms(geofence_server);
+ /**** Start the WPS as mobile data is connected and wifi and wps are on *******/
+ ret = __start_wps_positioning(geofence_server, __geofence_wps_position_changed_cb);
if (ret != FENCE_ERR_NONE) {
- LOGE_GEOFENCE("Fail to start standalone gps positioning. Error[%d]", ret);
- }
- }
- } else {
- if (__isDataConnected() == true) {/*&& wps_state == 1) {*/
- LOGI_GEOFENCE("DATA CONNECTION IS TRUE");
- if (wps_state == 1) {
- LOGI_GEOFENCE("WPS STATE IS 1");
- __stop_gps_positioning(geofence_server); /* Stop the gps which is running as wps can be used*/
- __stop_gps_alarms(geofence_server);
- /**** Start the WPS as mobile data is connected and wifi and wps are on *******/
- ret = __start_wps_positioning(geofence_server, __geofence_wps_position_changed_cb);
- if (ret != FENCE_ERR_NONE) {
- LOGE_GEOFENCE("Fail to start wps positioning. Error[%d]", ret);
- }
+ LOGE_GEOFENCE("Fail to start wps positioning. Error[%d]", ret);
}
}
}
diff --git a/packaging/geofence-server.spec b/packaging/geofence-server.spec
index 45feb66..71ec32e 100644
--- a/packaging/geofence-server.spec
+++ b/packaging/geofence-server.spec
@@ -1,6 +1,6 @@
Name: geofence-server
Summary: Geofence Server for Tizen
-Version: 0.4.2
+Version: 0.4.3
Release: 1
Group: Location/Service
License: Apache-2.0