From 5bc1b306f04f6746b44cae3ce7bf5dfef723dae4 Mon Sep 17 00:00:00 2001 From: Karunakaran A <48997923+karuna2git@users.noreply.github.com> Date: Fri, 27 Sep 2024 15:18:49 -0400 Subject: [PATCH] DELIA-66411 : Retry when subscription to an event failed (#13) Reason for change: In the reported ticket, it is noticed that WiFi Plugin failed to subscribe `onAvailableSSIDs` event but didnt retry. So when scan is called by application, the scan was success but it never posted any update as it never received `onAvailableSSIDs` event from unified networkmanager plugin Test Procedure: As per DELIA-66411 Risks: Medium Signed-off-by: Karunakaran A --- LegacyPlugin_NetworkAPIs.cpp | 5 +++++ LegacyPlugin_WiFiManagerAPIs.cpp | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/LegacyPlugin_NetworkAPIs.cpp b/LegacyPlugin_NetworkAPIs.cpp index 7ac3ca9c..482522d2 100644 --- a/LegacyPlugin_NetworkAPIs.cpp +++ b/LegacyPlugin_NetworkAPIs.cpp @@ -864,6 +864,11 @@ const string CIDR_PREFIXES[CIDR_NETMASK_IP_LEN] = { m_timer.stop(); NMLOG_INFO("subscriber timer stoped"); } + else + { + m_timer.start(SUBSCRIPTION_TIMEOUT_IN_MILLISECONDS); + NMLOG_INFO("subscriber timer started"); + } } string Network::getInterfaceMapping(const string & interface) diff --git a/LegacyPlugin_WiFiManagerAPIs.cpp b/LegacyPlugin_WiFiManagerAPIs.cpp index 0aa9596c..b003d60d 100644 --- a/LegacyPlugin_WiFiManagerAPIs.cpp +++ b/LegacyPlugin_WiFiManagerAPIs.cpp @@ -544,6 +544,11 @@ namespace WPEFramework m_timer.stop(); NMLOG_INFO("subscriber timer stoped"); } + else + { + m_timer.start(SUBSCRIPTION_TIMEOUT_IN_MILLISECONDS); + NMLOG_INFO("subscriber timer started"); + } } bool WiFiManager::ErrorCodeMapping(const uint32_t ipvalue, uint32_t &opvalue)