Skip to content

RDKB-58534 - [POC] Enable RRD Dynamic Profile for RDKB platforms #78

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

Open
wants to merge 90 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
3aa8a4d
Tr181set to rbus set conversion
Abhinavpv28 Jan 30, 2025
2665262
Update Makefile.am
Abhinavpv28 Jan 30, 2025
0c50382
Update rrdDeepSleep.c
Abhinavpv28 Jan 30, 2025
7c992e8
Update Makefile.am
Abhinavpv28 Jan 30, 2025
ed66021
Update Makefile.am
Abhinavpv28 Jan 30, 2025
9cb111b
Update rrdDeepSleep.c
Abhinavpv28 Jan 30, 2025
fbbdbb6
Update rrdEventProcess.c
Abhinavpv28 Jan 31, 2025
e824f61
Update rrdDeepSleep.c
Abhinavpv28 Jan 31, 2025
8d3231c
Merge pull request #31 from rdkcentral/develop
Abhinavpv28 Jan 31, 2025
1dcd950
Update rrdEventProcess.c
Abhinavpv28 Feb 1, 2025
11da8e0
Merge pull request #34 from rdkcentral/develop
Abhinavpv28 Feb 1, 2025
68a9e55
rdmdownload to new file rdmdownload.c
Feb 4, 2025
d7d3ea7
Update rdmdownload.c
Abhinavpv28 Feb 4, 2025
f923377
Update rrdDeepSleep.c
Abhinavpv28 Feb 4, 2025
97df765
Update rrdInterface.c
Abhinavpv28 Feb 17, 2025
3a48b1d
Update rrdRbus.h
Abhinavpv28 Feb 17, 2025
610b1ab
Merge pull request #50 from rdkcentral/develop
Abhinavpv28 Feb 17, 2025
f10c9b1
Update rrdInterface.c
Abhinavpv28 Feb 17, 2025
8baad47
Update rrdInterface.c
Abhinavpv28 Feb 17, 2025
0354d45
Update rrdInterface.h
Abhinavpv28 Feb 18, 2025
b1f07e5
Update rrdInterface.h
Abhinavpv28 Feb 18, 2025
6f49be7
Merge pull request #51 from rdkcentral/develop
Abhinavpv28 Feb 18, 2025
6294a14
Update rrdInterface.c
Abhinavpv28 Feb 18, 2025
36f5339
Update rrdInterface.h
Abhinavpv28 Feb 18, 2025
d9b0306
Update rrdInterface.c
Abhinavpv28 Feb 18, 2025
ae1edbe
Update rrdInterface.c
Abhinavpv28 Feb 19, 2025
463dce4
Update rrdInterface.h
Abhinavpv28 Feb 19, 2025
e633492
Update rrdInterface.c
Abhinavpv28 Feb 19, 2025
7e845ec
Update rrdInterface.c
Abhinavpv28 Feb 23, 2025
c3bd895
Create rdmMgr.h
Abhinavpv28 Feb 23, 2025
ed5750b
Merge pull request #68 from rdkcentral/develop
Abhinavpv28 Feb 23, 2025
485ac43
Update rrdInterface.c
Abhinavpv28 Feb 24, 2025
fef956f
Delete src/rdmMgr.h
Abhinavpv28 Feb 24, 2025
a66da2a
Update rrdInterface.c
Abhinavpv28 Feb 24, 2025
04db10f
Update rrdInterface.c
Abhinavpv28 Feb 25, 2025
2116d53
Update rrdInterface.c
Abhinavpv28 Feb 25, 2025
81cdd4e
Update rrdInterface.c
Abhinavpv28 Feb 25, 2025
b088ef1
Merge pull request #77 from rdkcentral/develop
Abhinavpv28 Feb 25, 2025
6702d57
Update rrdDeepSleep.c
Abhinavpv28 Feb 26, 2025
59248ba
Rename rrdDeepSleep.h to rrdDynamic.h
Abhinavpv28 Feb 26, 2025
06f548f
Update rrdMain.c
Abhinavpv28 Feb 26, 2025
972f47e
Update rrdDeepSleep.c
Abhinavpv28 Feb 26, 2025
efdcd8e
Update rrdUnitTestRunner.cpp
Abhinavpv28 Feb 26, 2025
b569f07
Update rdmdownload.c
Abhinavpv28 Feb 26, 2025
88a91de
Update rrdDynamic.h
Abhinavpv28 Feb 26, 2025
08dbf4d
Update rrdUnitTestRunner.cpp
Abhinavpv28 Feb 27, 2025
8b60ddf
Update rrdDeepSleep.c
Abhinavpv28 Mar 1, 2025
5183f28
Update rrdDeepSleep.c
Abhinavpv28 Mar 1, 2025
a701587
Update rrdDeepSleep.c
Abhinavpv28 Mar 1, 2025
2731974
Update rrdDeepSleep.c
Abhinavpv28 Mar 1, 2025
1d84994
Update rrdDeepSleep.c
Abhinavpv28 Mar 1, 2025
a075a8c
Update rrdDeepSleep.c
Abhinavpv28 Mar 1, 2025
d73eaf7
Update rrdDeepSleep.c
Abhinavpv28 Mar 1, 2025
fe3d446
Update rrdDeepSleep.c
Abhinavpv28 Mar 1, 2025
54ee131
Update Makefile.am
Abhinavpv28 Mar 1, 2025
9df73f7
Update rrdUnitTestRunner.cpp
Abhinavpv28 Mar 1, 2025
524ed21
Update rrdUnitTestRunner.cpp
Abhinavpv28 Mar 1, 2025
4bef912
Update rrdDeepSleep.c
Abhinavpv28 Mar 1, 2025
a66e962
Update Makefile.am
Abhinavpv28 Mar 1, 2025
7737eb9
Update rrdInterface.c
Abhinavpv28 Mar 2, 2025
ec8fe30
Update rrdInterface.c
Abhinavpv28 Mar 2, 2025
7b43598
Update rrdInterface.c
Abhinavpv28 Mar 3, 2025
dd32e44
Update rrdInterface.c
Abhinavpv28 Mar 3, 2025
e85f1f4
Update rrdInterface.c
Abhinavpv28 Mar 3, 2025
47b5cd2
Update rrdInterface.c
Abhinavpv28 Mar 3, 2025
0db0da8
Update rrdInterface.c
Abhinavpv28 Mar 3, 2025
428acde
Update rrdInterface.c
Abhinavpv28 Mar 4, 2025
705d28f
Update rrdInterface.c
Abhinavpv28 Mar 4, 2025
e40015b
Update rrdInterface.c
Abhinavpv28 Mar 4, 2025
821e7a3
Update rrdUnitTestRunner.cpp
Abhinavpv28 Mar 4, 2025
b7e8271
Update rrdEventProcess.c
Abhinavpv28 Mar 4, 2025
8a9f753
Update rrdUnitTestRunner.cpp
Abhinavpv28 Mar 4, 2025
2d4be85
Update rrdDeepSleep.c
Abhinavpv28 Mar 4, 2025
a274c7f
Update rrdMain.c
Abhinavpv28 Mar 4, 2025
acbc8fb
Update rrdInterface.c
Abhinavpv28 Mar 4, 2025
bc5ca68
Update rrdDeepSleep.c
Abhinavpv28 Mar 4, 2025
bd708d9
Update rrdInterface.c
Abhinavpv28 Mar 4, 2025
d4f9c1a
Update and rename rrdDeepSleep.c to rrdDynamic.c
Abhinavpv28 Mar 5, 2025
f6490ef
Update Makefile.am
Abhinavpv28 Mar 5, 2025
fa4b8be
Update rrdUnitTestRunner.cpp
Abhinavpv28 Mar 5, 2025
82900ae
Update rrdInterface.c
Abhinavpv28 Mar 5, 2025
e1cce1c
Update rrdUnitTestRunner.cpp
Abhinavpv28 Mar 5, 2025
348ca47
Update rrdMain.c
Abhinavpv28 Mar 5, 2025
ff0ea6c
Merge pull request #82 from rdkcentral/develop
Abhinavpv28 Mar 5, 2025
3236f4c
Update rrdInterface.c
Abhinavpv28 Mar 5, 2025
dd14b1f
Update rrdInterface.c
Abhinavpv28 Mar 5, 2025
f702733
Update rrdInterface.c
Abhinavpv28 Mar 5, 2025
6e28823
Update rrdDynamic.c
Abhinavpv28 Mar 5, 2025
aceb56d
Update rrdDynamic.c
Abhinavpv28 Mar 5, 2025
d816040
Update rrdDynamic.c
Abhinavpv28 Mar 6, 2025
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: 2 additions & 2 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ bin_PROGRAMS = remotedebugger
remotedebuggerincludedir = $(includedir)/rrd
remotedebuggerinclude_HEADERS = rrdCommon.h rrdInterface.h

