From: taesub kim Date: Tue, 29 Aug 2017 00:07:39 +0000 (+0900) Subject: Modified log for service and technology state X-Git-Tag: accepted/tizen/unified/20170901.025946^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F43%2F146443%2F1;p=platform%2Fcore%2Fconnectivity%2Fnet-config.git Modified log for service and technology state Change-Id: I8b7d391c79463f53bff86cc75f53b5a6ee926a7c Signed-off-by: Taesub Kim --- diff --git a/src/network-state.c b/src/network-state.c index 4c26944..2c66a1e 100755 --- a/src/network-state.c +++ b/src/network-state.c @@ -450,7 +450,7 @@ static void __netconfig_update_default_connection_info(void) if (profile == NULL) DBG("Reset network state configuration"); else - DBG("%s: ip(%s) ip6(%s) proxy(%s)", profile, ip_addr, ip_addr6, proxy_addr); + DBG("profile[%s] ipv4(%s) ipv6(%s) proxy(%s)", profile, ip_addr, ip_addr6, proxy_addr); netconfig_vconf_get_int(VCONFKEY_NETWORK_STATUS, &old_network_status); diff --git a/src/wifi-state.c b/src/wifi-state.c index 4fb0e44..40d0a95 100755 --- a/src/wifi-state.c +++ b/src/wifi-state.c @@ -44,6 +44,52 @@ static GSList *notifier_list = NULL; static guint network_connected_popup_timer_id = 0; static gboolean block_network_connected_popup = FALSE; +static const char *_convert_wifi_service_state_to_string(wifi_service_state_e wifi_service_state_type) +{ + switch (wifi_service_state_type) { + case NETCONFIG_WIFI_UNKNOWN: + return "unknown"; + case NETCONFIG_WIFI_IDLE: + return "idle"; + case NETCONFIG_WIFI_ASSOCIATION: + return "association"; + case NETCONFIG_WIFI_CONFIGURATION: + return "configuration"; + case NETCONFIG_WIFI_CONNECTED: + return "connected"; + case NETCONFIG_WIFI_FAILURE: + return "failure"; + default: + ERR("Invalid wifi_service_state_e parameter"); + break; + } + + return "Invalid parameter"; +} + +static const char *_convert_wifi_technology_state_to_string(wifi_tech_state_e wifi_tech_state_type) +{ + switch (wifi_tech_state_type) { + case NETCONFIG_WIFI_TECH_UNKNOWN: + return "unknown"; + case NETCONFIG_WIFI_TECH_OFF: + return "off"; + case NETCONFIG_WIFI_TECH_WPS_ONLY: + return "wps only"; + case NETCONFIG_WIFI_TECH_POWERED: + return "powered"; + case NETCONFIG_WIFI_TECH_CONNECTED: + return "connected"; + case NETCONFIG_WIFI_TECH_TETHERED: + return "tethered"; + default: + ERR("Invalid wifi_tech_state_e parameter"); + break; + } + + return "Invalid parameter"; +} + static gboolean _block_network_connection_popup(gpointer data) { block_network_connected_popup = FALSE; @@ -527,7 +573,8 @@ void wifi_state_set_service_state(wifi_service_state_e new_state) return; g_service_state = new_state; - DBG("Wi-Fi state %d ==> %d", old_state, new_state); + DBG("Wi-Fi service state, old state[%s] ==> new state[%s]", + _convert_wifi_service_state_to_string(old_state), _convert_wifi_service_state_to_string(new_state)); /* During DHCP, temporarily disable Wi-Fi power saving */ if ((old_state < NETCONFIG_WIFI_ASSOCIATION || old_state == NETCONFIG_WIFI_FAILURE) && new_state == NETCONFIG_WIFI_CONFIGURATION) { @@ -596,7 +643,8 @@ void wifi_state_set_tech_state(wifi_tech_state_e new_state) g_tech_state = new_state; - DBG("Wi-Fi technology state %d ==> %d", old_state, new_state); + DBG("Wi-Fi technology state, old state[%s] ==> new state[%s]", + _convert_wifi_technology_state_to_string(old_state), _convert_wifi_technology_state_to_string(new_state)); } wifi_tech_state_e wifi_state_get_technology_state(void)