Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DELIA-65419, RDKTV-31166: Delay in providing 'oninternetstatuschange'… #5435

Merged
merged 1 commit into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Network/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ All notable changes to this RDK Service will be documented in this file.

* For more details, refer to [versioning](https://github.com/rdkcentral/rdkservices#versioning) section under Main README.

## [1.3.11] - 2024-06-19
### Fixed
- onInternetStatus event not posting error fix

## [1.3.10] - 2024-04-17
### Added
- added retry logic for connectivity monitor
Expand Down
15 changes: 4 additions & 11 deletions Network/Network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ using namespace std;

#define API_VERSION_NUMBER_MAJOR 1
#define API_VERSION_NUMBER_MINOR 3
#define API_VERSION_NUMBER_PATCH 10
#define API_VERSION_NUMBER_PATCH 11

/* Netsrvmgr Based Macros & Structures */
#define IARM_BUS_NM_SRV_MGR_NAME "NET_SRV_MGR"
Expand Down Expand Up @@ -1461,17 +1461,10 @@ typedef struct _IARM_BUS_NetSrvMgr_Iface_EventData_t {
m_defInterfaceCache = "";

sendNotify("onConnectionStatusChanged", params);
if(connected)
connectivityMonitor.doInitialConnectivityMonitoring(30);
if(!connected)
{
connectivityMonitor.doInitialConnectivityMonitoring(30);
}
else
{
if (!connectivityMonitor.isMonitorThreadRunning())
{
/*run the thread again to notify no_internet state*/
connectivityMonitor.doInitialConnectivityMonitoring(30);
}
/* if disconnectd need to stop the thread after one event */
connectivityMonitor.stopInitialConnectivityMonitoring();
}
}
Expand Down
4 changes: 3 additions & 1 deletion Network/NetworkConnectivity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,7 @@ namespace WPEFramework {
if (isMonitorThreadRunning() && stopFlag == false)
{
LOGINFO("Connectivity Monitor Thread is active so notify");
g_internetState = nsm_internetState::UNKNOWN;
cv_.notify_all();
}
else
Expand Down Expand Up @@ -578,7 +579,8 @@ namespace WPEFramework {
if(g_internetState.load() != InternetConnectionState)
{
LOGINFO("notification count %d ...", notifyWaitCount);
if(InternetConnectionState == nsm_internetState::NO_INTERNET && notifyWaitCount > 0)
/* Retry logic only need when continuous monitor is running, otherwise post notification immediately */
if(InternetConnectionState == nsm_internetState::NO_INTERNET && isContinuesMonitoringNeeded && notifyWaitCount > 0)
{
/* Decrease the notification count to create a delay in posting the 'no internet' state. */
notifyWaitCount--;
Expand Down
1 change: 1 addition & 0 deletions NetworkManager/service/NetworkConnectivity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,7 @@ namespace WPEFramework {
if (isMonitorThreadRunning())
{
NMLOG_INFO("Connectivity Monitor Thread is active so notify");
g_internetState = nsm_internetState::UNKNOWN;
cv_.notify_all();
}
else
Expand Down
Loading