remotedebugger_SOURCES = rrdMain.c rrdEventProcess.c rrdJsonParser.c rrdRunCmdThread.c rrdCommandSanity.c rrdExecuteScript.c rrdMsgPackDecoder.c rrdInterface.c
remotedebugger_SOURCES = rrdMain.c rrdEventProcess.c rrdJsonParser.c rrdRunCmdThread.c rrdCommandSanity.c rrdDynamic.c rrdExecuteScript.c rrdMsgPackDecoder.c rrdInterface.c
remotedebugger_CFLAGS = -I$(top_srcdir)/include/rrd -I$(PKG_CONFIG_SYSROOT_DIR)${includedir}/trower-base64/ -I$(PKG_CONFIG_SYSROOT_DIR)${includedir}/rbus/ $(CJSON_CFLAGS)
AM_LDFLAGS="-lpthread -lrdkloggers -lmsgpackc -ltrower-base64 -lwebconfig_framework -lrbus -lsecure_wrapper"
if IARMBUS_ENABLE
remotedebugger_SOURCES += rrdIarmEvents.c rrdDeepSleep.c
remotedebugger_SOURCES += rrdIarmEvents.c
remotedebugger_CFLAGS += -I$(PKG_CONFIG_SYSROOT_DIR)${includedir}/rdk/iarmbus/ -I$(PKG_CONFIG_SYSROOT_DIR)${includedir}/rdk/iarmmgrs/rdmmgr -I$(PKG_CONFIG_SYSROOT_DIR)${includedir}/rdk/iarmmgrs-hal -DIARMBUS_SUPPORT
AM_LDFLAGS += "-lIARMBus -lrfcapi -ltr181api"
endif
Expand Down
252 changes: 252 additions & 0 deletions src/rdmdownload.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,252 @@
#include "rrdDynamic.h"
#include "rrdRunCmdThread.h"
#include "rrdInterface.h"

