From cc327935d6cf6a003d7d2c0775b1c240a12545be Mon Sep 17 00:00:00 2001 From: nhanasi Date: Mon, 24 Feb 2025 13:42:50 -0500 Subject: [PATCH 1/4] =?UTF-8?q?Revert=20"Revert=20"RDKB-58634:=20Replace?= =?UTF-8?q?=20tr181=20set=20with=20rbus=20set=20for=20rdm=20download=20?= =?UTF-8?q?=E2=80=A6"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 25f13a75102d0a68b7bb7c40d0ecc84a6e9de993. --- cov_build.sh | 1 + src/rrdInterface.c | 10 +------- src/rrdMain.c | 64 ++++++++++++++++++++++++---------------------- src/rrdMain.h | 1 - 4 files changed, 36 insertions(+), 40 deletions(-) diff --git a/cov_build.sh b/cov_build.sh index 0cee692d..90d6b02a 100644 --- a/cov_build.sh +++ b/cov_build.sh @@ -78,6 +78,7 @@ cp libIARM.h /usr/local/include cd $WORKDIR autoreconf -i autoupdate + ./configure --prefix=${INSTALL_DIR} --enable-iarmbusSupport=yes make remotedebugger_CFLAGS="-I/usr/include/cjson -I/usr/local/include/wdmp-c -I/usr/local/include/rbus -I/usr/local/include -I/usr/local/include/trower-base64 -DIARMBUS_SUPPORT" remotedebugger_LDFLAGS="-L/usr/local/lib -lrdkloggers -lcjson -lrfcapi -lrbus -lmsgpackc -lsecure_wrapper -lwebconfig_framework -lIARMBus -ltr181api -L/usr/local/lib/x86_64-linux-gnu -ltrower-base64 -L/usr/lib/x86_64-linux-gnu" make install diff --git a/src/rrdInterface.c b/src/rrdInterface.c index ceba6c52..f22cd5fe 100644 --- a/src/rrdInterface.c +++ b/src/rrdInterface.c @@ -30,7 +30,7 @@ int msqid = 0; key_t key = 1234; #endif uint32_t gWebCfgBloBVersion = 0; -rbusHandle_t rrdRbusHandle; +extern rbusHandle_t rrdRbusHandle; /*Function: RRD_subscribe *Details: This helps to perform Bus init/connect and event handler registration for receiving @@ -52,14 +52,6 @@ int RRD_subscribe() return ret; } #endif - //RBUS Event Subscribe for RRD - ret = rbus_open(&rrdRbusHandle, REMOTE_DEBUGGER_RBUS_HANDLE_NAME); - if (ret != 0) - { - RDK_LOG(RDK_LOG_ERROR, LOG_REMDEBUG, "[%s:%d]: RBUS Open Failed!!! \n ", __FUNCTION__, __LINE__); - return ret; - } - RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: SUCCESS: RBUS Open! \n", __FUNCTION__, __LINE__); #if !defined(GTEST_ENABLE) subscriptions[0].eventName = RRD_SET_ISSUE_EVENT; subscriptions[0].filter = NULL; diff --git a/src/rrdMain.c b/src/rrdMain.c index 5d5b5f78..14313093 100644 --- a/src/rrdMain.c +++ b/src/rrdMain.c @@ -28,6 +28,8 @@ devicePropertiesData devPropData; #endif +rbusHandle_t rrdRbusHandle; + /* * @function RRDEventThreadFunc * @brief Infinite thread created from the main function to read messages received from the TR181 parameter @@ -87,37 +89,30 @@ void *RRDEventThreadFunc(void *arg) */ bool isRRDEnabled(void) { - bool ret = true; + bool ret = false; + rbusError_t retCode = RBUS_ERROR_BUS_ERROR; + rbusValue_t value = NULL; + rbusValue_Init(&value); + #if !defined(GTEST_ENABLE) -#ifdef IARMBUS_SUPPORT - RFC_ParamData_t param; - WDMP_STATUS status = getRFCParameter("RDKRemoteDebugger", RRD_RFC, ¶m); - if(status == WDMP_SUCCESS || status == WDMP_ERR_DEFAULT_VALUE) { - RDK_LOG(RDK_LOG_DEBUG,LOG_REMDEBUG,"[%s:%d]:getRFCParameter() name=%s,type=%d,value=%s\n", __FUNCTION__, __LINE__, param.name, param.type, param.value); - if (strcasecmp("false", param.value) == 0) { - ret = false; - } - } - else { - RDK_LOG(RDK_LOG_DEBUG,LOG_REMDEBUG,"[%s:%d]:ERROR in getRFCParameter()\n", __FUNCTION__, __LINE__); - } -#else - char RRDValue[64]={'\0'}; - if(0 == syscfg_init()) - { - if( 0 == syscfg_get( NULL, "RemoteDebuggerEnabled", RRDValue, sizeof(RRDValue))) - RDK_LOG(RDK_LOG_DEBUG,LOG_REMDEBUG,"[%s:%d]: syscfg_get RemoteDebuggerEnabled %s\n", __FUNCTION__, __LINE__, RRDValue); - if ((RRDValue[0] != '\0' && strncmp(RRDValue, "true", strlen("true")) == 0)) - { + retCode = rbus_get(rrdRbusHandle, RRD_RFC, &value); + if ((retCode == RBUS_ERROR_SUCCESS) && (value != NULL)) + { + RDK_LOG(RDK_LOG_DEBUG,LOG_REMDEBUG,"RemoteDebugger Status: = [%d]\n", rbusValue_GetBoolean(value)); + ret = rbusValue_GetBoolean(value); + if(ret) + { RDK_LOG(RDK_LOG_INFO,LOG_REMDEBUG,"[%s:%d]:RFC is enabled, starting remote-debugger\n", __FUNCTION__, __LINE__); - ret = true; - } - else - { - ret = false; - } - } -#endif + } + else + { + RDK_LOG(RDK_LOG_INFO,LOG_REMDEBUG,"[%s:%d]:RFC is disabled, stopping remote-debugger\n", __FUNCTION__, __LINE__); + } + } + else + { + RDK_LOG(RDK_LOG_ERROR, LOG_REMDEBUG, "[%s:%d]: rbus_get failed with error [%s]\n\n", __FUNCTION__, __LINE__,rbusError_ToString((rbusError_t)ret)); + } #endif return ret; } @@ -137,6 +132,7 @@ int main(int argc, char *argv[]) #endif { pthread_t RRDTR69ThreadID; + rbusError_t ret = RBUS_ERROR_BUS_ERROR; rdk_logger_init(DEBUG_INI_FILE); #if !defined(GTEST_ENABLE) @@ -146,10 +142,18 @@ int main(int argc, char *argv[]) /* Initialize Cache */ initCache(); + //RBUS Event Subscribe for RRD + ret = rbus_open(&rrdRbusHandle, REMOTE_DEBUGGER_RBUS_HANDLE_NAME); + if (ret != 0) + { + RDK_LOG(RDK_LOG_ERROR, LOG_REMDEBUG, "[%s:%d]: RBUS Open Failed %s !!! \n ", __FUNCTION__, __LINE__, rbusError_ToString((rbusError_t)ret)); + } + RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: SUCCESS: RBUS Open! \n", __FUNCTION__, __LINE__); + /* Check RRD Enable RFC */ bool isEnabled = isRRDEnabled(); if(!isEnabled) { - RDK_LOG(RDK_LOG_DEBUG,LOG_REMDEBUG,"[%s:%d]:RFC is disabled, stopping remote-debugger\n", __FUNCTION__, __LINE__); + RDK_LOG(RDK_LOG_DEBUG,LOG_REMDEBUG,"[%s:%d]:Stopping RDK Remote Debugger Daemon \n", __FUNCTION__, __LINE__); exit(0); } diff --git a/src/rrdMain.h b/src/rrdMain.h index 8a6c7f4c..d4f9a4dd 100644 --- a/src/rrdMain.h +++ b/src/rrdMain.h @@ -32,7 +32,6 @@ extern "C" #ifdef IARMBUS_SUPPORT #include "rfcapi.h" #else -#include "syscfg/syscfg.h" #endif #endif From 197791a7ffde05945176e59db2b81f9321e5fe9a Mon Sep 17 00:00:00 2001 From: nhanasi Date: Mon, 24 Feb 2025 16:46:42 -0500 Subject: [PATCH 2/4] Update cov_build.sh --- cov_build.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cov_build.sh b/cov_build.sh index 90d6b02a..7c4f1875 100644 --- a/cov_build.sh +++ b/cov_build.sh @@ -78,7 +78,6 @@ cp libIARM.h /usr/local/include cd $WORKDIR autoreconf -i autoupdate - -./configure --prefix=${INSTALL_DIR} --enable-iarmbusSupport=yes +./configure --prefix=${INSTALL_DIR} make remotedebugger_CFLAGS="-I/usr/include/cjson -I/usr/local/include/wdmp-c -I/usr/local/include/rbus -I/usr/local/include -I/usr/local/include/trower-base64 -DIARMBUS_SUPPORT" remotedebugger_LDFLAGS="-L/usr/local/lib -lrdkloggers -lcjson -lrfcapi -lrbus -lmsgpackc -lsecure_wrapper -lwebconfig_framework -lIARMBus -ltr181api -L/usr/local/lib/x86_64-linux-gnu -ltrower-base64 -L/usr/lib/x86_64-linux-gnu" make install From 39c5df657ae9c2ee5c43468a8c5110ab6b897c72 Mon Sep 17 00:00:00 2001 From: nhanasi Date: Fri, 28 Feb 2025 10:14:43 -0500 Subject: [PATCH 3/4] Update cov_build.sh --- cov_build.sh | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/cov_build.sh b/cov_build.sh index 7c4f1875..a907b0e4 100644 --- a/cov_build.sh +++ b/cov_build.sh @@ -40,10 +40,6 @@ if [ ! -d iarmbus ]; then git clone https://github.com/rdkcentral/iarmbus.git fi -if [ ! -d tr69hostif ]; then - git clone https://github.com/rdkcentral/tr69hostif.git -fi - cd rfc autoreconf -i ./configure --enable-rfctool=yes --enable-tr181set=yes @@ -67,7 +63,7 @@ cp /usr/iarmbus/core/libIARMCore.h /usr/local/include cp /usr/iarmmgrs/hal/include/pwrMgr.h /usr/local/include/ # Build and install stubs from tr69hostif - +git clone https://github.com/rdkcentral/tr69hostif.git cd tr69hostif cd ./src/unittest/stubs g++ -fPIC -shared -o libIARMBus.so iarm_stubs.cpp -I/usr/tr69hostif/src/hostif/parodusClient/pal -I/usr/tr69hostif/src/unittest/stubs -I/usr/tr69hostif/src/hostif/parodusClient/waldb -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/tr69hostif/src/hostif/include -I/usr/tr69hostif/src/hostif/profiles/DeviceInfo -I/usr/tr69hostif/src/hostif/parodusClient/pal -fpermissive @@ -78,6 +74,6 @@ cp libIARM.h /usr/local/include cd $WORKDIR autoreconf -i autoupdate -./configure --prefix=${INSTALL_DIR} +./configure --prefix=${INSTALL_DIR} --enable-iarmbusSupport=yes make remotedebugger_CFLAGS="-I/usr/include/cjson -I/usr/local/include/wdmp-c -I/usr/local/include/rbus -I/usr/local/include -I/usr/local/include/trower-base64 -DIARMBUS_SUPPORT" remotedebugger_LDFLAGS="-L/usr/local/lib -lrdkloggers -lcjson -lrfcapi -lrbus -lmsgpackc -lsecure_wrapper -lwebconfig_framework -lIARMBus -ltr181api -L/usr/local/lib/x86_64-linux-gnu -ltrower-base64 -L/usr/lib/x86_64-linux-gnu" make install From a02c2024f9c45fcf68b0c57b39435fee8e162a3b Mon Sep 17 00:00:00 2001 From: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com> Date: Wed, 5 Mar 2025 12:56:51 +0530 Subject: [PATCH 4/4] Update cov_build.sh --- cov_build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cov_build.sh b/cov_build.sh index a907b0e4..29e0e423 100644 --- a/cov_build.sh +++ b/cov_build.sh @@ -47,7 +47,7 @@ cd rfcapi make librfcapi_la_CPPFLAGS="-I/usr/include/cjson -I/usr/rfc/rfcMgr/gtest/mocks" make install cd /usr/rfc/tr181api -g++ -fPIC -shared -o libtr181api.so tr181api.cpp -I/usr/local/include/wdmp-c +g++ -fPIC -shared -o libtr181api.so tr181api.cpp -I/usr/local/include/wdmp-c -L/usr/local/lib -lrfcapi mv ./libtr181api.so /usr/local/lib cp ./tr181api.h /usr/local/include