diff --git a/.github/workflows/L1-tests.yml b/.github/workflows/L1-tests.yml index d8b2a4e..d88236e 100755 --- a/.github/workflows/L1-tests.yml +++ b/.github/workflows/L1-tests.yml @@ -125,7 +125,7 @@ jobs: with: repository: rdkcentral/entservices-testframework path: entservices-testframework - ref: 1.0.1 + ref: 1.0.14 - name: Checkout entservices-avinput if: ${{ inputs.caller_source == 'local' }} @@ -330,6 +330,34 @@ jobs: && cmake --install build/googletest + - name: Checkout entservices-helpers + uses: actions/checkout@v3 + with: + repository: rdkcentral/entservices-helpers + path: entservices-helpers + ref: develop + + - name: Build entservices-helpers + run: > + cmake -G Ninja + -S "$GITHUB_WORKSPACE/entservices-helpers" + -B build/entservices-helpers + -DCMAKE_INSTALL_PREFIX="$GITHUB_WORKSPACE/install/usr" + -DCMAKE_MODULE_PATH="$GITHUB_WORKSPACE/install/tools/cmake" + -DUSE_THUNDER_R4=ON + -DHIDE_NON_EXTERNAL_SYMBOLS=OFF + -DPLUGIN_HELPERS=ON + "-DCMAKE_CXX_FLAGS= + -I$GITHUB_WORKSPACE/entservices-testframework/Tests/headers + -I$GITHUB_WORKSPACE/entservices-testframework/Tests/headers/rdk/iarmbus + -I$GITHUB_WORKSPACE/entservices-testframework/Tests/mocks + -include $GITHUB_WORKSPACE/entservices-testframework/Tests/mocks/tr181api.h + -include $GITHUB_WORKSPACE/entservices-testframework/Tests/mocks/Iarm.h" + && + cmake --build build/entservices-helpers + && + cmake --install build/entservices-helpers + - name: Build mocks run: > cmake @@ -359,7 +387,7 @@ jobs: -I $GITHUB_WORKSPACE/entservices-testframework/Tests/headers/ccec/drivers -I $GITHUB_WORKSPACE/entservices-testframework/Tests/headers/network -I $GITHUB_WORKSPACE/entservices-testframework/Tests - -I $GITHUB_WORKSPACE/entservices-avinput/helpers + -I $GITHUB_WORKSPACE/entservices-helpers/helpers -I $GITHUB_WORKSPACE/install/usr/include -I ./usr/include/libdrm -include $GITHUB_WORKSPACE/entservices-testframework/Tests/mocks/devicesettings.h @@ -487,7 +515,7 @@ jobs: -I $GITHUB_WORKSPACE/entservices-testframework/Tests/headers/rdk/iarmmgrs-hal -I $GITHUB_WORKSPACE/entservices-testframework/Tests/headers/ccec/drivers -I $GITHUB_WORKSPACE/entservices-testframework/Tests/headers/network - -I $GITHUB_WORKSPACE/entservices-avinput/helpers + -I $GITHUB_WORKSPACE/entservices-helpers/helpers -I $GITHUB_WORKSPACE/entservices-testframework/Tests -I $GITHUB_WORKSPACE/Thunder/Source -I $GITHUB_WORKSPACE/Thunder/Source/core diff --git a/.github/workflows/L2-tests.yml b/.github/workflows/L2-tests.yml index b1d829e..6923bb3 100755 --- a/.github/workflows/L2-tests.yml +++ b/.github/workflows/L2-tests.yml @@ -114,7 +114,7 @@ jobs: with: repository: rdkcentral/entservices-testframework path: entservices-testframework - ref: 1.0.1 + ref: 1.0.14 - name: Checkout googletest if: steps.cache.outputs.cache-hit != 'true' @@ -334,7 +334,7 @@ jobs: -I $GITHUB_WORKSPACE/entservices-testframework/Tests/headers/ccec/drivers -I $GITHUB_WORKSPACE/entservices-testframework/Tests/headers/network -I $GITHUB_WORKSPACE/entservices-testframework/Tests - -I $GITHUB_WORKSPACE/entservices-avinput/helpers + -I $GITHUB_WORKSPACE/entservices-helpers/helpers -I $GITHUB_WORKSPACE/Thunder/Source -I $GITHUB_WORKSPACE/Thunder/Source/core -I $GITHUB_WORKSPACE/install/usr/include @@ -369,6 +369,34 @@ jobs: && cmake --install build/mocks + - name: Checkout entservices-helpers + uses: actions/checkout@v3 + with: + repository: rdkcentral/entservices-helpers + path: entservices-helpers + ref: develop + + - name: Build entservices-helpers + run: > + cmake -G Ninja + -S "$GITHUB_WORKSPACE/entservices-helpers" + -B build/entservices-helpers + -DCMAKE_INSTALL_PREFIX="$GITHUB_WORKSPACE/install/usr" + -DCMAKE_MODULE_PATH="$GITHUB_WORKSPACE/install/tools/cmake" + -DUSE_THUNDER_R4=ON + -DHIDE_NON_EXTERNAL_SYMBOLS=OFF + -DPLUGIN_HELPERS=ON + "-DCMAKE_CXX_FLAGS= + -I$GITHUB_WORKSPACE/entservices-testframework/Tests/headers + -I$GITHUB_WORKSPACE/entservices-testframework/Tests/headers/rdk/iarmbus + -I$GITHUB_WORKSPACE/entservices-testframework/Tests/mocks + -include $GITHUB_WORKSPACE/entservices-testframework/Tests/mocks/tr181api.h + -include $GITHUB_WORKSPACE/entservices-testframework/Tests/mocks/Iarm.h" + && + cmake --build build/entservices-helpers + && + cmake --install build/entservices-helpers + - name: Build entservices-deviceanddisplay run: > cmake @@ -553,8 +581,7 @@ jobs: -I $GITHUB_WORKSPACE/entservices-testframework/Tests/headers/rdk/iarmmgrs-hal -I $GITHUB_WORKSPACE/entservices-testframework/Tests/headers/systemservices -I $GITHUB_WORKSPACE/entservices-testframework/Tests/headers/systemservices/proc - -I $GITHUB_WORKSPACE/entservices-deviceanddisplay/helpers - -I $GITHUB_WORKSPACE/entservices-avinput/helpers + -I $GITHUB_WORKSPACE/entservices-helpers/helpers -I $GITHUB_WORKSPACE/install/usr/include -I $GITHUB_WORKSPACE/install/usr/include/WPEFramework -I ./usr/include/libdrm diff --git a/CHANGELOG.md b/CHANGELOG.md index 022e398..0697fec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,9 +4,17 @@ All notable changes to this project will be documented in this file. Dates are d Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). +#### [1.2.5](https://github.com/rdkcentral/entservices-avinput/compare/1.2.4...1.2.5) + +- RDKEMW-18401 : Integrate entservices-avinput to common helpers lib [`#25`](https://github.com/rdkcentral/entservices-avinput/pull/25) +- Merge tag '1.2.4' into develop [`bef62b7`](https://github.com/rdkcentral/entservices-avinput/commit/bef62b72eeb756f971c48f7917c3dd38dd8931fc) + #### [1.2.4](https://github.com/rdkcentral/entservices-avinput/compare/1.2.3...1.2.4) +> 12 May 2026 + - RDKEMW-14878: Expose GetARCPortId to IUI through AVInput Plugin [`#12`](https://github.com/rdkcentral/entservices-avinput/pull/12) +- 1.2.4 release changelog updates [`270c633`](https://github.com/rdkcentral/entservices-avinput/commit/270c6331c92a946434f7663ebd8ea06dcfb4e475) - Merge tag '1.2.3' into develop [`2ffa946`](https://github.com/rdkcentral/entservices-avinput/commit/2ffa9461e43b16eba526028251c6e4ce9242988b) #### [1.2.3](https://github.com/rdkcentral/entservices-avinput/compare/1.2.2...1.2.3) diff --git a/Tests/L1Tests/CMakeLists.txt b/Tests/L1Tests/CMakeLists.txt index 2048a6a..ffb3b99 100755 --- a/Tests/L1Tests/CMakeLists.txt +++ b/Tests/L1Tests/CMakeLists.txt @@ -31,7 +31,7 @@ set (TEST_LIB ${NAMESPACE}Plugins::${NAMESPACE}Plugins ) -set (TEST_INC ../../helpers) +set (TEST_INC) ######################################################################################### # add_plugin_test_ex: Macro to add plugin tests, it will append to TEST_SRC, TEST_INC, @@ -102,7 +102,7 @@ endmacro() # PLUGIN_AVINPUT -set (AVINPUT_INC ../../plugin ../../helpers) +set (AVINPUT_INC ../../plugin ${CMAKE_SOURCE_DIR}/../entservices-helpers/helpers) set (AVINPUT_LIBS ${NAMESPACE}AVInput) add_plugin_test_ex(PLUGIN_AVINPUT tests/test_AVInput.cpp "${AVINPUT_INC}" "${AVINPUT_LIBS}") diff --git a/Tests/L2Tests/CMakeLists.txt b/Tests/L2Tests/CMakeLists.txt index c7055be..7e937d5 100755 --- a/Tests/L2Tests/CMakeLists.txt +++ b/Tests/L2Tests/CMakeLists.txt @@ -58,7 +58,7 @@ endif (MOCKACCESSOR_LIBRARIES) target_include_directories( ${MODULE_NAME} PRIVATE ./ - ../../helpers + ../../../entservices-helpers/helpers ../../../entservices-testframework/Tests/mocks ../../../entservices-testframework/Tests/mocks/thunder ../../../entservices-testframework/Tests/mocks/devicesettings diff --git a/build_dependencies.sh b/build_dependencies.sh index fa6956d..de8c171 100644 --- a/build_dependencies.sh +++ b/build_dependencies.sh @@ -41,7 +41,11 @@ git clone --branch R4.4.1 https://github.com/rdkcentral/Thunder.git git clone --branch develop https://github.com/rdkcentral/entservices-apis.git -git clone --branch 1.0.1 https://github.com/rdkcentral/entservices-testframework.git +cd .. +git clone --branch develop https://github.com/rdkcentral/entservices-helpers.git +cd "$GITHUB_WORKSPACE" + +git clone --branch 1.0.14 https://github.com/rdkcentral/entservices-testframework.git ############################ # Build Thunder-Tools @@ -103,7 +107,7 @@ cmake --build build/entservices-apis --target install -############################ +############################# # generating external headers for AVInput plugin cd $GITHUB_WORKSPACE cd entservices-testframework/Tests @@ -128,9 +132,24 @@ echo "Creating required IARM Bus headers" touch rdk/iarmbus/libIARM.h touch rdk/iarmbus/libIBus.h touch rdk/iarmbus/libIBusDaemon.h +touch tr181api.h echo "files created successfully" echo "======================================================================================" +cd $GITHUB_WORKSPACE +# Build entservices-helpers +echo "======================================================================================" +echo "building entservices-helpers" +cmake -G Ninja -S ../entservices-helpers -B build/entservices-helpers \ + -DEXCEPTIONS_ENABLE=ON \ + -DCMAKE_INSTALL_PREFIX="$GITHUB_WORKSPACE/install/usr" \ + -DCMAKE_MODULE_PATH="$GITHUB_WORKSPACE/install/tools/cmake" \ + -DPLUGIN_HELPERS=ON \ + "-DCMAKE_CXX_FLAGS=-I$GITHUB_WORKSPACE/entservices-testframework/Tests/mocks -I$GITHUB_WORKSPACE/entservices-testframework/Tests/headers -I$GITHUB_WORKSPACE/entservices-testframework/Tests/headers/rdk/iarmbus -include $GITHUB_WORKSPACE/entservices-testframework/Tests/mocks/Iarm.h " +cmake --build build/entservices-helpers --target install + + +############################ cd ../../ ls -la ${GITHUB_WORKSPACE} diff --git a/cmake/FindWPEFrameworkHelpers.cmake b/cmake/FindWPEFrameworkHelpers.cmake new file mode 100644 index 0000000..0548f7f --- /dev/null +++ b/cmake/FindWPEFrameworkHelpers.cmake @@ -0,0 +1,39 @@ +# - Try to find WPEFrameworkHelpers +# Once done this will define +# WPEFrameworkHelpers_FOUND - System has WPEFrameworkHelpers +# WPEFrameworkHelpers_INCLUDE_DIRS - The WPEFrameworkHelpers include directories +# WPEFrameworkHelpers_LIBRARIES - The libraries needed to use WPEFrameworkHelpers +# +# Also creates an imported target: +# WPEFramework::WPEFrameworkHelpers + +find_library(WPEFrameworkHelpers_LIBRARIES + NAMES WPEFrameworkHelpers + PATH_SUFFIXES wpeframework/plugins) + +find_path(WPEFrameworkHelpers_INCLUDE_DIRS + NAMES UtilsLogging.h + PATH_SUFFIXES wpeframework/helpers) + +set(WPEFrameworkHelpers_LIBRARIES + ${WPEFrameworkHelpers_LIBRARIES} + CACHE PATH "Path to WPEFrameworkHelpers library") + +set(WPEFrameworkHelpers_INCLUDE_DIRS ${WPEFrameworkHelpers_INCLUDE_DIRS} CACHE PATH "Path to WPEFrameworkHelpers includes") + +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(WPEFrameworkHelpers DEFAULT_MSG + WPEFrameworkHelpers_INCLUDE_DIRS + WPEFrameworkHelpers_LIBRARIES) + +if(WPEFrameworkHelpers_FOUND AND NOT TARGET WPEFramework::WPEFrameworkHelpers) + add_library(WPEFramework::WPEFrameworkHelpers SHARED IMPORTED) + set_target_properties(WPEFramework::WPEFrameworkHelpers PROPERTIES + IMPORTED_LOCATION "${WPEFrameworkHelpers_LIBRARIES}" + INTERFACE_INCLUDE_DIRECTORIES "${WPEFrameworkHelpers_INCLUDE_DIRS}") +endif() + +mark_as_advanced( + WPEFrameworkHelpers_FOUND + WPEFrameworkHelpers_INCLUDE_DIRS + WPEFrameworkHelpers_LIBRARIES) diff --git a/helpers/UtilsIarm.h b/helpers/UtilsIarm.h deleted file mode 100644 index c9e6116..0000000 --- a/helpers/UtilsIarm.h +++ /dev/null @@ -1,90 +0,0 @@ -/** -* If not stated otherwise in this file or this component's LICENSE -* file the following copyright and licenses apply: -* -* Copyright 2024 RDK Management -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -**/ - -#pragma once - -#include "UtilsLogging.h" - -#include "libIBus.h" -#include - -#define IARM_CHECK(FUNC) { \ - if ((res = FUNC) != IARM_RESULT_SUCCESS) { \ - LOGINFO("IARM %s: %s", #FUNC, \ - res == IARM_RESULT_INVALID_PARAM ? "invalid param" : ( \ - res == IARM_RESULT_INVALID_STATE ? "invalid state" : ( \ - res == IARM_RESULT_IPCCORE_FAIL ? "ipcore fail" : ( \ - res == IARM_RESULT_OOM ? "oom" : "unknown")))); \ - } \ - else \ - { \ - LOGINFO("IARM %s: success", #FUNC); \ - } \ -} - -namespace Utils { -struct IARM { - static bool init() - { - IARM_Result_t res; - bool result = false; - - if (isConnected()) { - LOGINFO("IARM already connected"); - result = true; - } else { - unsigned int retryCount = 0; - do - { - res = IARM_Bus_Init(NAME); - LOGINFO("IARM_Bus_Init: %d", res); - if (res == IARM_RESULT_SUCCESS || res == IARM_RESULT_INVALID_STATE /* already inited or connected */) { - res = IARM_Bus_Connect(); - LOGINFO("IARM_Bus_Connect: %d", res); - if (res == IARM_RESULT_SUCCESS || res == IARM_RESULT_INVALID_STATE /* already connected or not inited */) { - result = isConnected(); - LOGERR("ARM_Bus_Connect result: %d res: %d retryCount :%d ",result, res, retryCount); - } else { - LOGERR("IARM_Bus_Connect failure:result :%d res: %d retryCount :%d ",result, res, retryCount); - } - } else { - LOGERR("IARM_Bus_Init failure: result :%d res: %d retryCount :%d",result, res,retryCount); - } - - if(result == false) usleep(100000); - - }while((result == false) && (retryCount++ < 20)); - } - - return result; - } - - static bool isConnected() - { - IARM_Result_t res; - int isRegistered = 0; - res = IARM_Bus_IsConnected(NAME, &isRegistered); - LOGINFO("IARM_Bus_IsConnected: res:%d isRegistered (%d)", res, isRegistered); - - return (isRegistered == 1); - } - - static constexpr const char* NAME = "Thunder_Plugins"; -}; -} diff --git a/helpers/UtilsJsonRpc.h b/helpers/UtilsJsonRpc.h deleted file mode 100644 index bff772a..0000000 --- a/helpers/UtilsJsonRpc.h +++ /dev/null @@ -1,169 +0,0 @@ -/** -* If not stated otherwise in this file or this component's LICENSE -* file the following copyright and licenses apply: -* -* Copyright 2024 RDK Management -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -**/ - -#pragma once - -#include "UtilsLogging.h" - -#define LOGINFOMETHOD() { std::string json; parameters.ToString(json); LOGINFO( "params=%s", json.c_str() ); } -#define LOGTRACEMETHODFIN() { std::string json; response.ToString(json); LOGINFO( "response=%s", json.c_str() ); } - -/** - * DO NOT USE THIS. - * - * "success" parameter was added for legacy reasons. - * Newer APIs should return only error code to match the spec - */ - -#define returnResponse(expression) \ - { \ - bool successBoolean = expression; \ - response["success"] = successBoolean; \ - LOGTRACEMETHODFIN(); \ - return (successBoolean ? WPEFramework::Core::ERROR_NONE : WPEFramework::Core::ERROR_GENERAL); \ - } -#define returnIfParamNotFound(param, name) \ - if (!param.HasLabel(name)) \ - { \ - LOGERR("No argument '%s'", name); \ - returnResponse(false); \ - } -#define returnIfStringParamNotFound(param, name) \ - if (!param.HasLabel(name) || param[name].Content() != WPEFramework::Core::JSON::Variant::type::STRING) \ - {\ - LOGERR("No argument '%s' or it has incorrect type", name); \ - returnResponse(false); \ - } -#define returnIfBooleanParamNotFound(param, name) \ - if (!param.HasLabel(name) || param[name].Content() != WPEFramework::Core::JSON::Variant::type::BOOLEAN) \ - { \ - LOGERR("No argument '%s' or it has incorrect type", name); \ - returnResponse(false); \ - } -#define returnIfNumberParamNotFound(param, name) \ - if (!param.HasLabel(name) || param[name].Content() != WPEFramework::Core::JSON::Variant::type::NUMBER) \ - { \ - LOGERR("No argument '%s' or it has incorrect type", name); \ - returnResponse(false); \ - } - -/** - * DO NOT USE THIS. - * - * You should be capable of just using "Notify". - */ - -#if ((THUNDER_VERSION >= 4) && (THUNDER_VERSION_MINOR == 4)) - -#define sendNotify(event,params) { \ - std::string json; \ - params.ToString(json); \ - LOGINFO("Notify %s %s", event, json.c_str()); \ - Notify(event,params); \ -} - -#define sendNotifyMaskParameters(event,params) { \ - std::string json; \ - params.ToString(json); \ - LOGINFO("Notify %s <***>", event); \ - Notify(event,params); \ -} - -#else - -#define sendNotify(event,params) { \ - std::string json; \ - params.ToString(json); \ - LOGINFO("Notify %s %s", event, json.c_str()); \ - for (uint8_t i = 1; GetHandler(i); i++) GetHandler(i)->Notify(event,params); \ -} -#define sendNotifyMaskParameters(event,params) { \ - std::string json; \ - params.ToString(json); \ - LOGINFO("Notify %s <***>", event); \ - for (uint8_t i = 1; GetHandler(i); i++) GetHandler(i)->Notify(event,params); \ -} - -#endif -/** - * DO NOT USE THIS. - * - * Instead, add YOURPLUGINNAME.json to https://github.com/rdkcentral/ThunderInterfaces - * and use the generated classes from - */ - -#define getNumberParameter(paramName, param) { \ - if (WPEFramework::Core::JSON::Variant::type::NUMBER == parameters[paramName].Content()) \ - param = parameters[paramName].Number(); \ - else \ - try { param = std::stoi( parameters[paramName].String()); } \ - catch (...) { param = 0; } \ -} -#define getNumberParameterObject(parameters, paramName, param) { \ - if (WPEFramework::Core::JSON::Variant::type::NUMBER == parameters[paramName].Content()) \ - param = parameters[paramName].Number(); \ - else \ - try {param = std::stoi( parameters[paramName].String());} \ - catch (...) { param = 0; } \ -} -#define getBoolParameter(paramName, param) { \ - if (WPEFramework::Core::JSON::Variant::type::BOOLEAN == parameters[paramName].Content()) \ - param = parameters[paramName].Boolean(); \ - else \ - param = parameters[paramName].String() == "true" || parameters[paramName].String() == "1"; \ -} -#define getStringParameter(paramName, param) { \ - if (WPEFramework::Core::JSON::Variant::type::STRING == parameters[paramName].Content()) \ - param = parameters[paramName].String(); \ -} -#define getFloatParameter(paramName, param) { \ - if (Core::JSON::Variant::type::FLOAT == parameters[paramName].Content()) \ - param = parameters[paramName].Float(); \ - else \ - try { param = std::stof( parameters[paramName].String()); } \ - catch (...) { param = 0; } \ -} -#define vectorSet(v,s) \ - if (find(begin(v), end(v), s) == end(v)) \ - v.emplace_back(s); -#define getDefaultNumberParameter(paramName, param, default) { \ - if (parameters.HasLabel(paramName)) { \ - if (WPEFramework::Core::JSON::Variant::type::NUMBER == parameters[paramName].Content()) \ - param = parameters[paramName].Number(); \ - else \ - try { param = std::stoi( parameters[paramName].String()); } \ - catch (...) { param = default; } \ - } else param = default; \ -} -#define getDefaultStringParameter(paramName, param, default) { \ - if (parameters.HasLabel(paramName)) { \ - if (WPEFramework::Core::JSON::Variant::type::STRING == parameters[paramName].Content()) \ - param = parameters[paramName].String(); \ - else \ - param = default; \ - } else param = default; \ -} -#define getDefaultBoolParameter(paramName, param, default) { \ - if (parameters.HasLabel(paramName)) { \ - if (WPEFramework::Core::JSON::Variant::type::BOOLEAN == parameters[paramName].Content()) \ - param = parameters[paramName].Boolean(); \ - else \ - param = parameters[paramName].String() == "true" || parameters[paramName].String() == "1"; \ - } else param = default; \ -} diff --git a/helpers/UtilsLogging.h b/helpers/UtilsLogging.h deleted file mode 100644 index 2fd3d7b..0000000 --- a/helpers/UtilsLogging.h +++ /dev/null @@ -1,30 +0,0 @@ -/** -* If not stated otherwise in this file or this component's LICENSE -* file the following copyright and licenses apply: -* -* Copyright 2024 RDK Management -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -**/ - -#pragma once - -#include - -#define LOGINFO(fmt, ...) do { fprintf(stderr, "[%d] INFO [%s:%d] %s: " fmt "\n", (int)syscall(SYS_gettid), WPEFramework::Core::FileNameOnly(__FILE__), __LINE__, __FUNCTION__, ##__VA_ARGS__); fflush(stderr); } while (0) -#define LOGWARN(fmt, ...) do { fprintf(stderr, "[%d] WARN [%s:%d] %s: " fmt "\n", (int)syscall(SYS_gettid), WPEFramework::Core::FileNameOnly(__FILE__), __LINE__, __FUNCTION__, ##__VA_ARGS__); fflush(stderr); } while (0) -#define LOGERR(fmt, ...) do { fprintf(stderr, "[%d] ERROR [%s:%d] %s: " fmt "\n", (int)syscall(SYS_gettid), WPEFramework::Core::FileNameOnly(__FILE__), __LINE__, __FUNCTION__, ##__VA_ARGS__); fflush(stderr); } while (0) - -#define LOG_DEVICE_EXCEPTION0() LOGWARN("Exception caught: code=%d message=%s", err.getCode(), err.what()); -#define LOG_DEVICE_EXCEPTION1(param1) LOGWARN("Exception caught" #param1 "=%s code=%d message=%s", param1.c_str(), err.getCode(), err.what()); -#define LOG_DEVICE_EXCEPTION2(param1, param2) LOGWARN("Exception caught " #param1 "=%s " #param2 "=%s code=%d message=%s", param1.c_str(), param2.c_str(), err.getCode(), err.what()); diff --git a/plugin/CMakeLists.txt b/plugin/CMakeLists.txt index d5f3242..52adb50 100644 --- a/plugin/CMakeLists.txt +++ b/plugin/CMakeLists.txt @@ -23,6 +23,7 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") find_package(${NAMESPACE}Plugins REQUIRED) find_package(${NAMESPACE}Definitions REQUIRED) +find_package(${NAMESPACE}Helpers REQUIRED) find_package(CompileSettingsDebug CONFIG REQUIRED) if (USE_THUNDER_R4) @@ -46,14 +47,14 @@ find_package(IARMBus) target_include_directories(${MODULE_NAME} PRIVATE ${DS_INCLUDE_DIRS}) target_include_directories(${MODULE_NAME} PRIVATE ${IARMBUS_INCLUDE_DIRS}) -target_include_directories(${MODULE_NAME} PRIVATE ../helpers) set_source_files_properties(AVInput.cpp PROPERTIES COMPILE_FLAGS "-fexceptions") target_link_libraries(${MODULE_NAME} PRIVATE CompileSettingsDebug::CompileSettingsDebug - ${NAMESPACE}Definitions::${NAMESPACE}Definitions) + ${NAMESPACE}Definitions::${NAMESPACE}Definitions + ${NAMESPACE}::${NAMESPACE}Helpers) add_library(${PLUGIN_IMPLEMENTATION} SHARED AVInputImplementation.cpp AVInputUtils.cpp Module.cpp) @@ -79,10 +80,9 @@ endif (RDK_SERVICE_L2_TEST) target_include_directories(${PLUGIN_IMPLEMENTATION} PRIVATE ${DS_INCLUDE_DIRS}) target_include_directories(${PLUGIN_IMPLEMENTATION} PRIVATE ${IARMBUS_INCLUDE_DIRS}) -target_include_directories(${PLUGIN_IMPLEMENTATION} PRIVATE ../helpers) -target_link_libraries(${PLUGIN_IMPLEMENTATION} PUBLIC ${NAMESPACE}Plugins::${NAMESPACE}Plugins ${IARMBUS_LIBRARIES} ${DS_LIBRARIES} ) -target_link_libraries(${MODULE_NAME} PUBLIC ${NAMESPACE}Plugins::${NAMESPACE}Plugins ${IARMBUS_LIBRARIES} ${DS_LIBRARIES} ) +target_link_libraries(${PLUGIN_IMPLEMENTATION} PUBLIC ${NAMESPACE}Plugins::${NAMESPACE}Plugins ${IARMBUS_LIBRARIES} ${DS_LIBRARIES} ${NAMESPACE}::${NAMESPACE}Helpers) +target_link_libraries(${MODULE_NAME} PUBLIC ${NAMESPACE}Plugins::${NAMESPACE}Plugins ${IARMBUS_LIBRARIES} ${DS_LIBRARIES} ${NAMESPACE}::${NAMESPACE}Helpers) install(TARGETS ${PLUGIN_IMPLEMENTATION} DESTINATION lib/${STORAGE_DIRECTORY}/plugins) install(TARGETS ${MODULE_NAME} DESTINATION lib/${STORAGE_DIRECTORY}/plugins)