extern rbusHandle_t rrdRbusHandle;
extern devicePropertiesData devPropData;
/*
* @function RRDRdmManagerDownloadRequest
* @brief Sends a request to the RDM Manager to download a specific package based on the
* issue node data and whether it is related to a deep sleep awake event.
* @param issueNodeData *pissueStructNode - Pointer to the structure containing issue node data.
* @param char *dynJSONPath - Path to the dynamic JSON file.
* @param data_buf *rbuf - Buffer containing event data and metadata.
* @param bool isDeepSleepAwakeEvent - Flag to indicate if this is a deep sleep awake event.
* @return void
*/
void RRDRdmManagerDownloadRequest(issueNodeData *pissueStructNode, char *dynJSONPath, data_buf *rbuf, bool isDeepSleepAwakeEvent)
{
char *paramString = NULL;
char *msgDataString = NULL;
char *appendData = NULL;
unsigned char objSize = sizeof(unsigned char);
int mSGLength = -1;
int msgDataStringSize = -1;


RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: ...Entering.. \n", __FUNCTION__, __LINE__);
if (pissueStructNode)
{
RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: Issue Data Node:%s and Sub-Node:%s not found in Dynamic JSON File %s...\n", __FUNCTION__, __LINE__, pissueStructNode->Node, pissueStructNode->subNode, dynJSONPath);
RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: Request RDM Manager Download for a new Issue Type\n", __FUNCTION__, __LINE__);

/* Get mSGLength */
mSGLength = RRDGetProfileStringLength(pissueStructNode, isDeepSleepAwakeEvent);
if (mSGLength > 0)
{
paramString = (char *)calloc(mSGLength, objSize);
if (paramString)
{
/* Get paramString for Device */
if (isDeepSleepAwakeEvent)
{
const char *profileName = getRrdProfileName(&devPropData);
msgDataStringSize = strlen(RDM_PKG_PREFIX) + strlen(DEEP_SLEEP_STR) + strlen(RDM_PKG_SUFFIX);

if(profileName && strlen(profileName) > 0)
{
msgDataStringSize += strlen(profileName) + 1;
snprintf(paramString, mSGLength, "%s%s%s%s%s", RDM_PKG_PREFIX, profileName, "-", DEEP_SLEEP_STR, RDM_PKG_SUFFIX);
}
else{
snprintf(paramString, mSGLength, "%s%s%s", RDM_PKG_PREFIX, DEEP_SLEEP_STR, RDM_PKG_SUFFIX);
}
}
else
{
snprintf(paramString, mSGLength, "%s%s%s", RDM_PKG_PREFIX, pissueStructNode->Node, RDM_PKG_SUFFIX);
msgDataStringSize = strlen(RDM_PKG_PREFIX) + strlen(pissueStructNode->Node) + 1;
}

RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: Package TAR File Name : %s\n", __FUNCTION__, __LINE__, paramString);

msgDataString = (char *)calloc(msgDataStringSize, objSize);
if (msgDataString)
{
if (isDeepSleepAwakeEvent)
strncpy(msgDataString, paramString, msgDataStringSize);
else
snprintf(msgDataString, msgDataStringSize, "%s%s", RDM_PKG_PREFIX, pissueStructNode->Node);

/* Send RDM Manager Download Request */
RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: Request RDM Manager Download for... %s\n", __FUNCTION__, __LINE__, paramString);
rbusError_t rc = RBUS_ERROR_BUS_ERROR;
rbusValue_t value;
rbusValue_Init(&value);
rbusValue_SetString(value,paramString);
rc = rbus_set(rrdRbusHandle,RDM_MGR_PKG_INST, value, NULL);
//tr181status = setParam("rrd", RDM_MGR_PKG_INST, paramString);
if (rc == RBUS_ERROR_SUCCESS)
{
RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: Setting Parameters using rbus success...\n", __FUNCTION__, __LINE__);
/* Append Package string in Cache */
if (rbuf->appendMode)
{
appendData = (char *)malloc(strlen(APPEND_SUFFIX) + strlen(rbuf->mdata) + 1);
strcpy(appendData,rbuf->mdata);
strcat(appendData,APPEND_SUFFIX);
RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: Cache String updated in appendmode IssueStr:%s Length:%d\n", __FUNCTION__, __LINE__, appendData, strlen(appendData));
append_item(strdup(msgDataString), strdup(appendData));
RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: Setting Parameters Success and Cache Updated ...%s IssueStr:%s Length:%d\n", __FUNCTION__, __LINE__, msgDataString, appendData, strlen(appendData));
}
else
{
append_item(strdup(msgDataString), strdup((char *)rbuf->mdata));
RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: Setting Parameters Success and Cache Updated ...%s IssueStr:%s Length:%d\n", __FUNCTION__, __LINE__, msgDataString, (char *)rbuf->mdata, strlen((char *)rbuf->mdata));
}
}
else
{
RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: Setting Parameters failed...\n", __FUNCTION__, __LINE__);
}
free(msgDataString);
free(appendData);
}
else
{
RDK_LOG(RDK_LOG_ERROR, LOG_REMDEBUG, "[%s:%d]: Memory Allocation Failed for Request RDM Manager Download.\n", __FUNCTION__, __LINE__);
}
free(paramString);
}
else
{
RDK_LOG(RDK_LOG_ERROR, LOG_REMDEBUG, "[%s:%d]: Memory Allocation Failed for Request RDM Manager Download.\n", __FUNCTION__, __LINE__);
}
free(pissueStructNode->Node);
free(pissueStructNode->subNode);
}
}
else
{
RDK_LOG(RDK_LOG_ERROR, LOG_REMDEBUG, "[%s:%d]: Invalid Issued Struct Node\n", __FUNCTION__, __LINE__);
}

RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: ...Exiting...\n", __FUNCTION__, __LINE__);
return;
}

