#Dependencies
SET(common_dp "glib-2.0 geofence-dbus dlog gio-2.0 capi-appfw-app-manager")
-SET(server_dp "${common_dp} network vconf vconf-internal-keys capi-system-info gthread-2.0 gio-unix-2.0 sqlite3 db-util alarm-service deviced capi-location-manager capi-network-bluetooth capi-network-wifi-manager libcore-context-manager capi-system-device libtzplatform-config")
+SET(server_dp "${common_dp} vconf vconf-internal-keys capi-system-info gthread-2.0 gio-unix-2.0 sqlite3 db-util alarm-service deviced capi-network-connection capi-location-manager capi-network-bluetooth capi-network-wifi-manager libcore-context-manager capi-system-device libtzplatform-config")
SET(module_dp "${common_dp} gmodule-2.0 capi-geofence-manager")
# Set required packages
#include "geofence_server_internal.h"
#include "geofence_server_bluetooth.h"
#include <wifi-manager.h>
-#include <network-wifi-intf.h>
#include <system_info.h>
#define TIZEN_ENGINEER_MODE
#endif
}
-static void geofence_network_evt_cb(net_event_info_t *event_cb, void *user_data)
+static void geofence_network_evt_cb(connection_type_e type, void* user_data)
{
FUNC_ENTRANCE_SERVER;
GeofenceServer *geofence_server = (GeofenceServer *) user_data;
int wps_state = 0;
int gps_state = 0;
- switch (event_cb->Event) {
- case NET_EVENT_WIFI_POWER_IND:
+ switch (type) {
+ case CONNECTION_TYPE_WIFI:
LOGI_GEOFENCE("WIFI ON/OFF indication");
vconf_get_int(VCONFKEY_LOCATION_NETWORK_ENABLED, &wps_state);
vconf_get_int(VCONFKEY_LOCATION_ENABLED, &gps_state);
LOGE_GEOFENCE("WPS is not supported");
}
break;
- case NET_EVENT_OPEN_IND:
+ case CONNECTION_TYPE_CELLULAR:
LOGI_GEOFENCE("Mobile internet connected");
vconf_get_int(VCONFKEY_LOCATION_NETWORK_ENABLED, &wps_state);
if (__is_support_wps() == true && geofence_server->running_geopoint_cnt > 0 && wps_state == 1 && __isWifiOn() == true && __isDataConnected() == true) {
LOGE_GEOFENCE("Fail to start wps positioning. Error[%d]", ret);
}
break;
- case NET_EVENT_CLOSE_IND:
+ case CONNECTION_TYPE_DISCONNECTED:
LOGI_GEOFENCE("Mobile internet disconnected");
if (__is_support_wps() == true && geofence_server->running_geopoint_cnt > 0 && geofence_server->loc_wps_started == true) {
/***** Start standalone gps as mobile data is disconnected *****/
#include <locations.h>
#include <device/display.h>
#include <device/callback.h>
-#include <network-wifi-intf.h>
+#include <net_connection.h>
#include "geofence_server_data_types.h"
#define PACKAGE_NAME "geofence-server"
* @Param[in] user_data The user data to be returned
* @see None.
*/
-typedef void (*geofence_network_event_cb)(net_event_info_t *event_cb, void *user_data);
+typedef void (*geofence_network_event_cb)(connection_type_e type, void* user_data);
/**
* @brief BT Discovery status change callback
#include <geofence_dbus_server.h>
#include <locations.h>
#include <alarm.h>
-#include <network-wifi-intf.h>
#include "geofence_server_data_types.h"
#include "geofence_server.h"
#include <stdio.h>
#endif
/* for scan AP
#include <lbs_wps.h>*/
-#include <network-cm-intf.h>
-#include <network-pm-intf.h>
-#include <network-wifi-intf.h>
-#include <network-pm-config.h>
/* for telephony*/
#if USE_TAPI
#include <tapi_common.h>
#endif
geofence_callbacks g_fence_update_cb;
void *g_fence_user_data;
+static connection_h g_connection ;
#if USE_TAPI
typedef struct {
}
#endif
-static void __geofence_network_evt_cb(net_event_info_t *event_cb, void *user_data)
+static void __geofence_network_evt_cb(connection_type_e type, void* user_data)
{
GeofenceServer *geofence_server = (GeofenceServer *)user_data;
g_return_if_fail(geofence_server);
- LOGD_GEOFENCE("==CM Event callback==, Event[%d]", event_cb->Event);
+ LOGD_GEOFENCE("==CM Event callback==, Event[%d]", type);
if (g_fence_update_cb.network_evt_cb) {
LOGD_GEOFENCE("geofence_network_evt_cb");
- g_fence_update_cb.network_evt_cb(event_cb, user_data);
+ g_fence_update_cb.network_evt_cb(type, user_data);
}
}
LOGE_GEOFENCE("wifi_manager_initialize() failed(%d).", ret);
return -1;
}
-
- if (net_register_client((net_event_cb_t) __geofence_network_evt_cb, geofence_server) != NET_ERR_NONE) {
- LOGD_GEOFENCE("net_register_client() failed");
- return -1;
- } else {
- LOGD_GEOFENCE("net_register_client() succeeded");
+ ret = connection_create(&g_connection);
+ if(ret == CONNECTION_ERROR_NONE) {
+ connection_set_type_changed_cb(g_connection,
+ __geofence_network_evt_cb,geofence_server);
+ LOGD_GEOFENCE("Create connection() succeeded");
+ }
+ else {
+ LOGD_GEOFENCE("Create connection failed () failed");
}
ret = wifi_manager_set_connection_state_changed_cb(geofence_server->wifi_h, __geofence_wifi_device_connection_state_changed_cb, geofence_server);
LOGD_GEOFENCE("GPS unsetting failed\n");
else
LOGD_GEOFENCE("GPS unsetting success\n");
+ connection_unset_type_changed_cb(g_connection);
+ connection_destroy(g_connection);
#if USE_TAPI
__deinitialize_geofence_data();
#endif
#include "geofence_server.h"
#include "geofence_server_private.h"
+#include <net_connection.h>
#include <bluetooth.h>
#include <wifi-manager.h>
Requires(post): lbs-server
BuildRequires: cmake
BuildRequires: pkgconfig(glib-2.0)
-BuildRequires: pkgconfig(network)
BuildRequires: pkgconfig(vconf)
BuildRequires: pkgconfig(dlog)
BuildRequires: pkgconfig(geofence-dbus)
BuildRequires: pkgconfig(capi-appfw-app-manager)
BuildRequires: pkgconfig(capi-location-manager)
BuildRequires: pkgconfig(capi-network-wifi-manager)
+BuildRequires: pkgconfig(capi-network-connection)
BuildRequires: pkgconfig(capi-network-bluetooth)
BuildRequires: pkgconfig(libcore-context-manager)
BuildRequires: pkgconfig(capi-system-device)