From d8c91830a27ce9ad75a6d7fe54068d7e697cbdf9 Mon Sep 17 00:00:00 2001 From: Jaehyun Kim Date: Mon, 31 Oct 2022 22:28:44 +0900 Subject: [PATCH] DA: Standard error for customer self-diagnosis Change-Id: Ie222bb43c0128362324db57554fb9bba3fa7f140 Signed-off-by: Jaehyun Kim --- plugins/wifi.c | 12 +++++++++++- src/network.c | 4 ++++ src/service.c | 2 ++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/plugins/wifi.c b/plugins/wifi.c index 46a886a..065d818 100755 --- a/plugins/wifi.c +++ b/plugins/wifi.c @@ -109,6 +109,10 @@ static struct connman_technology *wifi_technology = NULL; static struct connman_technology *p2p_technology = NULL; +#if defined TIZEN_EXT +static GSupplicantState assoc_last_state = G_SUPPLICANT_STATE_UNKNOWN; +#endif + enum wifi_ap_capability{ WIFI_AP_UNKNOWN = 0, WIFI_AP_SUPPORTED = 1, @@ -4616,6 +4620,9 @@ static bool handle_wifi_assoc_retry(struct connman_network *network, return false; } + if (wifi->state > assoc_last_state) + assoc_last_state = wifi->state; + if (++wifi->assoc_retry_count >= TIZEN_ASSOC_RETRY_COUNT) { wifi->assoc_retry_count = 0; @@ -4623,7 +4630,7 @@ static bool handle_wifi_assoc_retry(struct connman_network *network, * however QA team recommends that the invalid-key error * might be better to display for user experience. */ - switch (wifi->state) { + switch (assoc_last_state) { case G_SUPPLICANT_STATE_AUTHENTICATING: connman_network_set_error(network, CONNMAN_NETWORK_ERROR_AUTHENTICATE_FAIL); break; @@ -4909,6 +4916,9 @@ static void interface_state(GSupplicantInterface *interface) } #if defined TIZEN_EXT + if (wifi->assoc_retry_count == 0) + assoc_last_state = G_SUPPLICANT_STATE_UNKNOWN; + /* Some of Wi-Fi networks are not comply Wi-Fi specification. * Retry association until its retry count is expired */ if (handle_wifi_assoc_retry(network, wifi) == true) { diff --git a/src/network.c b/src/network.c index abf88eb..e5c654e 100755 --- a/src/network.c +++ b/src/network.c @@ -1827,6 +1827,10 @@ static void set_authenticate_error(struct connman_network *network) if (!service) return; + if (connman_service_get_favorite(service)) { + __connman_service_set_ignore(service, true); + } + __connman_service_indicate_error(service, CONNMAN_SERVICE_ERROR_AUTH_FAILED); } diff --git a/src/service.c b/src/service.c index ef86e27..efc4143 100755 --- a/src/service.c +++ b/src/service.c @@ -6348,8 +6348,10 @@ static void set_error(struct connman_service *service, { const char *str; +#if !defined TIZEN_EXT if (service->error == error) return; +#endif service->error = error; -- 2.7.4