/*
* @function RRDCheckIssueInDynamicProfile
* @brief Checks for a specific issue in the dynamic JSON profile associated with the given
* buffer. Parses the JSON file and searches for the issue.
* @param data_buf *rbuf - Buffer containing event data and metadata.
* @param issueNodeData *issueStructNode - Pointer to structure containing issue node data.
* @return char* - Returns the parsed JSON as a string if the issue is found, otherwise returns NULL.
*/
char *RRDCheckIssueInDynamicProfile(data_buf *rbuf, issueNodeData *issueStructNode)
{
bool isDynamicIssueInJSON = false;
char *jsonParsed = NULL;


RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: ...Entering.. \n", __FUNCTION__, __LINE__);
if (rbuf->inDynamic)
{
RDK_LOG(RDK_LOG_INFO, LOG_REMDEBUG, "[%s:%d]: Issue Marked as inDynamic... \n", __FUNCTION__, __LINE__);
RDK_LOG(RDK_LOG_ERROR, LOG_REMDEBUG, "[%s:%d]: Checking Dynamic Profile... \n", __FUNCTION__, __LINE__);
if (!rbuf->jsonPath) // Dynamic Profile JSON does not exists
{
RDK_LOG(RDK_LOG_ERROR, LOG_REMDEBUG, "[%s:%d]: Dynamic Profile JSON Not Found... \n", __FUNCTION__, __LINE__);
#if !defined(GTEST_ENABLE)
free(rbuf->mdata);
#else
if (rbuf->mdata) {
free(rbuf->mdata);
rbuf->mdata = NULL;
}
#endif
}
else
{
/* Parse Dynamic Profile JSON from Package */
/* Fix for warning : Wincompatible-pointer-types */
jsonParsed = cJSON_Print(readAndParseJSON(rbuf->jsonPath));
if (!jsonParsed)
{
/* Parsing Failed */
RDK_LOG(RDK_LOG_ERROR, LOG_REMDEBUG, "[%s:%d]: Dynamic JSON Parse/Read failed... %s\n", __FUNCTION__, __LINE__, rbuf->jsonPath);
#if !defined(GTEST_ENABLE)
free(rbuf->mdata);
free(rbuf->jsonPath);
#else
if (rbuf->mdata) {
free(rbuf->mdata);
rbuf->mdata = NULL;
}
if (rbuf->jsonPath) {
free(rbuf->jsonPath);
rbuf->jsonPath = NULL;
}
#endif
}
else
{
/* Find the issue in Parsed Json File */
/* Fix for warning : Wincompatible-pointer-types */
isDynamicIssueInJSON = findIssueInParsedJSON(issueStructNode, cJSON_Parse(jsonParsed));
if (!isDynamicIssueInJSON) /* Issue Data not in Dynamic Profile JSON */
{
RDK_LOG(RDK_LOG_ERROR, LOG_REMDEBUG, "[%s:%d]: Issue Data not found in Dynamic JSON %s... \n", __FUNCTION__, __LINE__, rbuf->jsonPath);
#if !defined(GTEST_ENABLE)
free(rbuf->mdata);
free(rbuf->jsonPath);
free(jsonParsed);
jsonParsed = NULL;
#else
if (rbuf->mdata) {
free(rbuf->mdata);
rbuf->mdata = NULL;
}
if (rbuf->jsonPath) {
free(rbuf->jsonPath);
rbuf->jsonPath = NULL;
}
if (jsonParsed) {
free(jsonParsed);
jsonParsed = NULL;
}
#endif
}
}
}
}

RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: ...Exiting...\n", __FUNCTION__, __LINE__);
return jsonParsed;
}
/*
* @function RRDGetProfileStringLength
* @brief Calculates the JSON path length for a given profile, taking into account different
* device types and whether it is a deep sleep awake event.
* @param issueNodeData *pissueStructNode - Pointer to structure containing issue node data.
* @param bool isDeepSleepAwakeEvent - Flag to indicate if this is a deep sleep awake event.
* @return int - Returns the calculated JSON path length.
*/
int RRDGetProfileStringLength(issueNodeData *pissueStructNode, bool isDeepSleepAwakeEvent)
{
int length = -1;
unsigned int prefixlen = strlen(RDM_PKG_PREFIX);
unsigned int suffixlen = strlen(RDM_PKG_SUFFIX);
unsigned int nodelen = 0;

/* Calculate Length for Device Type for Deep Sleep Awake Event*/
if (isDeepSleepAwakeEvent)
{
suffixlen += strlen(DEEP_SLEEP_STR);
const char *profileName = getRrdProfileName(&devPropData);

if(profileName && strlen(profileName) > 0){
length = prefixlen + strlen(profileName) + suffixlen + 1;
}
else{
length = prefixlen + suffixlen;
}
}
else
{
nodelen = strlen(pissueStructNode->Node);
length = prefixlen + nodelen + suffixlen;
}
return length + 1;
}

