diff --git a/L2HalMock/README.md b/L2HalMock/README.md index 1a089217..53a2d05e 100644 --- a/L2HalMock/README.md +++ b/L2HalMock/README.md @@ -136,4 +136,20 @@ update details in Config.py python3 TestManager.py - +# README FOR CI CD HAL MOCK WORKFLOW +------------------------------------ + +--> HAL_MOCK yml is the workflow file designed to pull/setup the container/docker, build the binaries and execute testcases on the hal mock virtual environment. +--> A pull request/push on from a branch to sprint,release,develop and main triggers the HAL_MOCK yml. +--> Paths excluded in the yaml file are tools,tests,.github workflows and readme docs. Which makes the workflow to not trigger job when changes happens in any of these files. +--> Conditional commit message check has also been enabled in the workflow,which allows the user to trigger the hal mock environment job only when user specifies hdmicecsource_halmock in the commit message. +--> Workflow steps are:- + --> pull the customized docker from JFROG artifactory. + --> clone and build the required binaries for the mock environment inside docker. + --> make all services up + --> execute the currently developed testcases (L2) on Hdmicec source. + --> generate a test report containing the execution details. + --> fetch the report, upload it as an artifact. + --> users can download this test report artifact from the executed job summary. + --> stop all services +--> Destroy the container/Docker diff --git a/L2HalMock/README_CICD b/L2HalMock/README_CICD deleted file mode 100644 index ffebc8c9..00000000 --- a/L2HalMock/README_CICD +++ /dev/null @@ -1,18 +0,0 @@ - README FOR CI CD HAL MOCK WORKFLOW - - - ---> HAL_MOCK yml is the workflow file designed to pull/setup the container/docker, build the binaries and execute testcases on the hal mock virtual environment. ---> A pull request/push on from a branch to sprint,release,develop and main triggers the HAL_MOCK yml. ---> Paths excluded in the yaml file are tools,tests,.github workflows and readme docs. Which makes the workflow to not trigger job when changes happens in any of these files. ---> Conditional commit message check has also been enabled in the workflow,which allows the user to trigger the hal mock environment job only when user specifies hdmicecsource_halmock in the commit message. ---> Workflow steps are:- - --> pull the customized docker from JFROG artifactory. - --> clone and build the required binaries for the mock environment inside docker. - --> make all services up - --> execute the currently developed testcases (L2) on Hdmicec source. - --> generate a test report containing the execution details. - --> fetch the report, upload it as an artifact. - --> users can download this test report artifact from the executed job summary. - --> stop all services ---> Destroy the container/Docker diff --git a/L2HalMock/build.sh b/L2HalMock/build.sh index 5f123247..cc7094a8 100644 --- a/L2HalMock/build.sh +++ b/L2HalMock/build.sh @@ -16,6 +16,11 @@ if grep -q "HdmiCecSink" <<< "$SelectedPlugins"; then HdmiCecSink="ON" fi +if grep -q "HdcpProfile" <<< "$SelectedPlugins"; then + echo "Found: $SelectedPlugins" + HdcpProfile="ON" +fi + # Define ANSI color codes for green GREEN='\033[0;32m' # Green text NC='\033[0m' # No color (resets to default) @@ -198,6 +203,7 @@ cmake -S . -B build \ -DUSE_THUNDER_R4=ON \ -DPLUGIN_HDMICECSOURCE=$HdmiCecSource \ -DPLUGIN_HDMICECSINK=$HdmiCecSink \ +-DPLUGIN_HDCPPROFILE=$HdcpProfile \ -DCOMCAST_CONFIG=OFF \ -DCEC_INCLUDE_DIRS="$SCRIPTS_DIR/workspace/deps/rdk/hdmicec/ccec/include" \ -DOSAL_INCLUDE_DIRS="$SCRIPTS_DIR/workspace/deps/rdk/hdmicec/osal/include" \ diff --git a/L2HalMock/manifest.txt b/L2HalMock/manifest.txt deleted file mode 100644 index 370998f9..00000000 --- a/L2HalMock/manifest.txt +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - -# - -# - - - -# - - - - - - diff --git a/L2HalMock/manifest.xml b/L2HalMock/manifest.xml deleted file mode 100644 index f79b9287..00000000 --- a/L2HalMock/manifest.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - -# - -# - - ---- -diff --git a/HdmiCecSink/HdmiCecSink.cpp b/HdmiCecSink/HdmiCecSink.cpp -index 6dd5c229..9d6dbb93 100644 ---- a/HdmiCecSink/HdmiCecSink.cpp -+++ b/HdmiCecSink/HdmiCecSink.cpp -@@ -172,7 +172,7 @@ static float cecVersion = 1.4; - static AllDeviceTypes allDevicetype = ALL_DEVICE_TYPES; - static std::vector rcProfile = {RC_PROFILE_TV}; - static std::vector deviceFeatures = {DEVICE_FEATURES_TV}; -- -+extern "C" void __gcov_exit(); - #define API_VERSION_NUMBER_MAJOR 1 - #define API_VERSION_NUMBER_MINOR 3 - #define API_VERSION_NUMBER_PATCH 7 -@@ -848,6 +848,7 @@ namespace WPEFramework - HdmiCecSink::_instance = nullptr; - DeinitializeIARM(); - LOGWARN(" HdmiCecSink Deinitialize() Done"); -+ __gcov_exit(); - } - - const void HdmiCecSink::InitializeIARM() diff --git a/L2HalMock/patches/rdkservices/files/CMakeLists.txt b/L2HalMock/patches/rdkservices/files/CMakeLists.txt deleted file mode 100644 index 969a3c63..00000000 --- a/L2HalMock/patches/rdkservices/files/CMakeLists.txt +++ /dev/null @@ -1,70 +0,0 @@ -### -# If not stated otherwise in this file or this component's LICENSE -# file the following copyright and licenses apply: -# -# Copyright 2023 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. -### - -cmake_minimum_required(VERSION 3.3) -project(halmock) -find_package(WPEFramework PATHS ${WORKSPACE}/install/usr/lib/cmake/WPEFramework) -set(CMAKE_ROOT_DIR "${WORKSPACE}") -set(URL_INCLUDE_DIR "${WORKSPACE}/Thunder/Source/websocket") -# All packages that did not deliver a CMake Find script (and some deprecated scripts that need to be removed) -# are located in the cmake directory. Include it in the search. -list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/") - -option(COMCAST_CONFIG "Comcast services configuration" ON) -if(COMCAST_CONFIG) - include(services.cmake) -endif() - -option(PLUGIN_OCICONTAINER "Include OCIContainer plugin" OFF) -option(PLUGIN_RUSTBRIDGE "Include RustBridge plugin" OFF) - -if(RDK_SERVICES_TEST) - include(tests.cmake) -endif() - -# Library installation section -string(TOLOWER ${NAMESPACE} STORAGE_DIRECTORY) - -# for writing pc and config files -include(${WORKSPACE}/install/usr/lib/cmake/WPEFramework/common/CmakeHelperFunctions.cmake) - -if(PLUGIN_HDMICECSOURCE) - add_subdirectory(HdmiCecSource) -endif() - -if(WPEFRAMEWORK_CREATE_IPKG_TARGETS) - set(CPACK_GENERATOR "DEB") - set(CPACK_DEB_COMPONENT_INSTALL ON) - set(CPACK_COMPONENTS_GROUPING IGNORE) - - set(CPACK_DEBIAN_PACKAGE_NAME "${WPEFRAMEWORK_PLUGINS_OPKG_NAME}") - set(CPACK_DEBIAN_PACKAGE_VERSION "${WPEFRAMEWORK_PLUGINS_OPKG_VERSION}") - set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "${WPEFRAMEWORK_PLUGINS_OPKG_ARCHITECTURE}") - set(CPACK_DEBIAN_PACKAGE_MAINTAINER "${WPEFRAMEWORK_PLUGINS_OPKG_MAINTAINER}") - set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "${WPEFRAMEWORK_PLUGINS_OPKG_DESCRIPTION}") - set(CPACK_PACKAGE_FILE_NAME "${WPEFRAMEWORK_PLUGINS_OPKG_FILE_NAME}") - - # list of components from which packages will be generated - set(CPACK_COMPONENTS_ALL - ${NAMESPACE}WebKitBrowser - WPEInjectedBundle - ) - - include(CPack) -endif() diff --git a/L2HalMock/patches/rdkservices/files/FrontPanel.json b/L2HalMock/patches/rdkservices/files/FrontPanel.json deleted file mode 100644 index dd829935..00000000 --- a/L2HalMock/patches/rdkservices/files/FrontPanel.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "locator":"libWPEFrameworkFrontPanel.so", - "classname":"FrontPanel", - "precondition":[ - "Platform" - ], - "callsign":"org.rdk.FrontPanel", - "autostart":true -} diff --git a/L2HalMock/patches/rdkservices/files/HdmiCecSource/CMakeLists.txt b/L2HalMock/patches/rdkservices/files/HdmiCecSource/CMakeLists.txt deleted file mode 100644 index d5360e1d..00000000 --- a/L2HalMock/patches/rdkservices/files/HdmiCecSource/CMakeLists.txt +++ /dev/null @@ -1,73 +0,0 @@ -# If not stated otherwise in this file or this component's license file the -# following copyright and licenses apply: -# -# Copyright 2020 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. -set(PLUGIN_NAME HdmiCecSource) -set(MODULE_NAME ${NAMESPACE}${PLUGIN_NAME}) - -set(PLUGIN_HDMICECSOURCE_STARTUPORDER "" CACHE STRING "To configure startup order of HdmiCecSource plugin") -set_source_files_properties(HdmiCecSource.cpp PROPERTIES COMPILE_FLAGS "-fexceptions") - -find_package(${NAMESPACE}Plugins REQUIRED) - -add_library(${MODULE_NAME} SHARED - HdmiCecSource.cpp - Module.cpp) - -set_target_properties(${MODULE_NAME} PROPERTIES - CXX_STANDARD 11 - CXX_STANDARD_REQUIRED YES) - -find_package(DS) -find_package(IARMBus) -find_package(CEC) - -target_include_directories(${MODULE_NAME} PUBLIC ${URL_INCLUDE_DIR}) -target_include_directories(${MODULE_NAME} PUBLIC ${DS_INCLUDE_DIRS}) -target_include_directories(${MODULE_NAME} PUBLIC ${DSHAL_INCLUDE_DIRS}) -target_include_directories(${MODULE_NAME} PUBLIC ${DSRPC_INCLUDE_DIRS}) -target_include_directories(${MODULE_NAME} PUBLIC ${CEC_INCLUDE_DIRS}) -target_include_directories(${MODULE_NAME} PUBLIC ${OSAL_INCLUDE_DIRS}) -target_include_directories(${MODULE_NAME} PUBLIC ${CEC_HOST_INCLUDE_DIRS}) -target_include_directories(${MODULE_NAME} PUBLIC ${CEC_IARM_INCLUDE_DIRS}) -target_include_directories(${MODULE_NAME} PUBLIC ${IARMBUS_INCLUDE_DIRS}) -target_include_directories(${MODULE_NAME} PUBLIC ${IARMIR_INCLUDE_DIRS}) -target_include_directories(${MODULE_NAME} PUBLIC ${IARMRECEIVER_INCLUDE_DIRS}) -target_include_directories(${MODULE_NAME} PUBLIC ${IARMPWR_INCLUDE_DIRS}) -target_include_directories(${MODULE_NAME} PUBLIC ${CMAKE_SOURCE_DIR}/helpers) - -file(GLOB libraries ${DS_LIBRARIES}/*.so) -foreach(lib ${libraries}) - target_link_libraries(${MODULE_NAME} PUBLIC ${NAMESPACE}Plugins::${NAMESPACE}Plugins ${lib}) -endforeach(lib) - -file(GLOB libraries ${IARM_LIBRARIES}/*.so) -foreach(lib ${libraries}) - target_link_libraries(${MODULE_NAME} PUBLIC ${NAMESPACE}Plugins::${NAMESPACE}Plugins ${lib}) -endforeach(lib) - -file(GLOB libraries ${CEC_LIBRARIES}/*.so) -foreach(lib ${libraries}) - target_link_libraries(${MODULE_NAME} PUBLIC ${NAMESPACE}Plugins::${NAMESPACE}Plugins ${lib}) -endforeach(lib) - -if (NOT RDK_SERVICES_TEST) - target_compile_options(${MODULE_NAME} PRIVATE -Wno-error=deprecated) -endif () - -install(TARGETS ${MODULE_NAME} - DESTINATION lib/${STORAGE_DIRECTORY}/plugins) - -write_config(${PLUGIN_NAME}) diff --git a/L2HalMock/patches/rdkservices/files/cmake/FindCEC.cmake b/L2HalMock/patches/rdkservices/files/cmake/FindCEC.cmake deleted file mode 100644 index eddd7ebd..00000000 --- a/L2HalMock/patches/rdkservices/files/cmake/FindCEC.cmake +++ /dev/null @@ -1,62 +0,0 @@ -# If not stated otherwise in this file or this component's license file the -# following copyright and licenses apply: -# -# Copyright 2020 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. - -# - Try to find IARMBus -# Once done this will define -# IARMBUS_FOUND - System has IARMBus -# IARMBUS_INCLUDE_DIRS - The IARMBus include directories -# IARMBUS_LIBRARIES - The libraries needed to use IARMBus -# IARMBUS_FLAGS - The flags needed to use IARMBus -# - -find_package(PkgConfig) - -#find_library(CEC_LIBRARIES NAMES RCEC) -#find_library(CEC_IARM_LIBRARIES NAMES RCECIARMBusHal) -#find_library(OSAL_LIBRARIES NAMES RCECOSHal) - -#find_path(CEC_INCLUDE_DIRS NAMES ccec PATH_SUFFIXES ccec/include) -#find_path(OSAL_INCLUDE_DIRS NAMES osal PATH_SUFFIXES osal/include) -#find_path(CEC_HOST_INCLUDE_DIRS NAMES ccec/host PATH_SUFFIXES host/include) -#find_path(CEC_IARM_INCLUDE_DIRS NAMES ccec/drivers/iarmbus PATH_SUFFIXES ccec/drivers/include) - -#set(CEC_LIBRARIES "-Wl,--no-as-needed" ${CEC_LIBRARIES} ${CEC_IARM_LIBRARIES} ${OSAL_LIBRARIES} "-Wl,--as-needed") - -#set(CEC_LIBRARIES ${CEC_LIBRARIES} CACHE PATH "Path to library") - -#set(CEC_INCLUDE_DIRS ${CEC_INCLUDE_DIRS} ${OSAL_INCLUDE_DIRS} ${CEC_HOST_INCLUDE_DIRS} ${CEC_IARM_INCLUDE_DIRS}) -#set(CEC_INCLUDE_DIRS ${CEC_INCLUDE_DIRS} CACHE PATH "Path to include directories") - -set(CEC_INCLUDE_DIRS ${CMAKE_ROOT_DIR}/deps/rdk/hdmicec/ccec/include) -set(OSAL_INCLUDE_DIRS ${CMAKE_ROOT_DIR}/deps/rdk/hdmicec/osal/include) -set(CEC_HOST_INCLUDE_DIRS ${CMAKE_ROOT_DIR}/deps/rdk/hdmicec/host/include) -set(CEC_IARM_INCLUDE_DIRS ${CMAKE_ROOT_DIR}/deps/rdk/hdmicec/ccec/drivers/include) -message(STATUS "Anooj CEC_INCLUDE_DIRS: ${CEC_INCLUDE_DIRS}") -set(CEC_DIRS ${CEC_INCLUDE_DIRS} ${OSAL_INCLUDE_DIRS} ${CEC_HOST_INCLUDE_DIRS} ${CEC_IARM_INCLUDE_DIRS}) -message(STATUS "Anooj CEC_DIRS: ${CEC_DIRS}") -set(CEC_INCLUDE_DIRS ${CEC_INCLUDE_DIRS} CACHE PATH "Path to include directories") -set(CEC_LIBRARIES ${CMAKE_ROOT_DIR}/deps/rdk/hdmicec/install/lib) - -include(FindPackageHandleStandardArgs) -#FIND_PACKAGE_HANDLE_STANDARD_ARGS(IARMBUS DEFAULT_MSG IARMBUS_INCLUDE_DIRS IARMBUS_LIBRARIES) - -mark_as_advanced( - CEC_FOUND - CEC_INCLUDE_DIRS - CEC_LIBRARIES - CEC_LIBRARY_DIRS - CEC_FLAGS) diff --git a/L2HalMock/patches/rdkservices/files/cmake/FindDS.cmake b/L2HalMock/patches/rdkservices/files/cmake/FindDS.cmake deleted file mode 100644 index 49ce8de9..00000000 --- a/L2HalMock/patches/rdkservices/files/cmake/FindDS.cmake +++ /dev/null @@ -1,57 +0,0 @@ -# If not stated otherwise in this file or this component's license file the -# following copyright and licenses apply: -# -# Copyright 2020 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. - -# - Try to find Display Settings library -# Once done this will define -# DS_FOUND - System has DS -# DS_INCLUDE_DIRS - The DS include directories -# DS_LIBRARIES - The libraries needed to use DS -# DS_FLAGS - The flags needed to use DS -# - -find_package(PkgConfig) - -#find_library(DS_LIBRARIES NAMES ds) -#find_library(DSHAL_LIBRARIES NAMES dshalcli) -#find_library(OEMHAL_LIBRARIES NAMES ds-hal) -#find_library(IARMBUS_LIBRARIES NAMES IARMBus) -#find_path(DS_INCLUDE_DIRS NAMES manager.hpp PATH_SUFFIXES ds/include) -#find_path(DSHAL_INCLUDE_DIRS NAMES dsTypes.h PATHS hal/include/) -#find_path(DSRPC_INCLUDE_DIRS NAMES dsMgr.h PATH_SUFFIXES rpc/include) - -#set(DS_LIBRARIES ${DS_LIBRARIES} ${DSHAL_LIBRARIES}) -#set(DS_LIBRARIES ${DS_LIBRARIES} CACHE PATH "Path to DS library") -#set(DS_INCLUDE_DIRS ${DS_INCLUDE_DIRS} ${DSHAL_INCLUDE_DIRS} ${DSRPC_INCLUDE_DIRS}) -set(DS_INCLUDE_DIRS ${CMAKE_ROOT_DIR}/deps/rdk/devicesettings/ds/include) -set(DSHAL_INCLUDE_DIRS ${CMAKE_ROOT_DIR}/deps/rdk/devicesettings/hal/include) -set(DSRPC_INCLUDE_DIRS ${CMAKE_ROOT_DIR}/deps/rdk/devicesettings/rpc/include) -set(DS_DIRS ${DS_INCLUDE_DIRS} ${DSHAL_INCLUDE_DIRS} ${DSRPC_INCLUDE_DIRS}) -set(DS_LIBRARIES ${CMAKE_ROOT_DIR}/deps/rdk/devicesettings/install/lib) -#set(DS_INCLUDE_DIRS ${DSHAL_INCLUDE_DIRS}) -#set(DS_INCLUDE_DIRS ${DS_INCLUDE_DIRS} CACHE PATH "Path to DS include") - - - -include(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(DS DEFAULT_MSG DS_INCLUDE_DIRS DS_LIBRARIES) - -mark_as_advanced( - DS_FOUND - DS_INCLUDE_DIRS - DS_LIBRARIES - DS_LIBRARY_DIRS - DS_FLAGS) diff --git a/L2HalMock/patches/rdkservices/files/cmake/FindIARMBus.cmake b/L2HalMock/patches/rdkservices/files/cmake/FindIARMBus.cmake deleted file mode 100644 index acede449..00000000 --- a/L2HalMock/patches/rdkservices/files/cmake/FindIARMBus.cmake +++ /dev/null @@ -1,43 +0,0 @@ -# If not stated otherwise in this file or this component's license file the -# following copyright and licenses apply: -# -# Copyright 2020 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. - -# - Try to find IARMBus -# Once done this will define -# IARMBUS_FOUND - System has IARMBus -# IARMBUS_INCLUDE_DIRS - The IARMBus include directories -# IARMBUS_LIBRARIES - The libraries needed to use IARMBus -# IARMBUS_FLAGS - The flags needed to use IARMBus -# - -find_package(PkgConfig) - -set(IARMBUS_INCLUDE_DIRS ${CMAKE_ROOT_DIR}/deps/rdk/iarmbus/core/include) -set(IARMIR_INCLUDE_DIRS ${CMAKE_ROOT_DIR}/deps/rdk/iarmmgrs/ir/include) -set(IARMRECEIVER_INCLUDE_DIRS ${CMAKE_ROOT_DIR}/deps/rdk/iarmmgrs/receiver/include) -set(IARMPWR_INCLUDE_DIRS ${CMAKE_ROOT_DIR}/deps/rdk/iarmmgrs/hal/include) -set(IARM_DIRS ${IARMBUS_INCLUDE_DIRS} ${IARMIR_INCLUDE_DIRS} ${IARMRECEIVER_INCLUDE_DIRS} ${IARMPWR_INCLUDE_DIRS}) -set(IARM_LIBRARIES ${CMAKE_ROOT_DIR}/deps/rdk/iarmbus/install/) - -include(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(IARMBUS DEFAULT_MSG IARMBUS_INCLUDE_DIRS IARMBUS_LIBRARIES) - -mark_as_advanced( - IARMBUS_FOUND - IARMBUS_INCLUDE_DIRS - IARMBUS_LIBRARIES - IARMBUS_LIBRARY_DIRS - IARMBUS_FLAGS) diff --git a/L2HalMock/patches/rdkservices/iarmmgrs/Makefile b/L2HalMock/patches/rdkservices/iarmmgrs/Makefile deleted file mode 100644 index 0e3bd8b7..00000000 --- a/L2HalMock/patches/rdkservices/iarmmgrs/Makefile +++ /dev/null @@ -1,44 +0,0 @@ -########################################################################## -# If not stated otherwise in this file or this component's Licenses.txt -# file the following copyright and licenses apply: -# -# Copyright 2016 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. -########################################################################## -# -# List of Libraries -install_dir := ../install/bin -install_lib_dir := ../install/lib - -exe_ds := dsmgr - -executable := $(exe_ds) - -.PHONY: clean all $(executable) install - -all: clean $(executable) install - -$(executable): - $(MAKE) -C $@ - -install: - echo "Creating directory.." - mkdir -p $(install_dir) - mkdir -p $(install_lib_dir) - echo "Copying files now.." - cp $(exe_ds)/*Main $(install_dir) - -clean: - rm -rf $(install_dir) - rm -rf $(install_lib_dir) \ No newline at end of file diff --git a/L2HalMock/patches/rdkservices/iarmmgrs/ds.patch b/L2HalMock/patches/rdkservices/iarmmgrs/ds.patch deleted file mode 100644 index 0d55a76d..00000000 --- a/L2HalMock/patches/rdkservices/iarmmgrs/ds.patch +++ /dev/null @@ -1,36 +0,0 @@ -diff --git a/dsmgr/dsMgrPwrEventListener.c b/dsmgr/dsMgrPwrEventListener.c -index 034b733..90674d0 100644 ---- a/dsmgr/dsMgrPwrEventListener.c -+++ b/dsmgr/dsMgrPwrEventListener.c -@@ -117,7 +117,7 @@ void initPwrEventListner() - } - - try { -- device::Manager::load(); -+ device::Manager::Initialize(); - INT_DEBUG("device::Manager::load success.\n"); - } - catch (...){ -diff --git a/power/pwrMgr.c b/power/pwrMgr.c -index 550df26..df0e80b 100755 ---- a/power/pwrMgr.c -+++ b/power/pwrMgr.c -@@ -845,15 +845,15 @@ void performReboot(const char * requestor, const char * reboot_reason_custom, co - char * reboot_reason_other_cpy = strdup(reboot_reason_other); - - std::thread async_reboot_thread([requestor_cpy, reboot_reason_custom_cpy, reboot_reason_other_cpy] () { -- v_secure_system("echo 0 > /opt/.rebootFlag"); -+ // v_secure_system("echo 0 > /opt/.rebootFlag"); - sleep(5); - if(0 == access("/rebootNow.sh", F_OK)) - { -- v_secure_system("/rebootNow.sh -s '%s' -r '%s' -o '%s'", requestor_cpy, reboot_reason_custom_cpy, reboot_reason_other_cpy); -+ // v_secure_system("/rebootNow.sh -s '%s' -r '%s' -o '%s'", requestor_cpy, reboot_reason_custom_cpy, reboot_reason_other_cpy); - } - else - { -- v_secure_system("/lib/rdk/rebootNow.sh -s '%s' -r '%s' -o '%s'", requestor_cpy, reboot_reason_custom_cpy, reboot_reason_other_cpy); -+ // v_secure_system("/lib/rdk/rebootNow.sh -s '%s' -r '%s' -o '%s'", requestor_cpy, reboot_reason_custom_cpy, reboot_reason_other_cpy); - } - free(requestor_cpy); - free(reboot_reason_custom_cpy); diff --git a/L2HalMock/patches/rdkservices/iarmmgrs/dsmgr/Makefile b/L2HalMock/patches/rdkservices/iarmmgrs/dsmgr/Makefile deleted file mode 100644 index de4f5d5a..00000000 --- a/L2HalMock/patches/rdkservices/iarmmgrs/dsmgr/Makefile +++ /dev/null @@ -1,75 +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. -### - -RM := rm -rf -CFLAGS := -g -fPIC -D_REENTRANT -Wall -OBJS := $(patsubst %.c,%.o,$(wildcard *.c)) -CPPLAGS := -g -fPIC -D_REENTRANT -Wall -EXECUTABLE = dsSrvMain -INCLUDE = -I. \ - -I$(IARM_PATH)/core/ \ - -I$(IARM_PATH)/core/include \ - -I$(IARM_MGRS)/sysmgr/include \ - -I$(IARM_MGRS)/hal/include \ - -I$(IARM_MGRS)/mfr/include \ - -I$(DS_PATH)/rpc/include \ - -I$(DS_PATH)/hal/include \ - -I$(DS_PATH)/ds/include \ - -I$(DS_PATH)/hal/src \ - -I$(GLIB_HEADER_PATH)/ \ - -I$(GLIB_HEADER_PATH)/glib/ \ - -I$(GLIB_CONFIG_PATH)/../lib/glib-2.0/include/ \ - -I$(GLIB_INCLUDE_PATH)/ \ - -I$(DFB_ROOT)/usr/local/include/directfb \ - -I$(SAFEC_INCLUDE_PATH) - -INSTALL := $(PWD)/install - -CFLAGS += $(INCLUDE) - -# LDFLAGS +=-Wl,--copy-dt-needed-entries,-rpath,$(SDK_FSROOT)/usr/local/lib -# LDFLAGS += -L$(IARM_PATH)/install -lIARMBus -# LDFLAGS += -L$(DS_PATH)/install/lib -lds -ldshalcli - -# LDFLAGS := -L$(CEC_ROOT)/ccec/drivers/iarmbus/install/lib -L$(CEC_ROOT)/osal/src/install/lib -L$(CEC_ROOT)/soc/$(PLATFORM_SOC)/common/install/lib -L$(CEC_ROOT)/ccec/src/install/lib -LDFLAGS += -L$(IARM_PATH)/install -L$(CEC_ROOT)/ccec/iarmbus -LDFLAGS += -L$(FUSION_PATH) -L$(DFB_LIB) -L$(OPENSOURCE_BASE)/lib -L$(GLIB_LIBRARY_PATH) -L$(DS_PATH)/install/lib -L$(SAFEC_LIB_PATH) $(GLIBS) -lIARMBus -lpthread -ldirect -lfusion -ldshalsrv -lds -lds-hal -lsafec-3.5 -lglib-2.0 -# LDFLAGS += -lnexus # couldn't find nexus and not sure if it is really needed yet. -# LDFLAGS += -L$(DS_PATH)/install/lib -lds -ldshalcli - -# LDFLAGS += -L /home/administrator/PROJECT/GIT_COMMIT/work/LATEST_COMMIT/rdkservices/L2HalMock/workspace/deps/rdk/iarmbus/install -lIARMBus -# LDFLAGS += -L /home/administrator/PROJECT/GIT_COMMIT/work/LATEST_COMMIT/rdkservices/L2HalMock/workspace/deps/rdk/devicesettings/install/lib -ldshalcli -ldshalsrv -lds - -all:clean executable - @echo "Build Finished...." - -executable: $(OBJS) - $(CXX) $(CFLAGS) $(OBJS) -o $(EXECUTABLE) $(LDFLAGS) - -%.o: %.c - @echo "Building $@ ...." - $(CXX) -c $< $(CFLAGS) -o $@ - -%.o: %.cpp - @echo "Building $@ ...." - $(CXX) -c $< $(CFLAGS) -o $@ - -clean: - @echo "Cleaning the directory..." - @$(RM) $(OBJS) $(EXECUTABLE) \ No newline at end of file diff --git a/L2HalMock/patches/rdkservices/iarmmgrs/dsmgr/dsMgr.c b/L2HalMock/patches/rdkservices/iarmmgrs/dsmgr/dsMgr.c deleted file mode 100644 index d7cc18ad..00000000 --- a/L2HalMock/patches/rdkservices/iarmmgrs/dsmgr/dsMgr.c +++ /dev/null @@ -1,1035 +0,0 @@ -/* - * If not stated otherwise in this file or this component's Licenses.txt file the - * following copyright and licenses apply: - * - * Copyright 2016 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. -*/ - - - -/** -* @defgroup iarmmgrs -* @{ -* @defgroup dsmgr -* @{ -**/ - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -#include "libIARM.h" -#include "libIBusDaemon.h" -#include "dsMgrInternal.h" -#include "libIBus.h" -#include "iarmUtil.h" - -#include "sysMgr.h" - -#include "dsMgr.h" -#include "dsUtl.h" -#include "dsError.h" -#include "dsTypes.h" -#include "dsRpc.h" -#include "dsVideoPort.h" -#include "dsVideoResolutionSettings.h" -#include "dsDisplay.h" -#include "dsAudioSettings.h" -#include "dsAudio.h" -#include "safec_lib.h" -#include "rfcapi.h" -#include "dsMgrPwrEventListener.h" - -extern IARM_Result_t _dsSetResolution(void *arg); -extern IARM_Result_t _dsGetResolution(void *arg); -extern IARM_Result_t _dsInitResolution(void *arg); -extern IARM_Result_t _dsGetAudioPort(void *arg); -extern IARM_Result_t _dsGetStereoMode(void *arg); -extern IARM_Result_t _dsSetStereoMode(void *arg); -extern IARM_Result_t _dsGetEDID(void *arg); -extern IARM_Result_t _dsGetEDIDBytes(void *arg); -extern IARM_Result_t _dsGetVideoPort(void *arg); -extern IARM_Result_t _dsIsDisplayConnected(void *arg); -extern IARM_Result_t _dsGetStereoAuto(void *arg); -extern IARM_Result_t _dsIsDisplaySurround(void *arg); -extern IARM_Result_t _dsGetForceDisable4K(void *arg); -extern IARM_Result_t _dsSetBackgroundColor(void *arg); -extern IARM_Result_t _dsGetIgnoreEDIDStatus(void *arg); -extern bool isComponentPortPresent(); - -extern bool dsGetHDMIDDCLineStatus(void); -static int _SetVideoPortResolution(); -static int _SetResolution(intptr_t* handle,dsVideoPortType_t PortType); -static void _EventHandler(const char *owner, IARM_EventId_t eventId, void *data, size_t len); -static IARM_Result_t _SysModeChange(void *arg); -static void dumpHdmiEdidInfo(dsDisplayEDID_t* pedidData); -static int iTuneReady = 0; -static dsDisplayEvent_t edisplayEventStatus = dsDISPLAY_EVENT_MAX; -static pthread_t edsHDMIHPDThreadID; // HDMI HPD - HDMI Hot Plug detect events -static pthread_mutex_t tdsMutexLock; -static pthread_cond_t tdsMutexCond; -static void* _DSMgrResnThreadFunc(void *arg); -static void _setAudioMode(); -void _setEASAudioMode(); -static int iResnCount = 5; -static int iInitResnFlag = 0; -static bool bHDCPAuthenticated = false; -static bool bPwrMgeRFCEnabled = false; -IARM_Bus_Daemon_SysMode_t isEAS = IARM_BUS_SYS_MODE_NORMAL; // Default is Normal Mode - -#define RFC_PWRMGR2 "Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.Power.PwrMgr2.Enable" - -/*DSMgr Glib variables */ -/* For glib APIs*/ -#include -GMainLoop *dsMgr_Gloop = NULL; -static gboolean heartbeatMsg(gpointer data); -static gboolean _SetResolutionHandler(gpointer data); -static guint hotplug_event_src = 0; -static gboolean dumpEdidOnChecksumDiff(gpointer data); -static bool IsIgnoreEdid_gs = false; - -static intptr_t getVideoPortHandle(_dsVideoPortType_t port) -{ - /* Get the HDMI Video Port Parameter */ - dsVideoPortGetHandleParam_t vidPortParam; - memset(&vidPortParam, 0, sizeof(vidPortParam)); - vidPortParam.type = port; - vidPortParam.index = 0; - _dsGetVideoPort(&vidPortParam); - return vidPortParam.handle; -} - -static bool isHDMIConnected() -{ - /* Get the Display connection status */ - dsVideoPortIsDisplayConnectedParam_t ConParam; - memset(&ConParam, 0, sizeof(ConParam)); - ConParam.handle = getVideoPortHandle(dsVIDEOPORT_TYPE_HDMI); - _dsIsDisplayConnected(&ConParam); - return ConParam.connected; -} - -IARM_Result_t DSMgr_Start() -{ - FILE *fDSCtrptr = NULL; - IARM_Bus_SYSMgr_GetSystemStates_Param_t tuneReadyParam; - - - setvbuf(stdout, NULL, _IOLBF, 0); - INT_INFO("Entering [%s] - [%s] - disabling io redirect buf \r\n", __FUNCTION__, IARM_BUS_DSMGR_NAME); - - /* Register with IARM Libs and Connect */ - IARM_Bus_Init(IARM_BUS_DSMGR_NAME); - IARM_Bus_Connect(); - IARM_Bus_RegisterEvent(IARM_BUS_DSMGR_EVENT_MAX); - - /*Initialize the DS Manager - DS Srv and DS HAL */ - dsMgr_init(); - - iInitResnFlag = 1; - dsEdidIgnoreParam_t ignoreEdidParam; - memset(&ignoreEdidParam,0,sizeof(ignoreEdidParam)); - ignoreEdidParam.handle = dsVIDEOPORT_TYPE_HDMI; - _dsGetIgnoreEDIDStatus(&ignoreEdidParam); - IsIgnoreEdid_gs = ignoreEdidParam.ignoreEDID; - __TIMESTAMP();printf("ResOverride DSMgr_Start IsIgnoreEdid_gs: %d\n", IsIgnoreEdid_gs); - /*Register the Events */ - IARM_Bus_RegisterEventHandler(IARM_BUS_SYSMGR_NAME,IARM_BUS_SYSMGR_EVENT_SYSTEMSTATE,_EventHandler); - IARM_Bus_RegisterEventHandler(IARM_BUS_DSMGR_NAME,IARM_BUS_DSMGR_EVENT_HDMI_HOTPLUG,_EventHandler); - IARM_Bus_RegisterEventHandler(IARM_BUS_DSMGR_NAME,IARM_BUS_DSMGR_EVENT_HDCP_STATUS,_EventHandler); - - /*Register EAS handler so that we can ensure audio settings for EAS */ - IARM_Bus_RegisterCall(IARM_BUS_COMMON_API_SysModeChange, _SysModeChange); - - RFC_ParamData_t rfcParam; - // WDMP_STATUS status = getRFCParameter("dsMgr", RFC_PWRMGR2, &rfcParam); - WDMP_STATUS status = WDMP_SUCCESS; - if(strncmp(rfcParam.value, "true",4) == 0) - { - bPwrMgeRFCEnabled= true; - __TIMESTAMP(); printf("dsMgr:RFC PwrMgr2 feature enabled \r\n"); - } - - if(bPwrMgeRFCEnabled) - { - /*Refactored dsMGR code*/ - initPwrEventListner(); - } - /* Create Thread for listening Hot Plug events */ - pthread_mutex_init (&tdsMutexLock, NULL); - pthread_cond_init (&tdsMutexCond, NULL); - pthread_create (&edsHDMIHPDThreadID, NULL, _DSMgrResnThreadFunc, NULL); - - /* Read the HDMI DDC Line delay to be introduced - * for setting the resolution - * The DDC line is used for EDID and HDCP Negotiation - */ - fDSCtrptr = fopen("/opt/ddcDelay","r"); - if (NULL != fDSCtrptr) - { - if(0 > fscanf(fDSCtrptr,"%d",&iResnCount)) - { - INT_INFO("Error: fscanf on ddcDelay failed"); - } - fclose (fDSCtrptr); - } - __TIMESTAMP(); printf("Retry DS manager Resolution count is iResnCount = %d \r\n",iResnCount); - - - IARM_Bus_Call(IARM_BUS_SYSMGR_NAME, IARM_BUS_SYSMGR_API_GetSystemStates, &tuneReadyParam, sizeof(tuneReadyParam)); - __TIMESTAMP(); printf("Tune Ready Status on start up is %d \r\n",tuneReadyParam.TuneReadyStatus.state); - - /* Read the Tune Ready status on startup and update the tune ready flag */ - if(1 == tuneReadyParam.TuneReadyStatus.state) - { - iTuneReady = 1; - } - - /* Create Main loop for DS Manager */ - dsMgr_Gloop = g_main_loop_new ( NULL , FALSE ); - if(dsMgr_Gloop != NULL){ - g_timeout_add_seconds (300 , heartbeatMsg , dsMgr_Gloop); - } - else { - INT_INFO("Fails to Create a main Loop for [%s] \r\n",IARM_BUS_DSMGR_NAME); - } - - if(!isHDMIConnected()) - { - __TIMESTAMP();printf("HDMI not connected at bootup -Schedule a handler to set the resolution .. \r\n"); - _SetVideoPortResolution(); - } - return IARM_RESULT_SUCCESS; -} - -IARM_Result_t DSMgr_Loop() -{ - - /* DS Mgr loop */ - if(dsMgr_Gloop) - { - g_main_loop_run (dsMgr_Gloop); - g_main_loop_unref(dsMgr_Gloop); - } - return IARM_RESULT_SUCCESS; -} - -static gboolean heartbeatMsg(gpointer data) -{ - time_t curr = 0; - time(&curr); - INT_INFO("I-ARM BUS DS Mgr: HeartBeat at %s\r\n", ctime(&curr)); - return TRUE; -} - -IARM_Result_t DSMgr_Stop() -{ - - if(dsMgr_Gloop) - { - g_main_loop_quit(dsMgr_Gloop); - } - - IARM_Bus_Disconnect(); - IARM_Bus_Term(); - pthread_mutex_destroy (&tdsMutexLock); - pthread_cond_destroy (&tdsMutexCond); - - return IARM_RESULT_SUCCESS; -} - -/** - * @fn static IARM_Result_t _SysModeChange(void *arg){ - * @brief This function is a event handler which returns current system - * mode using IARM. It returns mode as "NORMAL", "WAREHOUSE","EAS" or "UNKNOWN". - * - * @param[in] void pointer to void, containing IARM_Bus_CommonAPI_SysModeChange_Param_t data. - * - * @return variable of IARM_Result_t type. - * @retval IARM_RESULT_SUCCESS On function completion. - */ -static IARM_Result_t _SysModeChange(void *arg) -{ - IARM_Bus_CommonAPI_SysModeChange_Param_t *param = (IARM_Bus_CommonAPI_SysModeChange_Param_t *)arg; - IARM_Bus_Daemon_SysMode_t isNextEAS = IARM_BUS_SYS_MODE_NORMAL; - - __TIMESTAMP();printf("[DSMgr] Recvd Sysmode Change::New mode --> %d,Old mode --> %d",param->newMode,param->oldMode); - - if ((param->newMode == IARM_BUS_SYS_MODE_EAS) || - (param->newMode == IARM_BUS_SYS_MODE_NORMAL)) - { - isNextEAS = param->newMode; - } - else - { - /* Do not process any other mode change as of now for DS Manager.. */ - return IARM_RESULT_SUCCESS; - } - - if ((isEAS == IARM_BUS_SYS_MODE_EAS) && (isNextEAS == IARM_BUS_SYS_MODE_NORMAL) ) { - isEAS = IARM_BUS_SYS_MODE_NORMAL; - _setAudioMode(); - } - else if ((isEAS == IARM_BUS_SYS_MODE_NORMAL) && (isNextEAS == IARM_BUS_SYS_MODE_EAS) ) { - /* - * Change the Audio Mode to Stereo if Current Audio Setting is Paasthrough - */ - isEAS = IARM_BUS_SYS_MODE_EAS; - _setEASAudioMode(); - - } - else { - /* no op for no mode change */ - } - return IARM_RESULT_SUCCESS; -} - -static void setBGColor(dsVideoBackgroundColor_t color) -{ - /* Get the HDMI Video Port Parameter */ - dsVideoPortGetHandleParam_t vidPortParam; - memset(&vidPortParam, 0, sizeof(vidPortParam)); - vidPortParam.type = dsVIDEOPORT_TYPE_HDMI; - vidPortParam.index = 0; - _dsGetVideoPort(&vidPortParam); - vidPortParam.handle; - - if(vidPortParam.handle != NULL) - { - dsSetBackgroundColorParam_t setBGColorParam; - memset(&setBGColorParam, 0, sizeof(setBGColorParam)); - setBGColorParam.color = color; - setBGColorParam.handle= vidPortParam.handle; - _dsSetBackgroundColor(&setBGColorParam); - } -} - - -/*Event Handler for DS Manager And Sys Manager Events */ -static void _EventHandler(const char *owner, IARM_EventId_t eventId, void *data, size_t len) -{ - /*Handle only Sys Manager Events */ - if (strcmp(owner, IARM_BUS_SYSMGR_NAME) == 0) - { - /* Only handle state events */ - if (eventId != IARM_BUS_SYSMGR_EVENT_SYSTEMSTATE) return; - // __TIMESTAMP();printf("_sysMgrEventHandler invoked in DS Manager\r\n"); - IARM_Bus_SYSMgr_EventData_t *sysEventData = (IARM_Bus_SYSMgr_EventData_t*)data; - IARM_Bus_SYSMgr_SystemState_t stateId = sysEventData->data.systemStates.stateId; - int state = sysEventData->data.systemStates.state; - __TIMESTAMP();printf("_sysEventHandler invoked for stateid %d of state %d \r\n", stateId, state); - switch(stateId) { - case IARM_BUS_SYSMGR_SYSSTATE_TUNEREADY: - __TIMESTAMP();printf("Tune Ready Evenets in DS Manager \r\n"); - - if (0 == iTuneReady) - { - iTuneReady = 1; - - /* Set audio mode from persistent */ - _setAudioMode(); - - /* Un-block the Resolution Settings Thread */ - pthread_mutex_lock(&tdsMutexLock); - pthread_cond_signal(&tdsMutexCond); - pthread_mutex_unlock(&tdsMutexLock); - } - break; - default: - break; - } - }else if (strcmp(owner,IARM_BUS_DSMGR_NAME) == 0) - { - switch (eventId) { - case IARM_BUS_DSMGR_EVENT_HDMI_HOTPLUG: - { - - IARM_Bus_DSMgr_EventData_t *eventData = (IARM_Bus_DSMgr_EventData_t *)data; - - __TIMESTAMP();printf("[DsMgr] Got HDMI %s Event \r\n",(eventData->data.hdmi_hpd.event == dsDISPLAY_EVENT_CONNECTED ? "Connect" : "Disconnect")); - - setBGColor(dsVIDEO_BGCOLOR_NONE); - - /* Un-Block the Resolution Settings Thread */ - pthread_mutex_lock(&tdsMutexLock); - edisplayEventStatus = ((eventData->data.hdmi_hpd.event == dsDISPLAY_EVENT_CONNECTED) ? dsDISPLAY_EVENT_CONNECTED : dsDISPLAY_EVENT_DISCONNECTED); - pthread_cond_signal(&tdsMutexCond); - pthread_mutex_unlock(&tdsMutexLock); - - } - break; - case IARM_BUS_DSMGR_EVENT_HDCP_STATUS: - { - IARM_Bus_DSMgr_EventData_t *eventData = (IARM_Bus_DSMgr_EventData_t *)data; - IARM_Bus_SYSMgr_EventData_t HDCPeventData; - int status = eventData->data.hdmi_hdcp.hdcpStatus; - //__TIMESTAMP();printf("%s: IARM_BUS_DSMGR_EVENT_HDCP_STATUS event status :%d \r\n",__FUNCTION__, status); - - /* HDCP is enabled */ - HDCPeventData.data.systemStates.stateId = IARM_BUS_SYSMGR_SYSSTATE_HDCP_ENABLED; - HDCPeventData.data.systemStates.state = 1; - if (status == dsHDCP_STATUS_AUTHENTICATED ) - { - __TIMESTAMP();printf("Changed status to HDCP Authentication Pass !!!!!!!! ..\r\n"); - HDCPeventData.data.systemStates.state = 1; - bHDCPAuthenticated = true; - __TIMESTAMP();printf("HDCP success - Removed hotplug_event_src Time source %d and set resolution immediately \r\n",hotplug_event_src); - if(hotplug_event_src) - { - g_source_remove(hotplug_event_src); - hotplug_event_src = 0; - } - setBGColor(dsVIDEO_BGCOLOR_NONE); - if (!IsIgnoreEdid_gs) { - _SetVideoPortResolution(); - } - g_timeout_add_seconds((guint)1,dumpEdidOnChecksumDiff,NULL); - } - else if (status == dsHDCP_STATUS_AUTHENTICATIONFAILURE ) - { - __TIMESTAMP();printf("Changed status to HDCP Authentication Fail !!!!!!!! ..\r\n"); - HDCPeventData.data.systemStates.state = 0; - setBGColor(dsVIDEO_BGCOLOR_BLUE); - bHDCPAuthenticated = false; - if (!IsIgnoreEdid_gs) { - _SetVideoPortResolution(); - } - g_timeout_add_seconds((guint)1,dumpEdidOnChecksumDiff,NULL); - } - - IARM_Bus_BroadcastEvent(IARM_BUS_SYSMGR_NAME, (IARM_EventId_t) IARM_BUS_SYSMGR_EVENT_SYSTEMSTATE, (void *)&HDCPeventData, sizeof(HDCPeventData)); - - } - break; - default: - break; - } - } -} - -/* Set Video resolution on HDMI Hot Plug or Tune Ready events */ -static int _SetVideoPortResolution() -{ - intptr_t _hdmihandle = 0; - intptr_t _comphandle = 0; - bool connected=false; - int iCount = 0; - - - __TIMESTAMP(); printf("%s:Enter \r\n",__FUNCTION__); - - _hdmihandle = getVideoPortHandle(dsVIDEOPORT_TYPE_HDMI); - if(_hdmihandle != NULL) - { - - usleep(100*1000); //wait for 100 milli seconds - - - /* - * Check for HDMI DDC Line when HDMI is connected. - */ - connected = isHDMIConnected(); - if(iInitResnFlag && connected) - { - - #ifdef _INIT_RESN_SETTINGS - /*Wait for iResnCount*/ - while(iCount < iResnCount) - { - sleep(1); //wait for 1 sec - if (dsGetHDMIDDCLineStatus()) - { - break; - } - __TIMESTAMP(); printf ("Waiting for HDMI DDC Line to be ready for resolution Change...\r\n"); - iCount++; - } - #endif - } - - /*Set HDMI Resolution if Connected else COomponent or Composite Resolution */ - if(connected){ - - __TIMESTAMP(); printf("Setting HDMI resolution.......... \r\n"); - _SetResolution(&_hdmihandle,dsVIDEOPORT_TYPE_HDMI); - } - else { - _comphandle = getVideoPortHandle(dsVIDEOPORT_TYPE_COMPONENT); - - if (NULL != _comphandle) - { - __TIMESTAMP();printf("Setting Component/Composite Resolution.......... \r\n"); - _SetResolution(&_comphandle,dsVIDEOPORT_TYPE_COMPONENT); - } - else - { - __TIMESTAMP();printf("%s: NULL Handle for component\r\n",__FUNCTION__); - - intptr_t _compositehandle = getVideoPortHandle(dsVIDEOPORT_TYPE_BB); - - if (NULL != _compositehandle) - { - __TIMESTAMP();printf("Setting BB Composite Resolution.......... \r\n"); - _SetResolution(&_compositehandle,dsVIDEOPORT_TYPE_BB); - } - else - { - __TIMESTAMP();printf("%s: NULL Handle for Composite \r\n",__FUNCTION__); - intptr_t _rfhandle = getVideoPortHandle(dsVIDEOPORT_TYPE_RF); - if (NULL != _rfhandle) - { - __TIMESTAMP();printf("Setting RF Resolution.......... \r\n"); - _SetResolution(&_rfhandle,dsVIDEOPORT_TYPE_RF); - } - else - { - __TIMESTAMP();printf("%s: NULL Handle for RF \r\n",__FUNCTION__); - } - } - } - - } - } - else - { - __TIMESTAMP();printf("%s: NULL Handle for HDMI \r\n",__FUNCTION__); - } - __TIMESTAMP();printf("%s:Exit \r\n",__FUNCTION__); - return 0; -} - -/** - * @brief This Function does following : - * Read Persisted resolution - * Verify Persisted resolution with Platform and EDID resolution - * If fails set best EDID resolution supported by platform - * If fails Default to 720P - * If 720p is not supported by TV , Default to 480p - * @param void pointer Device Handle - * * @param Connection Status - ** @return void pointer (NULL) - */ -static int _SetResolution(intptr_t* handle,dsVideoPortType_t PortType) -{ - errno_t rc = -1; - intptr_t _displayHandle = 0; - int numResolutions = 0,i=0; - intptr_t _handle = *handle; - bool IsValidResolution = false; - dsVideoPortSetResolutionParam_t Setparam; - dsVideoPortGetResolutionParam_t Getparam; - dsVideoPortResolution_t *setResn = NULL; - dsDisplayEDID_t edidData; - dsDisplayGetEDIDParam_t Edidparam; - /* - * Default Resolution Compatible check is false - Do not Force compatible resolution on startup - */ - Setparam.forceCompatible = false; - - /*Initialize the struct*/ - memset(&edidData, 0, sizeof(edidData)); - - /* Return if Handle is NULL */ - if (_handle == NULL) - { - __TIMESTAMP();printf("_SetResolution - Got NULL Handle ..\r\n"); - return 0; - } - - /*Get the User Persisted Resolution Based on Handle */ - memset(&Getparam,0,sizeof(Getparam)); - Getparam.handle = _handle; - Getparam.toPersist = true; - _dsGetResolution(&Getparam); - dsVideoPortResolution_t *presolution = &Getparam.resolution; - __TIMESTAMP();printf("Got User Persisted Resolution - %s..\r\n",presolution->name); - - - if (PortType == dsVIDEOPORT_TYPE_HDMI) { - /*Get The Display Handle */ - dsGetDisplay(dsVIDEOPORT_TYPE_HDMI, 0, &_displayHandle); - if (_displayHandle) - { - /* Get the EDID Display Handle */ - memset(&Edidparam,0,sizeof(Edidparam)); - Edidparam.handle = _displayHandle; - _dsGetEDID(&Edidparam); - rc = memcpy_s(&edidData,sizeof(edidData), &Edidparam.edid, sizeof(Edidparam.edid)); - if(rc!=EOK) - { - ERR_CHK(rc); - } - dumpHdmiEdidInfo(&edidData); - numResolutions = edidData.numOfSupportedResolution; - __TIMESTAMP();printf("numResolutions is %d \r\n",numResolutions); - - /* If HDMI is connected and Low power Mode. - The TV might not Transmit the EDID information - Change the Resolution in Next Hot plug - DO not set the Resolution if TV is in DVI mode. - */ - if ((0 == numResolutions) || (!(edidData.hdmiDeviceType))) - { - - __TIMESTAMP();printf("Do not Set Resolution..The HDMI is not Ready !! \r\n"); - __TIMESTAMP();printf("numResolutions = %d edidData.hdmiDeviceType = %d !! \r\n",numResolutions,edidData.hdmiDeviceType); - return 0; - } - - /* - * Check if Persisted Resolution matches with - * TV Resolution list - */ - for (i = 0; i < numResolutions; i++) - { - setResn = &(edidData.suppResolutionList[i]); - printf("presolution->name : %s, resolution->name : %s\r\n",presolution->name,setResn->name); - if ((strcmp(presolution->name,setResn->name) == 0 )) - { - __TIMESTAMP();printf("Breaking..Got Platform Resolution - %s..\r\n",setResn->name); - IsValidResolution = true; - Setparam.forceCompatible = true; - break; - } - } - /* - * The Persisted Resolution Does not matches with TV resolution list - * Set the Best Resolution Supported by TV and Platform - */ - if (false == IsValidResolution) - { - /* Set the Best Resolution Supported by TV and Platform*/ - for (i = numResolutions-1; i >= 0; i--) - { - setResn = &(edidData.suppResolutionList[i]); - int pNumResolutions = dsUTL_DIM(kResolutions); - for (int j = pNumResolutions-1; j >=0; j--) - { - dsVideoPortResolution_t *pfResolution = &kResolutions[j]; - if (0 == (strcmp(pfResolution->name,setResn->name))) - { - __TIMESTAMP();printf("[DsMgr] Set Best TV Supported Resolution %s \r\n",pfResolution->name); - IsValidResolution = true; - break; - } - } - if (IsValidResolution) - { - break; - } - } - } - /* - * The Persisted Resolution Does not matches with TV and Platform - * Resolution List - * Force PLatform Default Resolution - */ - if (false == IsValidResolution) - { - /* Check if the Default platform resolution is supported by Platfrom resolution List i.e 720p */ - dsVideoPortResolution_t *defaultResn; - defaultResn = &kResolutions[kDefaultResIndex]; - for (i = 0; i < numResolutions; i++) - { - setResn = &(edidData.suppResolutionList[i]); - //printf("\n presolution->name : %s, resolution->name : %s\n",defaultResn->name,setResn->name); - if ((strcmp(defaultResn->name,setResn->name) == 0 )) - { - IsValidResolution = true; - __TIMESTAMP();printf("Breaking..Got Default Platform Resolution - %s..\r\n",setResn->name); - break; - } - } - } - - if (false == IsValidResolution) - { - /*Take 480p as resolution if both above cases fail */ - for (i = 0; i < numResolutions; i++) - { - setResn = &(edidData.suppResolutionList[i]); - if ((strcmp("480p",setResn->name) == 0 )) - { - __TIMESTAMP();printf("Breaking..Default to 480p Resolution - %s..\r\n",setResn->name); - IsValidResolution = true; - break; - } - } - } - - if (false == IsValidResolution) - { - /* Boot with the Resolution Supported by TV and Platform*/ - for (i = 0; i < numResolutions; i++) - { - setResn = &(edidData.suppResolutionList[i]); - size_t numResolutions = dsUTL_DIM(kResolutions); - for (size_t j = 0; j < numResolutions; j++) - { - dsVideoPortResolution_t *pfResolution = &kResolutions[j]; - if (0 == (strcmp(pfResolution->name,setResn->name))) - { - __TIMESTAMP();printf("[DsMgr] Boot with TV Supported Resolution %s \r\n",pfResolution->name); - IsValidResolution = true; - break; - } - } - } - } - } - } - else if (PortType == dsVIDEOPORT_TYPE_COMPONENT || PortType == dsVIDEOPORT_TYPE_BB || PortType == dsVIDEOPORT_TYPE_RF) - { - /* Set the Component / Composite Resolution */ - numResolutions = dsUTL_DIM(kResolutions); - for (i = 0; i < numResolutions; i++) - { - setResn = &kResolutions[i]; - if ((strcmp(presolution->name,setResn->name) == 0 )) - { - __TIMESTAMP();printf("Breaking..Got Platform Resolution - %s..\r\n",setResn->name); - IsValidResolution = true; - break; - } - } - } - /* If the Persisted Resolution settings does not matches with Platform Resolution - - Force Default on Component/Composite - This is to keep upward compatible and if we intend to - remove any resolution from Dynamic Resolution List - */ - if(false == IsValidResolution) - { - setResn = &kResolutions[kDefaultResIndex]; - } - - /* Set The Video Port Resolution in Requested Handle */ - Setparam.handle = _handle; - Setparam.toPersist = false; - - /* If 4K support is disabled and last known resolution is 4K, default to 720p (aka default resolution) */ - dsForceDisable4KParam_t res_4K_override; - memset(&res_4K_override, 0, sizeof(res_4K_override)); - _dsGetForceDisable4K((void *) &res_4K_override); - if(true == res_4K_override.disable) - { - if(0 == strncmp(presolution->name, "2160", 4)) - { - __TIMESTAMP();printf("User persisted 4K resolution. Now limiting to default (720p?) as 4K support is now disabled.\n"); - setResn = &kResolutions[kDefaultResIndex]; - } - } - - Setparam.resolution = *setResn; - - /* Call during Init*/ - #ifdef _INIT_RESN_SETTINGS - if(0 == iInitResnFlag) - { - printf("Init Platform Resolution - %s..\r\n",setResn->name); - _dsInitResolution(&Setparam); - return 0 ; - } - #endif - - _dsSetResolution(&Setparam); - return 0 ; -} - -/** - * @brief Thread entry fuction to post Resolution on Hot Plug and Tune ready Events - * - * This functions changes the device resolution on Hot Plug and Tune ready Events - * - * @param void pointer (NULL) - * - * @return void pointer (NULL) - */ -static void* _DSMgrResnThreadFunc(void *arg) -{ - - /* Loop */ - while (1) - { - __TIMESTAMP(); printf ("_DSMgrResnThreadFunc... wait for for HDMI or Tune Ready Events \r\n"); - - /*Wait for the Event*/ - pthread_mutex_lock(&tdsMutexLock); - pthread_cond_wait(&tdsMutexCond, &tdsMutexLock); - pthread_mutex_unlock(&tdsMutexLock); - - __TIMESTAMP();printf("%s: Setting Resolution On:: HDMI %s Event with TuneReady status = %d \r\n",__FUNCTION__, (edisplayEventStatus == dsDISPLAY_EVENT_CONNECTED ? "Connect" : "Disconnect"),iTuneReady); - - - //On hot plug event , Remove event source - if(hotplug_event_src) - { - g_source_remove(hotplug_event_src); - __TIMESTAMP();printf("Removed Hot Plug Event Time source %d \r\n",hotplug_event_src); - hotplug_event_src = 0; - } - - /*Set the Resolution only on HDMI Hot plug Connect and Tune Ready events */ - if((1 == iTuneReady) && (dsDISPLAY_EVENT_CONNECTED == edisplayEventStatus)) { - /*Set Video Output Port Resolution */ - if(bHDCPAuthenticated) - { - _SetVideoPortResolution(); - } - /* Set audio mode on HDMI hot plug */ - _setAudioMode(); - }/*Set the Resolution only on HDMI Hot plug - Disconnect and Tune Ready event */ - else if((1 == iTuneReady) && (dsDISPLAY_EVENT_DISCONNECTED == edisplayEventStatus)) { - /* * To avoid reoslution settings of HDMI hot plug when TV goes from power OFF to ON condition - * Delay the setting of resolution by 5 sec. This will help to filter out un-necessary - * resolution settings on HDMI hot plug. - */ - bHDCPAuthenticated = false; - if(isComponentPortPresent()) - { - hotplug_event_src = g_timeout_add_seconds((guint)5,_SetResolutionHandler,dsMgr_Gloop); - __TIMESTAMP();printf("Schedule a handler to set the resolution after 5 sec for %d time src.. \r\n",hotplug_event_src); - } - } - - } - return arg; -} - - -static gboolean _SetResolutionHandler(gpointer data) -{ - __TIMESTAMP();printf("Set Video Resolution after delayed time .. \r\n"); - _SetVideoPortResolution(); - hotplug_event_src = 0; - return FALSE; -} - - -void _setEASAudioMode() -{ - - if (isEAS != IARM_BUS_SYS_MODE_EAS) { - __TIMESTAMP();printf("EAS Not In progress..Do not Modify Audio \r\n"); - return; - } - - dsAudioGetHandleParam_t getHandle; - dsAudioSetStereoModeParam_t setMode; - int numPorts, i = 0; - - numPorts = dsUTL_DIM(kSupportedPortTypes); - for (i=0; i < numPorts; i++) - { - const dsAudioPortType_t *audioPort = &kSupportedPortTypes[i]; - memset(&getHandle, 0, sizeof(getHandle)); - getHandle.type = *audioPort; - getHandle.index = 0; - _dsGetAudioPort (&getHandle); - - memset(&setMode, 0, sizeof(setMode)); - setMode.handle = getHandle.handle; - setMode.toPersist = false; - _dsGetStereoMode(&setMode); - - if (setMode.mode == dsAUDIO_STEREO_PASSTHRU) { - /* In EAS, fallsback to Stereo */ - setMode.mode = dsAUDIO_STEREO_STEREO; - } - - __TIMESTAMP();printf("EAS Audio mode for audio port %d is : %d \r\n",getHandle.type, setMode.mode); - setMode.toPersist = false; - _dsSetStereoMode (&setMode); - } -} -/** - * @brief Local function to get and set audio mode - * - * This functions gets the audio mode from persistent and sets it - * - * @param NULL - * - * @return NULL - */ -static void _setAudioMode() -{ - if (isEAS == IARM_BUS_SYS_MODE_EAS) { - __TIMESTAMP();printf("EAS In progress..Do not Modify Audio \r\n"); - return; - } - - dsAudioGetHandleParam_t getHandle; - dsAudioSetStereoModeParam_t setMode; - int numPorts, i = 0; - - numPorts = dsUTL_DIM(kSupportedPortTypes); - for (i=0; i < numPorts; i++) - { - const dsAudioPortType_t *audioPort = &kSupportedPortTypes[i]; - memset(&getHandle, 0, sizeof(getHandle)); - getHandle.type = *audioPort; - getHandle.index = 0; - _dsGetAudioPort (&getHandle); - - memset(&setMode, 0, sizeof(setMode)); - setMode.handle = getHandle.handle; - setMode.toPersist = true; - _dsGetStereoMode(&setMode); - if (getHandle.type == dsAUDIOPORT_TYPE_SPDIF) { - } - else if (getHandle.type == dsAUDIOPORT_TYPE_HDMI) { - //check if it is connected - intptr_t vHandle = 0; - int autoMode = 0; - bool connected = 0; - bool IsSurround = false; - { - dsVideoPortGetHandleParam_t param; - memset(¶m, 0, sizeof(param)); - param.type = dsVIDEOPORT_TYPE_HDMI; - param.index = 0; - _dsGetVideoPort(¶m); - vHandle = param.handle; - //printf("Audio port has HDMI handle\r\n"); - } - { - dsVideoPortIsDisplayConnectedParam_t param; - memset(¶m, 0, sizeof(param)); - param.handle = vHandle; - _dsIsDisplayConnected(¶m); - connected = param.connected; - //printf("Audio port HDMI is connected to sink %d\r\n", connected); - } - - if (!(connected)) { - __TIMESTAMP();printf("HDMI Not Connected ..Do not Set Audio on HDMI !!! \r\n"); - continue; - } - - { - dsAudioSetStereoAutoParam_t param; - memset(¶m, 0, sizeof(param)); - param.handle = getHandle.handle; - _dsGetStereoAuto(¶m); - autoMode = param.autoMode; - //printf("Audio port HDMI is Auto mode %d\r\n", autoMode); - } - - //printf("Audio port HDMI %d is connected %d Auto mode %d\r\n", vHandle, connected, autoMode); - if (autoMode) { - /* If auto, then force surround */ - setMode.mode = dsAUDIO_STEREO_SURROUND; - } - - if (0) /* Do not enforce surround protection, let HAL do it*/ - { - dsVideoPortIsDisplaySurroundParam_t param; - param.handle = vHandle; - param.surround = false; - _dsIsDisplaySurround(¶m); - IsSurround = param.surround; - } - else - { - IsSurround = true; - } - if (!(IsSurround)) { - /* If Surround not supported , then force Stereo */ - setMode.mode = dsAUDIO_STEREO_STEREO; - __TIMESTAMP();printf("Surround mode not Supported on HDMI ..Set Stereo \r\n"); - } - } - __TIMESTAMP();printf("Audio mode for audio port %d is : %d \r\n",getHandle.type, setMode.mode); - setMode.toPersist = false; - _dsSetStereoMode (&setMode); - } -} - -/* This functions Dump the HDMI EDID Information of the box. - * - * @param NULL - * - * @return NULL - */ -static void dumpHdmiEdidInfo(dsDisplayEDID_t* pedidData) -{ - __TIMESTAMP();printf("Connected HDMI Display Device Info !!!!!\r\n"); - - if (NULL == pedidData) { - __TIMESTAMP(); printf("Received EDID is NULL \r\n"); - return; - } - - if(pedidData->monitorName) - printf("HDMI Monitor Name is %s \r\n",pedidData->monitorName); - printf("HDMI Manufacturing ID is %d \r\n",pedidData->serialNumber); - printf("HDMI Product Code is %d \r\n",pedidData->productCode); - printf("HDMI Device Type is %s \r\n",pedidData->hdmiDeviceType?"HDMI":"DVI"); - printf("HDMI Sink Device %s a Repeater \r\n",pedidData->isRepeater?"is":"is not"); - printf("HDMI Physical Address is %d:%d:%d:%d \r\n",pedidData->physicalAddressA, - pedidData->physicalAddressB,pedidData->physicalAddressC,pedidData->physicalAddressD); -} - - -static gboolean dumpEdidOnChecksumDiff(gpointer data) { - __TIMESTAMP();printf("dumpEdidOnChecksumDiff HDMI-EDID Dump>>>>>>>>>>>>>>\r\n"); - intptr_t _displayHandle = 0; - dsGetDisplay(dsVIDEOPORT_TYPE_HDMI, 0, &_displayHandle); - if (_displayHandle) { - int length = 0; - dsDisplayGetEDIDBytesParam_t EdidBytesParam; - static int cached_EDID_checksum = 0; - int current_EDID_checksum = 0; - memset(&EdidBytesParam,0,sizeof(EdidBytesParam)); - EdidBytesParam.handle = _displayHandle; - _dsGetEDIDBytes(&EdidBytesParam); - length = EdidBytesParam.length; - - if((length > 0) && (length <= 512)) { - unsigned char* edidBytes = EdidBytesParam.bytes; - for (int i = 0; i < (length / 128); i++) - current_EDID_checksum += edidBytes[(i+1)*128 - 1]; - - if((cached_EDID_checksum == 0) || (current_EDID_checksum != cached_EDID_checksum)) { - cached_EDID_checksum = current_EDID_checksum; - __TIMESTAMP();printf("HDMI-EDID Dump BEGIN>>>>>>>>>>>>>>\r\n"); - for (int i = 0; i < length; i++) { - if (i % 16 == 0) { - printf("\r\n"); - } - if (i % 128 == 0) { - printf("\r\n"); - } - printf("%02X ", edidBytes[i]); - } - printf("\nHDMI-EDID Dump END>>>>>>>>>>>>>>\r\n"); - } - } - } - return false; -} - -/** @} */ -/** @} */ diff --git a/L2HalMock/patches/rdkservices/patchRemove.patch b/L2HalMock/patches/rdkservices/patchRemove.patch deleted file mode 100644 index 7fa5a114..00000000 --- a/L2HalMock/patches/rdkservices/patchRemove.patch +++ /dev/null @@ -1,58 +0,0 @@ -Signed-off-by: Kishore Darmaradje ---- -diff --git a/HdmiCecSource/CMakeLists.txt b/HdmiCecSource/CMakeLists.txt -index daabbee3..bd14cca5 100644 ---- a/HdmiCecSource/CMakeLists.txt -+++ b/HdmiCecSource/CMakeLists.txt -@@ -40,6 +40,23 @@ target_include_directories(${MODULE_NAME} PRIVATE ${DS_INCLUDE_DIRS}) - - target_link_libraries(${MODULE_NAME} PUBLIC ${NAMESPACE}Plugins::${NAMESPACE}Plugins ${IARMBUS_LIBRARIES} ${CEC_LIBRARIES} ${DS_LIBRARIES} ) - -+if(HALMOCK_PROJECT) -+file(GLOB libraries ${DS_LIBRARIES}/*.so) -+foreach(lib ${libraries}) -+ target_link_libraries(${MODULE_NAME} PUBLIC ${NAMESPACE}Plugins::${NAMESPACE}Plugins ${lib}) -+endforeach(lib) -+ -+file(GLOB libraries ${IARM_LIBRARIES}/*.so) -+foreach(lib ${libraries}) -+ target_link_libraries(${MODULE_NAME} PUBLIC ${NAMESPACE}Plugins::${NAMESPACE}Plugins ${lib}) -+endforeach(lib) -+ -+file(GLOB libraries ${CEC_LIBRARIES}/*.so) -+foreach(lib ${libraries}) -+ target_link_libraries(${MODULE_NAME} PUBLIC ${NAMESPACE}Plugins::${NAMESPACE}Plugins ${lib}) -+endforeach(lib) -+endif() -+ - if (NOT RDK_SERVICES_TEST) - target_compile_options(${MODULE_NAME} PRIVATE -Wno-error=deprecated) - endif () -diff --git a/cmake/FindCEC.cmake b/cmake/FindCEC.cmake -index a55dbbd2..e9c2b3b5 100644 ---- a/cmake/FindCEC.cmake -+++ b/cmake/FindCEC.cmake -@@ -34,7 +34,9 @@ find_path(OSAL_INCLUDE_DIRS NAMES osal/Mutex.hpp PATH_SUFFIXES osal/include) - find_path(CEC_HOST_INCLUDE_DIRS NAMES ccec/host/RDK.hpp PATH_SUFFIXES host/include) - find_path(CEC_IARM_INCLUDE_DIRS NAMES ccec/drivers/iarmbus/CecIARMBusMgr.h PATH_SUFFIXES ccec/drivers/include) - -+if(NOT HALMOCK_PROJECT) - set(CEC_LIBRARIES "-Wl,--no-as-needed" ${CEC_LIBRARIES} ${CEC_IARM_LIBRARIES} ${OSAL_LIBRARIES} "-Wl,--as-needed") -+endif() - - set(CEC_LIBRARIES ${CEC_LIBRARIES} CACHE PATH "Path to CEC library") - -diff --git a/cmake/FindDS.cmake b/cmake/FindDS.cmake -index b858fffc..15ea879c 100644 ---- a/cmake/FindDS.cmake -+++ b/cmake/FindDS.cmake -@@ -33,7 +33,9 @@ find_path(DS_INCLUDE_DIRS NAMES manager.hpp PATH_SUFFIXES rdk/ds) - find_path(DSHAL_INCLUDE_DIRS NAMES dsTypes.h PATH_SUFFIXES rdk/ds-hal) - find_path(DSRPC_INCLUDE_DIRS NAMES dsMgr.h PATH_SUFFIXES rdk/ds-rpc) - -+if(NOT HALMOCK_PROJECT) - set(DS_LIBRARIES ${DS_LIBRARIES} ${DSHAL_LIBRARIES}) -+endif() - set(DS_LIBRARIES ${DS_LIBRARIES} CACHE PATH "Path to DS library") - set(DS_INCLUDE_DIRS ${DS_INCLUDE_DIRS} ${DSHAL_INCLUDE_DIRS} ${DSRPC_INCLUDE_DIRS}) - set(DS_INCLUDE_DIRS ${DS_INCLUDE_DIRS} CACHE PATH "Path to DS include") diff --git a/L2HalMock/patches/rdkservices/rdkservices_patch.patch b/L2HalMock/patches/rdkservices/rdkservices_patch.patch deleted file mode 100644 index 896d9dce..00000000 --- a/L2HalMock/patches/rdkservices/rdkservices_patch.patch +++ /dev/null @@ -1,276 +0,0 @@ -Signed-off-by: Kishore Darmaradje ---- -diff -Naur rdkservices_org/cmake/FindCEC.cmake rdkservices/cmake/FindCEC.cmake ---- rdkservices_org/cmake/FindCEC.cmake 2024-01-23 09:20:14.254329106 -0500 -+++ rdkservices/cmake/FindCEC.cmake 2024-01-23 09:38:36.752032679 -0500 -@@ -25,21 +25,31 @@ - - find_package(PkgConfig) - --find_library(CEC_LIBRARIES NAMES RCEC) --find_library(CEC_IARM_LIBRARIES NAMES RCECIARMBusHal) --find_library(OSAL_LIBRARIES NAMES RCECOSHal) -- --find_path(CEC_INCLUDE_DIRS NAMES ccec/Connection.hpp PATH_SUFFIXES ccec/include) --find_path(OSAL_INCLUDE_DIRS NAMES osal/Mutex.hpp PATH_SUFFIXES osal/include) --find_path(CEC_HOST_INCLUDE_DIRS NAMES ccec/host/RDK.hpp PATH_SUFFIXES host/include) --find_path(CEC_IARM_INCLUDE_DIRS NAMES ccec/drivers/iarmbus/CecIARMBusMgr.h PATH_SUFFIXES ccec/drivers/include) -- --set(CEC_LIBRARIES "-Wl,--no-as-needed" ${CEC_LIBRARIES} ${CEC_IARM_LIBRARIES} ${OSAL_LIBRARIES} "-Wl,--as-needed") -- --set(CEC_LIBRARIES ${CEC_LIBRARIES} CACHE PATH "Path to CEC library") -- --set(CEC_INCLUDE_DIRS ${CEC_INCLUDE_DIRS} ${OSAL_INCLUDE_DIRS} ${CEC_HOST_INCLUDE_DIRS} ${CEC_IARM_INCLUDE_DIRS}) --set(CEC_INCLUDE_DIRS ${CEC_INCLUDE_DIRS} CACHE PATH "Path to CEC include") -+#find_library(CEC_LIBRARIES NAMES RCEC) -+#find_library(CEC_IARM_LIBRARIES NAMES RCECIARMBusHal) -+#find_library(OSAL_LIBRARIES NAMES RCECOSHal) -+ -+#find_path(CEC_INCLUDE_DIRS NAMES ccec PATH_SUFFIXES ccec/include) -+#find_path(OSAL_INCLUDE_DIRS NAMES osal PATH_SUFFIXES osal/include) -+#find_path(CEC_HOST_INCLUDE_DIRS NAMES ccec/host PATH_SUFFIXES host/include) -+#find_path(CEC_IARM_INCLUDE_DIRS NAMES ccec/drivers/iarmbus PATH_SUFFIXES ccec/drivers/include) -+ -+#set(CEC_LIBRARIES "-Wl,--no-as-needed" ${CEC_LIBRARIES} ${CEC_IARM_LIBRARIES} ${OSAL_LIBRARIES} "-Wl,--as-needed") -+ -+#set(CEC_LIBRARIES ${CEC_LIBRARIES} CACHE PATH "Path to library") -+ -+#set(CEC_INCLUDE_DIRS ${CEC_INCLUDE_DIRS} ${OSAL_INCLUDE_DIRS} ${CEC_HOST_INCLUDE_DIRS} ${CEC_IARM_INCLUDE_DIRS}) -+#set(CEC_INCLUDE_DIRS ${CEC_INCLUDE_DIRS} CACHE PATH "Path to include directories") -+ -+set(CEC_INCLUDE_DIRS ${CMAKE_ROOT_DIR}/deps/rdk/hdmicec/ccec/include) -+set(OSAL_INCLUDE_DIRS ${CMAKE_ROOT_DIR}/deps/rdk/hdmicec/osal/include) -+set(CEC_HOST_INCLUDE_DIRS ${CMAKE_ROOT_DIR}/deps/rdk/hdmicec/host/include) -+set(CEC_IARM_INCLUDE_DIRS ${CMAKE_ROOT_DIR}/deps/rdk/hdmicec/ccec/drivers/include) -+message(STATUS "Anooj CEC_INCLUDE_DIRS: ${CEC_INCLUDE_DIRS}") -+set(CEC_DIRS ${CEC_INCLUDE_DIRS} ${OSAL_INCLUDE_DIRS} ${CEC_HOST_INCLUDE_DIRS} ${CEC_IARM_INCLUDE_DIRS}) -+message(STATUS "Anooj CEC_DIRS: ${CEC_DIRS}") -+set(CEC_INCLUDE_DIRS ${CEC_INCLUDE_DIRS} CACHE PATH "Path to include directories") -+set(CEC_LIBRARIES ${CMAKE_ROOT_DIR}/deps/rdk/hdmicec/install/lib) - - include(FindPackageHandleStandardArgs) - #FIND_PACKAGE_HANDLE_STANDARD_ARGS(IARMBUS DEFAULT_MSG IARMBUS_INCLUDE_DIRS IARMBUS_LIBRARIES) -diff -Naur rdkservices_org/cmake/FindDS.cmake rdkservices/cmake/FindDS.cmake ---- rdkservices_org/cmake/FindDS.cmake 2024-01-23 09:20:14.254329106 -0500 -+++ rdkservices/cmake/FindDS.cmake 2024-01-23 09:20:26.374459926 -0500 -@@ -25,18 +25,24 @@ - - find_package(PkgConfig) - --find_library(DS_LIBRARIES NAMES ds) --find_library(DSHAL_LIBRARIES NAMES dshalcli) --find_library(OEMHAL_LIBRARIES NAMES ds-hal) --find_library(IARMBUS_LIBRARIES NAMES IARMBus) --find_path(DS_INCLUDE_DIRS NAMES manager.hpp PATH_SUFFIXES ds/include) --find_path(DSHAL_INCLUDE_DIRS NAMES dsTypes.h PATH_SUFFIXES hal/include) --find_path(DSRPC_INCLUDE_DIRS NAMES dsMgr.h PATH_SUFFIXES rpc/include) -- --set(DS_LIBRARIES ${DS_LIBRARIES} ${DSHAL_LIBRARIES}) --set(DS_LIBRARIES ${DS_LIBRARIES} CACHE PATH "Path to DS library") --set(DS_INCLUDE_DIRS ${DS_INCLUDE_DIRS} ${DSHAL_INCLUDE_DIRS} ${DSRPC_INCLUDE_DIRS}) --set(DS_INCLUDE_DIRS ${DS_INCLUDE_DIRS} CACHE PATH "Path to DS include") -+#find_library(DS_LIBRARIES NAMES ds) -+#find_library(DSHAL_LIBRARIES NAMES dshalcli) -+#find_library(OEMHAL_LIBRARIES NAMES ds-hal) -+#find_library(IARMBUS_LIBRARIES NAMES IARMBus) -+#find_path(DS_INCLUDE_DIRS NAMES manager.hpp PATH_SUFFIXES ds/include) -+#find_path(DSHAL_INCLUDE_DIRS NAMES dsTypes.h PATHS hal/include/) -+#find_path(DSRPC_INCLUDE_DIRS NAMES dsMgr.h PATH_SUFFIXES rpc/include) -+ -+#set(DS_LIBRARIES ${DS_LIBRARIES} ${DSHAL_LIBRARIES}) -+#set(DS_LIBRARIES ${DS_LIBRARIES} CACHE PATH "Path to DS library") -+#set(DS_INCLUDE_DIRS ${DS_INCLUDE_DIRS} ${DSHAL_INCLUDE_DIRS} ${DSRPC_INCLUDE_DIRS}) -+set(DS_INCLUDE_DIRS ${CMAKE_ROOT_DIR}/deps/rdk/devicesettings/ds/include) -+set(DSHAL_INCLUDE_DIRS ${CMAKE_ROOT_DIR}/deps/rdk/devicesettings/hal/include) -+set(DSRPC_INCLUDE_DIRS ${CMAKE_ROOT_DIR}/deps/rdk/devicesettings/rpc/include) -+set(DS_DIRS ${DS_INCLUDE_DIRS} ${DSHAL_INCLUDE_DIRS} ${DSRPC_INCLUDE_DIRS}) -+set(DS_LIBRARIES ${CMAKE_ROOT_DIR}/deps/rdk/devicesettings/install/lib) -+#set(DS_INCLUDE_DIRS ${DSHAL_INCLUDE_DIRS}) -+#set(DS_INCLUDE_DIRS ${DS_INCLUDE_DIRS} CACHE PATH "Path to DS include") - - - -diff -Naur rdkservices_org/cmake/FindIARMBus.cmake rdkservices/cmake/FindIARMBus.cmake ---- rdkservices_org/cmake/FindIARMBus.cmake 2024-01-23 09:20:14.254329106 -0500 -+++ rdkservices/cmake/FindIARMBus.cmake 2024-01-23 09:20:26.374459926 -0500 -@@ -25,15 +25,12 @@ - - find_package(PkgConfig) - --find_library(IARMBUS_LIBRARIES NAMES IARMBus) --find_path(IARMBUS_INCLUDE_DIRS NAMES libIARM.h PATH_SUFFIXES core/include) --find_path(IARMIR_INCLUDE_DIRS NAMES irMgr.h PATH_SUFFIXES ir/include) --find_path(IARMRECEIVER_INCLUDE_DIRS NAMES receiverMgr.h PATH_SUFFIXES receiver/include) --find_path(IARMPWR_INCLUDE_DIRS NAMES pwrMgr.h PATH_SUFFIXES hal/include) -- --set(IARMBUS_LIBRARIES ${IARMBUS_LIBRARIES} CACHE PATH "Path to IARMBus library") --set(IARMBUS_INCLUDE_DIRS ${IARMBUS_INCLUDE_DIRS} ${IARMIR_INCLUDE_DIRS} ${IARMRECEIVER_INCLUDE_DIRS} ${IARMPWR_INCLUDE_DIRS}) --set(IARMBUS_INCLUDE_DIRS ${IARMBUS_INCLUDE_DIRS} ${IARMIR_INCLUDE_DIRS} ${IARMRECEIVER_INCLUDE_DIRS} ${IARMPWR_INCLUDE_DIRS} CACHE PATH "Path to IARMBus include") -+set(IARMBUS_INCLUDE_DIRS ${CMAKE_ROOT_DIR}/deps/rdk/iarmbus/core/include) -+set(IARMIR_INCLUDE_DIRS ${CMAKE_ROOT_DIR}/deps/rdk/iarmmgrs/ir/include) -+set(IARMRECEIVER_INCLUDE_DIRS ${CMAKE_ROOT_DIR}/deps/rdk/iarmmgrs/receiver/include) -+set(IARMPWR_INCLUDE_DIRS ${CMAKE_ROOT_DIR}/deps/rdk/iarmmgrs/hal/include) -+set(IARM_DIRS ${IARMBUS_INCLUDE_DIRS} ${IARMIR_INCLUDE_DIRS} ${IARMRECEIVER_INCLUDE_DIRS} ${IARMPWR_INCLUDE_DIRS}) -+set(IARM_LIBRARIES ${CMAKE_ROOT_DIR}/deps/rdk/iarmbus/install/) - - include(FindPackageHandleStandardArgs) - FIND_PACKAGE_HANDLE_STANDARD_ARGS(IARMBUS DEFAULT_MSG IARMBUS_INCLUDE_DIRS IARMBUS_LIBRARIES) -diff -Naur rdkservices_org/CMakeLists.txt rdkservices/CMakeLists.txt ---- rdkservices_org/CMakeLists.txt 2024-01-23 09:20:14.254329106 -0500 -+++ rdkservices/CMakeLists.txt 2024-01-23 09:20:26.378459949 -0500 -@@ -1,69 +1,70 @@ --### --# If not stated otherwise in this file or this component's LICENSE --# file the following copyright and licenses apply: --# --# Copyright 2023 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. --### -- --cmake_minimum_required(VERSION 3.3) -- --find_package(WPEFramework) -- --# All packages that did not deliver a CMake Find script (and some deprecated scripts that need to be removed) --# are located in the cmake directory. Include it in the search. --list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/") -- --option(COMCAST_CONFIG "Comcast services configuration" ON) --if(COMCAST_CONFIG) -- include(services.cmake) --endif() -- --option(PLUGIN_OCICONTAINER "Include OCIContainer plugin" OFF) --option(PLUGIN_RUSTBRIDGE "Include RustBridge plugin" OFF) -- --if(RDK_SERVICES_TEST) -- include(tests.cmake) --endif() -- --# Library installation section --string(TOLOWER ${NAMESPACE} STORAGE_DIRECTORY) -- --# for writing pc and config files --include(CmakeHelperFunctions) -- --if(PLUGIN_HDMICECSOURCE) -- add_subdirectory(HdmiCecSource) --endif() -- --if(WPEFRAMEWORK_CREATE_IPKG_TARGETS) -- set(CPACK_GENERATOR "DEB") -- set(CPACK_DEB_COMPONENT_INSTALL ON) -- set(CPACK_COMPONENTS_GROUPING IGNORE) -- -- set(CPACK_DEBIAN_PACKAGE_NAME "${WPEFRAMEWORK_PLUGINS_OPKG_NAME}") -- set(CPACK_DEBIAN_PACKAGE_VERSION "${WPEFRAMEWORK_PLUGINS_OPKG_VERSION}") -- set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "${WPEFRAMEWORK_PLUGINS_OPKG_ARCHITECTURE}") -- set(CPACK_DEBIAN_PACKAGE_MAINTAINER "${WPEFRAMEWORK_PLUGINS_OPKG_MAINTAINER}") -- set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "${WPEFRAMEWORK_PLUGINS_OPKG_DESCRIPTION}") -- set(CPACK_PACKAGE_FILE_NAME "${WPEFRAMEWORK_PLUGINS_OPKG_FILE_NAME}") -- -- # list of components from which packages will be generated -- set(CPACK_COMPONENTS_ALL -- ${NAMESPACE}WebKitBrowser -- WPEInjectedBundle -- ) -- -- include(CPack) --endif() -+### -+# If not stated otherwise in this file or this component's LICENSE -+# file the following copyright and licenses apply: -+# -+# Copyright 2023 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. -+### -+ -+cmake_minimum_required(VERSION 3.3) -+project(halmock) -+find_package(WPEFramework PATHS ${WORKSPACE}/install/usr/lib/cmake/WPEFramework) -+set(CMAKE_ROOT_DIR "${WORKSPACE}") -+set(URL_INCLUDE_DIR "${WORKSPACE}/Thunder/Source/websocket") -+# All packages that did not deliver a CMake Find script (and some deprecated scripts that need to be removed) -+# are located in the cmake directory. Include it in the search. -+list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/") -+ -+option(COMCAST_CONFIG "Comcast services configuration" ON) -+if(COMCAST_CONFIG) -+ include(services.cmake) -+endif() -+ -+option(PLUGIN_OCICONTAINER "Include OCIContainer plugin" OFF) -+option(PLUGIN_RUSTBRIDGE "Include RustBridge plugin" OFF) -+ -+if(RDK_SERVICES_TEST) -+ include(tests.cmake) -+endif() -+ -+# Library installation section -+string(TOLOWER ${NAMESPACE} STORAGE_DIRECTORY) -+ -+# for writing pc and config files -+include(${WORKSPACE}/install/usr/lib/cmake/WPEFramework/common/CmakeHelperFunctions.cmake) -+ -+if(PLUGIN_HDMICECSOURCE) -+ add_subdirectory(HdmiCecSource) -+endif() -+ -+if(WPEFRAMEWORK_CREATE_IPKG_TARGETS) -+ set(CPACK_GENERATOR "DEB") -+ set(CPACK_DEB_COMPONENT_INSTALL ON) -+ set(CPACK_COMPONENTS_GROUPING IGNORE) -+ -+ set(CPACK_DEBIAN_PACKAGE_NAME "${WPEFRAMEWORK_PLUGINS_OPKG_NAME}") -+ set(CPACK_DEBIAN_PACKAGE_VERSION "${WPEFRAMEWORK_PLUGINS_OPKG_VERSION}") -+ set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "${WPEFRAMEWORK_PLUGINS_OPKG_ARCHITECTURE}") -+ set(CPACK_DEBIAN_PACKAGE_MAINTAINER "${WPEFRAMEWORK_PLUGINS_OPKG_MAINTAINER}") -+ set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "${WPEFRAMEWORK_PLUGINS_OPKG_DESCRIPTION}") -+ set(CPACK_PACKAGE_FILE_NAME "${WPEFRAMEWORK_PLUGINS_OPKG_FILE_NAME}") -+ -+ # list of components from which packages will be generated -+ set(CPACK_COMPONENTS_ALL -+ ${NAMESPACE}WebKitBrowser -+ WPEInjectedBundle -+ ) -+ -+ include(CPack) -+endif() -diff -Naur rdkservices_org/HdmiCecSource/CMakeLists.txt rdkservices/HdmiCecSource/CMakeLists.txt ---- rdkservices_org/HdmiCecSource/CMakeLists.txt 2024-01-23 09:20:14.194328162 -0500 -+++ rdkservices/HdmiCecSource/CMakeLists.txt 2024-01-23 09:40:13.224387067 -0500 -@@ -34,9 +34,9 @@ - find_package(IARMBus) - find_package(CEC) - --target_include_directories(${MODULE_NAME} PRIVATE ${IARMBUS_INCLUDE_DIRS} ../helpers) --target_include_directories(${MODULE_NAME} PRIVATE ${CEC_INCLUDE_DIRS}) --target_include_directories(${MODULE_NAME} PRIVATE ${DS_INCLUDE_DIRS}) -+target_include_directories(${MODULE_NAME} PRIVATE ${IARM_DIRS} ../helpers) -+target_include_directories(${MODULE_NAME} PRIVATE ${CEC_DIRS}) -+target_include_directories(${MODULE_NAME} PRIVATE ${DS_DIRS}) - - target_link_libraries(${MODULE_NAME} PUBLIC ${NAMESPACE}Plugins::${NAMESPACE}Plugins ${IARMBUS_LIBRARIES} ${CEC_LIBRARIES} ${DS_LIBRARIES} ) - diff --git a/L2HalMock/patches/rdkservices/rfcapi.h b/L2HalMock/patches/rdkservices/rfcapi.h deleted file mode 100644 index d92f6d15..00000000 --- a/L2HalMock/patches/rdkservices/rfcapi.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - * If not stated otherwise in this file or this component's Licenses.txt file the - * following copyright and licenses apply: - * - * Copyright 2016 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. -*/ - -#ifndef RFCAPI_H_ -#define RFCAPI_H_ - -#include -#include - -#define RFCVAR_FILE "/opt/secure/RFC/rfcVariable.ini" -#define TR181STORE_FILE "/opt/secure/RFC/tr181store.ini" - -#ifdef __cplusplus -extern "C" -{ -#endif -#ifndef RDKC -#include -#endif - -#define MAX_PARAM_LEN (2*1024) - -#ifdef RDKC -typedef enum -{ - SUCCESS=0, - FAILURE, - NONE, - EMPTY -}DATATYPE; -#endif - -#ifdef RDKC -typedef struct _RFC_Param_t { - char name[MAX_PARAM_LEN]; - char value[MAX_PARAM_LEN]; - DATATYPE type; -} RFC_ParamData_t; -#else -typedef struct _RFC_Param_t { - char name[MAX_PARAM_LEN]; - char value[MAX_PARAM_LEN]; - DATA_TYPE type; -} RFC_ParamData_t; -#endif -#ifdef RDKC -int getRFCParameter(const char* pcParameterName, RFC_ParamData_t *pstParamData); -#else -WDMP_STATUS getRFCParameter(const char *pcCallerID, const char* pcParameterName, RFC_ParamData_t *pstParamData); -WDMP_STATUS setRFCParameter(const char *pcCallerID, const char* pcParameterName, const char* pcParameterValue, DATA_TYPE eDataType); -const char* getRFCErrorString(WDMP_STATUS code); -bool isRFCEnabled(const char *); -bool isFileInDirectory(const char *, const char *); -#endif -#ifdef __cplusplus -} -#endif - -#endif diff --git a/L2HalMock/patches/thunder/JSON_Value.patch b/L2HalMock/patches/thunder/JSON_Value.patch deleted file mode 100644 index 35d3e7de..00000000 --- a/L2HalMock/patches/thunder/JSON_Value.patch +++ /dev/null @@ -1,16 +0,0 @@ -Signed-off-by: Kishore Darmaradje ---- -diff --git a/Source/core/JSONRPC.h b/Source/core/JSONRPC.h -index 7b48a579..015c18b8 100644 ---- a/Source/core/JSONRPC.h -+++ b/Source/core/JSONRPC.h -@@ -149,7 +149,8 @@ namespace Core { - Text = _T("Requested service is not available."); - break; - default: -- Code = ApplicationErrorCodeBase - static_cast(frameworkError); -+ // Code = ApplicationErrorCodeBase - static_cast(frameworkError); -+ Code = frameworkError; - Text = Core::ErrorToString(frameworkError); - break; - } diff --git a/L2HalMock/temp.txt b/L2HalMock/temp.txt deleted file mode 100644 index 8b137891..00000000 --- a/L2HalMock/temp.txt +++ /dev/null @@ -1 +0,0 @@ - diff --git a/L2HalMock/workflowConfig.env b/L2HalMock/workflowConfig.env deleted file mode 100644 index 8b137891..00000000 --- a/L2HalMock/workflowConfig.env +++ /dev/null @@ -1 +0,0 @@ - diff --git a/L2HalMock/workspace/deps/rdk/flask/Test_Framework/Config.py b/L2HalMock/workspace/deps/rdk/flask/Test_Framework/Config.py deleted file mode 100644 index 8c17e131..00000000 --- a/L2HalMock/workspace/deps/rdk/flask/Test_Framework/Config.py +++ /dev/null @@ -1,259 +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. -# * -#* ****************************************************************************** - -# This config file contains all the configurable parameters required for Test Framework -import os -# IP & port details of Flask server -flask_server_ip = "127.0.0.1:8000" - -# Define the paths of Websocket server & WPEFramework -# Define the paths of Websocket server & WPEFramework -WPEFramework_restart = os.getcwd() -os.chdir("../Flask") - -directory_websocket = os.getcwd() -os.chdir("../../../../install/etc/WPEFramework") - -directory_thunder = os.getcwd() -os.chdir(WPEFramework_restart) - -# Define the path where WPEFramework logs needs to be stored -file_name = 'log_file.txt' -WPEFramework_logs_path = os.path.abspath(file_name) - -# Data required for setDeviceConfig api -config_data = { - "apiName": "setDeviceConfig", - "arguments": { - "devices": [ - { - "device": [ - {"name": "xione_uk"}, - {"islocal": 1}, - {"type": "source"}, - {"powerState": 0}, - {"physicalAddress": "301"}, - {"logicalAddress": "3"}, - {"vendorId": "4567"}, - {"osdName": "404753747265616D696E672054776F"}, - {"optionalProperty1": "value1"}, - {"optionalProperty2": "value2"} - ] - }, - { - "device": [ - {"name": "amazon fire stick"}, - {"islocal": 0}, - {"type": "source"}, - {"powerState": 0}, - {"physicalAddress": "304"}, - {"logicalAddress": "4"}, - {"vendorId": "4567"}, - {"osdName": "53747265616D696E67204F6E65"}, - {"optionalProperty1": "value1"}, - {"optionalProperty2": "value2"} - ] - }, - { - "device": [ - {"name": "amazon fire stick"}, - {"islocal": 0}, - {"type": "source"}, - {"powerState": 0}, - {"physicalAddress": "304"}, - {"logicalAddress": "9"}, - {"vendorId": "4567"}, - {"osdName": "53747265616D696E67204F6E65"}, - {"optionalProperty1": "value1"}, - {"optionalProperty2": "value2"} - ] - } - ] - } - } - -# Data required for setAPIConfig api -api_data = { - "apiName": "setAPIConfig", - "arguments": { - "apiOverrides": [ - { - "HdmiCecOpen": [ - { "return": 0 }, - { "outParams": [{"handle": 2345678}] } - ] - }, - { - "HdmiCecGetLogicalAddress": [ - { "return": 0 }, - { "outParams": [{"logicalAddress": "0x3"}] } - ] - }, - { - "HdmiCecGetPhysicalAddress": [ - { "return": 0 }, - { "outParams": [{"physicalAddress": "0x304"}] } - ] - } - ] - } - } - -# Device data for HiSense TV -hisense_device_data = { - "device": [ - {"name": "hisense"}, - {"islocal": 0}, - {"type": "sink"}, - {"powerState": 0}, - {"physicalAddress": "0"}, - {"logicalAddress": "6"}, - {"vendorId": "0x4567"}, - {"osdName": "545620426F78"}, - {"optionalProperty1": "value1"}, - {"optionalProperty2": "value2"} - ] - } - -# Invalid device data for Xione US -invalid_device_data = { - "device": [ - {"name": "xione_us"}, - {"islocal": 0}, - {"type": "sink"}, - {"powerState": 0}, - {"physicalAddress": "333"}, - {"logicalAddress": "77"}, - {"vendorId": "4444"}, - {"osdName": "3333"}, - {"optionalProperty1": "value1"}, - {"optionalProperty2": "value2"} - ] - } - -# Send message data for sendStandbyMessage -sendStandbyMessage = { - "apiName": "sendMessage", - "arguments": { - "remoteDevices": [ - { - "device": { - "name": "hisense", - "messages": [ - { - "message1": { - "buf": [ - "0x03", - "0x36" - ], - "len": 2, - "repeat": 2, - "delay": 1 - } - } - ] - } - } - ] - } - } - -# message send to know the current power status of device -getPowerStatusMessage = { - "apiName": "sendMessage", - "arguments": { - "remoteDevices": [ - { - "device": { - "name": "hisense", - "messages": [ - { - "message1": { - "buf": [ - "0x03", - "0x8F" - ], - "len": 2, - "repeat": 2, - "delay": 1 - } - } - ] - } - } - ] - } - } - -# message for perform OTP Action -performOTPActionMessage = { - "apiName": "sendMessage", - "arguments": { - "remoteDevices": [ - { - "device": { - "name": "hisense", - "messages": [ - { - "message1": { - "buf": [ - "0x03", - "0x04" - ], - "len": 2, - "repeat": 2, - "delay": 1 - } - } - ] - } - } - ] - } - } - -# api overrides data in which return value for HdmiCecOpen is set to -1 -cec_minus_one = { - "apiName": "setAPIConfig", - "arguments": { - "apiOverrides": [ - { - "HdmiCecOpen": [ - {"return": -1}, - {"outParams": [{"handle": 2345678}]} - ] - }, - { - "HdmiCecGetLogicalAddress": [ - {"return": 0}, - {"outParams": [{"logicalAddress": "0x3"}]} - ] - }, - { - "HdmiCecGetPhysicalAddress": [ - {"return": 0}, - {"outParams": [{"physicalAddress": "0x304"}]} - ] - } - ] - } - } diff --git a/L2HalMock/workspace/deps/rdk/flask/Test_Framework/HdmiCecSource/Testcases/TCID004.py b/L2HalMock/workspace/deps/rdk/flask/Test_Framework/HdmiCecSource/Testcases/TCID004.py deleted file mode 100644 index a1f91b10..00000000 --- a/L2HalMock/workspace/deps/rdk/flask/Test_Framework/HdmiCecSource/Testcases/TCID004.py +++ /dev/null @@ -1,117 +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. -# * -#* ****************************************************************************** - -# Testcase ID : TCID004 -# Testcase Description : To verify that standby message is successfully triggered -# and got proper logs in thunder. Hit the curl command for sendStandbyMessage and send the corresponding -# messages to hal. Verify the output response. Also, wake up the devices by sending cec message as post condition - -import json -import requests -import time -import Config -import subprocess -from Utilities import Utils, ReportGenerator -from HdmiCecSource import HdmiCecSourceApis - -op=subprocess.run(['netstat', '-ntlp'],capture_output=True,text=True) -print(op.stdout) -# store the expected output response -expected_output_response = '{"jsonrpc":"2.0","id":42,"result":{"success":true}}' - -print("TC Description - To verify that standby message is successfully triggered and get proper logs in thunder. Hit the curl command for sendStandbyMessage and send the corresponding messages to hal. Verify the output response. Also, wake up the devices by sending cec message as post condition") -#send messages required for getting power status of device -print("---------------------------------------------------------------------------------------------------------------------------") -message1_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format( - Config.flask_server_ip, json.dumps(Config.getPowerStatusMessage))) -if "200" in str(message1_response): - Utils.info_log("sendMessage emulation success for querying the powerstatus of local device") -else: - Utils.error_log("sendMessage emulation failed for querying the powerstatus of local device") -time.sleep(3) -print("") - -# send the curl command and fetch the output json response -curl_response = Utils.send_curl_command(HdmiCecSourceApis.send_standby_message) -if curl_response: - Utils.warning_log("send_standby_message curl command sent from the test runner") -else: - Utils.error_log("send_standby_message curl command failed") -# send messages required for sendStandbyMessage method -message2_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format( - Config.flask_server_ip, json.dumps(Config.sendStandbyMessage))) -if "200" in str(message2_response): - Utils.info_log("sendMessage emulation success for sending the remote device state as standby to local device") -else: - Utils.error_log("sendMessage emulation failed for sending the remote device state as standby to local device") -time.sleep(3) -print("") - -# send messages required for getting power status of device -message3_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format( - Config.flask_server_ip, json.dumps(Config.getPowerStatusMessage))) -time.sleep(3) -if "200" in str(message3_response): - Utils.info_log("sendMessage emulation success for querying the powerstatus of local device") -else: - Utils.error_log("sendMessage emulation failed for querying the powerstatus of local device") - -print("---------------------------------------------------------------------------------------------------------------------------") - -# compare both expected and received output responses -if str(curl_response) == str(expected_output_response): - status = 'Pass' - message = 'Output response is matching with expected one. We are expecting opcode : 36 in thunder logs' -else: - status = 'Fail' - message = 'Output response is different from expected one' - -# generate logs in terminal -tc_id = 'TCID004' -print("Testcase ID : " + tc_id) -print("Testcase Output Response : " + curl_response) -print("Testcase Status : " + status) -print("Testcase Message : " + message) -print("") - -if status == 'Pass': - ReportGenerator.passed_tc_list.append(tc_id) -else: - ReportGenerator.failed_tc_list.append(tc_id) - -# push the testcase execution details to report file -ReportGenerator.append_test_results_to_csv(tc_id, curl_response, status, message) - -# wake up the device from standby as post condition by sending message -message4_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format( - Config.flask_server_ip, json.dumps(Config.performOTPActionMessage))) -Utils.warning_log("Reset the device state to ON from standby") -time.sleep(3) - -# send messages required for getting power status of device -message5_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format( - Config.flask_server_ip, json.dumps(Config.getPowerStatusMessage))) -time.sleep(3) -Utils.info_log("send the emulated message to get the power status of local device") -op=subprocess.run(['netstat', '-ntlp'],capture_output=True,text=True) -print(op.stdout) - diff --git a/Tests/L2HALMockTests/TestCases/HDCPProfile/HDCPProfileApis.py b/Tests/L2HALMockTests/TestCases/HDCPProfile/HDCPProfileApis.py new file mode 100644 index 00000000..bdb24234 --- /dev/null +++ b/Tests/L2HALMockTests/TestCases/HDCPProfile/HDCPProfileApis.py @@ -0,0 +1,39 @@ +#** ***************************************************************************** +# * +# * 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. +# * +#* ****************************************************************************** + +activate_command = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc":"2.0","id":"3" +,"method": "Controller.1.activate", "params":{"callsign":"org.rdk.HdcpProfile"}}' http://127.0.0.1:55555/jsonrpc''' + +# Curl command for deactivating HDCPProfile plugin +deactivate_command = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc":"2.0","id":"3" +,"method": "Controller.1.deactivate", "params":{"callsign":"org.rdk.HdcpProfile"}}' http://127.0.0.1:55555/jsonrpc''' + +# Store the expected output response for activate & deactivate curl command +expected_output_response = '{"jsonrpc":"2.0","id":3,"result":null}' + +###################################################################################### + +# HDCPProfile Methods : + +get_hdcpstatus = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0","id": 42,"method": "org.rdk.HdcpProfile.getHDCPStatus"}' http://127.0.0.1:55555/jsonrpc''' + +get_settophdcpsupport = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0","id": 42,"method": "org.rdk.HdcpProfile.getSettopHDCPSupport"}' http://127.0.0.1:55555/jsonrpc''' \ No newline at end of file diff --git a/Tests/L2HALMockTests/TestCases/HDCPProfile/HdcpUtils.py b/Tests/L2HALMockTests/TestCases/HDCPProfile/HdcpUtils.py new file mode 100644 index 00000000..670392b5 --- /dev/null +++ b/Tests/L2HALMockTests/TestCases/HDCPProfile/HdcpUtils.py @@ -0,0 +1,21 @@ +#** ***************************************************************************** +# * +# * 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. +# * +#* ****************************************************************************** diff --git a/Tests/L2HALMockTests/TestCases/HDCPProfile/TCID_001_HDCPProfile_getHDCPStatus.py b/Tests/L2HALMockTests/TestCases/HDCPProfile/TCID_001_HDCPProfile_getHDCPStatus.py new file mode 100644 index 00000000..f2230bf5 --- /dev/null +++ b/Tests/L2HALMockTests/TestCases/HDCPProfile/TCID_001_HDCPProfile_getHDCPStatus.py @@ -0,0 +1,72 @@ +#** ***************************************************************************** +# * +# * 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. +# * +#* ****************************************************************************** + +# Testcase ID : TCID001_DS_HDCPProfile_getHdcpStatus +# Testcase Description :Returns HDCP-related data. +# hdcpReason Argument Values +# +# 0: HDMI cable is not connected or rx sense status is off +# 1: Rx device is connected with power ON state, and HDCP authentication is not initiated +# 2: HDCP success +# 3: HDCP authentication failed after multiple retries +# 4: HDCP authentication in progress +# 5: HDMI video port is disabled. + +from Utilities import Utils, ReportGenerator +from HDCPProfile import HDCPProfileApis + +print("TC Description - Returns HDCP-related data hdcpReason Argument Values--- 0: HDMI cable is not connected or rx sense status is off, 1: Rx device is connected with power ON state, and HDCP authentication is not initiated, 2: HDCP success, 3: HDCP authentication failed after multiple retries, 4: HDCP authentication in progress , 5: HDMI video port is disabled.") +print("---------------------------------------------------------------------------------------------------------------------------") +# store the expected output response +expected_output_response = '{"jsonrpc":"2.0","id":42,"result":{"HDCPStatus":{"isConnected":false,"isHDCPCompliant":false,"isHDCPEnabled":true,"hdcpReason":0,"supportedHDCPVersion":"1.4","receiverHDCPVersion":"1.4","currentHDCPVersion":"1.4"},"success":true}}' + +# send the curl command and fetch the output json response +curl_response = Utils.send_curl_command(HDCPProfileApis.get_hdcpstatus) +if curl_response: + Utils.info_log("curl command to get hdcp status is sent from the test runner") +else: + Utils.error_log("curl command invoke failed for {}" .format(HDCPProfileApis.get_hdcpstatus)) + +print("---------------------------------------------------------------------------------------------------------------------------") +# compare both expected and received output responses +if str(curl_response) == str(expected_output_response): + status = 'Pass' + message = 'Output response is matching with expected one. The HDCP Status ' \ + 'is obtained in output response' +else: + status = 'Fail' + message = 'Output response is different from expected one' + +# generate logs in terminal +tc_id = 'TCID001_DS_HDCPProfile_getHdcpStatus' +print("Testcase ID : " + tc_id) +print("Testcase Output Response : " + curl_response) +print("Testcase Status : " + status) +print("Testcase Message : " + message) +print("") + +if status == 'Pass': + ReportGenerator.passed_tc_list.append(tc_id) +else: + ReportGenerator.failed_tc_list.append(tc_id) +# push the testcase execution details to report file +ReportGenerator.append_test_results_to_csv(tc_id, curl_response, status, message) diff --git a/Tests/L2HALMockTests/TestCases/HDCPProfile/TCID_002_HDCPProfile_getSettopHDCPSupport.py b/Tests/L2HALMockTests/TestCases/HDCPProfile/TCID_002_HDCPProfile_getSettopHDCPSupport.py new file mode 100644 index 00000000..a4b2aec1 --- /dev/null +++ b/Tests/L2HALMockTests/TestCases/HDCPProfile/TCID_002_HDCPProfile_getSettopHDCPSupport.py @@ -0,0 +1,66 @@ +#** ***************************************************************************** +# * +# * 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. +# * +#* ****************************************************************************** + +# Testcase ID : TCID002_DS_HDCPProfile_getSettopHDCP +# Testcase Description :Returns which version of HDCP is supported by the STB. +# + + +from Utilities import Utils, ReportGenerator +from HDCPProfile import HDCPProfileApis + +print("TC Description - Returns which version of HDCP is supported by the STB..") +print("---------------------------------------------------------------------------------------------------------------------------") +# store the expected output response +expected_output_response = '{"jsonrpc":"2.0","id":42,"result":{"supportedHDCPVersion":"1.4","isHDCPSupported":true,"success":true}}' + +# send the curl command and fetch the output json response +curl_response = Utils.send_curl_command(HDCPProfileApis.get_settophdcpsupport) +if curl_response: + Utils.info_log("curl command to get hdcp support version status is sent from the test runner") +else: + Utils.error_log("curl command invoke failed for {}" .format(HDCPProfileApis.get_settophdcpsupport)) + +print("---------------------------------------------------------------------------------------------------------------------------") +# compare both expected and received output responses +if str(curl_response) == str(expected_output_response): + status = 'Pass' + message = 'Output response is matching with expected one. The HDCP Support version ' \ + 'is obtained in output response' +else: + status = 'Fail' + message = 'Output response is different from expected one' + +# generate logs in terminal +tc_id = 'TCID002_DS_HDCPProfile_getSettopHdcpSupport' +print("Testcase ID : " + tc_id) +print("Testcase Output Response : " + curl_response) +print("Testcase Status : " + status) +print("Testcase Message : " + message) +print("") + +if status == 'Pass': + ReportGenerator.passed_tc_list.append(tc_id) +else: + ReportGenerator.failed_tc_list.append(tc_id) +# push the testcase execution details to report file +ReportGenerator.append_test_results_to_csv(tc_id, curl_response, status, message) diff --git a/Tests/L2HALMockTests/TestCases/HDCPProfile/TCID_003_HDCPProfile_ActivateDeactivateSimulation.py b/Tests/L2HALMockTests/TestCases/HDCPProfile/TCID_003_HDCPProfile_ActivateDeactivateSimulation.py new file mode 100644 index 00000000..d94a83b9 --- /dev/null +++ b/Tests/L2HALMockTests/TestCases/HDCPProfile/TCID_003_HDCPProfile_ActivateDeactivateSimulation.py @@ -0,0 +1,75 @@ +#** ***************************************************************************** +# * +# * 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. +# * +#* ****************************************************************************** + +# Testcase ID : TCID003__HDCPProfile_ActivateDeactivateSimulation +# Testcase Description :Simulate activation and deactivation functions in HDCPProfile +# + + +from Utilities import Utils, ReportGenerator +from HDCPProfile import HDCPProfileApis +import time + +print("TC Description - Simulate activation and deactivation functions in HDCPProfile") +print("---------------------------------------------------------------------------------------------------------------------------") +# store the expected output response +expected_output_response = '{"jsonrpc":"2.0","id":42,"result":{"supportedHDCPVersion":"1.4","isHDCPSupported":true,"success":true}}' + +time.sleep(5) +# send the curl command and fetch the output json response +curl_response = Utils.send_curl_command(HDCPProfileApis.activate_command) +time.sleep(8) +curl_response = Utils.send_curl_command(HDCPProfileApis.deactivate_command) + +if curl_response: + Utils.info_log("curl command to deactivate plugin is sent from the test runner") +else: + Utils.error_log("curl command invoke failed for {}" .format(HDCPProfileApis.deactivate_command)) + +print("---------------------------------------------------------------------------------------------------------------------------") +# compare both expected and received output responses +if curl_response: + status = 'Pass' + message = 'Output response is matching with expected one. The deactivate RPC response ' \ + 'is obtained in output response' +else: + status = 'Fail' + message = 'Output response is different from expected one' + +# generate logs in terminal +tc_id = 'TCID003__HDCPProfile_ActivateDeactivateSimulation' +print("Testcase ID : " + tc_id) +print("Testcase Output Response : " + curl_response) +print("Testcase Status : " + status) +print("Testcase Message : " + message) +print("") + +time.sleep(2) +print("Post Condition - Activate HDCPProfile") +curl_response = Utils.send_curl_command(HDCPProfileApis.activate_command) + +if status == 'Pass': + ReportGenerator.passed_tc_list.append(tc_id) +else: + ReportGenerator.failed_tc_list.append(tc_id) +# push the testcase execution details to report file +ReportGenerator.append_test_results_to_csv(tc_id, curl_response, status, message) diff --git a/Tests/L2HALMockTests/TestCases/HDCPProfile/TCID_004_HDCPProfile_Events.py b/Tests/L2HALMockTests/TestCases/HDCPProfile/TCID_004_HDCPProfile_Events.py new file mode 100644 index 00000000..6b69a54e --- /dev/null +++ b/Tests/L2HALMockTests/TestCases/HDCPProfile/TCID_004_HDCPProfile_Events.py @@ -0,0 +1,85 @@ +#** ***************************************************************************** +# * +# * 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. +# * +#* ****************************************************************************** + +# Testcase ID : TCID004 +# Testcase Description : To verify the emulation of sending of events + +import subprocess +import Config +from Utilities import Utils, ReportGenerator +from HdmiCecSource import HdmiCecSourceApis +from HDCPProfile import HDCPProfileApis +import time + + +# store the expected output response +expected_output_response = '{"jsonrpc":"2.0","id":3,"result":null}' + +print("TC Description - To verify the emulation of sending of events.") +time.sleep(3) +# send the curl command and fetch the output json response +curl_response = Utils.send_curl_command(HDCPProfileApis.activate_command) +time.sleep(1) +if curl_response: + Utils.warning_log("activate curl command sent from the test runner") +else: + Utils.error_log("activate curl command failed") + +#Define the script to be executed +execute_script = '../../../../../sendEvents.sh' + + +#Execute the script +try: + result = subprocess.run(['/bin/bash', execute_script], check=True, capture_output=True, text=True) + print("sendEvents.sh executed successfully.") + print("Output:\n", result.stdout) + +except subprocess.CalledProcessError as e: + print("Error occured while executing the shell script.") + print("Error message:\n", e.stderr) + +print("---------------------------------------------------------------------------------------------------------------------------") + +# compare both expected and received output responses +if str(curl_response) == str(expected_output_response): + status = 'Pass' + message = 'Output response is matching with expected one.' +else: + status = 'Fail' + message = 'Output response is different from expected one.' + +# generate logs in terminal +tc_id = 'TCID004_sending events' +print("Testcase ID : " + tc_id) +print("Testcase Output Response : " + curl_response) +print("Testcase Status : " + status) +print("Testcase Message : " + message) +print("") + +if status == 'Pass': + ReportGenerator.passed_tc_list.append(tc_id) +else: + ReportGenerator.failed_tc_list.append(tc_id) + +# push the testcase execution details to report file +ReportGenerator.append_test_results_to_csv(tc_id, curl_response, status, message) diff --git a/Tests/L2HALMockTests/Test_Framework/Test Execution Reports/TestReport_23Q4-HAL-MOCK-TEST_05-02-2024_16h10m12s.html b/Tests/L2HALMockTests/Test_Framework/Test Execution Reports/TestReport_23Q4-HAL-MOCK-TEST_05-02-2024_16h10m12s.html deleted file mode 100644 index 725cb331..00000000 --- a/Tests/L2HALMockTests/Test_Framework/Test Execution Reports/TestReport_23Q4-HAL-MOCK-TEST_05-02-2024_16h10m12s.html +++ /dev/null @@ -1,63 +0,0 @@ -

- Build Name: 23Q4-HAL-MOCK-TEST -

-

- Date of Execution: 05/02/2024 -

-

- Time of Execution: 16:10:12 -

-

- Number of Testcases Passed: 2 -

-

- Number of Testcases Failed: 0 -

- - - - - - - - - - - - - - - - - - - - - - - -
- TC ID - - Output Response - - TC Status - - TC Message -
- TCID004 - - {"jsonrpc":"2.0","id":42,"result":{"success":true}} - - Pass - - Output response is matching with expected one. We are expecting opcode : 36 in thunder logs -
- TCID016 - - {"jsonrpc":"2.0","id":42,"result":{"enabled":false,"success":true}} - - Pass - - Output response is matching with expected one. The cec enable status is true initially and after changing the return value, cec enable status changed to false -
\ No newline at end of file