From 230a31ea0758c3bfa70aa797bbdba9f70dce464c Mon Sep 17 00:00:00 2001 From: sadhyama Date: Fri, 20 Dec 2024 15:59:04 +0530 Subject: [PATCH] Revert "WebPA Sync Notification handling during Factory reset cloud sync" --- source/broadband/include/webpa_notification.h | 2 - source/broadband/webpa_notification.c | 53 ++----------------- 2 files changed, 3 insertions(+), 52 deletions(-) diff --git a/source/broadband/include/webpa_notification.h b/source/broadband/include/webpa_notification.h index a0e7bcaa..46390845 100644 --- a/source/broadband/include/webpa_notification.h +++ b/source/broadband/include/webpa_notification.h @@ -140,5 +140,3 @@ WDMP_STATUS validate_webpa_notification_data(char *notify_param_name, char *writ pthread_cond_t *get_global_sync_condition(void); pthread_mutex_t *get_global_sync_mutex(void); - -void FR_CloudSyncCheck(); diff --git a/source/broadband/webpa_notification.c b/source/broadband/webpa_notification.c index 94ae763b..4ba7fbcb 100644 --- a/source/broadband/webpa_notification.c +++ b/source/broadband/webpa_notification.c @@ -242,7 +242,7 @@ void sendNotificationForFactoryReset(); void sendNotificationForFirmwareUpgrade(); static WDMP_STATUS addOrUpdateFirmwareVerToConfigFile(char *value); static WDMP_STATUS processParamNotification(ParamNotify *paramNotify, unsigned int *cmc, char **cid); -static WDMP_STATUS getCmcCidValues(unsigned int *cmc, char **cid); +static WDMP_STATUS processParamNotificationRetry(unsigned int *cmc, char **cid); static void processConnectedClientNotification(NodeData *connectedNotify, char *deviceId, char **version, char ** nodeMacId, char **timeStamp, char **destination); static WDMP_STATUS processFactoryResetNotification(ParamNotify *paramNotify, unsigned int *cmc, char **cid, char **reason); static WDMP_STATUS processFirmwareUpgradeNotification(ParamNotify *paramNotify, unsigned int *cmc, char **cid); @@ -1036,59 +1036,12 @@ static void addNotifyMsgToQueue(NotifyData *notifyData) WalPrint("*****Returned from addNotifyMsgToQueue*****\n"); } -/* - * @brief To delay sync notifications until FR cloud sync is acknowledged by cloud with Test and Set request for max wait period of 60s - */ -void FR_CloudSyncCheck() -{ - char *cid = NULL; - unsigned int cmc = 0; - int FR_cloud_sync_completed = false; - WDMP_STATUS ret = WDMP_FAILURE; - - for(int i=0;i<12;i++) - { - ret = getCmcCidValues(&cmc, &cid); - if (ret != WDMP_SUCCESS) - { - WalError("Unable to get dbCID/CMC value during FR cloud sync check\n"); - } - else if ((strcmp(cid, "0") == 0) && cmc != 512) //To check whether the device is up after factory reset - { - WalInfo("Factory reset cloud sync is in progress, wait for 5sec to process sync notifications\n"); - WAL_FREE(cid); - } - else - { - FR_cloud_sync_completed = true; - WAL_FREE(cid); - break; - } - sleep(5); - } - - if(FR_cloud_sync_completed == false) - { - WalInfo("Factory reset cloud sync is failed after 60sec, proceeding to sync notifications without FR cloud sync\n"); - }else - { - WalInfo("Factory reset cloud sync is completed, proceeding to sync notifications\n"); - } -} /* * @brief To monitor notification events in Notification queue */ static void handleNotificationEvents() { - char *reboot_reason = NULL; - reboot_reason = getParameterValue(PARAM_REBOOT_REASON); - if( (NULL != reboot_reason) && (strcmp(reboot_reason,"factory-reset")==0) ) - { - WAL_FREE(reboot_reason); - FR_CloudSyncCheck(); - } - while(1) { pthread_mutex_lock (&mut); @@ -1462,7 +1415,7 @@ void processNotification(NotifyData *notifyData) case PARAM_NOTIFY_RETRY: { strcpy(dest, "event:SYNC_NOTIFICATION"); - ret = getCmcCidValues(&cmc, &cid); + ret = processParamNotificationRetry(&cmc, &cid); if (ret != WDMP_SUCCESS) { free(dest); @@ -1564,7 +1517,7 @@ static WDMP_STATUS processParamNotification(ParamNotify *paramNotify, return status; } -static WDMP_STATUS getCmcCidValues(unsigned int *cmc, char **cid) +static WDMP_STATUS processParamNotificationRetry(unsigned int *cmc, char **cid) { char *dbCID = NULL, *dbCMC = NULL;