35 changes: 27 additions & 8 deletions src/rrdDeepSleep.c → src/rrdDynamic.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@
* limitations under the License.
*/

#include "rrdDeepSleep.h"
#include "rrdDynamic.h"
#include "rrdRunCmdThread.h"
#include "rrdInterface.h"

extern rbusHandle_t rrdRbusHandle;
extern devicePropertiesData devPropData;

/*
Expand Down Expand Up @@ -81,7 +83,7 @@ void RRDProcessDeepSleepAwakeEvents(data_buf *rbuf)
/*Initiate RDM Manager Download Request*/
RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: Sending RDM Download Request for DeepSleep dynamic package...\n", __FUNCTION__, __LINE__);
RRDRdmManagerDownloadRequest(&issueStructNode, dynJSONPath, rbuf, true);

/*Free Recieved Buffer and Dynamic Json Path Pointer*/
free(dynJSONPath);
free(rbuf->mdata);
Expand Down Expand Up @@ -158,7 +160,6 @@ int RRDGetProfileStringLength(issueNodeData *pissueStructNode, bool isDeepSleepA
*/
void RRDRdmManagerDownloadRequest(issueNodeData *pissueStructNode, char *dynJSONPath, data_buf *rbuf, bool isDeepSleepAwakeEvent)
{
tr181ErrorCode_t tr181status = tr181Failure;
char *paramString = NULL;
char *msgDataString = NULL;
char *appendData = NULL;
Expand All @@ -174,13 +175,18 @@ void RRDRdmManagerDownloadRequest(issueNodeData *pissueStructNode, char *dynJSON
RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: Request RDM Manager Download for a new Issue Type\n", __FUNCTION__, __LINE__);

/* Get mSGLength */
mSGLength = RRDGetProfileStringLength(pissueStructNode, isDeepSleepAwakeEvent);
#ifdef IARMBUS_SUPPORT
mSGLength = RRDGetProfileStringLength(pissueStructNode, isDeepSleepAwakeEvent);
#else
mSGLength = RRDGetProfileStringLength(pissueStructNode, false);
#endif
if (mSGLength > 0)
{
paramString = (char *)calloc(mSGLength, objSize);
if (paramString)
{
/* Get paramString for Device */
#ifdef IARMBUS_SUPPORT
if (isDeepSleepAwakeEvent)
{
const char *profileName = getRrdProfileName(&devPropData);
Expand All @@ -200,23 +206,36 @@ void RRDRdmManagerDownloadRequest(issueNodeData *pissueStructNode, char *dynJSON
snprintf(paramString, mSGLength, "%s%s%s", RDM_PKG_PREFIX, pissueStructNode->Node, RDM_PKG_SUFFIX);
msgDataStringSize = strlen(RDM_PKG_PREFIX) + strlen(pissueStructNode->Node) + 1;
}

#else
snprintf(paramString, mSGLength, "%s%s%s", RDM_PKG_PREFIX, pissueStructNode->Node, RDM_PKG_SUFFIX);
msgDataStringSize = strlen(RDM_PKG_PREFIX) + strlen(pissueStructNode->Node) + 1;
#endif
RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: Package TAR File Name : %s\n", __FUNCTION__, __LINE__, paramString);

msgDataString = (char *)calloc(msgDataStringSize, objSize);
if (msgDataString)
{
#ifdef IARMBUS_SUPPORT
if (isDeepSleepAwakeEvent)
strncpy(msgDataString, paramString, msgDataStringSize);
else
snprintf(msgDataString, msgDataStringSize, "%s%s", RDM_PKG_PREFIX, pissueStructNode->Node);
#else
snprintf(msgDataString, msgDataStringSize, "%s%s", RDM_PKG_PREFIX, pissueStructNode->Node);
#endif

/* Send RDM Manager Download Request */
RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: Request RDM Manager Download for... %s\n", __FUNCTION__, __LINE__, paramString);
tr181status = setParam("rrd", RDM_MGR_PKG_INST, paramString);
if (tr181status == tr181Success)
rbusError_t rc = RBUS_ERROR_BUS_ERROR;
rbusValue_t value;
//rbusValue_Init(&value);
rbusValue_SetString(value,paramString);
rc = rbus_set(rrdRbusHandle,RDM_MGR_PKG_INST, value, NULL);
//tr181status = setParam("rrd", RDM_MGR_PKG_INST, paramString);
if (rc == RBUS_ERROR_SUCCESS)
{
/* Append Package string in Cache */
RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: Setting Parameters using rbus success...\n", __FUNCTION__, __LINE__);
/* Append Package string in Cache */
if (rbuf->appendMode)
{
appendData = (char *)malloc(strlen(APPEND_SUFFIX) + strlen(rbuf->mdata) + 1);
Expand Down
4 changes: 2 additions & 2 deletions src/rrdDeepSleep.h → src/rrdDynamic.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
* limitations under the License.
*/

#ifndef _RRDDEEPSLEEP_H_
#define _RRDDEEPSLEEP_H_
#ifndef _RRDDYNAMIC_H_
#define _RRDDYNAMIC_H_

#ifdef __cplusplus
extern "C"
Expand Down
Loading
Loading