#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 libcore-context-manager capi-system-device libtzplatform-config")
+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(module_dp "${common_dp} gmodule-2.0 capi-geofence-manager")
# Set required packages
#include "geofence_server_alarm.h"
#include "geofence_server_internal.h"
#include "geofence_server_bluetooth.h"
-#include <wifi.h>
+#include <wifi-manager.h>
#include <network-wifi-intf.h>
#include <system_info.h>
return is_wps_supported;
}
-static const char *__convert_wifi_error_to_string(wifi_error_e err_type)
+static const char *__convert_wifi_error_to_string(wifi_manager_error_e err_type)
{
switch (err_type) {
- case WIFI_ERROR_NONE:
+ case WIFI_MANAGER_ERROR_NONE:
return "NONE";
- case WIFI_ERROR_INVALID_PARAMETER:
+ case WIFI_MANAGER_ERROR_INVALID_PARAMETER:
return "INVALID_PARAMETER";
- case WIFI_ERROR_OUT_OF_MEMORY:
+ case WIFI_MANAGER_ERROR_OUT_OF_MEMORY:
return "OUT_OF_MEMORY";
- case WIFI_ERROR_INVALID_OPERATION:
+ case WIFI_MANAGER_ERROR_INVALID_OPERATION:
return "INVALID_OPERATION";
- case WIFI_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED:
+ case WIFI_MANAGER_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED:
return "ADDRESS_FAMILY_NOT_SUPPORTED";
- case WIFI_ERROR_OPERATION_FAILED:
+ case WIFI_MANAGER_ERROR_OPERATION_FAILED:
return "OPERATION_FAILED";
- case WIFI_ERROR_NO_CONNECTION:
+ case WIFI_MANAGER_ERROR_NO_CONNECTION:
return "NO_CONNECTION";
- case WIFI_ERROR_NOW_IN_PROGRESS:
+ case WIFI_MANAGER_ERROR_NOW_IN_PROGRESS:
return "NOW_IN_PROGRESS";
- case WIFI_ERROR_ALREADY_EXISTS:
+ case WIFI_MANAGER_ERROR_ALREADY_EXISTS:
return "ALREADY_EXISTS";
- case WIFI_ERROR_OPERATION_ABORTED:
+ case WIFI_MANAGER_ERROR_OPERATION_ABORTED:
return "OPERATION_ABORTED";
- case WIFI_ERROR_DHCP_FAILED:
+ case WIFI_MANAGER_ERROR_DHCP_FAILED:
return "DHCP_FAILED";
- case WIFI_ERROR_INVALID_KEY:
+ case WIFI_MANAGER_ERROR_INVALID_KEY:
return "INVALID_KEY";
- case WIFI_ERROR_NO_REPLY:
+ case WIFI_MANAGER_ERROR_NO_REPLY:
return "NO_REPLY";
- case WIFI_ERROR_SECURITY_RESTRICTED:
+ case WIFI_MANAGER_ERROR_SECURITY_RESTRICTED:
return "SECURITY_RESTRICTED";
- case WIFI_ERROR_PERMISSION_DENIED:
+ case WIFI_MANAGER_ERROR_ALREADY_INITIALIZED:
+ return "ALREADY_INITIALIZED";
+ case WIFI_MANAGER_ERROR_PERMISSION_DENIED:
return "PERMISSION_DENIED";
+ case WIFI_MANAGER_ERROR_NOT_SUPPORTED:
+ return "NOT_SUPPORTED";
default:
return "NOT Defined";
}
static int __check_fence_permission(int fence_id, const char *app_id)
{
access_type_e access_type = ACCESS_TYPE_PUBLIC;
- char *appid;
+ char *appid = NULL;
int ret = FENCE_ERR_NONE;
ret = geofence_manager_get_access_type(fence_id, -1, &access_type);
if (ret != FENCE_ERR_NONE) {
return -1;
}
if (g_strcmp0(appid, app_id)) {
- LOGE("Not authorized to access this private fence[%d]", fence_id);
+ LOGE("Not authorized to access this private fence[%d]", fence_id);
+ g_free(appid);
return 0;
}
}
+ g_free(appid);
return 1;
}
static int __check_place_permission(int place_id, const char *app_id)
{
access_type_e access_type = ACCESS_TYPE_PUBLIC;
- char *appid;
+ char *appid = NULL;
int ret = FENCE_ERR_NONE;
ret = geofence_manager_get_access_type(-1, place_id, &access_type);
if (ret != FENCE_ERR_NONE) {
return -1;
}
if (g_strcmp0(appid, app_id)) {
- LOGE("Not authorized to access this private place[%d]", place_id);
+ LOGE("Not authorized to access this private place[%d]", place_id);
+ g_free(appid);
return 0;
}
}
+ g_free(appid);
return 1;
}
g_strlcpy(geocoordinate_info->address, address, ADDRESS_LEN);
/*Geopoint information is saved in the DB*/
- ret = geofence_manager_set_geocoordinate_info(fence_id, geocoordinate_info);
+ ret = geofence_manager_set_geocoordinate_info(fence_id, geocoordinate_info);
if (ret != FENCE_ERR_NONE) {
LOGI_GEOFENCE("Fail to set geocoordinate_info");
ret = geofence_manager_delete_fence_info(fence_id);
g_return_if_fail(geofence_server);
int ret = FENCE_ERR_NONE;
int place_id = -1;
- char *app_id_db;
+ char *app_id_db = NULL;
access_type_e access_type = ACCESS_TYPE_UNKNOWN;
/*//////////Required to be sent in the event callback////////////////--*/
}
} else if (item_data->common_info.type == GEOFENCE_TYPE_WIFI) {
LOGI_GEOFENCE("fence_type [GEOFENCE_TYPE_WIFI]");
- wifi_error_e rv = WIFI_ERROR_NONE;
+ wifi_manager_error_e rv = WIFI_MANAGER_ERROR_NONE;
int nWifiState;
- wifi_ap_h ap_h;
+ wifi_manager_ap_h ap_h;
char *ap_bssid = NULL;
int bssidlen;
bssid_info_s *wifi_info = NULL;
if (item_data->priv != NULL)
wifi_info = (bssid_info_s *) item_data->priv;
- rv = wifi_get_connected_ap(&ap_h);
- if (rv != WIFI_ERROR_NONE) {
+ rv = wifi_manager_get_connected_ap(geofence_server->wifi_h, &ap_h);
+ if (rv != WIFI_MANAGER_ERROR_NONE) {
LOGI_GEOFENCE("Fail/not connected to get the connected AP: [%s] , geofence will be added to the fence list", __convert_wifi_error_to_string(rv));
- if (rv == WIFI_ERROR_NO_CONNECTION) {
+ if (rv == WIFI_MANAGER_ERROR_NO_CONNECTION) {
LOGI_GEOFENCE("Not connected to any AP");
status_to_be_emitted = GEOFENCE_FENCE_STATE_OUT;
}
} else {
- rv = wifi_ap_get_bssid(ap_h, &ap_bssid);
- if (rv != WIFI_ERROR_NONE) {
+ rv = wifi_manager_ap_get_bssid(ap_h, &ap_bssid);
+ if (rv != WIFI_MANAGER_ERROR_NONE) {
LOGI_GEOFENCE("Fail to get the bssid: [%d]\n", __convert_wifi_error_to_string(rv));
} else {
bssidlen = strlen(ap_bssid);
if ((place_info != NULL) && (place_info->access_type == ACCESS_TYPE_PRIVATE)) {
if (g_strcmp0(app_id, place_info->appid) != 0) {
LOGI_GEOFENCE("Not authorized to access this private place[%d]", place_id);
- if (place_info)
- g_free(place_info);
+ g_free(place_info);
/* Send ZERO data gvariant*/
*errorCode = GEOFENCE_SERVER_ERROR_PLACE_ACCESS_DENIED;
*fenceCnt = fence_cnt;
g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
return g_variant_builder_end(&b);
}
- if (place_info)
- g_free(place_info);
+ g_free(place_info);
}
ret = geofence_manager_get_fence_list_from_db(&count, &fence_list, place_id);
}
geofence_server->activity_run_h = NULL;
geofence_server->activity_in_vehicle_h = NULL;
+ geofence_server->wifi_h = NULL;
+
/*Initializing the DB to store the fence informations*/
if (geofence_manager_db_init() != FENCE_ERR_NONE)
LOGI_GEOFENCE("Error initalizing the DB");
if (FENCE_ERR_NONE != geofence_manager_get_enable_status(fence_id, &item_data->common_info.enable))
return FENCE_ERR_SQLITE_FAIL;
- if (FENCE_ERR_NONE != geofence_manager_get_appid_from_geofence(fence_id, &app_id)) {
- g_free(app_id);
+ if (FENCE_ERR_NONE != geofence_manager_get_appid_from_geofence(fence_id, &app_id))
return FENCE_ERR_SQLITE_FAIL;
- } else {
+ else {
g_strlcpy(item_data->common_info.appid, app_id, APP_ID_LEN);
g_free(app_id);
}
* } */
GeofenceItemData *item_data = (GeofenceItemData *)g_malloc0(sizeof(GeofenceItemData));
+ if (item_data == NULL) {
+ LOGI_GEOFENCE("Unable to add the fence because of malloc fail");
+ return;
+ }
if (FENCE_ERR_NONE != __copy_geofence_to_item_data(fence_id, item_data)) {
g_free(item_data);
return;
LOGD_GEOFENCE("GEOFENCE_manager deamon Stop....");
/*This call goes to server.c and deregisters all the callbacks w.r.t bt and wifi*/
- _geofence_deinitialize_geofence_server();
+ _geofence_deinitialize_geofence_server(geofenceserver);
#ifdef TIZEN_ENGINEER_MODE
_deinit_log();
#include <glib.h>
#include <bluetooth.h>
-#include <wifi.h>
+#include <wifi-manager.h>
#include <locations.h>
#include <device/display.h>
#include <device/callback.h>
* @Param[in] user_data The user data to be returned
* @see None.
*/
-typedef void (*geofence_wifi_conn_state_changed_cb)(wifi_connection_state_e state, wifi_ap_h ap, void *user_data);
+typedef void (*geofence_wifi_conn_state_changed_cb)(wifi_manager_connection_state_e state, wifi_manager_ap_h ap, void *user_data);
/**
* @brief Wifi device status change callback
* @Param[in] user_data The user data to be returned
* @see None.
*/
-typedef void (*geofence_wifi_device_state_changed_cb)(wifi_device_state_e state, void *user_data);
+typedef void (*geofence_wifi_device_state_changed_cb)(wifi_manager_device_state_e state, void *user_data);
/**
* @brief Network scan status change callback
* @see wifi_set_rssi_level_changed_cb()
* @see wifi_unset_rssi_level_changed_cb()
*/
-typedef void(*geofence_wifi_rssi_level_changed_cb)(wifi_rssi_level_e rssi_level, void *user_data);
+typedef void(*geofence_wifi_rssi_level_changed_cb)(wifi_manager_rssi_level_e rssi_level, void *user_data);
/**
* Geofence callback structure.
}
item_data->common_info.proximity_status = fence_proximity_status;
}
-
- if (app_id)
- free(app_id);
+ g_free(app_id);
}
#include <sys/stat.h>
#include <string.h>
#include <bluetooth.h>
-#include <wifi.h>
+#include <wifi-manager.h>
#include <tzplatform_config.h>
#include <sys/types.h>
#include <fcntl.h>
if (ret != BT_ERROR_NONE)
LOGD_GEOFENCE("bt address get fail %d", ret);
- ret = wifi_get_mac_address(&wifi_address);
- if (ret != WIFI_ERROR_NONE)
+ ret = wifi_manager_get_mac_address(&wifi_address);
+ if (ret != WIFI_MANAGER_ERROR_NONE)
LOGD_GEOFENCE("wifi address get fail %d", ret);
if (bt_address) {
activity_h activity_walk_h;
activity_h activity_run_h;
activity_h activity_in_vehicle_h;
+
+ wifi_manager_h wifi_h;
} GeofenceServer;
#ifdef __cplusplus
item_data->common_info.status = GEOFENCE_FENCE_STATE_OUT;
}
}
- if (app_id)
- free(app_id);
+ g_free(app_id);
}
static bool __check_for_match(char *str1, char *str2)
}
item_data->common_info.proximity_status = fence_proximity_status;
}
- if (app_id)
- free(app_id);
+ g_free(app_id);
}
-void wifi_rssi_level_changed(wifi_rssi_level_e rssi_level, void *user_data)
+void wifi_rssi_level_changed(wifi_manager_rssi_level_e rssi_level, void *user_data)
{
FUNC_ENTRANCE_SERVER
GeofenceServer *geofence_server = (GeofenceServer *) user_data;
g_return_if_fail(geofence_server);
- wifi_ap_h ap_h;
+ wifi_manager_ap_h ap_h;
char *bssid = NULL;
geofence_proximity_state_e state = GEOFENCE_PROXIMITY_UNCERTAIN;
- wifi_error_e rv = WIFI_ERROR_NONE;
+ wifi_manager_error_e rv = WIFI_MANAGER_ERROR_NONE;
LOGI_GEOFENCE("running cnt: %d, connected id: %d", geofence_server->running_wifi_cnt, geofence_server->connectedTrackingWifiFenceId);
if (geofence_server->running_wifi_cnt > 0 && geofence_server->connectedTrackingWifiFenceId != -1) {
- rv = wifi_get_connected_ap(&ap_h);
- if (rv != WIFI_ERROR_NONE) {
+ rv = wifi_manager_get_connected_ap(geofence_server->wifi_h, &ap_h);
+ if (rv != WIFI_MANAGER_ERROR_NONE) {
LOGE_GEOFENCE("Fail to get the connected AP: Error - %d", rv);
return;
}
- rv = wifi_ap_get_bssid(ap_h, &bssid);
- if (rv != WIFI_ERROR_NONE) {
+ rv = wifi_manager_ap_get_bssid(ap_h, &bssid);
+ if (rv != WIFI_MANAGER_ERROR_NONE) {
LOGI_GEOFENCE("Fail to get the bssid: [%d]", rv);
} else {
/*Emit the proximity alert here using mConnectedFenceId*/
- if (rssi_level == WIFI_RSSI_LEVEL_4)
+ if (rssi_level == WIFI_MANAGER_RSSI_LEVEL_4)
state = GEOFENCE_PROXIMITY_IMMEDIATE;
- else if (rssi_level == WIFI_RSSI_LEVEL_3)
+ else if (rssi_level == WIFI_MANAGER_RSSI_LEVEL_3)
state = GEOFENCE_PROXIMITY_NEAR;
else
state = GEOFENCE_PROXIMITY_FAR;
}
}
-void wifi_device_state_changed(wifi_device_state_e state, void *user_data)
+void wifi_device_state_changed(wifi_manager_device_state_e state, void *user_data)
{
FUNC_ENTRANCE_SERVER
GeofenceServer *geofence_server = (GeofenceServer *) user_data;
if (fence_type != GEOFENCE_TYPE_WIFI)
continue;
- if (state == WIFI_DEVICE_STATE_DEACTIVATED) {
+ if (state == WIFI_MANAGER_DEVICE_STATE_DEACTIVATED) {
LOGD_GEOFENCE("Emitted to fence_id [%d] GEOFENCE_FENCE_STATE_OUT", fence_id);
emit_wifi_geofence_inout_changed(geofence_server, fence_id, GEOFENCE_FENCE_STATE_OUT);
emit_wifi_geofence_proximity_changed(geofence_server, fence_id, GEOFENCE_PROXIMITY_UNCERTAIN);
LOGD_GEOFENCE("exit");
}
-void __geofence_check_wifi_matched_bssid(wifi_connection_state_e state, char *bssid, void *user_data)
+void __geofence_check_wifi_matched_bssid(wifi_manager_connection_state_e state, char *bssid, void *user_data)
{
LOGD_GEOFENCE("Comparing the matching bssids");
GeofenceServer *geofence_server = (GeofenceServer *)user_data;
}
if (!g_ascii_strcasecmp(bssid_info->bssid, bssid) || !g_ascii_strcasecmp(g_strdelimit(bssid_info->bssid, "-", ':'), bssid)) {
LOGI_GEOFENCE("Matched wifi fence: fence_id = %d, bssid = %s", tracking_fence_id, bssid_info->bssid);
- if (state == WIFI_CONNECTION_STATE_CONNECTED) {
+ if (state == WIFI_MANAGER_CONNECTION_STATE_CONNECTED) {
emit_wifi_geofence_inout_changed(geofence_server, tracking_fence_id, GEOFENCE_FENCE_STATE_IN);
geofence_server->connectedTrackingWifiFenceId = tracking_fence_id;
- } else if (state == WIFI_CONNECTION_STATE_DISCONNECTED) {
+ } else if (state == WIFI_MANAGER_CONNECTION_STATE_DISCONNECTED) {
emit_wifi_geofence_inout_changed(geofence_server, tracking_fence_id, GEOFENCE_FENCE_STATE_OUT);
emit_wifi_geofence_proximity_changed(geofence_server, tracking_fence_id, GEOFENCE_PROXIMITY_UNCERTAIN);
geofence_server->connectedTrackingWifiFenceId = -1;
}
-void wifi_conn_state_changed(wifi_connection_state_e state, wifi_ap_h ap, void *user_data)
+void wifi_conn_state_changed(wifi_manager_connection_state_e state, wifi_manager_ap_h ap, void *user_data)
{
LOGD_GEOFENCE("wifi_conn_state_changed");
GeofenceServer *geofence_server = (GeofenceServer *)user_data;
char *ap_bssid = NULL;
int rv = 0;
g_return_if_fail(geofence_server);
- rv = wifi_ap_get_bssid(ap, &ap_bssid);
+ rv = wifi_manager_ap_get_bssid(ap, &ap_bssid);
- if (rv != WIFI_ERROR_NONE) {
+ if (rv != WIFI_MANAGER_ERROR_NONE) {
LOGD_GEOFENCE("Failed to get the bssid");
return;
}
- if (state == WIFI_CONNECTION_STATE_CONNECTED) {
+ if (state == WIFI_MANAGER_CONNECTION_STATE_CONNECTED) {
LOGD_GEOFENCE("Wifi connected to [%s].", ap_bssid);
__geofence_check_wifi_matched_bssid(state, ap_bssid, user_data);
- } else if (state == WIFI_CONNECTION_STATE_DISCONNECTED) {
+ } else if (state == WIFI_MANAGER_CONNECTION_STATE_DISCONNECTED) {
LOGD_GEOFENCE("Wifi disconnected with [%s].", ap_bssid);
__geofence_check_wifi_matched_bssid(state, ap_bssid, user_data);
}
* @Param[in] user_data The user data
* @see None.
*/
-void wifi_conn_state_changed(wifi_connection_state_e state, wifi_ap_h ap, void *user_data);
+void wifi_conn_state_changed(wifi_manager_connection_state_e state, wifi_manager_ap_h ap, void *user_data);
/**
* @brief Wifi device status change
* @Param[in] user_data The user data
* @see None.
*/
-void wifi_device_state_changed(wifi_device_state_e state, void *user_data);
+void wifi_device_state_changed(wifi_manager_device_state_e state, void *user_data);
/**
* @brief Wifi AP rssi level change
* @Param[in] user_data The user data
* @see None.
**/
-void wifi_rssi_level_changed(wifi_rssi_level_e rssi_level, void *user_data);
+void wifi_rssi_level_changed(wifi_manager_rssi_level_e rssi_level, void *user_data);
#endif /* GEOFENCE_MANAGER_WIFI_H_ */
#include "geofence_server_private.h"
/* for bluetooth-geofence*/
#include <bluetooth.h>
-#include <wifi.h>
+#include <wifi-manager.h>
#include <locations.h>
#define TIZEN_ENGINEER_MODE
LOGD_GEOFENCE("exit");
}
-static void __geofence_wifi_device_connection_state_changed_cb(wifi_connection_state_e state, wifi_ap_h ap, void *user_data)
+static void __geofence_wifi_device_connection_state_changed_cb(wifi_manager_connection_state_e state, wifi_manager_ap_h ap, void *user_data)
{
LOGD_GEOFENCE("__geofence_wifi_device_connection_state_changed_cb()");
}
}
-static void __geofence_wifi_device_state_changed_cb(wifi_device_state_e state, void *user_data)
+static void __geofence_wifi_device_state_changed_cb(wifi_manager_device_state_e state, void *user_data)
{
LOGD_GEOFENCE("__geofence_wifi_device_state_changed_cb()");
}
}
-static void __geofence_wifi_rssi_level_changed_cb(wifi_rssi_level_e rssi_level, void *user_data)
+static void __geofence_wifi_rssi_level_changed_cb(wifi_manager_rssi_level_e rssi_level, void *user_data)
{
LOGD_GEOFENCE("__geofence_wifi_rssi_level_changed_cb()");
GeofenceServer *geofence_server = (GeofenceServer *)user_data;
if (BT_ERROR_NONE != ret)
LOGE_GEOFENCE("Failed to set the callback for discovery");
- ret = wifi_initialize();
- if (WIFI_ERROR_NONE != ret) {
- LOGD_GEOFENCE("wifi_initialize() failed(%d).", ret);
+ ret = wifi_manager_initialize(&(geofence_server->wifi_h));
+ if (WIFI_MANAGER_ERROR_NONE != ret) {
+ LOGD_GEOFENCE("wifi_manager_initialize() failed(%d).", ret);
return -1;
}
LOGD_GEOFENCE("net_register_client() succeeded");
}
- ret = wifi_set_connection_state_changed_cb(__geofence_wifi_device_connection_state_changed_cb, geofence_server);
- if (WIFI_ERROR_NONE != ret) {
- LOGD_GEOFENCE("wifi_set_connection_state_changed_cb() failed(%d).", ret);
- ret = wifi_deinitialize();
- if (ret != WIFI_ERROR_NONE)
- LOGD_GEOFENCE("wifi_deinitialize() failed(%d).", ret);
+ ret = wifi_manager_set_connection_state_changed_cb(geofence_server->wifi_h, __geofence_wifi_device_connection_state_changed_cb, geofence_server);
+ if (WIFI_MANAGER_ERROR_NONE != ret) {
+ LOGD_GEOFENCE("wifi_manager_set_connection_state_changed_cb() failed(%d).", ret);
+ ret = wifi_manager_deinitialize(geofence_server->wifi_h);
+ if (ret != WIFI_MANAGER_ERROR_NONE)
+ LOGD_GEOFENCE("wifi_manager_deinitialize() failed(%d).", ret);
+ geofence_server->wifi_h = NULL;
return -1;
} else {
- LOGD_GEOFENCE("wifi_set_connection_state_changed_cb() success.", ret);
+ LOGD_GEOFENCE("wifi_manager_set_connection_state_changed_cb() success.", ret);
}
- ret = wifi_set_device_state_changed_cb(__geofence_wifi_device_state_changed_cb, geofence_server);
- if (WIFI_ERROR_NONE != ret) {
- LOGD_GEOFENCE("wifi_set_device_state_changed_cb() failed(%d).", ret);
- ret = wifi_deinitialize();
- if (ret != WIFI_ERROR_NONE)
- LOGD_GEOFENCE("wifi_deinitialize() failed(%d).", ret);
+ ret = wifi_manager_set_device_state_changed_cb(geofence_server->wifi_h, __geofence_wifi_device_state_changed_cb, geofence_server);
+ if (WIFI_MANAGER_ERROR_NONE != ret) {
+ LOGD_GEOFENCE("wifi_manager_set_device_state_changed_cb() failed(%d).", ret);
+ ret = wifi_manager_deinitialize(geofence_server->wifi_h);
+ if (ret != WIFI_MANAGER_ERROR_NONE)
+ LOGD_GEOFENCE("wifi_manager_deinitialize() failed(%d).", ret);
+ geofence_server->wifi_h = NULL;
return -1;
} else {
- LOGD_GEOFENCE("wifi_set_device_state_changed_cb() success.", ret);
+ LOGD_GEOFENCE("wifi_manager_set_device_state_changed_cb() success.", ret);
}
- ret = wifi_set_rssi_level_changed_cb(__geofence_wifi_rssi_level_changed_cb, geofence_server);
- if (WIFI_ERROR_NONE != ret) {
- LOGD_GEOFENCE("wifi_set_rssi_level_changed_cb() failed(%d).", ret);
- ret = wifi_deinitialize();
- if (ret != WIFI_ERROR_NONE)
- LOGD_GEOFENCE("wifi_deinitialize() failed(%d).", ret);
+ ret = wifi_manager_set_rssi_level_changed_cb(geofence_server->wifi_h, __geofence_wifi_rssi_level_changed_cb, geofence_server);
+ if (WIFI_MANAGER_ERROR_NONE != ret) {
+ LOGD_GEOFENCE("wifi_manager_set_rssi_level_changed_cb() failed(%d).", ret);
+ ret = wifi_manager_deinitialize(geofence_server->wifi_h);
+ if (ret != WIFI_MANAGER_ERROR_NONE)
+ LOGD_GEOFENCE("wifi_manager_deinitialize() failed(%d).", ret);
+ geofence_server->wifi_h = NULL;
return -1;
} else {
- LOGD_GEOFENCE("wifi_set_rssi_level_changed_cb() success.", ret);
+ LOGD_GEOFENCE("wifi_manager_set_rssi_level_changed_cb() success.", ret);
}
/*Set the callback for location*/
return 0;
}
-int _geofence_deinitialize_geofence_server()
+int _geofence_deinitialize_geofence_server(GeofenceServer *geofence_server)
{
/* to denit geofence engine staff...*/
LOGD_GEOFENCE("bt_deinitialize() success.\n");
/*unset the callbacks related to wifi*/
- if (wifi_unset_connection_state_changed_cb() != WIFI_ERROR_NONE)
- LOGD_GEOFENCE("wifi_unset_connection_state_changed_cb() failed.\n");
+ if (wifi_manager_unset_connection_state_changed_cb(geofence_server->wifi_h) != WIFI_MANAGER_ERROR_NONE)
+ LOGD_GEOFENCE("wifi_manager_unset_connection_state_changed_cb() failed.\n");
else
- LOGD_GEOFENCE("wifi_unset_connection_state_changed_cb() success.\n");
+ LOGD_GEOFENCE("wifi_manager_unset_connection_state_changed_cb() success.\n");
- if (wifi_deinitialize() != WIFI_ERROR_NONE)
- LOGD_GEOFENCE("wifi_deinitialize() failed.\n");
+ if (wifi_manager_deinitialize(geofence_server->wifi_h) != WIFI_MANAGER_ERROR_NONE)
+ LOGD_GEOFENCE("wifi_manager_deinitialize() failed.\n");
else
- LOGD_GEOFENCE("wifi_deinitialize() success.\n");
+ LOGD_GEOFENCE("wifi_manager_deinitialize() success.\n");
+ geofence_server->wifi_h = NULL;
if (location_manager_unset_setting_changed_cb(LOCATIONS_METHOD_GPS) != LOCATIONS_ERROR_NONE)
LOGD_GEOFENCE("GPS unsetting failed\n");
#include "geofence_server.h"
#include "geofence_server_private.h"
#include <bluetooth.h>
-#include <wifi.h>
+#include <wifi-manager.h>
typedef enum {
GEOFENCE_STATE_AVAILABLE,
* @retval 0 if success
* @see none
*/
-int _geofence_deinitialize_geofence_server();
+int _geofence_deinitialize_geofence_server(GeofenceServer *geofence_server);
/**
* @brief Registers the update callbacks
Name: geofence-server
Summary: Geofence Server for Tizen
-Version: 0.4.5
+Version: 0.4.6
Release: 1
Group: Location/Service
License: Apache-2.0
BuildRequires: pkgconfig(capi-system-info)
BuildRequires: pkgconfig(capi-appfw-app-manager)
BuildRequires: pkgconfig(capi-location-manager)
-BuildRequires: pkgconfig(capi-network-wifi)
+BuildRequires: pkgconfig(capi-network-wifi-manager)
BuildRequires: pkgconfig(capi-network-bluetooth)
BuildRequires: pkgconfig(libcore-context-manager)
BuildRequires: pkgconfig(capi-system-device)