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

Revert "Add unit tests in parodus2ccsp" #287

Merged
merged 1 commit into from
Dec 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
9 changes: 5 additions & 4 deletions source/broadband/webpa_notification.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ char deviceMAC[32]={'\0'};
static int g_syncRetryThreadStarted = 0;

//This flag is used to avoid sync notification retry when param notification is already in progress.
int g_syncNotifyInProgress = 0;
static int g_syncNotifyInProgress = 0;

//This flag is used to avoid CMC check when CPE and cloud are in sync.
int g_checkSyncNotifyRetry = 0;
static int g_checkSyncNotifyRetry = 0;
#ifdef FEATURE_SUPPORT_WEBCONFIG
char *g_systemReadyTime=NULL;
#endif
Expand Down Expand Up @@ -379,7 +379,7 @@ void SyncNotifyRetryTask()
else
{
WalInfo("SyncNotifyRetry Thread created Successfully\n");
g_syncRetryThreadStarted = 1;
g_syncRetryThreadStarted = 1;
}
}

Expand Down Expand Up @@ -429,6 +429,7 @@ void *SyncNotifyRetry()
WalInfo("PARAM_NOTIFY is in progress\n");
continue;
}

if(g_checkSyncNotifyRetry || (rv == 0))
{
dbCMC = getParameterValue(PARAM_CMC);
Expand Down Expand Up @@ -1420,7 +1421,7 @@ void processNotification(NotifyData *notifyData)
{
free(dest);
return;
}
}
cJSON_AddNumberToObject(notifyPayload, "cmc", cmc);
cJSON_AddStringToObject(notifyPayload, "cid", cid);
WAL_FREE(cid);
Expand Down
19 changes: 8 additions & 11 deletions source/broadband/webpa_rbus.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,12 @@ WDMP_STATUS webpaRbusInit(const char *pComponentName)
void webpaRbus_Uninit()
{
rbus_close(rbus_handle);
rbus_handle = NULL;
}

rbusError_t setTraceContext(char* traceContext[])
{
rbusError_t ret = RBUS_ERROR_BUS_ERROR;
if(isRbusInitialized())
if(isRbusInitialized)
{
if(traceContext[0] != NULL && traceContext[1] != NULL) {
if(strlen(traceContext[0]) > 0 && strlen(traceContext[1]) > 0) {
Expand Down Expand Up @@ -86,7 +85,7 @@ rbusError_t getTraceContext(char* traceContext[])
rbusError_t ret = RBUS_ERROR_BUS_ERROR;
char traceParent[512] = {'\0'};
char traceState[512] = {'\0'};
if(isRbusInitialized())
if(isRbusInitialized)
{
ret = rbusHandle_GetTraceContextAsString(rbus_handle, traceParent, sizeof(traceParent), traceState, sizeof(traceState));
if( ret == RBUS_ERROR_SUCCESS) {
Expand All @@ -113,7 +112,7 @@ rbusError_t getTraceContext(char* traceContext[])
rbusError_t clearTraceContext()
{
rbusError_t ret = RBUS_ERROR_BUS_ERROR;
if(isRbusInitialized())
if(isRbusInitialized)
{
ret = rbusHandle_ClearTraceContext(rbus_handle);
if(ret == RBUS_ERROR_SUCCESS) {
Expand Down Expand Up @@ -160,17 +159,17 @@ static void cloudConnEventHandler(
(void)handle;
}

int SubscribeCloudConnOnlineEvent()
void SubscribeCloudConnOnlineEvent()
{
int rc = RBUS_ERROR_SUCCESS;
int rc = RBUS_ERROR_SUCCESS;
WalPrint("rbus event subscribe to cloud connection online subscribe callback\n");
if(isRbusInitialized())
if(isRbusInitialized)
{
rc = rbusEvent_Subscribe(rbus_handle, CLOUD_CONN_ONLINE, cloudConnEventHandler, NULL, 0);
if(rc != RBUS_ERROR_SUCCESS)
{
WalError("rbusEvent_Subscribe to %s failed: %d\n", CLOUD_CONN_ONLINE, rc);
return rc;
WalError("consumer: rbusEvent_Subscribe for %s failed: %d\n", CLOUD_CONN_ONLINE, rc);
return NULL;
}
else
{
Expand All @@ -180,8 +179,6 @@ int SubscribeCloudConnOnlineEvent()
else
{
WalError("Failed to subscribe to cloud_conn_online event as rbus is not initialized\n");
return RBUS_ERROR_BUS_ERROR;
}
return rc;
}

2 changes: 1 addition & 1 deletion source/include/webpa_rbus.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ rbusError_t setTraceContext(char* traceContext[]);
rbusError_t getTraceContext(char* traceContext[]);
rbusError_t clearTraceContext();
static void cloudConnEventHandler(rbusHandle_t handle,rbusEvent_t const* event,rbusEventSubscription_t* subscription);
int SubscribeCloudConnOnlineEvent();
void SubscribeCloudConnOnlineEvent();
#endif
2 changes: 0 additions & 2 deletions tests/mock_stack.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ parameterInfoStruct_t **get_global_parameterInfo()

int CcspBaseIf_discComponentSupportingNamespace (void* bus_handle, const char* dst_component_id, const char *name_space, const char *subsystem_prefix, componentStruct_t ***components, int *size)
{

UNUSED(bus_handle); UNUSED(dst_component_id); UNUSED(name_space); UNUSED(subsystem_prefix);
*components = get_global_components();
*size = get_global_component_size();
Expand All @@ -150,7 +149,6 @@ void free_componentStruct_t (void* bus_handle, int size, componentStruct_t **val

int CcspBaseIf_getParameterValues(void* bus_handle, const char* dst_component_id, char* dbus_path, char * parameterNames[], int size, int *val_size, parameterValStruct_t ***val)
{

UNUSED(bus_handle); UNUSED(dst_component_id); UNUSED(dbus_path); UNUSED(parameterNames);
check_expected(size);
*val = get_global_values();
Expand Down
Loading
Loading