From: Liu, Guoqiang Date: Mon, 1 Apr 2013 06:07:15 +0000 (+0800) Subject: Tethering: Add Tethering state in Wi-Fi technology states X-Git-Tag: accepted/tizen/20130912.103241~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F69%2F5669%2F1;p=platform%2Fcore%2Fconnectivity%2Fnet-config.git Tethering: Add Tethering state in Wi-Fi technology states There are 4 Wi-Fi technology states from ConnMan side: Off, Powered, Connected and Tethering. this patch is to add the Tethering state in net-config. Signed-off-by: Liu, Guoqiang --- diff --git a/src/wifi-state.c b/src/wifi-state.c index 9028b5b..c445f3d 100644 --- a/src/wifi-state.c +++ b/src/wifi-state.c @@ -232,6 +232,7 @@ enum netconfig_wifi_tech_state netconfig_wifi_get_technology_state(void) enum netconfig_wifi_tech_state ret = NETCONFIG_WIFI_TECH_OFF; gboolean wifi_tech_powered = FALSE; gboolean wifi_tech_connected = FALSE; + gboolean wifi_tethering = FALSE; message = netconfig_invoke_dbus_method(CONNMAN_SERVICE, CONNMAN_MANAGER_PATH, CONNMAN_MANAGER_INTERFACE, @@ -281,7 +282,7 @@ enum netconfig_wifi_tech_state netconfig_wifi_get_technology_state(void) } else if (strcmp(key, "Connected") == 0 && data) { wifi_tech_connected = TRUE; } else if (strcmp(key, "Tethering") == 0 && data) { - /* For further use */ + wifi_tethering = TRUE; } } else if (dbus_message_iter_get_arg_type(&value1) == DBUS_TYPE_STRING) { @@ -302,6 +303,9 @@ enum netconfig_wifi_tech_state netconfig_wifi_get_technology_state(void) if (wifi_tech_connected) ret = NETCONFIG_WIFI_TECH_CONNECTED; + if (wifi_tethering) + ret = NETCONFIG_WIFI_TECH_TETHERING_ON; + return ret; } @@ -337,7 +341,8 @@ void netconfig_wifi_update_power_state(gboolean powered) netconfig_wifi_device_picker_service_stop(); - netconfig_wifi_remove_driver(); + if (netconfig_is_wifi_tethering_on() != TRUE) + netconfig_wifi_remove_driver(); vconf_set_int(VCONFKEY_NETWORK_WIFI_STATE, VCONFKEY_NETWORK_WIFI_OFF); vconf_set_int(VCONF_WIFI_LAST_POWER_STATE, WIFI_POWER_OFF);