Skip to content

Commit

Permalink
Merge branch 'rdkcentral:main' into rename_rbuscode
Browse files Browse the repository at this point in the history
  • Loading branch information
NetajiPanigrahi authored Jul 9, 2024
2 parents 29f7caa + db9eeba commit 2c9169a
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 23 deletions.
4 changes: 2 additions & 2 deletions src/core/rbuscore.c
Original file line number Diff line number Diff line change
Expand Up @@ -2297,15 +2297,15 @@ rbusCoreError_t rbuscore_discoverRegisteredComponents(int * count, char *** comp
}

rtMessage_Release(msg);
rtMessage_Release(out);
ret = RBUSCORE_SUCCESS;
}
else
{
RBUSCORELOG_ERROR("Failed with error code %d", err);
ret = RBUSCORE_ERROR_GENERAL;
}


rtMessage_Release(out);
return ret;
}

Expand Down
14 changes: 11 additions & 3 deletions src/rbus/rbus.c
Original file line number Diff line number Diff line change
Expand Up @@ -3493,7 +3493,7 @@ rbusError_t rbus_getExt(rbusHandle_t handle, int paramCount, char const** pParam
}
else
{
rbusProperty_t tmpProperties;
rbusProperty_t tmpProperties = NULL;

if((errorcode = _getExt_response_parser(response, &tmpNumOfValues, &tmpProperties)) != RBUS_ERROR_SUCCESS)
{
Expand Down Expand Up @@ -3531,8 +3531,16 @@ rbusError_t rbus_getExt(rbusHandle_t handle, int paramCount, char const** pParam
for(i = 0; i < numDestinations; i++)
free(destinations[i]);
free(destinations);
if ((*retProperties != NULL) && (errorcode != RBUS_ERROR_SUCCESS))
{
RBUSLOG_WARN("Query for expression %s was partially successful", pParamNames[0]);
return RBUS_ERROR_SUCCESS;
}
else
{
return errorcode;
}

return errorcode;
}
}
else
Expand Down Expand Up @@ -3633,7 +3641,7 @@ rbusError_t rbus_getExt(rbusHandle_t handle, int paramCount, char const** pParam
}
else
{
rbusProperty_t batchResult;
rbusProperty_t batchResult = NULL;
int batchNumVals;
if((errorcode = _getExt_response_parser(response, &batchNumVals, &batchResult)) != RBUS_ERROR_SUCCESS)
{
Expand Down
36 changes: 18 additions & 18 deletions utils/rbuscli/rbuscli.c
Original file line number Diff line number Diff line change
Expand Up @@ -1195,7 +1195,7 @@ void validate_and_execute_get_cmd (int argc, char *argv[])
rc = rbus_getExt(g_busHandle, numOfInputParams, pInputParam, &numOfOutVals, &outputVals);
}

if(RBUS_ERROR_SUCCESS == rc)
if((RBUS_ERROR_SUCCESS == rc) && (outputVals != NULL))
{
rbusProperty_t next = outputVals;
for (i = 0; i < numOfOutVals; i++)
Expand All @@ -1204,23 +1204,23 @@ void validate_and_execute_get_cmd (int argc, char *argv[])
rbusValueType_t type = rbusValue_GetType(val);
char *pStrVal = rbusValue_ToString(val,NULL,0);

if ((strcmp("-g", argv[1]) == 0))
{
printf ("%s\n", pStrVal);
}
else
{
printf ("Parameter %2d:\n\r", i+1);
printf (" Name : %s\n\r", rbusProperty_GetName(next));
printf (" Type : %s\n\r", getDataType_toString(type));
printf (" Value : %s\n\r", pStrVal);
}
if(pStrVal)
{
free(pStrVal);
}
next = rbusProperty_GetNext(next);
}
if ((strcmp("-g", argv[1]) == 0))
{
printf ("%s\n", pStrVal);
}
else
{
printf ("Parameter %2d:\n\r", i+1);
printf (" Name : %s\n\r", rbusProperty_GetName(next));
printf (" Type : %s\n\r", getDataType_toString(type));
printf (" Value : %s\n\r", pStrVal);
}
if(pStrVal)
{
free(pStrVal);
}
next = rbusProperty_GetNext(next);
}
/* Free the memory */
rbusProperty_Release(outputVals);
}
Expand Down

0 comments on commit 2c9169a

Please sign in to comment.