diff --git a/configure.ac b/configure.ac index 6a87226c..c4e922ff 100644 --- a/configure.ac +++ b/configure.ac @@ -61,6 +61,18 @@ AC_TYPE_SIZE_T AC_CONFIG_FILES([Makefile src/Makefile]) +AC_ARG_ENABLE([L2support], + AS_HELP_STRING([--enable-L2support],[enable L2support (default is no)]), + [ + case "${enableval}" in + yes) L2_SUPPORT_ENABLE=true + L2_SUPPORT_FLAG="-DUSE_L2_SUPPORT" + m4_if(m4_sysval,[0],[SUBDIRS_L2_SUPPORT="src"]) ;; + no) L2_SUPPORT_ENABLE=false AC_MSG_ERROR([L2_SUPPORT is disabled]) ;; + *) AC_MSG_ERROR([bad value ${enableval} for --enable-L2support]) ;; + esac + ], + [echo "L2support is disabled"]) # IARMBus Support AC_ARG_ENABLE([iarmbusSupport], diff --git a/cov_build.sh b/cov_build.sh index 2c2e17d2..caf7a0d6 100644 --- a/cov_build.sh +++ b/cov_build.sh @@ -69,6 +69,13 @@ cp /usr/iarmmgrs/hal/include/pwrMgr.h /usr/local/include/ # Build and install stubs from tr69hostif cd tr69hostif +cp ./src/hostif/parodusClient/waldb/data-model/data-model-generic.xml /etc +pid=`pidof tr69hostif` +if [ ! -z "$pid" ]; then + kill -9 `pidof tr69hostif` +fi +sh cov_build.sh +sh run_l2.sh 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 cp libIARMBus.so /usr/local/lib @@ -78,6 +85,6 @@ 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 -DUSECOV" 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" +./configure --prefix=${INSTALL_DIR} --enable-iarmbusSupport=yes --enable-L2support=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 -DUSECOV -DUSE_L2_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 279d64f4..c32acb42 100644 --- a/src/rrdInterface.c +++ b/src/rrdInterface.c @@ -74,16 +74,24 @@ int RRD_subscribe() subscriptions[1].handler = _remoteDebuggerWebCfgDataEventHandler; subscriptions[1].userData = NULL; -#ifndef IARMBUS_SUPPORT - subscriptions[2].eventName = RDM_DOWNLOAD_EVENT; - subscriptions[2].filter = NULL; - subscriptions[2].duration = 0; - subscriptions[2].handler = _rdmDownloadEventHandler; - subscriptions[2].userData = NULL; - - ret = rbusEvent_SubscribeEx(rrdRbusHandle, subscriptions, 3, 60); +#ifdef IARMBUS_SUPPORT +#ifdef USE_L2_SUPPORT + subscriptions[2].eventName = RDM_DOWNLOAD_EVENT; + subscriptions[2].filter = NULL; + subscriptions[2].duration = 0; + subscriptions[2].handler = _rdmDownloadEventHandler; + subscriptions[2].userData = NULL; + ret = rbusEvent_SubscribeEx(rrdRbusHandle, subscriptions, 3, 60); +#else + ret = rbusEvent_SubscribeEx(rrdRbusHandle, subscriptions, 2, 60); +#endif #else - ret = rbusEvent_SubscribeEx(rrdRbusHandle, subscriptions, 2, 60); + subscriptions[2].eventName = RDM_DOWNLOAD_EVENT; + subscriptions[2].filter = NULL; + subscriptions[2].duration = 0; + subscriptions[2].handler = _rdmDownloadEventHandler; + subscriptions[2].userData = NULL; + ret = rbusEvent_SubscribeEx(rrdRbusHandle, subscriptions, 3, 60); #endif #endif if(ret != 0)