diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 5c95d12b..8e723fc4 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -38,10 +38,10 @@ jobs: - name: Make Build Directory run: mkdir build - - name: Get Sonarcloud Binaries - uses: xmidt-org/sonarcloud-installer-action@v1 - with: - working-directory: build + #- name: Get Sonarcloud Binaries + #uses: xmidt-org/sonarcloud-installer-action@v1 + # with: + # working-directory: build - name: Get rtrouted Binary working-directory: build @@ -64,7 +64,7 @@ jobs: mkdir _install mkdir _install/lib cp ${RBUS_INSTALL_DIR}/usr/lib/librbus* _install/lib - build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir bw-output make all test + build-wrapper-linux-x86-64 --out-dir bw-output make all test # ARGS=-VV make test # use this version for debugging diff --git a/source/broadband/include/webpa_notification.h b/source/broadband/include/webpa_notification.h index 46390845..a0e7bcaa 100644 --- a/source/broadband/include/webpa_notification.h +++ b/source/broadband/include/webpa_notification.h @@ -140,3 +140,5 @@ 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_adapter.c b/source/broadband/webpa_adapter.c index e9a396a7..2a8beb4e 100644 --- a/source/broadband/webpa_adapter.c +++ b/source/broadband/webpa_adapter.c @@ -57,7 +57,7 @@ void processRequest(char *reqPayload,char *transactionId, char **resPayload, hea char *dbCID = NULL; char *dbCMC = NULL; char newCMC[32]={'\0'}; - + static int testing = 1; WalPrint("************** processRequest *****************\n"); wdmp_parse_request(reqPayload,&reqObj); @@ -324,6 +324,12 @@ void processRequest(char *reqPayload,char *transactionId, char **resPayload, hea case TEST_AND_SET: { + if(testing == 1) + { + testing =0; + WalInfo("Sleeping 30sec before processing TEST_AND_SET\n"); + sleep(30); + } WalPrint("Request:> ParamCount = %zu\n",reqObj->u.testSetReq->paramCnt); resObj->paramCnt = reqObj->u.testSetReq->paramCnt; WalPrint("Response:> paramCnt = %zu\n", resObj->paramCnt); diff --git a/source/broadband/webpa_notification.c b/source/broadband/webpa_notification.c index 7fffe149..a9247aa2 100644 --- a/source/broadband/webpa_notification.c +++ b/source/broadband/webpa_notification.c @@ -1041,12 +1041,50 @@ static void addNotifyMsgToQueue(NotifyData *notifyData) WalPrint("*****Returned from addNotifyMsgToQueue*****\n"); } +/* + * @brief To handle sync notifications during factory reset + */ +void FR_CloudSyncCheck() +{ + char *dbCID = NULL; + int factory_reset_flag = flase; + for(int i=1;i<=12;i++) + { + dbCID = getParameterValue(PARAM_CID); + if(dbCID == NULL) + { + WalError("Unable to get dbCID value in handleNotificationEvents\n"); + sleep(5); + } + else if (dbCID != NULL && strcmp(dbCID, "0") == 0) //To check wheter the devie is up after factory reset + { + WalInfo("factory reset cloud sync is in progress, wait 5sec for process nitification\n"); + factory_reset_flag = true; + sleep(5); + } + else + { + break; + } + WAL_FREE(dbCID); + } + if(factory_reset_flag == true) + { + WalInfo("factory reset cloud sync is done, processing NotificationEvents\n"); + } + if(dbCID != NULL && (strcmp(dbCID, "0") == 0) && factory_reset_flag == true) + { + WalError("factory reset sync is failed after 60sec, proceding NotificationEvents without cloud sysnc\n"); + } + WAL_FREE(dbCID); +} /* * @brief To monitor notification events in Notification queue */ static void handleNotificationEvents() { + FR_CloudSyncCheck(); while(1) { pthread_mutex_lock (&mut); @@ -1281,6 +1319,7 @@ void processNotification(NotifyData *notifyData) free(dest); return; } + WalInfo("Parameter name: %s\n",notifyData->u.notify->paramName); cJSON_AddNumberToObject(notifyPayload, "cmc", cmc); cJSON_AddStringToObject(notifyPayload, "cid", cid); OnboardLog("%s/%d/%s\n",dest,cmc,cid);