From 414b13084060d0f0b6246be111d45fbd337e6214 Mon Sep 17 00:00:00 2001 From: Gene Gallagher <129112619+egalla204@users.noreply.github.com> Date: Thu, 9 Apr 2026 15:07:48 -0400 Subject: [PATCH 01/72] Release/1.1.12 (#200) https://ccp.sys.comcast.net/browse/RDKEMW-16915 --- CHANGELOG.md | 26 +++++++++- CMakeLists.txt | 2 - include/ctrlm_ipc_voice.h | 2 +- src/auth/ctrlm_auth.h | 1 - src/auth/ctrlm_auth_thunder.cpp | 5 -- src/auth/ctrlm_auth_thunder.h | 1 - src/auth/ctrlm_thunder_plugin_authservice.cpp | 18 ------- src/auth/ctrlm_thunder_plugin_authservice.h | 7 --- src/ctrlm.h | 1 - src/ctrlm_controller.cpp | 4 -- src/ctrlm_controller.h | 1 - src/ctrlm_main.cpp | 46 ------------------ src/ctrlm_network.cpp | 10 ---- src/ctrlm_network.h | 3 -- src/thunder/ctrlm_thunder_plugin.cpp | 47 +++++++++++++++++++ src/thunder/ctrlm_thunder_plugin.h | 29 +++++++++--- .../ctrlm_thunder_plugin_powermanager.cpp | 21 +++++---- src/voice/ctrlm_voice_obj.cpp | 18 ------- src/voice/ctrlm_voice_obj.h | 3 -- src/voice/endpoints/ctrlm_voice_endpoint.cpp | 1 - src/voice/endpoints/ctrlm_voice_endpoint.h | 1 - .../endpoints/ctrlm_voice_endpoint_http.cpp | 8 ---- .../endpoints/ctrlm_voice_endpoint_http.h | 1 - .../ctrlm_voice_endpoint_ws_nextgen.cpp | 8 ---- .../ctrlm_voice_endpoint_ws_nextgen.h | 1 - 25 files changed, 107 insertions(+), 158 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 52e8cb2d..8121aa80 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,9 +4,32 @@ All notable changes to this project will be documented in this file. Dates are d Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). + + +#### [1.1.12](https://github.com/rdkcentral/control/compare/1.1.11...1.1.12) + +> 9 April 2026 + +- RDKEMW-16333: Update Thunder plugin to use _string and _boolean [`#197`](https://github.com/rdkcentral/control/pull/197) +- RDKEMW-5849 : remove deprecated "experience" code [`#185`](https://github.com/rdkcentral/control/pull/185) + +#### [1.1.11.2](https://github.com/rdkcentral/control/compare/1.1.11.1...1.1.11.2) + +> 7 April 2026 + +- RDKEMW-16711: CHANGELOG for ctrlm hotfix release 1.1.11.2 [`#196`](https://github.com/rdkcentral/control/pull/196) +- RDKEMW-16711 : Add wakeup reason string, on support/1.1.11 [`#195`](https://github.com/rdkcentral/control/pull/195) + +#### [1.1.11.1](https://github.com/rdkcentral/control/compare/1.1.11...1.1.11.1) + +> 1 April 2026 + +- RDKEMW-16330: Update Control Manager to use bool for NSM [`#188`](https://github.com/rdkcentral/control/pull/188) +- RDKEMW-16330: update CHANGELOG for release 1.1.11p1 [`98ea5f5`](https://github.com/rdkcentral/control/commit/98ea5f51f8da9ef6ded7038d760baa3b41cc4a90) + #### [1.1.11](https://github.com/rdkcentral/control/compare/1.1.10...1.1.11) -> 5 March 2026 +> 6 March 2026 - RDKEMW-14589: No UI action with "Info" keypress from rf4ce remote in RF mode [`#181`](https://github.com/rdkcentral/control/pull/181) - RDKEMW-14445 : Add session end and protocol return to telemetry [`#182`](https://github.com/rdkcentral/control/pull/182) @@ -15,7 +38,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - RDKEMW-12930: RF4CE network export XCONF on pair/unpair/etc. [`#177`](https://github.com/rdkcentral/control/pull/177) - RDKEMW-13833: Remove duplicate RFC fetch attempts in listeners [`#179`](https://github.com/rdkcentral/control/pull/179) - #### [1.1.10](https://github.com/rdkcentral/control/compare/1.1.9...1.1.10) diff --git a/CMakeLists.txt b/CMakeLists.txt index 565ab874..112b3c00 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -234,8 +234,6 @@ if(THUNDER) if(AUTH_ACTIVATION_STATUS) add_compile_definitions(AUTH_ACTIVATION_STATUS) endif() - #By default disabled but can be enabled - #add_compile_definitions(AUTH_EXPERIENCE) target_link_libraries(controlMgr RdkCertSelector) endif() endif() diff --git a/include/ctrlm_ipc_voice.h b/include/ctrlm_ipc_voice.h index 665ffaa5..ed96c951 100644 --- a/include/ctrlm_ipc_voice.h +++ b/include/ctrlm_ipc_voice.h @@ -64,7 +64,7 @@ #define CTRLM_VOICE_SESSION_TEXT_MAX_LENGTH (512) ///< Session text string maximum length #define CTRLM_VOICE_SESSION_MSG_MAX_LENGTH (128) ///< Session message string maximum length #define CTRLM_VOICE_QUERY_STRING_MAX_LENGTH (128) ///< Query string maximum name or value length -#define CTRLM_VOICE_QUERY_STRING_MAX_PAIRS (16) ///< Query string maximum number of name/value pairs +#define CTRLM_VOICE_QUERY_STRING_MAX_PAIRS (24) ///< Query string maximum number of name/value pairs #define CTRLM_VOICE_REQUEST_IP_MAX_LENGTH (48) ///< cURL request primary IP address string maximum length (big enough for IPv6) #define CTRLM_VOICE_MIN_UTTERANCE_DURATION_MAXIMUM (600) ///< Maximum value of the utterance duration minimum setting (in milliseconds) diff --git a/src/auth/ctrlm_auth.h b/src/auth/ctrlm_auth.h index 0964335f..bda34998 100644 --- a/src/auth/ctrlm_auth.h +++ b/src/auth/ctrlm_auth.h @@ -34,7 +34,6 @@ class ctrlm_auth_t { virtual bool get_device_id(std::string &device_id) = 0; virtual bool get_account_id(std::string &account_id) = 0; virtual bool get_partner_id(std::string &partner_id) = 0; - virtual bool get_experience(std::string &experience) = 0; virtual bool get_sat(std::string &sat, time_t &expiration) = 0; virtual bool supports_sat_expiration() const = 0; diff --git a/src/auth/ctrlm_auth_thunder.cpp b/src/auth/ctrlm_auth_thunder.cpp index 2f954df3..7e37f8b4 100644 --- a/src/auth/ctrlm_auth_thunder.cpp +++ b/src/auth/ctrlm_auth_thunder.cpp @@ -48,11 +48,6 @@ bool ctrlm_auth_thunder_t::get_partner_id(std::string &partner_id) { return(ret); } -bool ctrlm_auth_thunder_t::get_experience(std::string &experience) { - bool ret = this->plugin->get_experience(experience); - return(ret); -} - bool ctrlm_auth_thunder_t::get_sat(std::string &sat, time_t &expiration) { bool ret = this->plugin->get_sat(sat, expiration); return(ret); diff --git a/src/auth/ctrlm_auth_thunder.h b/src/auth/ctrlm_auth_thunder.h index 3a476e67..67a385db 100644 --- a/src/auth/ctrlm_auth_thunder.h +++ b/src/auth/ctrlm_auth_thunder.h @@ -13,7 +13,6 @@ class ctrlm_auth_thunder_t : public ctrlm_auth_t { virtual bool get_device_id(std::string &device_id); virtual bool get_account_id(std::string &account_id); virtual bool get_partner_id(std::string &partner_id); - virtual bool get_experience(std::string &experience); virtual bool get_sat(std::string &sat, time_t &expiration); virtual bool supports_sat_expiration() const; diff --git a/src/auth/ctrlm_thunder_plugin_authservice.cpp b/src/auth/ctrlm_thunder_plugin_authservice.cpp index 60c57d7a..e5913d07 100644 --- a/src/auth/ctrlm_thunder_plugin_authservice.cpp +++ b/src/auth/ctrlm_thunder_plugin_authservice.cpp @@ -125,24 +125,6 @@ bool ctrlm_thunder_plugin_authservice_t::get_account_id(std::string &account_id) return(ret); } -bool ctrlm_thunder_plugin_authservice_t::get_experience(std::string &experience) { - bool ret = false; - JsonObject params, response; - if(this->call_plugin("getExperience", (void *)¶ms, (void *)&response)) { - if(response["success"].Boolean()) { // If success doesn't exist, it defaults to false which is fine. - experience = response["experience"].String(); - if(!experience.empty()) { - ret = true; - } - } else { - XLOGD_WARN("Success for getExperience was false"); - } - } else { - XLOGD_WARN("Call for getExperience failed"); - } - return(ret); -} - bool ctrlm_thunder_plugin_authservice_t::get_sat(std::string &sat, time_t &expiration) { bool ret = false; JsonObject params, response; diff --git a/src/auth/ctrlm_thunder_plugin_authservice.h b/src/auth/ctrlm_thunder_plugin_authservice.h index c39de41d..169cee88 100644 --- a/src/auth/ctrlm_thunder_plugin_authservice.h +++ b/src/auth/ctrlm_thunder_plugin_authservice.h @@ -75,13 +75,6 @@ class ctrlm_thunder_plugin_authservice_t : public Thunder::Plugin::ctrlm_thunder */ bool get_account_id(std::string &account_id); - /** - * Function that retrieves the Experience String from Authservice. - * @param experience The reference to a string which will contain the Experience String. - * @return True on success otherwise False. - */ - bool get_experience(std::string &experience); - /** * Function that retrieves the SAT Token from Authservice. * @param sat The reference to a string which will contain the SAT Token. diff --git a/src/ctrlm.h b/src/ctrlm.h index 905803d1..376608b3 100644 --- a/src/ctrlm.h +++ b/src/ctrlm.h @@ -458,7 +458,6 @@ gboolean ctrlm_main_has_device_id_get(void); gboolean ctrlm_main_has_device_type_get(void); gboolean ctrlm_main_has_service_account_id_get(void); gboolean ctrlm_main_has_partner_id_get(void); -gboolean ctrlm_main_has_experience_get(void); gboolean ctrlm_main_needs_service_access_token_get(void); void ctrlm_main_invalidate_service_access_token(void); void ctrlm_main_sat_enabled_set(gboolean sat_enabled); diff --git a/src/ctrlm_controller.cpp b/src/ctrlm_controller.cpp index 15496dd3..60173d47 100644 --- a/src/ctrlm_controller.cpp +++ b/src/ctrlm_controller.cpp @@ -118,10 +118,6 @@ string ctrlm_obj_controller_t::partner_id_get() const { return(obj_network_->partner_id_get()); } -string ctrlm_obj_controller_t::experience_get() const { - return(obj_network_->experience_get()); -} - string ctrlm_obj_controller_t::stb_name_get() const { return(obj_network_->stb_name_get()); } diff --git a/src/ctrlm_controller.h b/src/ctrlm_controller.h index 66749062..ae9b800b 100644 --- a/src/ctrlm_controller.h +++ b/src/ctrlm_controller.h @@ -63,7 +63,6 @@ class ctrlm_obj_controller_t std::string device_id_get() const; std::string service_account_id_get() const; std::string partner_id_get() const; - std::string experience_get() const; std::string stb_name_get() const; void set_device_minor_id(int device_minor_id); int get_device_minor_id() const; diff --git a/src/ctrlm_main.cpp b/src/ctrlm_main.cpp index f76c3682..c3da8d6d 100644 --- a/src/ctrlm_main.cpp +++ b/src/ctrlm_main.cpp @@ -302,10 +302,6 @@ static void ctrlm_main_has_service_account_id_set(gboolean has_id); static gboolean ctrlm_load_partner_id(void); static void ctrlm_main_has_partner_id_set(gboolean has_id); #endif -#ifdef AUTH_EXPERIENCE -static gboolean ctrlm_load_experience(void); -static void ctrlm_main_has_experience_set(gboolean has_experience); -#endif #ifdef AUTH_SAT_TOKEN static gboolean ctrlm_load_service_access_token(void); static void ctrlm_main_has_service_access_token_set(gboolean has_token); @@ -1421,30 +1417,6 @@ gboolean ctrlm_load_partner_id(void) { } #endif -#ifdef AUTH_EXPERIENCE -gboolean ctrlm_main_has_experience_get(void) { - return(g_ctrlm.has_experience); -} - -void ctrlm_main_has_experience_set(gboolean has_experience) { - g_ctrlm.has_experience = has_experience; -} - -gboolean ctrlm_load_experience(void) { - if(!g_ctrlm.authservice->get_experience(g_ctrlm.experience)) { - ctrlm_main_has_experience_set(false); - return(false); - } - g_ctrlm.voice_session->voice_stb_data_experience_set(g_ctrlm.experience); - - for(auto const &itr : g_ctrlm.networks) { - itr.second->experience_set(g_ctrlm.experience); - } - ctrlm_main_has_experience_set(true); - return(true); -} -#endif - #ifdef AUTH_SAT_TOKEN gboolean ctrlm_main_needs_service_access_token_get(void) { gboolean ret = false; @@ -1510,12 +1482,6 @@ gboolean ctrlm_has_authservice_data(void) { } #endif -#ifdef AUTH_EXPERIENCE - if(!ctrlm_main_has_experience_get()) { - ret = FALSE; - } -#endif - #ifdef AUTH_SAT_TOKEN if(ctrlm_main_needs_service_access_token_get()) { ret = FALSE; @@ -1566,18 +1532,6 @@ gboolean ctrlm_load_authservice_data(void) { } #endif -#ifdef AUTH_EXPERIENCE - if(!ctrlm_main_has_experience_get()) { - XLOGD_INFO("load experience"); - if(!ctrlm_load_experience()) { - XLOGD_TELEMETRY("failed to load experience"); - ret = FALSE; - } else { - XLOGD_INFO("load experience successfully <%s>", ctrlm_is_pii_mask_enabled() ? "***" : g_ctrlm.experience.c_str()); - } - } -#endif - #ifdef AUTH_SAT_TOKEN if(ctrlm_main_needs_service_access_token_get()) { XLOGD_INFO("load sat token"); diff --git a/src/ctrlm_network.cpp b/src/ctrlm_network.cpp index e8f591c3..26201231 100644 --- a/src/ctrlm_network.cpp +++ b/src/ctrlm_network.cpp @@ -187,16 +187,6 @@ string ctrlm_obj_network_t::partner_id_get() const { return(partner_id_); } -void ctrlm_obj_network_t::experience_set(const string& experience) { - THREAD_ID_VALIDATE(); - experience_ = experience; -} - -string ctrlm_obj_network_t::experience_get() const { - THREAD_ID_VALIDATE(); - return(experience_); -} - void ctrlm_obj_network_t::stb_name_set(const string& stb_name) { THREAD_ID_VALIDATE(); XLOGD_INFO("STB Name <%s>", stb_name.c_str()); diff --git a/src/ctrlm_network.h b/src/ctrlm_network.h index 90ea909f..ca6ad547 100644 --- a/src/ctrlm_network.h +++ b/src/ctrlm_network.h @@ -192,8 +192,6 @@ class ctrlm_obj_network_t std::string service_account_id_get() const; void partner_id_set(const std::string& partner_id); std::string partner_id_get() const; - void experience_set(const std::string& experience); - std::string experience_get() const; void mask_key_codes_set(gboolean mask_key_codes); gboolean mask_key_codes_get() const; void stb_name_set(const std::string& stb_name); @@ -325,7 +323,6 @@ class ctrlm_obj_network_t std::string device_id_; std::string service_account_id_; std::string partner_id_; - std::string experience_; std::string stb_name_; ctrlm_rcu_validation_result_t validation_result_ = CTRLM_RCU_VALIDATION_RESULT_MAX; ctrlm_key_code_t validation_key_ = CTRLM_KEY_CODE_INVALID; diff --git a/src/thunder/ctrlm_thunder_plugin.cpp b/src/thunder/ctrlm_thunder_plugin.cpp index 3040fae5..ca6afffc 100644 --- a/src/thunder/ctrlm_thunder_plugin.cpp +++ b/src/thunder/ctrlm_thunder_plugin.cpp @@ -261,6 +261,53 @@ bool ctrlm_thunder_plugin_t::call_plugin(std::string method, void *params, void return(ret); } +bool ctrlm_thunder_plugin_t::call_plugin_boolean(std::string method, void *params, bool *response) { + bool ret = false; + auto clientObject = (JSONRPC::LinkType*)this->plugin_client; + JsonObject *jsonParams = (JsonObject *)params; + if(clientObject) { + if(!method.empty() && jsonParams && response) { + Core::JSON::Boolean jsonResponse; + uint32_t thunderRet = clientObject->Invoke(CALL_TIMEOUT, _T(method), *jsonParams, jsonResponse); + if(thunderRet != Core::ERROR_NONE) { + XLOGD_ERROR("Thunder call failed <%s> <%u>", method.c_str(), thunderRet); + } else { + *response = jsonResponse.Value(); + ret = true; + } + } else { + XLOGD_ERROR("Invalid parameters"); + } + } else { + XLOGD_ERROR("Client is NULL"); + } + return(ret); +} + +bool ctrlm_thunder_plugin_t::call_plugin_string(std::string method, void *params, std::string *response) { + bool ret = false; + auto clientObject = (JSONRPC::LinkType*)this->plugin_client; + JsonObject *jsonParams = (JsonObject *)params; + if(clientObject) { + if(!method.empty() && jsonParams && response) { + Core::JSON::String jsonString; + uint32_t thunderRet = clientObject->Invoke(CALL_TIMEOUT, _T(method), *jsonParams, jsonString); + if(thunderRet != Core::ERROR_NONE) { + XLOGD_ERROR("Thunder call failed <%s> <%u>", method.c_str(), thunderRet); + } else { + *response = jsonString.Value(); + ret = true; + } + } else { + XLOGD_ERROR("Invalid parameters"); + } + } else { + XLOGD_ERROR("Client is NULL"); + } + return(ret); +} + + bool ctrlm_thunder_plugin_t::call_controller(std::string method, void *params, void *response) { bool ret = false; if(this->controller) { diff --git a/src/thunder/ctrlm_thunder_plugin.h b/src/thunder/ctrlm_thunder_plugin.h index f1a3944a..9bf6d780 100644 --- a/src/thunder/ctrlm_thunder_plugin.h +++ b/src/thunder/ctrlm_thunder_plugin.h @@ -105,9 +105,8 @@ class ctrlm_thunder_plugin_t { std::string callsign_with_api(); /** - * This functions is used to get a Thunder Plugin property. - * @param method The method in which the user wants to call. - * @param params The WPEFramework JsonObject containing the parameters for the call. (We can't include WPEFramework headers in controlMgr .h files as their logging macros clash) + * This function is used to get a Thunder Plugin property. + * @param property The name of the property that the user wants to get * @param response The WPEFramework JsonObject containing the response from the call. (We can't include WPEFramework headers in controlMgr .h files as their logging macros clash) * @param retries The number of retries if the call times out. * @return True if the call succeeded, otherwise False. @@ -115,7 +114,7 @@ class ctrlm_thunder_plugin_t { bool property_get(std::string property, void *response, unsigned int retries = 0); /** - * This functions is used to call a Thunder Plugin method. + * This function is used to call a Thunder Plugin method. * @param method The method in which the user wants to call. * @param params The WPEFramework JsonObject containing the parameters for the call. (We can't include WPEFramework headers in controlMgr .h files as their logging macros clash) * @param response The WPEFramework JsonObject containing the response from the call. (We can't include WPEFramework headers in controlMgr .h files as their logging macros clash) @@ -125,7 +124,25 @@ class ctrlm_thunder_plugin_t { bool call_plugin(std::string method, void *params, void *response, unsigned int retries = 0); /** - * This functions is used to call a Thunder Controller method. + * This function is used to call a Thunder Plugin method. + * @param method The method in which the user wants to call. + * @param params The WPEFramework JsonObject containing the parameters for the call. (We can't include WPEFramework headers in controlMgr .h files as their logging macros clash) + * @param response The boolean pointer which will be assigned the response from the call + * @return True if the call succeeded, otherwise False. + */ + bool call_plugin_boolean(std::string method, void *params, bool *response); + + /** + * This function is used to call a Thunder Plugin method. + * @param method The method in which the user wants to call. + * @param params The WPEFramework JsonObject containing the parameters for the call. (We can't include WPEFramework headers in controlMgr .h files as their logging macros clash) + * @param response The string pointer which will be assigned containing the response from the call. + * @return True if the call succeeded, otherwise False. + */ + bool call_plugin_string(std::string method, void *params, std::string *response); + + /** + * This function is used to call a Thunder Controller method. * @param method The method in which the user wants to call. * @param params The WPEFramework JsonObject containing the parameters for the call. (We can't include WPEFramework headers in controlMgr .h files as their logging macros clash) * @param params The WPEFramework JsonObject containing the response from the call. (We can't include WPEFramework headers in controlMgr .h files as their logging macros clash) @@ -164,4 +181,4 @@ class ctrlm_thunder_plugin_t { }; }; -#endif \ No newline at end of file +#endif diff --git a/src/thunder/ctrlm_thunder_plugin_powermanager.cpp b/src/thunder/ctrlm_thunder_plugin_powermanager.cpp index 6e0c83b0..e84fa983 100755 --- a/src/thunder/ctrlm_thunder_plugin_powermanager.cpp +++ b/src/thunder/ctrlm_thunder_plugin_powermanager.cpp @@ -89,16 +89,15 @@ ctrlm_power_state_t ctrlm_thunder_plugin_powermanager_t::get_power_state() { /* root@pioneer-uhd:~# curl --request POST --url http://127.0.0.1:9998/jsonrpc --header 'Content-Type: application/json' --data '{ "jsonrpc": "2.0", "id": 1234567890, "method": "org.rdk.PowerManager.1.getNetworkStandbyMode", "params": {} }' {"jsonrpc":"2.0","id":1234567890,"result":true} */ bool ctrlm_thunder_plugin_powermanager_t::get_networked_standby_mode() { - JsonObject params, response; + JsonObject params; params = {}; bool networked_standby_mode = false; - sem_wait(&this->semaphore); - if(this->call_plugin("getNetworkStandbyMode", (void *)¶ms, (void *)&response)) { - networked_standby_mode = response["result"].Boolean(); + sem_wait(&this->semaphore); + if(this->call_plugin_boolean("getNetworkStandbyMode", (void *)¶ms, &networked_standby_mode)) { XLOGD_DEBUG("networked_standby_mode is %s", networked_standby_mode?"TRUE":"FALSE"); } else { - XLOGD_ERROR("getNetworkedStandbyMode call failed"); + XLOGD_ERROR("getNetworkStandbyMode call failed"); } sem_post(&this->semaphore); @@ -108,19 +107,23 @@ bool ctrlm_thunder_plugin_powermanager_t::get_networked_standby_mode() { /* root@pioneer-uhd:~# curl --request POST --url http://127.0.0.1:9998/jsonrpc --header 'Content-Type: application/json' --data '{ "jsonrpc": "2.0", "id": 1234567890, "method": "org.rdk.PowerManager.1.getLastWakeupReason", "params": {} }' {"jsonrpc":"2.0","id":1234567890,"result":"COLDBOOT"} */ bool ctrlm_thunder_plugin_powermanager_t::get_wakeup_reason_voice() { - JsonObject params, response; + JsonObject params; + std::string response; params = {}; bool wakeup_reason_voice = false; sem_wait(&this->semaphore); - if(this->call_plugin("getLastWakeupReason", (void *)¶ms, (void *)&response)) { - wakeup_reason_voice = (0 == strncmp(response["result"].String().c_str(), "VOICE", 5)); - XLOGD_DEBUG("voice_wakeup is %s", wakeup_reason_voice?"TRUE":"FALSE"); + if(this->call_plugin_string("getLastWakeupReason", (void *)¶ms, &response)) { + if(response == "VOICE") { + wakeup_reason_voice = true; + } } else { XLOGD_ERROR("getLastWakeupReason call failed"); } sem_post(&this->semaphore); + XLOGD_DEBUG("voice_wakeup is %s", wakeup_reason_voice?"TRUE":"FALSE"); + return wakeup_reason_voice; } diff --git a/src/voice/ctrlm_voice_obj.cpp b/src/voice/ctrlm_voice_obj.cpp index 6e4b354f..a6787b1e 100644 --- a/src/voice/ctrlm_voice_obj.cpp +++ b/src/voice/ctrlm_voice_obj.cpp @@ -2252,18 +2252,6 @@ std::string ctrlm_voice_t::voice_stb_data_partner_id_get() const { return(this->partner_id); } -void ctrlm_voice_t::voice_stb_data_experience_set(std::string &experience) { - XLOGD_DEBUG("Experience Tag set to %s", experience.c_str()); - this->experience = experience; - for(const auto &itr : this->endpoints) { - itr->voice_stb_data_experience_set(experience); - } -} - -std::string ctrlm_voice_t::voice_stb_data_experience_get() const { - return(this->experience); -} - std::string ctrlm_voice_t::voice_stb_data_app_id_http_get() const { return(this->prefs.app_id_http); } @@ -2427,12 +2415,6 @@ bool ctrlm_voice_t::voice_session_has_stb_data() { return(false); } #endif -#ifdef AUTH_EXPERIENCE - if(this->experience == "") { - XLOGD_INFO("No experience tag"); - return(false); - } -#endif #ifdef AUTH_SAT_TOKEN if(this->sat_token_required && this->sat_token[0] == '\0') { XLOGD_INFO("No SAT token"); diff --git a/src/voice/ctrlm_voice_obj.h b/src/voice/ctrlm_voice_obj.h index 38699a6b..3ec217b2 100644 --- a/src/voice/ctrlm_voice_obj.h +++ b/src/voice/ctrlm_voice_obj.h @@ -525,8 +525,6 @@ class ctrlm_voice_t { ctrlm_device_type_t voice_stb_data_device_type_get() const; virtual void voice_stb_data_partner_id_set(std::string &partner_id); std::string voice_stb_data_partner_id_get() const; - virtual void voice_stb_data_experience_set(std::string &experience); - std::string voice_stb_data_experience_get() const; std::string voice_stb_data_app_id_http_get() const; std::string voice_stb_data_app_id_ws_get() const; virtual void voice_stb_data_guide_language_set(const char *language); @@ -662,7 +660,6 @@ class ctrlm_voice_t { std::string device_id; ctrlm_device_type_t device_type; std::string partner_id; - std::string experience; char sat_token[XRSR_SAT_TOKEN_LEN_MAX]; bool sat_token_required; bool mtls_required; diff --git a/src/voice/endpoints/ctrlm_voice_endpoint.cpp b/src/voice/endpoints/ctrlm_voice_endpoint.cpp index 7815cd27..1aed8d46 100644 --- a/src/voice/endpoints/ctrlm_voice_endpoint.cpp +++ b/src/voice/endpoints/ctrlm_voice_endpoint.cpp @@ -63,7 +63,6 @@ void ctrlm_voice_endpoint_t::voice_stb_data_account_number_set(std::string &acco void ctrlm_voice_endpoint_t::voice_stb_data_device_id_set(std::string &device_id) {} void ctrlm_voice_endpoint_t::voice_stb_data_device_type_set(ctrlm_device_type_t device_type) {} void ctrlm_voice_endpoint_t::voice_stb_data_partner_id_set(std::string &partner_id) {} -void ctrlm_voice_endpoint_t::voice_stb_data_experience_set(std::string &experience) {} void ctrlm_voice_endpoint_t::voice_stb_data_guide_language_set(const char *language) {} void ctrlm_voice_endpoint_t::voice_stb_data_mask_pii_set(bool enable) {} diff --git a/src/voice/endpoints/ctrlm_voice_endpoint.h b/src/voice/endpoints/ctrlm_voice_endpoint.h index ac881880..3298348f 100644 --- a/src/voice/endpoints/ctrlm_voice_endpoint.h +++ b/src/voice/endpoints/ctrlm_voice_endpoint.h @@ -50,7 +50,6 @@ class ctrlm_voice_endpoint_t { virtual void voice_stb_data_device_id_set(std::string &device_id); virtual void voice_stb_data_device_type_set(ctrlm_device_type_t device_type); virtual void voice_stb_data_partner_id_set(std::string &partner_id); - virtual void voice_stb_data_experience_set(std::string &experience); virtual void voice_stb_data_guide_language_set(const char *language); virtual void voice_stb_data_mask_pii_set(bool enable); // End Data Setters diff --git a/src/voice/endpoints/ctrlm_voice_endpoint_http.cpp b/src/voice/endpoints/ctrlm_voice_endpoint_http.cpp index 1ec3e647..c119ee43 100644 --- a/src/voice/endpoints/ctrlm_voice_endpoint_http.cpp +++ b/src/voice/endpoints/ctrlm_voice_endpoint_http.cpp @@ -72,14 +72,12 @@ bool ctrlm_voice_endpoint_http_t::open() { std::string device_id = this->voice_obj->voice_stb_data_device_id_get(); std::string partner_id = this->voice_obj->voice_stb_data_partner_id_get(); - std::string experience = this->voice_obj->voice_stb_data_experience_get(); std::string app_id = this->voice_obj->voice_stb_data_app_id_http_get(); std::string language = this->voice_obj->voice_stb_data_guide_language_get().c_str(); xrsv_http_params_t params_http = { .device_id = device_id.c_str(), .partner_id = partner_id.c_str(), - .experience = experience.c_str(), .app_id = app_id.c_str(), .language = language.c_str(), .test_flag = this->voice_obj->voice_stb_data_test_get(), @@ -138,12 +136,6 @@ void ctrlm_voice_endpoint_http_t::voice_stb_data_partner_id_set(std::string &par } } -void ctrlm_voice_endpoint_http_t::voice_stb_data_experience_set(std::string &experience) { - if(this->xrsv_obj_http) { - xrsv_http_update_experience(this->xrsv_obj_http, experience.c_str()); - } -} - void ctrlm_voice_endpoint_http_t::voice_stb_data_guide_language_set(const char *language) { if(this->xrsv_obj_http) { xrsv_http_update_language(this->xrsv_obj_http, language); diff --git a/src/voice/endpoints/ctrlm_voice_endpoint_http.h b/src/voice/endpoints/ctrlm_voice_endpoint_http.h index 9338e20d..79a0d50d 100644 --- a/src/voice/endpoints/ctrlm_voice_endpoint_http.h +++ b/src/voice/endpoints/ctrlm_voice_endpoint_http.h @@ -32,7 +32,6 @@ class ctrlm_voice_endpoint_http_t : public ctrlm_voice_endpoint_t { public: void voice_stb_data_device_id_set(std::string &device_id); void voice_stb_data_partner_id_set(std::string &partner_id); - void voice_stb_data_experience_set(std::string &experience); void voice_stb_data_guide_language_set(const char *language); void voice_stb_data_pii_mask_set(bool enable); diff --git a/src/voice/endpoints/ctrlm_voice_endpoint_ws_nextgen.cpp b/src/voice/endpoints/ctrlm_voice_endpoint_ws_nextgen.cpp index e5165cd7..9abc27db 100644 --- a/src/voice/endpoints/ctrlm_voice_endpoint_ws_nextgen.cpp +++ b/src/voice/endpoints/ctrlm_voice_endpoint_ws_nextgen.cpp @@ -86,7 +86,6 @@ bool ctrlm_voice_endpoint_ws_nextgen_t::open() { } std::string device_id = this->voice_obj->voice_stb_data_device_id_get(); std::string partner_id = this->voice_obj->voice_stb_data_partner_id_get(); - std::string experience = this->voice_obj->voice_stb_data_experience_get(); std::string language = this->voice_obj->voice_stb_data_guide_language_get().c_str(); std::string account_number = this->voice_obj->voice_stb_data_account_number_get(); std::string device_mac = ctrlm_device_mac_get(); @@ -96,7 +95,6 @@ bool ctrlm_voice_endpoint_ws_nextgen_t::open() { .device_id = (device_id.empty() == false ? device_id.c_str() : NULL), .account_id = (account_number.empty() == false ? account_number.c_str() : NULL), .partner_id = (partner_id.empty() == false ? partner_id.c_str() : NULL), - .experience = (experience.empty() == false ? experience.c_str() : NULL), .audio_profile = controller_name_to_audio_profile(""), .audio_model = controller_name_to_audio_model(""), .language = language.c_str(), @@ -235,12 +233,6 @@ void ctrlm_voice_endpoint_ws_nextgen_t::voice_stb_data_partner_id_set(std::strin } } -void ctrlm_voice_endpoint_ws_nextgen_t::voice_stb_data_experience_set(std::string &experience) { - if(this->xrsv_obj_ws_nextgen) { - xrsv_ws_nextgen_update_experience(this->xrsv_obj_ws_nextgen, experience.c_str()); - } -} - void ctrlm_voice_endpoint_ws_nextgen_t::voice_stb_data_guide_language_set(const char *language) { if(this->xrsv_obj_ws_nextgen) { xrsv_ws_nextgen_update_language(this->xrsv_obj_ws_nextgen, language); diff --git a/src/voice/endpoints/ctrlm_voice_endpoint_ws_nextgen.h b/src/voice/endpoints/ctrlm_voice_endpoint_ws_nextgen.h index 16667f2f..218e1d39 100644 --- a/src/voice/endpoints/ctrlm_voice_endpoint_ws_nextgen.h +++ b/src/voice/endpoints/ctrlm_voice_endpoint_ws_nextgen.h @@ -37,7 +37,6 @@ class ctrlm_voice_endpoint_ws_nextgen_t : public ctrlm_voice_endpoint_t { void voice_stb_data_device_id_set(std::string &device_id); void voice_stb_data_device_type_set(ctrlm_device_type_t device_type); void voice_stb_data_partner_id_set(std::string &partner_id); - void voice_stb_data_experience_set(std::string &experience); void voice_stb_data_guide_language_set(const char *language); void voice_stb_data_mask_pii_set(bool enable); From 895e258f35d2cb8473bc71a5b19237e6cea662ac Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Fri, 10 Apr 2026 18:52:37 +0000 Subject: [PATCH 02/72] RDKEMW-14537: Coverity integration for ctrlm --- .github/workflows/native_full_build.yml | 33 +++ build_dependencies.sh | 359 ++++++++++++++++++++++++ cov_build.sh | 102 +++++++ 3 files changed, 494 insertions(+) create mode 100644 .github/workflows/native_full_build.yml create mode 100644 build_dependencies.sh create mode 100644 cov_build.sh diff --git a/.github/workflows/native_full_build.yml b/.github/workflows/native_full_build.yml new file mode 100644 index 00000000..e22ab36b --- /dev/null +++ b/.github/workflows/native_full_build.yml @@ -0,0 +1,33 @@ +name: Build Control Manager in Native Environment + +on: + push: + branches: [ main, 'sprint/**', 'release/**', 'feature/**', develop ] + pull_request: + branches: [ main, 'sprint/**', 'release/**', topic/RDK*, 'feature/**', develop ] + +permissions: + contents: read + +jobs: + build-control-on-pr: + name: Build Control Manager in github rdkcentral + runs-on: ubuntu-latest + container: + image: ghcr.io/rdkcentral/docker-rdk-ci:latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: build dependencies + run: | + sh -x build_dependencies.sh + env: + GITHUB_TOKEN: ${{ secrets.RDKCM_RDKE }} + + - name: cov build + run: | + sh -x cov_build.sh + env: + GITHUB_TOKEN: ${{ secrets.RDKCM_RDKE }} diff --git a/build_dependencies.sh b/build_dependencies.sh new file mode 100644 index 00000000..f6926abd --- /dev/null +++ b/build_dependencies.sh @@ -0,0 +1,359 @@ +#!/bin/bash +set -x +set -e +############################## +GITHUB_WORKSPACE="${PWD}" +ls -la ${GITHUB_WORKSPACE} +cd ${GITHUB_WORKSPACE} + +git config --global --add safe.directory "${GITHUB_WORKSPACE}" + +# ############################# +# 1. Install Dependencies and packages + +apt update +apt install -y \ + libsqlite3-dev \ + libcurl4-openssl-dev \ + libsystemd-dev \ + libboost-all-dev \ + libglib2.0-dev \ + libgio2.0-cil-dev \ + libjansson-dev \ + libarchive-dev \ + libssl-dev \ + zlib1g-dev \ + libdbus-1-dev \ + uuid-dev \ + libevdev-dev \ + libdrm-dev \ + gperf \ + meson \ + valgrind \ + lcov \ + clang +pip install jsonref + +########################################### +# 2. Clone the required repositories + +git clone --depth 1 --branch R4.4.3 https://github.com/rdkcentral/ThunderTools.git + +git clone --depth 1 --branch R4.4.1 https://github.com/rdkcentral/Thunder.git + +git clone --depth 1 --branch feature/RDKEMW-10727 https://github.com/rdkcentral/entservices-apis.git + +git clone --depth 1 --branch feature/RDKEMW-14537 https://$GITHUB_TOKEN@github.com/rdkcentral/entservices-testframework.git + +git clone --depth 1 https://github.com/rdkcentral/xr-voice-sdk.git + +############################ +# 3. Build Thunder-Tools +echo "======================================================================================" +echo "building thunderTools" +cd ThunderTools +patch -p1 < $GITHUB_WORKSPACE/entservices-testframework/patches/00010-R4.4-Add-support-for-project-dir.patch +cd - + +cmake -G Ninja -S ThunderTools -B build/ThunderTools \ + -DEXCEPTIONS_ENABLE=ON \ + -DCMAKE_INSTALL_PREFIX="$GITHUB_WORKSPACE/install/usr" \ + -DCMAKE_MODULE_PATH="$GITHUB_WORKSPACE/install/tools/cmake" \ + -DGENERIC_CMAKE_MODULE_PATH="$GITHUB_WORKSPACE/install/tools/cmake" + +cmake --build build/ThunderTools --target install + +############################ +# 4. Build Thunder +echo "======================================================================================" +echo "building thunder" + +cd Thunder +patch -p1 < $GITHUB_WORKSPACE/entservices-testframework/patches/Use_Legact_Alt_Based_On_ThunderTools_R4.4.3.patch +patch -p1 < $GITHUB_WORKSPACE/entservices-testframework/patches/error_code_R4_4.patch +patch -p1 < $GITHUB_WORKSPACE/entservices-testframework/patches/1004-Add-support-for-project-dir.patch +patch -p1 < $GITHUB_WORKSPACE/entservices-testframework/patches/RDKEMW-733-Add-ENTOS-IDS.patch +cd - + +cmake -G Ninja -S Thunder -B build/Thunder \ + -DMESSAGING=ON \ + -DCMAKE_INSTALL_PREFIX="$GITHUB_WORKSPACE/install/usr" \ + -DCMAKE_MODULE_PATH="$GITHUB_WORKSPACE/install/tools/cmake" \ + -DGENERIC_CMAKE_MODULE_PATH="$GITHUB_WORKSPACE/install/tools/cmake" \ + -DBUILD_TYPE=Debug \ + -DBINDING=127.0.0.1 \ + -DPORT=55555 \ + -DEXCEPTIONS_ENABLE=ON + +cmake --build build/Thunder --target install + +############################ +# 5. Build entservices-apis +echo "======================================================================================" +echo "building entservices-apis" +cd entservices-apis +rm -rf jsonrpc/DTV.json +cd .. + +cmake -G Ninja -S entservices-apis -B build/entservices-apis \ + -DEXCEPTIONS_ENABLE=ON \ + -DCMAKE_INSTALL_PREFIX="$GITHUB_WORKSPACE/install/usr" \ + -DCMAKE_MODULE_PATH="$GITHUB_WORKSPACE/install/tools/cmake" + +cmake --build build/entservices-apis --target install + +############################ +# 6. Create stub/empty headers for external dependencies +echo "======================================================================================" +echo "Creating stub headers" + +HEADERS_DIR="$GITHUB_WORKSPACE/entservices-testframework/Tests/headers" +mkdir -p "${HEADERS_DIR}" +mkdir -p "${HEADERS_DIR}/rdk/iarmbus" +mkdir -p "${HEADERS_DIR}/rdk/ds" +mkdir -p "${HEADERS_DIR}/rdk/ds-rpc" +mkdir -p "${HEADERS_DIR}/rdk/ds-hal" +mkdir -p "${HEADERS_DIR}/rdk/halif/ds-hal" +mkdir -p "${HEADERS_DIR}/rdk/iarmmgrs-hal" +mkdir -p "${HEADERS_DIR}/websocket" +mkdir -p "${HEADERS_DIR}/proc" +mkdir -p "${HEADERS_DIR}/audiocapturemgr" +mkdir -p "${HEADERS_DIR}/ccec/drivers" +mkdir -p "${HEADERS_DIR}/network" +mkdir -p "${HEADERS_DIR}/nopoll" + +cd "${HEADERS_DIR}" + +# IARM headers (types provided via -include Iarm.h) +touch rdk/iarmbus/libIARM.h +touch rdk/iarmbus/libIBus.h +touch rdk/iarmbus/libIBusDaemon.h + +# IARM managers (types provided via -include Iarm.h for sysMgr, or in control stubs) +touch rdk/iarmmgrs-hal/sysMgr.h +touch rdk/iarmmgrs-hal/irMgr.h +touch rdk/iarmmgrs-hal/deepSleepMgr.h +touch rdk/iarmmgrs-hal/mfrMgr.h +touch rdk/iarmmgrs-hal/pwrMgr.h +touch rdk/iarmmgrs-hal/plat_ir.h + +# Device settings headers (types provided via -include devicesettings.h) +touch rdk/ds/audioOutputPort.hpp +touch rdk/ds/compositeIn.hpp +touch rdk/ds/dsDisplay.h +touch rdk/ds/dsError.h +touch rdk/ds/dsMgr.h +touch rdk/ds/dsRpc.h +touch rdk/ds/dsTypes.h +touch rdk/ds/dsUtl.h +touch rdk/ds/exception.hpp +touch rdk/ds/hdmiIn.hpp +touch rdk/ds/host.hpp +touch rdk/ds/list.hpp +# manager.hpp is empty — device::Manager is provided by the force-included devicesettings.h +touch rdk/ds/manager.hpp +touch rdk/ds/sleepMode.hpp +touch rdk/ds/videoDevice.hpp +touch rdk/ds/videoOutputPort.hpp +touch rdk/ds/videoOutputPortConfig.hpp +touch rdk/ds/videoOutputPortType.hpp +touch rdk/ds/videoResolution.hpp +touch rdk/ds/frontPanelIndicator.hpp +touch rdk/ds/frontPanelConfig.hpp +touch rdk/ds/frontPanelTextDisplay.hpp + +# Other stubs +touch audiocapturemgr/audiocapturemgr_iarm.h +touch rdk_logger_milestone.h +touch btmgr.h +touch proc/readproc.h +touch nopoll/nopoll.h + +# rfcapi.h (types provided via -include Rfc.h) +touch rfcapi.h + +# telemetry (types provided via -include Telemetry.h) +touch telemetry_busmessage_sender.h +touch telemetry2_0.h + +# secure_wrapper (types provided via -include secure_wrappermock.h) +touch secure_wrapper.h + +# edid / drm +touch edid-parser.hpp +touch dsFPD.h + +# safec - needs actual dummy API content +cat > safec_lib.h << 'SAFEC_EOF' +#ifndef _SAFEC_LIB_H_ +#define _SAFEC_LIB_H_ +#include +#include +#include +#ifdef SAFEC_DUMMY_API +typedef int errno_t; +#define EOK 0 + +static inline errno_t strcpy_s(char *dest, size_t dmax, const char *src) { + (void)dmax; + if(dest == NULL || src == NULL) { + return -1; + } + strcpy(dest, src); + return EOK; +} + +static inline errno_t strncpy_s(char *dest, size_t dmax, const char *src, size_t count) { + (void)dmax; + if(dest == NULL || src == NULL) { + return -1; + } + strncpy(dest, src, count); + return EOK; +} + +static inline errno_t strcat_s(char *dest, size_t dmax, const char *src) { + (void)dmax; + if(dest == NULL || src == NULL) { + return -1; + } + strcat(dest, src); + return EOK; +} + +static inline errno_t strncat_s(char *dest, size_t dmax, const char *src, size_t count) { + (void)dmax; + if(dest == NULL || src == NULL) { + return -1; + } + strncat(dest, src, count); + return EOK; +} + +static inline errno_t sprintf_s(char *dest, size_t dmax, const char *format, ...) { + va_list args; + int ret; + if(dest == NULL || format == NULL) { + return -1; + } + va_start(args, format); + ret = vsnprintf(dest, dmax, format, args); + va_end(args); + return (ret < 0) ? -1 : EOK; +} + +static inline errno_t snprintf_s(char *dest, size_t dmax, size_t count, const char *format, ...) { + va_list args; + int ret; + size_t max_len = count < dmax ? count : dmax; + if(dest == NULL || format == NULL) { + return -1; + } + va_start(args, format); + ret = vsnprintf(dest, max_len, format, args); + va_end(args); + return (ret < 0) ? -1 : EOK; +} + +static inline errno_t strcmp_s(const char *dest, size_t dmax, const char *src, int *indicator) { + (void)dmax; + if(dest == NULL || src == NULL || indicator == NULL) { + return -1; + } + *indicator = strcmp(dest, src); + return EOK; +} + +static inline errno_t strncmp_s(const char *dest, size_t dmax, const char *src, size_t count, int *indicator) { + (void)dmax; + if(dest == NULL || src == NULL || indicator == NULL) { + return -1; + } + *indicator = strncmp(dest, src, count); + return EOK; +} + +static inline char *strtok_s(char *str, size_t *strmax, const char *delim, char **context) { + char *token; + (void)strmax; + if(delim == NULL || context == NULL) { + return NULL; + } + token = strtok_r(str, delim, context); + return token; +} + +static inline errno_t memcpy_s(void *dest, size_t dmax, const void *src, size_t count) { + (void)dmax; + if(dest == NULL || src == NULL) { + return -1; + } + memcpy(dest, src, count); + return EOK; +} + +static inline errno_t memset_s(void *dest, size_t dmax, int value, size_t count) { + (void)dmax; + if(dest == NULL) { + return -1; + } + memset(dest, value, count); + return EOK; +} + +static inline errno_t memmove_s(void *dest, size_t dmax, const void *src, size_t count) { + (void)dmax; + if(dest == NULL || src == NULL) { + return -1; + } + memmove(dest, src, count); + return EOK; +} + +static inline errno_t memcmp_s(const void *dest, size_t dmax, const void *src, size_t count, int *indicator) { + (void)dmax; + if(dest == NULL || src == NULL || indicator == NULL) { + return -1; + } + *indicator = memcmp(dest, src, count); + return EOK; +} + +#define ERR_CHK(rc) do { (void)(rc); } while(0) +#endif +#endif +SAFEC_EOF + +echo "Stub headers created successfully" + +cd ${GITHUB_WORKSPACE} + +mkdir -p "${GITHUB_WORKSPACE}/install/usr/include" +printf '{}\n' > "${GITHUB_WORKSPACE}/install/usr/include/ctrlm_config_empty.json" + +# Copy system headers for compatibility +cp -r /usr/include/glib-2.0/* /usr/lib/x86_64-linux-gnu/glib-2.0/include/* "${HEADERS_DIR}/" 2>/dev/null || true + +############################ +# 7. Create stub shared libraries for linking +echo "======================================================================================" +echo "Creating stub libraries" + +STUB_LIB_DIR="$GITHUB_WORKSPACE/install/usr/lib" +mkdir -p "${STUB_LIB_DIR}" + +# Create a minimal C stub source +cat > /tmp/stub.c << 'STUB_EOF' +void __stub_placeholder(void) {} +STUB_EOF + +# Build stub .so for each missing library +for lib in xr-voice-sdk rdkversion IARMBus ds dshalcli nopoll rfcapi secure_wrapper evdev; do + gcc -shared -fPIC -o "${STUB_LIB_DIR}/lib${lib}.so" /tmp/stub.c +done + +rm /tmp/stub.c + +echo "Stub libraries created in ${STUB_LIB_DIR}" +echo "======================================================================================" +echo "build_dependencies.sh complete" diff --git a/cov_build.sh b/cov_build.sh new file mode 100644 index 00000000..8dfe3bdb --- /dev/null +++ b/cov_build.sh @@ -0,0 +1,102 @@ +#!/bin/bash +set -x +set -e +############################## +GITHUB_WORKSPACE="${PWD}" +ls -la ${GITHUB_WORKSPACE} +############################ + +# Build control (ctrlm-main) +echo "building control (ctrlm-main)" + +CTRL_STUBS="$GITHUB_WORKSPACE/entservices-testframework/Tests/mocks/control" +MOCK_DIR="$GITHUB_WORKSPACE/entservices-testframework/Tests/mocks" +HEADERS_DIR="$GITHUB_WORKSPACE/entservices-testframework/Tests/headers" +EMPTY_JSON="$GITHUB_WORKSPACE/install/usr/include/ctrlm_config_empty.json" + +cmake -G Ninja -S "$GITHUB_WORKSPACE" -B build/control \ +-DCMAKE_INSTALL_PREFIX="${GITHUB_WORKSPACE}/install/usr" \ +-DCMAKE_INSTALL_SYSCONFDIR="${GITHUB_WORKSPACE}/install/etc" \ +-DCMAKE_MODULE_PATH="${GITHUB_WORKSPACE}/install/tools/cmake" \ +-DCMAKE_VERBOSE_MAKEFILE=ON \ +-DCMAKE_PROJECT_VERSION="1.0.0" \ +-DUSE_THUNDER_R4=ON \ +-DTHUNDER=ON \ +-DTHUNDER_SECURITY=OFF \ +-DBLE_ENABLED=OFF \ +-DRF4CE_ENABLED=ON \ +-DIP_ENABLED=OFF \ +-DTELEMETRY_SUPPORT=OFF \ +-DAUTH_ENABLED=OFF \ +-DXRSR_HTTP=OFF \ +-DXRSR_SDT=OFF \ +-DBUILD_CTRLM_FACTORY=OFF \ +-DBUILD_FACTORY_TEST=OFF \ +-DUSE_SAFEC=OFF \ +-DUSE_IARM_POWER_MANAGER=OFF \ +-DBREAKPAD=OFF \ +-DFDC_ENABLED=OFF \ +-DENABLE_ASYNC_SRVR_MSG=OFF \ +-DHIDE_NON_EXTERNAL_SYMBOLS=OFF \ +-DBUILD_SYSTEM=NONE \ +-DCTRLM_UTILS_JSON_COMBINE="${GITHUB_WORKSPACE}/xr-voice-sdk/scripts/vsdk_json_combine.py" \ +-DCTRLM_UTILS_JSON_TO_HEADER="${GITHUB_WORKSPACE}/xr-voice-sdk/scripts/vsdk_json_to_header.py" \ +-DCTRLM_CONFIG_JSON_CPC="${EMPTY_JSON}" \ +-DCTRLM_CONFIG_JSON_CPC_SUB="${EMPTY_JSON}" \ +-DCTRLM_CONFIG_JSON_CPC_ADD="${EMPTY_JSON}" \ +-DCTRLM_CONFIG_JSON_MAIN_SUB="${EMPTY_JSON}" \ +-DCTRLM_CONFIG_JSON_MAIN_ADD="${EMPTY_JSON}" \ +-DCMAKE_CXX_FLAGS=" \ +-I ${CTRL_STUBS} \ +-I ${MOCK_DIR} \ +-I ${MOCK_DIR}/thunder \ +-I ${MOCK_DIR}/devicesettings \ +-I ${HEADERS_DIR} \ +-I ${HEADERS_DIR}/rdk/iarmbus \ +-I ${HEADERS_DIR}/rdk/ds \ +-I ${HEADERS_DIR}/rdk/ds-rpc \ +-I ${HEADERS_DIR}/rdk/ds-hal \ +-I ${HEADERS_DIR}/rdk/halif/ds-hal \ +-I ${HEADERS_DIR}/rdk/iarmmgrs-hal \ +-I ${HEADERS_DIR}/audiocapturemgr \ +-I ${HEADERS_DIR}/ccec/drivers \ +-I ${HEADERS_DIR}/network \ +-I ${HEADERS_DIR}/nopoll \ +-I ${GITHUB_WORKSPACE}/install/usr/include \ +-I ${GITHUB_WORKSPACE}/install/usr/include/WPEFramework \ +-I /usr/include/glib-2.0 \ +-I /usr/lib/x86_64-linux-gnu/glib-2.0/include \ +-I /usr/include/libdrm \ +-include ${MOCK_DIR}/Iarm.h \ +-include ${MOCK_DIR}/devicesettings.h \ +-include ${MOCK_DIR}/Rfc.h \ +-include ${MOCK_DIR}/Telemetry.h \ +-include ${MOCK_DIR}/secure_wrappermock.h \ +-Wall -Wno-error \ +-Wl,--unresolved-symbols=ignore-all \ +-DSAFEC_DUMMY_API \ +-DDISABLE_SECURITY_TOKEN \ +-DUSE_THUNDER_R4=ON -DTHUNDER_VERSION=4 -DTHUNDER_VERSION_MAJOR=4 -DTHUNDER_VERSION_MINOR=4" \ +-DCMAKE_C_FLAGS=" \ +-I ${CTRL_STUBS} \ +-I ${MOCK_DIR} \ +-I ${HEADERS_DIR} \ +-I ${HEADERS_DIR}/rdk/iarmbus \ +-I ${HEADERS_DIR}/rdk/ds \ +-I ${HEADERS_DIR}/rdk/iarmmgrs-hal \ +-I ${GITHUB_WORKSPACE}/install/usr/include \ +-I ${GITHUB_WORKSPACE}/install/usr/include/WPEFramework \ +-Wall -Wno-error \ +-DSAFEC_DUMMY_API \ +-DDISABLE_SECURITY_TOKEN" \ +-DCMAKE_EXE_LINKER_FLAGS="-L${GITHUB_WORKSPACE}/install/usr/lib -Wl,--unresolved-symbols=ignore-all" + + +# control's CMakeLists.txt adds -Werror via target_compile_options, which appends +# after CMAKE_CXX_FLAGS and overrides our -Wno-error. Strip it from generated build files. +find "${GITHUB_WORKSPACE}/build/control" \( -name "*.ninja" -o -name "flags.make" \) -exec sed -i 's/ -Werror\b//g' {} \; + +cmake --build build/control -j$(nproc) 2>&1 +echo "======================================================================================" +echo "control build complete" +exit 0 From f39f025755e767180c753674f80c602ca69b2e24 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Fri, 10 Apr 2026 18:59:54 +0000 Subject: [PATCH 03/72] Removing feature/** from push workflow --- .github/workflows/native_full_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/native_full_build.yml b/.github/workflows/native_full_build.yml index e22ab36b..26a556bf 100644 --- a/.github/workflows/native_full_build.yml +++ b/.github/workflows/native_full_build.yml @@ -2,7 +2,7 @@ name: Build Control Manager in Native Environment on: push: - branches: [ main, 'sprint/**', 'release/**', 'feature/**', develop ] + branches: [ main, 'sprint/**', 'release/**', develop ] pull_request: branches: [ main, 'sprint/**', 'release/**', topic/RDK*, 'feature/**', develop ] From 11c36ce86eb6f2f81aec1c76f4d0be0cd8d44174 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Fri, 10 Apr 2026 19:04:20 +0000 Subject: [PATCH 04/72] Updates --- .github/workflows/native_full_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/native_full_build.yml b/.github/workflows/native_full_build.yml index 26a556bf..730aa43c 100644 --- a/.github/workflows/native_full_build.yml +++ b/.github/workflows/native_full_build.yml @@ -4,7 +4,7 @@ on: push: branches: [ main, 'sprint/**', 'release/**', develop ] pull_request: - branches: [ main, 'sprint/**', 'release/**', topic/RDK*, 'feature/**', develop ] + branches: [ main, 'sprint/**', 'release/**', topic/RDK*, develop ] permissions: contents: read From ae4a2ae3b44d9e5d8b5918d2c649cfc13937b963 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Fri, 10 Apr 2026 15:06:40 -0400 Subject: [PATCH 05/72] Update cov_build.sh Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- cov_build.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/cov_build.sh b/cov_build.sh index 8dfe3bdb..e247bc70 100644 --- a/cov_build.sh +++ b/cov_build.sh @@ -73,7 +73,6 @@ cmake -G Ninja -S "$GITHUB_WORKSPACE" -B build/control \ -include ${MOCK_DIR}/Telemetry.h \ -include ${MOCK_DIR}/secure_wrappermock.h \ -Wall -Wno-error \ --Wl,--unresolved-symbols=ignore-all \ -DSAFEC_DUMMY_API \ -DDISABLE_SECURITY_TOKEN \ -DUSE_THUNDER_R4=ON -DTHUNDER_VERSION=4 -DTHUNDER_VERSION_MAJOR=4 -DTHUNDER_VERSION_MINOR=4" \ From a7950c857ef1ca42a97dd9a02d25b56949a10891 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Fri, 10 Apr 2026 15:07:38 -0400 Subject: [PATCH 06/72] Update cov_build.sh Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- cov_build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cov_build.sh b/cov_build.sh index e247bc70..68928176 100644 --- a/cov_build.sh +++ b/cov_build.sh @@ -93,7 +93,7 @@ cmake -G Ninja -S "$GITHUB_WORKSPACE" -B build/control \ # control's CMakeLists.txt adds -Werror via target_compile_options, which appends # after CMAKE_CXX_FLAGS and overrides our -Wno-error. Strip it from generated build files. -find "${GITHUB_WORKSPACE}/build/control" \( -name "*.ninja" -o -name "flags.make" \) -exec sed -i 's/ -Werror\b//g' {} \; +find "${GITHUB_WORKSPACE}/build/control" \( -name "*.ninja" -o -name "flags.make" \) -exec sed -i 's/\(^\|[[:space:]]\)-Werror\([[:space:]]\|$\)/\1\2/g' {} \; cmake --build build/control -j$(nproc) 2>&1 echo "======================================================================================" From f1c00d941ecaabacdb6a3c782bae3873da93f96b Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Fri, 10 Apr 2026 19:57:10 +0000 Subject: [PATCH 07/72] Update --- build_dependencies.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_dependencies.sh b/build_dependencies.sh index f6926abd..8e0de41b 100644 --- a/build_dependencies.sh +++ b/build_dependencies.sh @@ -41,7 +41,7 @@ git clone --depth 1 --branch R4.4.3 https://github.com/rdkcentral/ThunderTools.g git clone --depth 1 --branch R4.4.1 https://github.com/rdkcentral/Thunder.git -git clone --depth 1 --branch feature/RDKEMW-10727 https://github.com/rdkcentral/entservices-apis.git +git clone --depth 1 --branch develop https://github.com/rdkcentral/entservices-apis.git git clone --depth 1 --branch feature/RDKEMW-14537 https://$GITHUB_TOKEN@github.com/rdkcentral/entservices-testframework.git From 97c049ea8e9d2b548b5fa382579997359850d3b1 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Tue, 14 Apr 2026 15:44:15 +0000 Subject: [PATCH 08/72] Moving mock headers out of test framework --- .github/workflows/native_full_build.yml | 8 +- .../build_dependencies.sh | 14 +- cov_build.sh => ci/cov_build.sh | 6 +- ci/mocks/Iarm.h | 923 +++++++ ci/mocks/Rfc.h | 114 + ci/mocks/Telemetry.h | 61 + ci/mocks/control/comcastIrKeyCodes.h | 49 + ci/mocks/control/irMgr.h | 42 + ci/mocks/control/rdkversion.h | 33 + ci/mocks/control/rdkx_logger.h | 204 ++ ci/mocks/control/xr_fdc.h | 23 + ci/mocks/control/xr_mq.h | 50 + ci/mocks/control/xr_timestamp.h | 44 + ci/mocks/control/xr_voice_sdk.h | 42 + ci/mocks/control/xraudio.h | 47 + ci/mocks/control/xrsr.h | 347 +++ ci/mocks/control/xrsv_http.h | 57 + ci/mocks/control/xrsv_ws_nextgen.h | 98 + ci/mocks/devicesettings.h | 2297 +++++++++++++++++ ci/mocks/mfrTypes.h | 651 +++++ ci/mocks/secure_wrappermock.h | 37 + ...010-R4.4-Add-support-for-project-dir.patch | 116 + .../1004-Add-support-for-project-dir.patch | 42 + ci/patches/RDKEMW-733-Add-ENTOS-IDS.patch | 21 + ...act_Alt_Based_On_ThunderTools_R4.4.3.patch | 20 + ci/patches/error_code_R4_4.patch | 64 + 26 files changed, 5393 insertions(+), 17 deletions(-) rename build_dependencies.sh => ci/build_dependencies.sh (93%) rename cov_build.sh => ci/cov_build.sh (94%) create mode 100644 ci/mocks/Iarm.h create mode 100644 ci/mocks/Rfc.h create mode 100644 ci/mocks/Telemetry.h create mode 100644 ci/mocks/control/comcastIrKeyCodes.h create mode 100644 ci/mocks/control/irMgr.h create mode 100644 ci/mocks/control/rdkversion.h create mode 100644 ci/mocks/control/rdkx_logger.h create mode 100644 ci/mocks/control/xr_fdc.h create mode 100644 ci/mocks/control/xr_mq.h create mode 100644 ci/mocks/control/xr_timestamp.h create mode 100644 ci/mocks/control/xr_voice_sdk.h create mode 100644 ci/mocks/control/xraudio.h create mode 100644 ci/mocks/control/xrsr.h create mode 100644 ci/mocks/control/xrsv_http.h create mode 100644 ci/mocks/control/xrsv_ws_nextgen.h create mode 100644 ci/mocks/devicesettings.h create mode 100644 ci/mocks/mfrTypes.h create mode 100755 ci/mocks/secure_wrappermock.h create mode 100755 ci/patches/00010-R4.4-Add-support-for-project-dir.patch create mode 100755 ci/patches/1004-Add-support-for-project-dir.patch create mode 100755 ci/patches/RDKEMW-733-Add-ENTOS-IDS.patch create mode 100755 ci/patches/Use_Legact_Alt_Based_On_ThunderTools_R4.4.3.patch create mode 100644 ci/patches/error_code_R4_4.patch diff --git a/.github/workflows/native_full_build.yml b/.github/workflows/native_full_build.yml index 730aa43c..cff24b88 100644 --- a/.github/workflows/native_full_build.yml +++ b/.github/workflows/native_full_build.yml @@ -22,12 +22,8 @@ jobs: - name: build dependencies run: | - sh -x build_dependencies.sh - env: - GITHUB_TOKEN: ${{ secrets.RDKCM_RDKE }} + sh -x ci/build_dependencies.sh - name: cov build run: | - sh -x cov_build.sh - env: - GITHUB_TOKEN: ${{ secrets.RDKCM_RDKE }} + sh -x ci/cov_build.sh diff --git a/build_dependencies.sh b/ci/build_dependencies.sh similarity index 93% rename from build_dependencies.sh rename to ci/build_dependencies.sh index 8e0de41b..d46c2575 100644 --- a/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -43,8 +43,6 @@ git clone --depth 1 --branch R4.4.1 https://github.com/rdkcentral/Thunder.git git clone --depth 1 --branch develop https://github.com/rdkcentral/entservices-apis.git -git clone --depth 1 --branch feature/RDKEMW-14537 https://$GITHUB_TOKEN@github.com/rdkcentral/entservices-testframework.git - git clone --depth 1 https://github.com/rdkcentral/xr-voice-sdk.git ############################ @@ -52,7 +50,7 @@ git clone --depth 1 https://github.com/rdkcentral/xr-voice-sdk.git echo "======================================================================================" echo "building thunderTools" cd ThunderTools -patch -p1 < $GITHUB_WORKSPACE/entservices-testframework/patches/00010-R4.4-Add-support-for-project-dir.patch +patch -p1 < $GITHUB_WORKSPACE/ci/patches/00010-R4.4-Add-support-for-project-dir.patch cd - cmake -G Ninja -S ThunderTools -B build/ThunderTools \ @@ -69,10 +67,10 @@ echo "========================================================================== echo "building thunder" cd Thunder -patch -p1 < $GITHUB_WORKSPACE/entservices-testframework/patches/Use_Legact_Alt_Based_On_ThunderTools_R4.4.3.patch -patch -p1 < $GITHUB_WORKSPACE/entservices-testframework/patches/error_code_R4_4.patch -patch -p1 < $GITHUB_WORKSPACE/entservices-testframework/patches/1004-Add-support-for-project-dir.patch -patch -p1 < $GITHUB_WORKSPACE/entservices-testframework/patches/RDKEMW-733-Add-ENTOS-IDS.patch +patch -p1 < $GITHUB_WORKSPACE/ci/patches/Use_Legact_Alt_Based_On_ThunderTools_R4.4.3.patch +patch -p1 < $GITHUB_WORKSPACE/ci/patches/error_code_R4_4.patch +patch -p1 < $GITHUB_WORKSPACE/ci/patches/1004-Add-support-for-project-dir.patch +patch -p1 < $GITHUB_WORKSPACE/ci/patches/RDKEMW-733-Add-ENTOS-IDS.patch cd - cmake -G Ninja -S Thunder -B build/Thunder \ @@ -107,7 +105,7 @@ cmake --build build/entservices-apis --target install echo "======================================================================================" echo "Creating stub headers" -HEADERS_DIR="$GITHUB_WORKSPACE/entservices-testframework/Tests/headers" +HEADERS_DIR="$GITHUB_WORKSPACE/ci/headers" mkdir -p "${HEADERS_DIR}" mkdir -p "${HEADERS_DIR}/rdk/iarmbus" mkdir -p "${HEADERS_DIR}/rdk/ds" diff --git a/cov_build.sh b/ci/cov_build.sh similarity index 94% rename from cov_build.sh rename to ci/cov_build.sh index 68928176..e8348b96 100644 --- a/cov_build.sh +++ b/ci/cov_build.sh @@ -9,9 +9,9 @@ ls -la ${GITHUB_WORKSPACE} # Build control (ctrlm-main) echo "building control (ctrlm-main)" -CTRL_STUBS="$GITHUB_WORKSPACE/entservices-testframework/Tests/mocks/control" -MOCK_DIR="$GITHUB_WORKSPACE/entservices-testframework/Tests/mocks" -HEADERS_DIR="$GITHUB_WORKSPACE/entservices-testframework/Tests/headers" +CTRL_STUBS="$GITHUB_WORKSPACE/ci/mocks/control" +MOCK_DIR="$GITHUB_WORKSPACE/ci/mocks" +HEADERS_DIR="$GITHUB_WORKSPACE/ci/headers" EMPTY_JSON="$GITHUB_WORKSPACE/install/usr/include/ctrlm_config_empty.json" cmake -G Ninja -S "$GITHUB_WORKSPACE" -B build/control \ diff --git a/ci/mocks/Iarm.h b/ci/mocks/Iarm.h new file mode 100644 index 00000000..03cd08d4 --- /dev/null +++ b/ci/mocks/Iarm.h @@ -0,0 +1,923 @@ +/** +* If not stated otherwise in this file or this component's LICENSE +* file the following copyright and licenses apply: +* +* Copyright 2024 RDK Management +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +**/ + +#pragma once + +#include +#include + +#include "mfrTypes.h" + +typedef int IARM_EventId_t; + +typedef enum _IARM_Result_t { + IARM_RESULT_SUCCESS, + IARM_RESULT_INVALID_PARAM, + IARM_RESULT_INVALID_STATE, + IARM_RESULT_IPCCORE_FAIL, + IARM_RESULT_OOM, +} IARM_Result_t; + +#define IARM_BUS_DAEMON_NAME "Daemon" + +typedef IARM_Result_t (*IARM_BusCall_t)(void* arg); +typedef void (*IARM_EventHandler_t)(const char* owner, IARM_EventId_t eventId, void* data, size_t len); + +class IarmBusImpl { +public: + virtual ~IarmBusImpl() = default; + + virtual IARM_Result_t IARM_Bus_Init(const char* name) = 0; + virtual IARM_Result_t IARM_Bus_Connect() = 0; + virtual IARM_Result_t IARM_Bus_Disconnect() = 0; + virtual IARM_Result_t IARM_Bus_Term() = 0; + virtual IARM_Result_t IARM_Bus_IsConnected(const char* memberName, int* isRegistered) = 0; + virtual IARM_Result_t IARM_Bus_RegisterEventHandler(const char* ownerName, IARM_EventId_t eventId, IARM_EventHandler_t handler) = 0; + virtual IARM_Result_t IARM_Bus_UnRegisterEventHandler(const char* ownerName, IARM_EventId_t eventId) = 0; + virtual IARM_Result_t IARM_Bus_RemoveEventHandler(const char* ownerName, IARM_EventId_t eventId, IARM_EventHandler_t handler) = 0; + virtual IARM_Result_t IARM_Bus_Call(const char* ownerName, const char* methodName, void* arg, size_t argLen) = 0; + virtual IARM_Result_t IARM_Bus_BroadcastEvent(const char *ownerName, IARM_EventId_t eventId, void *arg, size_t argLen) = 0; + virtual IARM_Result_t IARM_Bus_RegisterCall(const char* methodName, IARM_BusCall_t handler) = 0; + virtual IARM_Result_t IARM_Bus_Call_with_IPCTimeout(const char *ownerName, const char *methodName, void *arg, size_t argLen, int timeout) = 0; +}; + +class IarmBus { +protected: + static IarmBusImpl* impl; +public: + IarmBus(); + IarmBus(const IarmBus &obj) = delete; // deleted copy constructor so that copy of the instance cannot be created. + static void setImpl(IarmBusImpl* newImpl); + static IARM_Result_t IARM_Bus_Init(const char* name); + static IARM_Result_t IARM_Bus_Connect(); + static IARM_Result_t IARM_Bus_Disconnect(); + static IARM_Result_t IARM_Bus_Term(); + static IARM_Result_t IARM_Bus_IsConnected(const char* memberName, int* isRegistered); + static IARM_Result_t IARM_Bus_RegisterEventHandler(const char* ownerName, IARM_EventId_t eventId, IARM_EventHandler_t handler); + static IARM_Result_t IARM_Bus_UnRegisterEventHandler(const char* ownerName, IARM_EventId_t eventId); + static IARM_Result_t IARM_Bus_RemoveEventHandler(const char* ownerName, IARM_EventId_t eventId, IARM_EventHandler_t handler); + static IARM_Result_t IARM_Bus_Call(const char* ownerName, const char* methodName, void* arg, size_t argLen); + static IARM_Result_t IARM_Bus_BroadcastEvent(const char *ownerName, IARM_EventId_t eventId, void *arg, size_t argLen) ; + static IARM_Result_t IARM_Bus_RegisterCall(const char* methodName, IARM_BusCall_t handler); + static IARM_Result_t IARM_Bus_Call_with_IPCTimeout(const char *ownerName, const char *methodName, void *arg, size_t argLen, int timeout); +}; + +extern IARM_Result_t (*IARM_Bus_Init)(const char*); +extern IARM_Result_t (*IARM_Bus_Connect)(); +extern IARM_Result_t (*IARM_Bus_Disconnect)(); +extern IARM_Result_t (*IARM_Bus_Term)(); +extern IARM_Result_t (*IARM_Bus_IsConnected)(const char*,int*); +extern IARM_Result_t (*IARM_Bus_RegisterEventHandler)(const char*,IARM_EventId_t,IARM_EventHandler_t); +extern IARM_Result_t (*IARM_Bus_UnRegisterEventHandler)(const char*,IARM_EventId_t); +extern IARM_Result_t (*IARM_Bus_RemoveEventHandler)(const char*,IARM_EventId_t,IARM_EventHandler_t); +extern IARM_Result_t (*IARM_Bus_Call)(const char*,const char*,void*,size_t); +extern IARM_Result_t (*IARM_Bus_BroadcastEvent)(const char *,IARM_EventId_t,void *,size_t); +extern IARM_Result_t (*IARM_Bus_RegisterCall)(const char*,IARM_BusCall_t); +extern IARM_Result_t (*IARM_Bus_Call_with_IPCTimeout)(const char*,const char*,void*,size_t,int); +/* ctrlm-main uses IARM_Bus_RegisterEvent as a plain function (defined in stubs_iarm.cpp) */ +extern IARM_Result_t IARM_Bus_RegisterEvent(IARM_EventId_t maxEventId); + +#define IARM_BUS_COMMON_API_SysModeChange "SysModeChange" + +typedef enum _IARM_Bus_Daemon_PowerState_t { + IARM_BUS_PWRMGR_POWERSTATE_OFF, + IARM_BUS_PWRMGR_POWERSTATE_STANDBY, + IARM_BUS_PWRMGR_POWERSTATE_ON, + IARM_BUS_PWRMGR_POWERSTATE_STANDBY_LIGHT_SLEEP, + IARM_BUS_PWRMGR_POWERSTATE_STANDBY_DEEP_SLEEP +} IARM_Bus_PowerState_t; + +typedef IARM_Bus_PowerState_t IARM_Bus_PWRMgr_PowerState_t; + +typedef enum _IARM_Bus_Daemon_SysMode_t { + IARM_BUS_SYS_MODE_NORMAL, + IARM_BUS_SYS_MODE_EAS, + IARM_BUS_SYS_MODE_WAREHOUSE +} IARM_Bus_Daemon_SysMode_t; + +#define IARMBUS_AUDIOCAPTUREMGR_NAME "audiocapturemgr" +#define IARMBUS_AUDIOCAPTUREMGR_REQUEST_SAMPLE "requestSample" + +#define IARMBUS_AUDIOCAPTUREMGR_OPEN "open" +#define IARMBUS_AUDIOCAPTUREMGR_CLOSE "close" +#define IARMBUS_AUDIOCAPTUREMGR_START "start" +#define IARMBUS_AUDIOCAPTUREMGR_STOP "stop" +#define IARMBUS_AUDIOCAPTUREMGR_GET_DEFAULT_AUDIO_PROPS "getDefaultAudioProperties" +#define IARMBUS_AUDIOCAPTUREMGR_GET_AUDIO_PROPS "getAudioProperties" +#define IARMBUS_AUDIOCAPTUREMGR_GET_OUTPUT_PROPS "getOutputProperties" +#define IARMBUS_AUDIOCAPTUREMGR_SET_AUDIO_PROPERTIES "setAudioProperties" +#define IARMBUS_AUDIOCAPTUREMGR_SET_OUTPUT_PROPERTIES "setOutputProperties" + +#define AUDIOCAPTUREMGR_FILENAME_PREFIX "audio_sample" +#define AUDIOCAPTUREMGR_FILE_PATH "/opt/" + +#define DATA_CAPTURE_IARM_EVENT_AUDIO_CLIP_READY 100 + +#define ACM_RESULT_GENERAL_FAILURE 0 +#define ACM_RESULT_PRECAPTURE_NOT_SUPPORTED 1 +#define ACM_RESULT_STREAM_UNAVAILABLE 2 +#define ACM_RESULT_DURATION_OUT_OF_BOUNDS 3 +#define BUFFERED_FILE_OUTPUT "" + +enum Format { + acmFormate16BitStereo, + acmFormate16BitMonoLeft, + acmFormate16BitMonoRight, + acmFormate16BitMono, + acmFormate24BitStereo, + acmFormate24Bit5_1 +}; + +enum Sampling_frequency { + acmFreqe48000, + acmFreqe44100, + acmFreqe32000, + acmFreqe24000, + acmFreqe16000 +}; + +namespace audiocapturemgr { +using session_id_t = int; + +struct audio_properties_ifce_t { + Format format; + Sampling_frequency sampling_frequency; +}; +} + +struct iarmbus_notification_payload_t { + char dataLocator[64]; +}; + +struct iarmbus_acm_arg_t { + struct iarmbus_open_args { + int source; + std::string output_type; + }; + + struct iarmbus_request_payload_t { + float duration; + bool is_precapture; + }; + + struct output_t { + unsigned int buffer_duration; + unsigned int max_buffer_duration; + }; + + struct arg_output_props_t { + output_t output; + }; + + struct Details { + iarmbus_open_args arg_open; + audiocapturemgr::audio_properties_ifce_t arg_audio_properties; + iarmbus_request_payload_t arg_sample_request; + arg_output_props_t arg_output_props; + }; + + int session_id; + int result; + Details details; +}; + +#define IARM_BUS_CECMGR_NAME "CECMgr" +#define IARM_BUS_CECMGR_MAX_DATA_LENGTH 62 +#define IARM_BUS_CECMGR_API_Send "Send" + +typedef struct _IARM_Bus_CECMgr_Send_Param_t { + uint8_t length; + uint8_t data[IARM_BUS_CECMGR_MAX_DATA_LENGTH + 1]; + uint8_t retVal; +} IARM_Bus_CECMgr_Send_Param_t; + +#define IARM_BUS_DEEPSLEEPMGR_NAME "DEEPSLEEPMgr" + +#define IARM_BUS_DEEPSLEEPMGR_API_GetLastWakeupReason "GetLastWakeupReason" +#define IARM_BUS_DEEPSLEEPMGR_API_GetLastWakeupKeyCode "GetLastWakeupKeycode" + +typedef enum _DeepSleep_WakeupReason_t { + DEEPSLEEP_WAKEUPREASON_IR = 0, + DEEPSLEEP_WAKEUPREASON_RCU_BT, + DEEPSLEEP_WAKEUPREASON_RCU_RF4CE, + DEEPSLEEP_WAKEUPREASON_GPIO, + DEEPSLEEP_WAKEUPREASON_LAN, + DEEPSLEEP_WAKEUPREASON_WLAN, + DEEPSLEEP_WAKEUPREASON_TIMER, + DEEPSLEEP_WAKEUPREASON_FRONT_PANEL, + DEEPSLEEP_WAKEUPREASON_WATCHDOG, + DEEPSLEEP_WAKEUPREASON_SOFTWARE_RESET, + DEEPSLEEP_WAKEUPREASON_THERMAL_RESET, + DEEPSLEEP_WAKEUPREASON_WARM_RESET, + DEEPSLEEP_WAKEUPREASON_COLDBOOT, + DEEPSLEEP_WAKEUPREASON_STR_AUTH_FAILURE, + DEEPSLEEP_WAKEUPREASON_CEC, + DEEPSLEEP_WAKEUPREASON_PRESENCE, + DEEPSLEEP_WAKEUPREASON_VOICE, + DEEPSLEEP_WAKEUPREASON_UNKNOWN +} DeepSleep_WakeupReason_t; + +typedef struct _DeepSleepMgr_WakeupKeyCode_Param_t { + unsigned int keyCode; +} DeepSleepMgr_WakeupKeyCode_Param_t; + +#define IARM_BUS_MFRLIB_NAME "MFRLib" +#define IARM_BUS_MFRLIB_API_SetBootLoaderPattern "mfrSetBootloaderPattern" +#define IARM_BUS_MFRLIB_API_SetBlSplashScreen "mfrSetBlSplashScreen" +#define IARM_BUS_MFRLIB_API_GetSerializedData "mfrGetManufacturerData" +#define IARM_BUS_MFRLIB_API_SetFsrFlag "mfrSetFSRflag" +#define IARM_BUS_MFRLIB_API_GetFsrFlag "mfrGetFSRflag" +#define IARM_BUS_MFRLIB_API_GetTemperature "mfrGetTemperature" /*!< Gets the thermal temperature for the device*/ +#define IARM_BUS_MFRLIB_API_SetTemperatureThresholds "mfrSetTempThresholds" /*!< Sets the thermal threshold for the device*/ +#define IARM_BUS_MFRLIB_API_GetTemperatureThresholds "mfrGetTempThresholds" /*!< Gets the thermal threshold for the device*/ + +typedef struct _IARM_Bus_MFRLib_SetBLPattern_Param_t { + mfrBlPattern_t pattern; +} IARM_Bus_MFRLib_SetBLPattern_Param_t; + +typedef struct _IARM_Bus_MFRLib_GetSerializedData_Param_t { + mfrSerializedType_t type; + char buffer[1280]; + int bufLen; +} IARM_Bus_MFRLib_GetSerializedData_Param_t; + +#define PWRMGR_MAX_REBOOT_REASON_LENGTH 100 + +#define MAX_PWR_STATE_BEF_REBOOR_STR_LEN (32) +#define IARM_BUS_PWRMGR_API_GetPowerStateBeforeReboot "GetPowerStateBeforeReboot" +#define IARM_BUS_PWRMGR_API_SetStandbyVideoState "SetStandbyVideoState" +#define IARM_BUS_PWRMGR_API_GetStandbyVideoState "GetStandbyVideoState" +#define IARM_BUS_PWRMGR_API_SetNetworkStandbyMode "SetNetworkStandbyMode" +#define IARM_BUS_PWRMGR_API_GetNetworkStandbyMode "GetNetworkStandbyMode" +#define IARM_BUS_PWRMGR_API_Reboot "performReboot" +#define IARM_BUS_PWRMGR_API_WareHouseClear "WarehouseClear" /*!< */ +#define IARM_BUS_PWRMGR_API_ColdFactoryReset "ColdFactoryReset" /*!< Reset the box to cold factory state*/ +#define IARM_BUS_PWRMGR_API_FactoryReset "FactoryReset" /*!< Reset the box to factory state*/ +#define IARM_BUS_PWRMGR_API_UserFactoryReset "UserFactoryReset" /*!< Reset the box to user factory state*/ +#define IARM_BUS_PWRMGR_API_WareHouseReset "WareHouseReset" /*!< Reset the box to warehouse state*/ + +typedef struct _IARM_Bus_PWRMgr_NetworkStandbyMode_Param_t { + bool bStandbyMode; +} IARM_Bus_PWRMgr_NetworkStandbyMode_Param_t; + +typedef struct _IARM_Bus_PWRMgr_GetPowerStateBeforeReboot_Param_t { + char powerStateBeforeReboot[MAX_PWR_STATE_BEF_REBOOR_STR_LEN]; +} IARM_Bus_PWRMgr_GetPowerStateBeforeReboot_Param_t; + +typedef struct _IARM_Bus_PWRMgr_SetDeepSleepTimeOut_Param_t { + unsigned int timeout; +} IARM_Bus_PWRMgr_SetDeepSleepTimeOut_Param_t; + +typedef enum _IARM_Bus_PWRMgr_ThermalState_t { + IARM_BUS_PWRMGR_TEMPERATURE_NORMAL = 0, + IARM_BUS_PWRMGR_TEMPERATURE_HIGH, + IARM_BUS_PWRMGR_TEMPERATURE_CRITICAL +} IARM_Bus_PWRMgr_ThermalState_t; + +typedef enum _WakeupSrcType_t { + WAKEUPSRC_VOICE = 0, + WAKEUPSRC_PRESENCE_DETECTION, + WAKEUPSRC_BLUETOOTH, + WAKEUPSRC_WIFI, + WAKEUPSRC_IR, + WAKEUPSRC_POWER_KEY, + WAKEUPSRC_TIMER, + WAKEUPSRC_CEC, + WAKEUPSRC_LAN, + WAKEUPSRC_MAX +} WakeupSrcType_t; + +typedef struct _PWRMgr_EventData_t { + union { + struct _MODE_DATA { + IARM_Bus_PWRMgr_PowerState_t curState; + IARM_Bus_PWRMgr_PowerState_t newState; + uint32_t deep_sleep_timeout; + bool nwStandbyMode; + } state; + struct _THERM_DATA { + IARM_Bus_PWRMgr_ThermalState_t curLevel; + IARM_Bus_PWRMgr_ThermalState_t newLevel; + float curTemperature; + } therm; + bool bNetworkStandbyMode; + int32_t reset_sequence_progress; + } data; +} IARM_Bus_PWRMgr_EventData_t; + +typedef struct _IARM_Bus_PWRMgr_GetThermalState_Param_t { + IARM_Bus_PWRMgr_ThermalState_t curLevel; + float curTemperature; +} IARM_Bus_PWRMgr_GetThermalState_Param_t; + +typedef struct _IARM_Bus_PWRMgr_GetTempThresholds_Param_t { + float tempHigh; + float tempCritical; +} IARM_Bus_PWRMgr_GetTempThresholds_Param_t; + +typedef struct _IARM_Bus_PWRMgr_SetTempThresholds_Param_t { + float tempHigh; + float tempCritical; +} IARM_Bus_PWRMgr_SetTempThresholds_Param_t; + +typedef struct _IARM_Bus_PWRMgr_GetOvertempGraceInterval_Param_t { + int graceInterval; +} IARM_Bus_PWRMgr_GetOvertempGraceInterval_Param_t; + +typedef struct _IARM_Bus_PWRMgr_SetOvertempGraceInterval_Param_t { + int graceInterval; +} IARM_Bus_PWRMgr_SetOvertempGraceInterval_Param_t; + +typedef struct _IARM_Bus_CommonAPI_SysModeChange_Param_t { + IARM_Bus_Daemon_SysMode_t oldMode; + IARM_Bus_Daemon_SysMode_t newMode; +} IARM_Bus_CommonAPI_SysModeChange_Param_t; + +typedef enum _PWRMgr_EventId_t { + IARM_BUS_PWRMGR_EVENT_MODECHANGED = 0, + IARM_BUS_PWRMGR_EVENT_DEEPSLEEP_TIMEOUT, + IARM_BUS_PWRMGR_EVENT_RESET_SEQUENCE, + IARM_BUS_PWRMGR_EVENT_REBOOTING, + IARM_BUS_PWRMGR_EVENT_THERMAL_MODECHANGED, + IARM_BUS_PWRMGR_EVENT_WAREHOUSEOPS_STATUSCHANGED, + IARM_BUS_PWRMGR_EVENT_NETWORK_STANDBYMODECHANGED, + IARM_BUS_PWRMGR_EVENT_MAX, + IARM_BUS_DSMGR_EVENT_ATMOS_CAPS_CHANGED, +} IARM_Bus_PWRMgr_EventId_t; + +typedef struct _IARM_Bus_PWRMgr_RebootParam_t { + char reboot_reason_custom[PWRMGR_MAX_REBOOT_REASON_LENGTH]; + char reboot_reason_other[PWRMGR_MAX_REBOOT_REASON_LENGTH]; + char requestor[PWRMGR_MAX_REBOOT_REASON_LENGTH]; +} IARM_Bus_PWRMgr_RebootParam_t; + +#define IARM_BUS_PWRMGR_NAME "PWRMgr" +#define IARM_BUS_PWRMGR_API_SetPowerState "SetPowerState" +#define IARM_BUS_PWRMGR_API_GetPowerState "GetPowerState" + +typedef struct _IARM_Bus_PWRMgr_SetPowerState_Param_t { + IARM_Bus_PWRMgr_PowerState_t newState; + int keyCode; +} IARM_Bus_PWRMgr_SetPowerState_Param_t; + +typedef struct _IARM_Bus_PWRMgr_GetPowerState_Param_t { + IARM_Bus_PWRMgr_PowerState_t curState; + IARM_Bus_PowerState_t prevState; +} IARM_Bus_PWRMgr_GetPowerState_Param_t; + +typedef struct _IARM_BUS_PWRMgr_DeepSleepTimeout_EventData_t { + unsigned int timeout; /*!< Timeout for deep sleep in seconds*/ +} IARM_BUS_PWRMgr_DeepSleepTimeout_EventData_t; + +#define IARM_BUS_PWRMGR_API_GetThermalState "GetThermalState" +#define IARM_BUS_PWRMGR_API_GetTemperatureThresholds "GetTemperatureThresholds" +#define IARM_BUS_PWRMGR_API_SetTemperatureThresholds "SetTemperatureThresholds" +#define IARM_BUS_PWRMGR_API_GetOvertempGraceInterval "GetOvertempGraceInterval" +#define IARM_BUS_PWRMGR_API_SetOvertempGraceInterval "SetOvertempGraceInterval" +#define IARM_BUS_PWRMGR_API_GetLastWakeupReason "GetLastWakeupReason" +#define IARM_BUS_PWRMGR_API_GetLastWakeupKeyCode "GetLastWakeupKeyCode" + +/** + * @brief Structure which holds the wakeup source type and the value to be set and the power state. + */ +typedef struct _IARM_Bus_PWRMgr_WakeupSrcConfig_Param_t{ + uint32_t pwrMode; + uint32_t srcType; + uint32_t config; +} IARM_Bus_PWRMgr_WakeupSrcConfig_Param_t; +/** + * @brief Structure which holds the ware house reset time. + */ +typedef struct _IARM_Bus_PWRMgr_WareHouseReset_Param_t { + bool suppressReboot; /*!< STB should not be rebooted */ +} IARM_Bus_PWRMgr_WareHouseReset_Param_t; + +/** + * @brief Enumerator which represents the possible warehouse ops + */ +typedef enum _IARM_Bus_PWRMgr_WareHouseOpsStatus_t{ + IARM_BUS_PWRMGR_WAREHOUSE_COMPLETED = 0, /* warehouse operation completed sucessfully */ + IARM_BUS_PWRMGR_WAREHOUSE_INPROGRESS, /* warehouse operation in progress*/ + IARM_BUS_PWRMGR_WAREHOUSE_FAILED, /* warehouse operation failed.*/ +} IARM_Bus_PWRMgr_WareHouseOpsStatus_t; + +/** + * @brief Enumerator which represents the possible warehouse ops + */ +typedef enum _IARM_Bus_PWRMgr_WareHouseOps_t{ + IARM_BUS_PWRMGR_WAREHOUSE_RESET = 0, /* warehouse reset */ + IARM_BUS_PWRMGR_WAREHOUSE_CLEAR, /* warehouse clear*/ +} IARM_Bus_PWRMgr_WareHouseOps_t; + +/** + * @brief Structure which holds warehouse opn status value. + */ +typedef struct _IARM_BUS_PWRMgr_WareHouseOpn_EventData_t { + IARM_Bus_PWRMgr_WareHouseOps_t wareHouseOpn; /*!< WareHouse operation*/ + IARM_Bus_PWRMgr_WareHouseOpsStatus_t status; /*!< WareHouse operation status*/ +} IARM_BUS_PWRMgr_WareHouseOpn_EventData_t; + +#define IARM_BUS_PWRMGR_API_SetWakeupSrcConfig "setWakeupSrcConfig" +#define IARM_BUS_PWRMGR_API_GetWakeupSrcConfig "getWakeupSrcConfig" /*!< gets wakup configuration*/ + +#define IARM_BUS_SYSMGR_NAME "SYSMgr" +#define IARM_BUS_SYSMGR_API_GetSystemStates "GetSystemStates" + +/** + * @brief Structure which holds RFC device management update information. + */ +typedef struct _IARM_BUS_SYSMGR_DeviceMgtUpdateInfo_Param_t +{ + char source[10]; /*!< Device Management Update source. Ex: rfc */ + char type[10]; /*!< Device Management Update type. Ex: initial */ + bool status; /*!< Device Management Update status. true/false */ +} IARM_BUS_SYSMGR_DeviceMgtUpdateInfo_Param_t; + +typedef enum _SYSMgr_EventId_t { + IARM_BUS_SYSMGR_EVENT_SYSTEMSTATE, + IARM_BUS_SYSMGR_EVENT_XUPNP_DATA_REQUEST, /*!< Xupnp data request frm Receiver to UPNP*/ + IARM_BUS_SYSMGR_EVENT_XUPNP_DATA_UPDATE, /*!< Xupnp data frm UPNP to Receiver*/ + IARM_BUS_SYSMGR_EVENT_IMAGE_DNLD, /*Image download status to Receiver */ + IARM_BUS_SYSMGR_EVENT_CARD_FWDNLD, /*!< CARD FW download event to Receiver - Valid on some product's CA*/ + IARM_BUS_SYSMGR_EVENT_HDCP_PROFILE_UPDATE, /*!< HDCP Profile Update */ + IARM_BUS_SYSMGR_EVENT_INTRUSION, /*!< Intrusion Detection */ + IARM_BUS_SYSMGR_EVENT_EISS_FILTER_STATUS, /*!< EISS Filter status event */ + IARM_BUS_SYSMGR_EVENT_EISS_APP_ID_UPDATE, /*!< EISS App ID update */ + IARM_BUS_SYSMGR_EVENT_KEYCODE_LOGGING_CHANGED, /*!< Key Code logging status update */ + IARM_BUS_SYSMGR_EVENT_USB_MOUNT_CHANGED, /*!< Fires when USB mounts change */ + IARM_BUS_SYSMGR_EVENT_APP_RELEASE_FOCUS, /*!< Application fires event to release focus*/ + IARM_BUS_SYSMGR_EVENT_DEVICE_UPDATE_RECEIVED, /*!< Received Device Management update information */ + IARM_BUS_SYSMGR_EVENT_MAX /*!< Max Event Id */ +} IARM_Bus_SYSMgr_EventId_t; + +typedef struct _IARM_BUS_SYSMGR_KEYCodeLoggingInfo_Param_t { + int logStatus; /*!< HDCP Profile Data */ +} IARM_BUS_SYSMGR_KEYCodeLoggingInfo_Param_t; + +#define IARM_BUS_SYSMGR_API_GetKeyCodeLoggingPref "GetKeyCodeLoggingPref" +#define IARM_BUS_SYSMGR_API_SetKeyCodeLoggingPref "SetKeyCodeLoggingPref" + +typedef enum _SYSMgr_SystemState_t { + IARM_BUS_SYSMGR_SYSSTATE_CHANNELMAP, //0 + IARM_BUS_SYSMGR_SYSSTATE_DISCONNECTMGR, //1 + IARM_BUS_SYSMGR_SYSSTATE_TUNEREADY, //2 + IARM_BUS_SYSMGR_SYSSTATE_EXIT_OK, //3 + IARM_BUS_SYSMGR_SYSSTATE_CMAC, //4 + IARM_BUS_SYSMGR_SYSSTATE_MOTO_ENTITLEMENT, //5 + IARM_BUS_SYSMGR_SYSSTATE_MOTO_HRV_RX, //6 + IARM_BUS_SYSMGR_SYSSTATE_CARD_CISCO_STATUS, //7 + IARM_BUS_SYSMGR_SYSSTATE_VIDEO_PRESENTING, //8 + IARM_BUS_SYSMGR_SYSSTATE_HDMI_OUT, //9 + IARM_BUS_SYSMGR_SYSSTATE_HDCP_ENABLED, //10 + IARM_BUS_SYSMGR_SYSSTATE_HDMI_EDID_READ, //11 + IARM_BUS_SYSMGR_SYSSTATE_FIRMWARE_DWNLD, //12 + IARM_BUS_SYSMGR_SYSSTATE_TIME_SOURCE, //13 + IARM_BUS_SYSMGR_SYSSTATE_TIME_ZONE, //14 + IARM_BUS_SYSMGR_SYSSTATE_CA_SYSTEM, //15 + IARM_BUS_SYSMGR_SYSSTATE_ESTB_IP, //16 + IARM_BUS_SYSMGR_SYSSTATE_ECM_IP, //17 + IARM_BUS_SYSMGR_SYSSTATE_LAN_IP, //18 + IARM_BUS_SYSMGR_SYSSTATE_MOCA, //19 + IARM_BUS_SYSMGR_SYSSTATE_DOCSIS, //20 + IARM_BUS_SYSMGR_SYSSTATE_DSG_BROADCAST_CHANNEL, //21 + IARM_BUS_SYSMGR_SYSSTATE_DSG_CA_TUNNEL, //22 + IARM_BUS_SYSMGR_SYSSTATE_CABLE_CARD, //23 + IARM_BUS_SYSMGR_SYSSTATE_CABLE_CARD_DWNLD, //24 + IARM_BUS_SYSMGR_SYSSTATE_CVR_SUBSYSTEM, //25 + IARM_BUS_SYSMGR_SYSSTATE_DOWNLOAD, //26 + IARM_BUS_SYSMGR_SYSSTATE_VOD_AD, //27 + IARM_BUS_SYSMGR_SYSSTATE_DAC_INIT_TIMESTAMP, //28 + IARM_BUS_SYSMGR_SYSSTATE_CABLE_CARD_SERIAL_NO, //29 + IARM_BUS_SYSMGR_SYSSTATE_ECM_MAC, //30 + IARM_BUS_SYSMGR_SYSSTATE_DAC_ID, //31 + IARM_BUS_SYSMGR_SYSSTATE_PLANT_ID, //32 + IARM_BUS_SYSMGR_SYSSTATE_STB_SERIAL_NO, //33 + IARM_BUS_SYSMGR_SYSSTATE_BOOTUP, //34 + IARM_BUS_SYSMGR_SYSSTATE_GATEWAY_CONNECTION, //35 + IARM_BUS_SYSMGR_SYSSTATE_DST_OFFSET, //36 + IARM_BUS_SYSMGR_SYSSTATE_RF_CONNECTED, //37 + IARM_BUS_SYSMGR_SYSSTATE_PARTNERID_CHANGE, //38 + IARM_BUS_SYSMGR_SYSSTATE_IP_MODE, //39 + IARM_BUS_SYSMGR_SYSSTATE_LP_CONNECTION_RESET, //40 + IARM_BUS_SYSMGR_SYSSTATE_RWS_CONNECTION_RESET, //41 + IARM_BUS_SYSMGR_SYSSTATE_QAM_READY, //42 + IARM_BUS_SYSMGR_SYSSTATE_FIRMWARE_UPDATE_STATE, //43, Added as part of RDK-19978, As the IARM + IARM_BUS_SYSMGR_SYSSTATE_USB_DETECTED, //44 + IARM_BUS_SYSMGR_SYSSTATE_LOG_UPLOAD, //45 +} IARM_Bus_SYSMgr_SystemState_t; + +typedef enum _SYSMgr_FirmwareUpdateState_t { + IARM_BUS_SYSMGR_FIRMWARE_UPDATE_STATE_UNINITIALIZED = 0, + IARM_BUS_SYSMGR_FIRMWARE_UPDATE_STATE_REQUESTING = 1, + IARM_BUS_SYSMGR_FIRMWARE_UPDATE_STATE_DOWNLOADING = 2, + IARM_BUS_SYSMGR_FIRMWARE_UPDATE_STATE_FAILED = 3, + IARM_BUS_SYSMGR_FIRMWARE_UPDATE_STATE_DOWNLOAD_COMPLETE = 4, + IARM_BUS_SYSMGR_FIRMWARE_UPDATE_STATE_VALIDATION_COMPLETE = 5, + IARM_BUS_SYSMGR_FIRMWARE_UPDATE_STATE_PREPARING_TO_REBOOT = 6, + IARM_BUS_SYSMGR_FIRMWARE_UPDATE_STATE_ONHOLD_FOR_OPTOUT = 7, /* On Hold for opt-out */ + IARM_BUS_SYSMGR_FIRMWARE_UPDATE_STATE_CRITICAL_REBOOT = 8, + IARM_BUS_SYSMGR_FIRMWARE_UPDATE_STATE_NO_UPGRADE_REQUIRED = 9 +} IARM_Bus_SYSMGR_FirmwareUpdateState_t; + +typedef enum _SYSMgr_LogUpload_t +{ + IARM_BUS_SYSMGR_LOG_UPLOAD_SUCCESS = 0, + IARM_BUS_SYSMGR_LOG_UPLOAD_FAILED = 1, + IARM_BUS_SYSMGR_LOG_UPLOAD_ABORTED = 2, +} IARM_Bus_SYSMGR_SYSMgr_LogUpload_t; + +typedef struct _IARM_BUS_SYSMgr_EventData_t { + union { + struct _CARD_FWDNLD_DATA { + char eventType; + char status; + } cardFWDNLD; + struct _IMAGE_FWDNLD_DATA { + char status; + } imageFWDNLD; + struct _XUPNP_DATA { + unsigned long deviceInfoLength; + } xupnpData; + struct _HDCP_PROFILE { + unsigned int hdcpProfile; + } hdcpProfileData; + struct _SystemStates { + IARM_Bus_SYSMgr_SystemState_t stateId; + int state; + int error; + char payload[128]; + } systemStates; + struct _EISS_STATUS { + int filterStatus; + } eissEventData; + struct _EISS_APP_ID { + unsigned char idList[4][6]; + int count; + } eissAppIDList; + struct _KEY_CODE_LOG { + int logStatus; + } keyCodeLogData; + struct _USB_MOUNT { + int mounted; + char device[128]; + char dir[256]; + } usbMountData; + + } data; +} IARM_Bus_SYSMgr_EventData_t; + +typedef struct _propertyValue { + int state; + int error; + char payload[128]; +} state_property; + +typedef struct _IARM_Bus_SYSMgr_GetSystemStates_Param_t { + state_property channel_map; + state_property disconnect_mgr_state; + state_property TuneReadyStatus; + state_property exit_ok_key_sequence; + state_property cmac; + state_property card_moto_entitlements; + state_property card_moto_hrv_rx; + state_property dac_init_timestamp; + state_property card_cisco_status; + state_property video_presenting; + state_property hdmi_out; + state_property hdcp_enabled; + state_property hdmi_edid_read; + state_property firmware_download; + state_property time_source; + state_property time_zone_available; + state_property ca_system; + state_property estb_ip; + state_property ecm_ip; + state_property lan_ip; + state_property moca; + state_property docsis; + state_property dsg_broadcast_tunnel; + state_property dsg_ca_tunnel; + state_property cable_card; + state_property cable_card_download; + state_property cvr_subsystem; + state_property download; + state_property vod_ad; + state_property card_serial_no; + state_property ecm_mac; + state_property dac_id; + state_property plant_id; + state_property stb_serial_no; + state_property bootup; + state_property dst_offset; + state_property rf_connected; + state_property ip_mode; + state_property qam_ready_status; + state_property firmware_update_state; +} IARM_Bus_SYSMgr_GetSystemStates_Param_t; + +#define IARM_BUS_DSMGR_NAME "DSMgr" + +/*! Events published from DS Mananger */ +typedef enum _DSMgr_EventId_t { + IARM_BUS_DSMGR_EVENT_RES_PRECHANGE = 0, /*!< Resolution Pre Change Event */ + IARM_BUS_DSMGR_EVENT_RES_POSTCHANGE, /*!< Resolution Post Change Event */ + IARM_BUS_DSMGR_EVENT_ZOOM_SETTINGS, /*!< Zoom Settings Events */ + IARM_BUS_DSMGR_EVENT_HDMI_HOTPLUG, /*!< HDMI HPD DETECT Change Event */ + IARM_BUS_DSMGR_EVENT_AUDIO_MODE, /*!< HDMI HPD DETECT Change Event */ + IARM_BUS_DSMGR_EVENT_HDCP_STATUS, /*!< HDMI HDCP status */ + IARM_BUS_DSMGR_EVENT_RX_SENSE, /*!< HDMI Rx Sense status */ + IARM_BUS_DSMGR_EVENT_HDMI_IN_HOTPLUG, /*!< HDMI IN HPD change event */ + IARM_BUS_DSMGR_EVENT_HDMI_IN_SIGNAL_STATUS, /*!< HDMI IN signal status change event */ + IARM_BUS_DSMGR_EVENT_HDMI_IN_STATUS, /*!< HDMI IN status change event */ + IARM_BUS_DSMGR_EVENT_HDMI_IN_AV_LATENCY, /*!< HDMI IN AV Latency Event */ + IARM_BUS_DSMGR_EVENT_HDMI_IN_VIDEO_MODE_UPDATE, /*!< HDMI IN video mode update event */ + IARM_BUS_DSMGR_EVENT_HDMI_IN_ALLM_STATUS, /*!< HDMI IN ALLM mode update event */ + IARM_BUS_DSMGR_EVENT_HDMI_IN_VRR_STATUS, /*!< HDMI IN VRR mode update event */ + IARM_BUS_DSMGR_EVENT_COMPOSITE_IN_HOTPLUG, /*!< COMPOSITE IN HPD change event */ + IARM_BUS_DSMGR_EVENT_COMPOSITE_IN_SIGNAL_STATUS, /*!< COMPOSITE IN signal status change event */ + IARM_BUS_DSMGR_EVENT_COMPOSITE_IN_STATUS, /*!< COMPOSITE IN status change event */ + IARM_BUS_DSMGR_EVENT_COMPOSITE_IN_VIDEO_MODE_UPDATE, /*!< COMPOSITE IN Video Mode change event */ + IARM_BUS_DSMGR_EVENT_TIME_FORMAT_CHANGE, /*!< Clock Time Format Change Event*/ + IARM_BUS_DSMGR_EVENT_AUDIO_LEVEL_CHANGED, /*!< Audio Level Change Event*/ + IARM_BUS_DSMGR_EVENT_AUDIO_OUT_HOTPLUG, /*!< AUDIO OUT HPD change event */ + IARM_BUS_DSMGR_EVENT_AUDIO_FORMAT_UPDATE, /*!< Audio Format change event */ + IARM_BUS_DSMGR_EVENT_AUDIO_PRIMARY_LANGUAGE_CHANGED, /*!< Audio Primary Language change event */ + IARM_BUS_DSMGR_EVENT_AUDIO_SECONDARY_LANGUAGE_CHANGED, /*!< Audio Secondary Language change event */ + IARM_BUS_DSMGR_EVENT_AUDIO_FADER_CONTROL_CHANGED, /*!< Audio Fader Control change event */ + IARM_BUS_DSMGR_EVENT_AUDIO_ASSOCIATED_AUDIO_MIXING_CHANGED, /*!< Audio Associated Audio Mixing change event */ + IARM_BUS_DSMGR_EVENT_VIDEO_FORMAT_UPDATE, /*!< Video Format change event */ + IARM_BUS_DSMGR_EVENT_DISPLAY_FRAMRATE_PRECHANGE, /*!< Frame rate pre change */ + IARM_BUS_DSMGR_EVENT_DISPLAY_FRAMRATE_POSTCHANGE, /*!< Frame rate post change */ + IARM_BUS_DSMGR_EVENT_AUDIO_PORT_STATE, /*!< Audio Port Init State */ + IARM_BUS_DSMGR_EVENT_SLEEP_MODE_CHANGED, /*!< Sleep Mode Change Event*/ + IARM_BUS_DSMGR_EVENT_HDMI_IN_AVI_CONTENT_TYPE, /*Register(__VA_ARGS__) +#endif + +/* Netsrvmgr Based Macros & Structures */ +typedef struct _IARM_BUS_NetSrvMgr_Iface_EventData_t { + union { + char activeIface[INTERFACE_SIZE]; + char allNetworkInterfaces[INTERFACE_LIST]; + char setInterface[INTERFACE_SIZE]; + char activeIfaceIpaddr[MAX_IP_ADDRESS_LEN]; + }; + char interfaceCount; + bool isInterfaceEnabled; + bool persist; + char ipfamily[MAX_IP_FAMILY_SIZE]; +} IARM_BUS_NetSrvMgr_Iface_EventData_t; + +#define IARM_BUS_SYSMGR_API_RunScript "RunScript" +/*! Parameter for RunScript call*/ +typedef struct _IARM_Bus_SYSMgr_RunScript_t{ + char script_path [256]; //[in] Null terminated path name of the script. + int return_value; //[out] Returns the ret value of system. +} IARM_Bus_SYSMgr_RunScript_t; + +typedef enum _CECMgr_EventId_t { + IARM_BUS_CECMGR_EVENT_SEND, + IARM_BUS_CECMGR_EVENT_RECV, + IARM_BUS_CECMGR_EVENT_ENABLE, + IARM_BUS_CECMGR_EVENT_DAEMON_INITIALIZED, + IARM_BUS_CECMGR_EVENT_MAX, + IARM_BUS_CECMGR_EVENT_STATUS_UPDATED +} IARM_Bus_CECMgr_EventId_t; + +typedef enum _IARM_Bus_MFRLib_ThermalState_t{ + IARM_BUS_TEMPERATURE_NORMAL = 0, /* Temp is within normal operating range */ + IARM_BUS_TEMPERATURE_HIGH, /* Temp is high, but just a warning as device can still operate */ + IARM_BUS_TEMPERATURE_CRITICAL /* Temp is critical, should trigger a thermal reset */ +} IARM_Bus_MFRLib_CurThermalState_t; + +typedef struct _IARM_Bus_CECMgr_Status_Updated_Param_t +{ + int logicalAddress; +}IARM_Bus_CECMgr_Status_Updated_Param_t; + +typedef struct _IARM_Bus_MFRLib_SetBLSplashScreen_Param{ + char path[255]; +} IARM_Bus_MFRLib_SetBLSplashScreen_Param_t; + +typedef struct _IARM_Bus_MFRLib_ThermalSoCTemp_Param_t{ + IARM_Bus_MFRLib_CurThermalState_t curState; /* !< Current Thermal level */ + int curSoCTemperature; /* !< Current SoC temperature value */ + int curWiFiTemperature; /* !< Current WiFi temperature value */ + int highTemp; /* !< New threshold at which TEMPERATURE_HIGH will be reported */ + int criticalTemp; /* !< New threshold at which TEMPERATURE_CRITICAL will be reported */ +} IARM_Bus_MFRLib_ThermalSoCTemp_Param_t; + +typedef bool IARM_Bus_MFRLib_FsrFlag_Param_t; // true or false + +#define IARM_BUS_CECMGR_API_isAvailable "isAvailable" +#define IARM_BUS_DSMGR_API_dsHdmiInGetNumberOfInputs "dsHdmiInGetNumberOfInputs" +#define IARM_BUS_DSMGR_API_dsHdmiInGetStatus "dsHdmiInGetStatus" +#define IARM_BUS_DSMGR_API_dsGetHDMIARCPortId "dsGetHDMIARCPortId" +#define IARM_BUS_DSMGR_API_SetStandbyVideoState "dsSetStandbyVideoState" +#define IARM_BUS_DSMGR_API_GetStandbyVideoState "dsGetStandbyVideoState" diff --git a/ci/mocks/Rfc.h b/ci/mocks/Rfc.h new file mode 100644 index 00000000..e7f001df --- /dev/null +++ b/ci/mocks/Rfc.h @@ -0,0 +1,114 @@ +/** +* If not stated otherwise in this file or this component's LICENSE +* file the following copyright and licenses apply: +* +* Copyright 2024 RDK Management +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +**/ + +#pragma once + +typedef enum { + WDMP_SUCCESS = 0, /**< Success. */ + WDMP_FAILURE, /**< General Failure */ + WDMP_ERR_TIMEOUT, + WDMP_ERR_NOT_EXIST, + WDMP_ERR_INVALID_PARAMETER_NAME, + WDMP_ERR_INVALID_PARAMETER_TYPE, + WDMP_ERR_INVALID_PARAMETER_VALUE, + WDMP_ERR_NOT_WRITABLE, + WDMP_ERR_SETATTRIBUTE_REJECTED, + WDMP_ERR_REQUEST_REJECTED, + WDMP_ERR_NAMESPACE_OVERLAP, + WDMP_ERR_UNKNOWN_COMPONENT, + WDMP_ERR_NAMESPACE_MISMATCH, + WDMP_ERR_UNSUPPORTED_NAMESPACE, + WDMP_ERR_DP_COMPONENT_VERSION_MISMATCH, + WDMP_ERR_INVALID_PARAM, + WDMP_ERR_UNSUPPORTED_DATATYPE, + WDMP_STATUS_RESOURCES, + WDMP_ERR_WIFI_BUSY, + WDMP_ERR_INVALID_ATTRIBUTES, + WDMP_ERR_WILDCARD_NOT_SUPPORTED, + WDMP_ERR_SET_OF_CMC_OR_CID_NOT_SUPPORTED, + WDMP_ERR_VALUE_IS_EMPTY, + WDMP_ERR_VALUE_IS_NULL, + WDMP_ERR_DATATYPE_IS_NULL, + WDMP_ERR_CMC_TEST_FAILED, + WDMP_ERR_NEW_CID_IS_MISSING, + WDMP_ERR_CID_TEST_FAILED, + WDMP_ERR_SETTING_CMC_OR_CID, + WDMP_ERR_INVALID_INPUT_PARAMETER, + WDMP_ERR_ATTRIBUTES_IS_NULL, + WDMP_ERR_NOTIFY_IS_NULL, + WDMP_ERR_INVALID_WIFI_INDEX, + WDMP_ERR_INVALID_RADIO_INDEX, + WDMP_ERR_ATOMIC_GET_SET_FAILED, + WDMP_ERR_METHOD_NOT_SUPPORTED, + WDMP_ERR_SESSION_IN_PROGRESS, + WDMP_ERR_INTERNAL_ERROR, + WDMP_ERR_DEFAULT_VALUE +} WDMP_STATUS; + +typedef enum { + WDMP_STRING = 0, + WDMP_INT, + WDMP_UINT, + WDMP_BOOLEAN, + WDMP_DATETIME, + WDMP_BASE64, + WDMP_LONG, + WDMP_ULONG, + WDMP_FLOAT, + WDMP_DOUBLE, + WDMP_BYTE, + WDMP_NONE, + WDMP_BLOB +} DATA_TYPE; + +#define MAX_PARAM_LEN (2 * 1024) + +typedef struct _RFC_Param_t { + char name[MAX_PARAM_LEN]; + char value[MAX_PARAM_LEN]; + DATA_TYPE type; +} RFC_ParamData_t; + +class RfcApiImpl { +public: + virtual ~RfcApiImpl() = default; + + virtual WDMP_STATUS getRFCParameter(char* pcCallerID, const char* pcParameterName, RFC_ParamData_t* pstParamData) = 0; + virtual WDMP_STATUS setRFCParameter(char* pcCallerID, const char* pcParameterName, const char* pcParameterValue, DATA_TYPE eDataType) = 0; + virtual const char* getRFCErrorString(WDMP_STATUS code) = 0; +}; + +class RfcApi { + +protected: + static RfcApiImpl* impl; + +public: + RfcApi(); + RfcApi(const RfcApi &obj) = delete; // deleted copy constructor so that copy of the instance cannot be created. + static void setImpl(RfcApiImpl* newImpl); + static WDMP_STATUS getRFCParameter(char* pcCallerID, const char* pcParameterName, RFC_ParamData_t* pstParamData); + static WDMP_STATUS setRFCParameter(char* pcCallerID, const char* pcParameterName, const char* pcParameterValue, DATA_TYPE eDataType); + static const char* getRFCErrorString(WDMP_STATUS code); +}; + +extern WDMP_STATUS (*getRFCParameter)(char*,const char*,RFC_ParamData_t*); +extern WDMP_STATUS (*setRFCParameter)(char*,const char*,const char*,DATA_TYPE); +extern const char* (*getRFCErrorString)(WDMP_STATUS); + diff --git a/ci/mocks/Telemetry.h b/ci/mocks/Telemetry.h new file mode 100644 index 00000000..4ae4133c --- /dev/null +++ b/ci/mocks/Telemetry.h @@ -0,0 +1,61 @@ +/** +* If not stated otherwise in this file or this component's LICENSE +* file the following copyright and licenses apply: +* +* Copyright 2024 RDK Management +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +**/ + +#pragma once + +typedef enum { + T2ERROR_SUCCESS, + T2ERROR_FAILURE, + T2ERROR_INVALID_PROFILE, + T2ERROR_PROFILE_NOT_FOUND, + T2ERROR_PROFILE_NOT_SET, + T2ERROR_MAX_PROFILES_REACHED, + T2ERROR_MEMALLOC_FAILED, + T2ERROR_INVALID_ARGS, + T2ERROR_INTERNAL_ERROR +} T2ERROR; + +class TelemetryApiImpl { +public: + virtual ~TelemetryApiImpl() = default; + + virtual void t2_init(char* component) = 0; + virtual void t2_uninit(void) = 0; + virtual T2ERROR t2_event_s(const char* marker, const char* value) = 0; + virtual T2ERROR t2_event_d(const char* marker, int value) = 0; +}; + +class TelemetryApi { +protected: + static TelemetryApiImpl* impl; +public: + TelemetryApi(); + TelemetryApi(const TelemetryApi &obj) = delete; + static void setImpl(TelemetryApiImpl* newImpl); + static void t2_init(char* component); + static void t2_uninit(void); + static T2ERROR t2_event_s(const char* marker, const char* value); + static T2ERROR t2_event_d(const char* marker, int value); +}; + +extern void (*t2_init)(char*); +extern void (*t2_uninit)(void); +extern T2ERROR (*t2_event_s)(const char*,const char*); +extern T2ERROR (*t2_event_d)(const char*,int); + diff --git a/ci/mocks/control/comcastIrKeyCodes.h b/ci/mocks/control/comcastIrKeyCodes.h new file mode 100644 index 00000000..123661fa --- /dev/null +++ b/ci/mocks/control/comcastIrKeyCodes.h @@ -0,0 +1,49 @@ +/* + * Stub for comcastIrKeyCodes.h + * + * Copyright 2024 RDK Management + * Licensed under the Apache License, Version 2.0 + */ +#ifndef _COMCAST_IR_KEY_CODES_H_ +#define _COMCAST_IR_KEY_CODES_H_ + +/* Key event types */ +#define KET_KEYDOWN 0x00000008 +#define KET_KEYUP 0x00000100 +#define KET_KEYREPEAT 0x00000200 + +/* Key codes */ +#define KED_POWER 0x00000001 +#define KED_TVPOWER 0x00000002 +#define KED_RF_POWER 0x00000003 +#define KED_DISCRETE_POWER_ON 0x00000004 +#define KED_DISCRETE_POWER_STANDBY 0x00000005 +#define KED_VOLUMEUP 0x00000010 +#define KED_VOLUMEDOWN 0x00000011 +#define KED_MUTE 0x00000012 +#define KED_INPUTKEY 0x00000013 +#define KED_SETUP 0x00000020 +#define KED_PUSH_TO_TALK 0x00000030 +#define KED_RF_PAIR_GHOST 0x00000040 +#define KED_SCREEN_BIND_NOTIFY 0x00000050 +#define KED_XR2V3 0x00000060 +#define KED_XR5V2 0x00000061 +#define KED_XR11V1 0x00000062 +#define KED_XR11V2 0x00000063 +#define KED_XR11_NOTIFY 0x00000064 +#define KED_XR15V1_NOTIFY 0x00000065 +#define KED_XR16V1_NOTIFY 0x00000066 +#define KED_UNDEFINEDKEY 0x000000FF + +/* XMP tags */ +#define XMP_TAG_COMCAST 0x0001 +#define XMP_TAG_PLATCO 0x0002 +#define XMP_TAG_XR11V2 0x0003 +#define XMP_TAG_XR15V1 0x0004 +#define XMP_TAG_XR15V2 0x0005 +#define XMP_TAG_XR16V1 0x0006 +#define XMP_TAG_XRAV1 0x0007 +#define XMP_TAG_XR20V1 0x0008 +#define XMP_TAG_UNDEFINED 0x00FF + +#endif /* _COMCAST_IR_KEY_CODES_H_ */ diff --git a/ci/mocks/control/irMgr.h b/ci/mocks/control/irMgr.h new file mode 100644 index 00000000..f1fe0313 --- /dev/null +++ b/ci/mocks/control/irMgr.h @@ -0,0 +1,42 @@ +/* + * Stub for irMgr.h - IR Manager types + * + * Copyright 2024 RDK Management + * Licensed under the Apache License, Version 2.0 + */ +#ifndef _IR_MGR_H_ +#define _IR_MGR_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#define IARM_BUS_IRMGR_NAME "IRMgr" + +typedef enum { + IARM_BUS_IRMGR_EVENT_IRKEY = 0, + IARM_BUS_IRMGR_EVENT_CONTROL = 1, + IARM_BUS_IRMGR_EVENT_MAX = 2 +} IARM_Bus_IRMgr_EventId_t; + +#define IARM_BUS_IRMGR_KEYSRC_IR 0 +#define IARM_BUS_IRMGR_KEYSRC_FP 1 +#define IARM_BUS_IRMGR_KEYSRC_RF 2 + +typedef struct { + union { + struct { + int keyType; + int keyCode; + int keySrc; + int keyTag; + int keySourceId; + } irkey; + } data; +} IARM_Bus_IRMgr_EventData_t; + +#ifdef __cplusplus +} +#endif + +#endif /* _IR_MGR_H_ */ diff --git a/ci/mocks/control/rdkversion.h b/ci/mocks/control/rdkversion.h new file mode 100644 index 00000000..3527916c --- /dev/null +++ b/ci/mocks/control/rdkversion.h @@ -0,0 +1,33 @@ +/* + * Stub for rdkversion.h + * + * Copyright 2024 RDK Management + * Licensed under the Apache License, Version 2.0 + */ +#ifndef _RDKVERSION_H_ +#define _RDKVERSION_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct { + char *image_name; + char *stb_name; + char *branch_name; + char *version_name; + char *image_build_time; + bool production_build; + char *parse_error; +} rdk_version_info_t; + +int rdk_version_parse_version(rdk_version_info_t *info); +void rdk_version_object_free(rdk_version_info_t *info); + +#ifdef __cplusplus +} +#endif + +#endif /* _RDKVERSION_H_ */ diff --git a/ci/mocks/control/rdkx_logger.h b/ci/mocks/control/rdkx_logger.h new file mode 100644 index 00000000..984f663b --- /dev/null +++ b/ci/mocks/control/rdkx_logger.h @@ -0,0 +1,204 @@ +/* + * 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. + */ +#ifndef _RDKX_LOGGER_H_ +#define _RDKX_LOGGER_H_ + +#ifdef __cplusplus +#include +#include +#include +/* The real rdkx_logger.h pulls in std:: namespace indirectly; replicate only the needed names here */ +// ctrlm expects these to be in the global namespace, so we need to pull them in here +using std::get; +using std::map; +using std::string; +using std::tuple; +#endif + +/* Log option flags */ +#define XLOG_OPTS_DATE (1 << 0) +#define XLOG_OPTS_TIME (1 << 1) +#define XLOG_OPTS_LF (1 << 2) +#define XLOG_OPTS_MOD_NAME (1 << 3) +#define XLOG_OPTS_LEVEL (1 << 4) +#define XLOG_OPTS_COLOR (1 << 5) + +/* Module IDs */ +#define XLOG_MODULE_ID_CTRLM 0 +#define XLOG_MODULE_ID_VSDK 1 +#define XLOG_MODULE_ID_XRAUDIO 2 + +#ifndef XLOG_MODULE_ID +#define XLOG_MODULE_ID XLOG_MODULE_ID_CTRLM +#endif + +/* Stub types and functions used by xlog_fprintf */ +#ifndef XLOG_OPTS_DEFAULT +#define XLOG_OPTS_DEFAULT 0 +#endif + +#ifndef XLOG_COLOR_NONE +#define XLOG_COLOR_NONE 0 +#endif + +#ifndef XLOG_COLOR_BLU +#define XLOG_COLOR_BLU 0 +#endif + +#ifndef XLOG_COLOR_GRN +#define XLOG_COLOR_GRN 0 +#endif + +#ifndef XLOG_LINE_NONE +#define XLOG_LINE_NONE 0 +#endif + +typedef int xlog_level_t; + +#ifndef XLOG_LEVEL_DEBUG +#define XLOG_LEVEL_DEBUG 0 +#endif + +#ifndef XLOG_LEVEL_INFO +#define XLOG_LEVEL_INFO 1 +#endif + +#ifndef XLOG_LEVEL_WARN +#define XLOG_LEVEL_WARN 2 +#endif + +#ifndef XLOG_LEVEL_ERROR +#define XLOG_LEVEL_ERROR 3 +#endif + +#ifndef XLOG_LEVEL_FATAL +#define XLOG_LEVEL_FATAL 4 +#endif + +#ifndef XLOG_LEVEL_TELEMETRY +#define XLOG_LEVEL_TELEMETRY 5 +#endif + +#ifndef XLOG_BUF_SIZE_DEFAULT +#define XLOG_BUF_SIZE_DEFAULT 0 +#endif + +typedef struct { + int options; + int color; + const char *function; + int line; + int level; + int id; + int size_max; +} xlog_args_t; + +#ifndef xlog_fprintf +#define xlog_fprintf(args, output, fmt, ...) do { (void)(args); (void)(output); (void)sizeof(fmt); } while(0) +#endif + +#ifndef xlog_printf +#define xlog_printf(args, fmt, ...) do { (void)(args); (void)sizeof(fmt); } while(0) +#endif + +#ifndef xlog_init +#define xlog_init(id, path, options, console, syslog) (0) +#endif + +#ifndef xlog_level_set_all +#define xlog_level_set_all(level) do { (void)(level); } while(0) +#endif + +#ifndef xlog_level_get +#define xlog_level_get(id) (XLOG_LEVEL_INFO) +#endif + +#ifndef xlog_term +#define xlog_term() do { } while(0) +#endif + +/* Logging macros - silently discard in stub builds (avoids -Werror=format-zero-length) */ +#ifndef XLOGD +#define XLOGD(level, opts, color, size, fmt, ...) do { (void)(level); (void)(opts); (void)(color); (void)(size); (void)sizeof(fmt); } while(0) +#endif +#ifndef XLOGD_INFO +#define XLOGD_INFO(fmt, ...) do { (void)sizeof(fmt); } while(0) +#endif +#ifndef XLOGD_DEBUG +#define XLOGD_DEBUG(fmt, ...) do { (void)sizeof(fmt); } while(0) +#endif +#ifndef XLOGD_ERROR +#define XLOGD_ERROR(fmt, ...) do { (void)sizeof(fmt); } while(0) +#endif +#ifndef XLOGD_WARN +#define XLOGD_WARN(fmt, ...) do { (void)sizeof(fmt); } while(0) +#endif +#ifndef XLOGD_FATAL +#define XLOGD_FATAL(fmt, ...) do { (void)sizeof(fmt); } while(0) +#endif +#ifndef XLOGD_TELEMETRY +#define XLOGD_TELEMETRY(fmt, ...) do { (void)sizeof(fmt); } while(0) +#endif +#ifndef XLOGD_INFO_OPTS +#define XLOGD_INFO_OPTS(opts, fmt, ...) do { (void)(opts); (void)sizeof(fmt); } while(0) +#endif +#ifndef XLOGD_NO_LF +#define XLOGD_NO_LF(level, fmt, ...) do { (void)(level); (void)sizeof(fmt); } while(0) +#endif +/* XLOGD_OUTPUT is used as an output-handle VALUE (second arg to xlog_fprintf), not a logging macro */ +#ifndef XLOGD_OUTPUT +#define XLOGD_OUTPUT NULL +#endif + +#ifndef XLOGD_AUTOMATION_INFO +#define XLOGD_AUTOMATION_INFO(fmt, ...) do { (void)sizeof(fmt); } while(0) +#endif +#ifndef XLOGD_AUTOMATION_DEBUG +#define XLOGD_AUTOMATION_DEBUG(fmt, ...) do { (void)sizeof(fmt); } while(0) +#endif +#ifndef XLOGD_AUTOMATION_ERROR +#define XLOGD_AUTOMATION_ERROR(fmt, ...) do { (void)sizeof(fmt); } while(0) +#endif +#ifndef XLOGD_AUTOMATION_WARN +#define XLOGD_AUTOMATION_WARN(fmt, ...) do { (void)sizeof(fmt); } while(0) +#endif +#ifndef XLOGD_AUTOMATION_TELEMETRY +#define XLOGD_AUTOMATION_TELEMETRY(fmt, ...) do { (void)sizeof(fmt); } while(0) +#endif + +#ifndef XLOG_INFO +#define XLOG_INFO(fmt, ...) do { (void)sizeof(fmt); } while(0) +#endif +#ifndef XLOG_DEBUG +#define XLOG_DEBUG(fmt, ...) do { (void)sizeof(fmt); } while(0) +#endif +#ifndef XLOG_ERROR +#define XLOG_ERROR(fmt, ...) do { (void)sizeof(fmt); } while(0) +#endif +#ifndef XLOG_WARN +#define XLOG_WARN(fmt, ...) do { (void)sizeof(fmt); } while(0) +#endif +#ifndef XLOG_RAW +#define XLOG_RAW(fmt, ...) do { (void)sizeof(fmt); } while(0) +#endif +#ifndef XLOG_FLUSH +#define XLOG_FLUSH() do { } while(0) +#endif + +#endif /* _RDKX_LOGGER_H_ */ diff --git a/ci/mocks/control/xr_fdc.h b/ci/mocks/control/xr_fdc.h new file mode 100644 index 00000000..7af85a31 --- /dev/null +++ b/ci/mocks/control/xr_fdc.h @@ -0,0 +1,23 @@ +/* + * Stub for xr_fdc.h - File Descriptor Check + * + * Copyright 2024 RDK Management + * Licensed under the Apache License, Version 2.0 + */ +#ifndef _XR_FDC_H_ +#define _XR_FDC_H_ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +int32_t xr_fdc_check(uint32_t limit_soft, uint32_t limit_hard, bool log_fds); + +#ifdef __cplusplus +} +#endif + +#endif /* _XR_FDC_H_ */ diff --git a/ci/mocks/control/xr_mq.h b/ci/mocks/control/xr_mq.h new file mode 100644 index 00000000..ece5597c --- /dev/null +++ b/ci/mocks/control/xr_mq.h @@ -0,0 +1,50 @@ +/* + * 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. + */ +#ifndef _XR_MQ_H_ +#define _XR_MQ_H_ + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* xr_mq_t is an integer (OS queue descriptor), not a pointer */ +typedef int xr_mq_t; + +#define XR_MQ_INVALID ((xr_mq_t)-1) + +typedef struct { + uint32_t max_msg; /* field name used by ctrlm source (must be first — matches designated init order) */ + size_t max_msg_size; +} xr_mq_attr_t; + +xr_mq_t xr_mq_create(const xr_mq_attr_t *attr); +void xr_mq_destroy(xr_mq_t mq); +bool xr_mq_push(xr_mq_t mq, const void *msg, size_t msg_size); +bool xr_mq_pop(xr_mq_t mq, void *msg, size_t msg_size); +bool xr_mq_pop_timeout(xr_mq_t mq, void *msg, size_t msg_size, int32_t timeout_ms); + +#ifdef __cplusplus +} +#endif + +#endif /* _XR_MQ_H_ */ diff --git a/ci/mocks/control/xr_timestamp.h b/ci/mocks/control/xr_timestamp.h new file mode 100644 index 00000000..0a185e47 --- /dev/null +++ b/ci/mocks/control/xr_timestamp.h @@ -0,0 +1,44 @@ +/* + * 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. + */ +#ifndef _XR_TIMESTAMP_H_ +#define _XR_TIMESTAMP_H_ + +#include +#include + +/* Use timespec-compatible layout so ctrlm can assign directly between types. */ +typedef struct timespec rdkx_timestamp_t; + +#ifdef __cplusplus +extern "C" { +#endif + +void rdkx_timestamp_get(rdkx_timestamp_t *timestamp); +void rdkx_timestamp_get_realtime(rdkx_timestamp_t *timestamp); +double rdkx_timestamp_subtract(const rdkx_timestamp_t *a, const rdkx_timestamp_t *b); +signed long long rdkx_timestamp_subtract_us(rdkx_timestamp_t a, rdkx_timestamp_t b); +signed long long rdkx_timestamp_subtract_ms(rdkx_timestamp_t a, rdkx_timestamp_t b); +void rdkx_timestamp_add_ms(rdkx_timestamp_t *timestamp, unsigned long milliseconds); +int rdkx_timestamp_cmp(const rdkx_timestamp_t *a, const rdkx_timestamp_t *b); + +#ifdef __cplusplus +} +#endif + +#endif /* _XR_TIMESTAMP_H_ */ diff --git a/ci/mocks/control/xr_voice_sdk.h b/ci/mocks/control/xr_voice_sdk.h new file mode 100644 index 00000000..f4a385e5 --- /dev/null +++ b/ci/mocks/control/xr_voice_sdk.h @@ -0,0 +1,42 @@ +/* + * Stub for xr_voice_sdk.h + * + * Copyright 2024 RDK Management + * Licensed under the Apache License, Version 2.0 + */ +#ifndef _XR_VOICE_SDK_H_ +#define _XR_VOICE_SDK_H_ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* xr_voice_sdk API */ +int xr_voice_sdk_init(void); +int xr_voice_sdk_term(void); + +/* vsdk API used by ctrlm-main */ +#define VSDK_VERSION_QTY_MAX (16) + +typedef struct { + const char *name; + const char *version; + const char *branch; + const char *commit_id; +} vsdk_version_info_t; + +typedef void (*vsdk_thread_poll_response_t)(void *data); + +void vsdk_version(vsdk_version_info_t *info, uint32_t *qty); +bool vsdk_init(bool console, const char *filename, uint32_t file_size_max); +void vsdk_term(void); +void vsdk_thread_poll(vsdk_thread_poll_response_t response, void *data); + +#ifdef __cplusplus +} +#endif + +#endif /* _XR_VOICE_SDK_H_ */ diff --git a/ci/mocks/control/xraudio.h b/ci/mocks/control/xraudio.h new file mode 100644 index 00000000..f28f5c25 --- /dev/null +++ b/ci/mocks/control/xraudio.h @@ -0,0 +1,47 @@ +/* + * Stub for xraudio.h - Audio types + * + * Copyright 2024 RDK Management + * Licensed under the Apache License, Version 2.0 + */ +#ifndef _XRAUDIO_H_ +#define _XRAUDIO_H_ + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum { + XRAUDIO_ENCODING_PCM = 0, + XRAUDIO_ENCODING_ADPCM = 1, + XRAUDIO_ENCODING_OPUS = 2, + XRAUDIO_ENCODING_INVALID = 3 +} xraudio_encoding_t; + +typedef struct { + xraudio_encoding_t type; +} xraudio_encoding_info_t; + +typedef struct { + xraudio_encoding_info_t encoding; + uint16_t sample_rate; + uint8_t sample_size; + uint8_t channel_qty; +} xraudio_output_format_t; + +typedef enum { + XRAUDIO_RESULT_OK = 0, + XRAUDIO_RESULT_ERROR = 1 +} xraudio_result_t; + +int32_t xraudio_container_header_parse_wave(int audio_fd, const uint8_t *header, size_t size, xraudio_output_format_t *format, uint32_t *data_length); + +#ifdef __cplusplus +} +#endif + +#endif /* _XRAUDIO_H_ */ diff --git a/ci/mocks/control/xrsr.h b/ci/mocks/control/xrsr.h new file mode 100644 index 00000000..88ea90ba --- /dev/null +++ b/ci/mocks/control/xrsr.h @@ -0,0 +1,347 @@ +/* + * 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. + */ +#ifndef _XRSR_H_ +#define _XRSR_H_ + +#include +#include +#include +#include +#include "xr_timestamp.h" + +/* Minimal opaque placeholders to avoid requiring OpenSSL dev headers in mocks. */ +typedef struct xrsr_x509_stub X509; +typedef struct xrsr_evp_pkey_stub EVP_PKEY; +typedef struct xrsr_x509_stack_stub X509_STACK; +#define STACK_OF(type) type##_STACK +#ifdef __cplusplus +extern "C" { +#endif + +#define XRSR_SAT_TOKEN_LEN_MAX (2048) +#define XRSR_QUERY_STRING_QTY_MAX (16) +#define XRSR_SESSION_BY_TEXT_MAX (256) +#define XRSR_DST_PARAM_LEN_MAX (256) +#define XRSR_USER_AGENT_LEN_MAX (512) +#define XRSR_DST_QTY_MAX (4) + +/* Source types */ +typedef enum { + XRSR_SRC_RCU_PTT = 0, + XRSR_SRC_RCU_FF = 1, + XRSR_SRC_MICROPHONE = 2, + XRSR_SRC_MICROPHONE_TAP = 3, + XRSR_SRC_INVALID = 4 +} xrsr_src_t; + +/* Audio format values used in ctrlm. */ +enum { + XRSR_AUDIO_FORMAT_NONE = 0, + XRSR_AUDIO_FORMAT_PCM = (1 << 0), + XRSR_AUDIO_FORMAT_PCM_32_BIT = (1 << 1), + XRSR_AUDIO_FORMAT_PCM_32_BIT_MULTI = (1 << 2), + XRSR_AUDIO_FORMAT_PCM_RAW = (1 << 3), + XRSR_AUDIO_FORMAT_ADPCM = (1 << 4), + XRSR_AUDIO_FORMAT_ADPCM_FRAME = (1 << 5), + XRSR_AUDIO_FORMAT_OPUS = (1 << 6), + XRSR_AUDIO_FORMAT_OPUS_XVP = (1 << 7), + XRSR_AUDIO_FORMAT_MAX = (1 << 8) +}; + +typedef struct { + uint32_t size_packet; + uint32_t size_header; + uint32_t offset_step_size_index; + uint32_t offset_predicted_sample_lsb; + uint32_t offset_predicted_sample_msb; + uint32_t offset_sequence_value; + uint32_t shift_sequence_value; + uint32_t sequence_value_min; + uint32_t sequence_value_max; +} xrsr_audio_format_adpcm_frame_t; + +typedef struct { + int type; + union { + xrsr_audio_format_adpcm_frame_t adpcm_frame; + } value; +} xrsr_audio_format_t; + +typedef enum { + XRSR_SESSION_END_REASON_EOS = 0, + XRSR_SESSION_END_REASON_TERMINATE = 1, + XRSR_SESSION_END_REASON_EOT = 2, + XRSR_SESSION_END_REASON_DISCONNECT_REMOTE = 3, + XRSR_SESSION_END_REASON_ERROR_AUDIO_BEGIN = 4, + XRSR_SESSION_END_REASON_ERROR_AUDIO_DURATION = 5, + XRSR_SESSION_END_REASON_INVALID = 6 +} xrsr_session_end_reason_t; + +typedef enum { + XRSR_STREAM_FROM_BEGINNING = 0, + XRSR_STREAM_FROM_KEYWORD = 1, + XRSR_STREAM_FROM_KEYWORD_BEGIN = 2, + XRSR_STREAM_FROM_LIVE = 3, + XRSR_STREAM_FROM_INVALID = 4 +} xrsr_stream_from_t; + +typedef enum { + XRSR_STREAM_UNTIL_END_OF_STREAM = 0, + XRSR_STREAM_UNTIL_END_OF_SPEECH = 1, + XRSR_STREAM_UNTIL_END_OF_KEYWORD = 2, + XRSR_STREAM_UNTIL_INVALID = 3 +} xrsr_stream_until_t; + +typedef enum { + XRSR_POWER_MODE_FULL = 0, + XRSR_POWER_MODE_LOW = 1, + XRSR_POWER_MODE_SLEEP = 2, + XRSR_POWER_MODE_QTY = 3 +} xrsr_power_mode_t; + +typedef enum { + XRSR_KWD_RESULT_DETECTED = 0, + XRSR_KWD_RESULT_NOT_DETECTED = 1, + XRSR_KWD_RESULT_INVALID = 2 +} xrsr_keyword_detector_result_t; + +typedef enum { + XRSR_CERT_TYPE_P12 = 0, + XRSR_CERT_TYPE_X509 = 1, + XRSR_CERT_TYPE_PEM = 2 +} xrsr_cert_type_t; + +typedef struct { + xrsr_cert_type_t type; + union { + struct { + const char *filename; + const char *passphrase; + } p12; + struct { + X509 *x509; + EVP_PKEY *pkey; + STACK_OF(X509) *chain; + } x509; + struct { + const char *filename_cert; + const char *filename_pkey; + const char *filename_chain; + const char *passphrase; + } pem; + } cert; +} xrsr_cert_t; + +typedef struct { + uint32_t connect_check_interval; + uint32_t timeout_connect; + uint32_t timeout_inactivity; + uint32_t timeout_session; + bool ipv4_fallback; + uint32_t backoff_delay; +} xrsr_dst_params_t; + +typedef struct xrsr_session_config_in_t xrsr_session_config_in_t; +typedef struct xrsr_session_config_out_t xrsr_session_config_out_t; +typedef struct xrsr_session_config_update_t xrsr_session_config_update_t; + +typedef void (*xrsr_session_config_cb_t)(const uuid_t uuid, xrsr_session_config_in_t *config_in); +typedef xrsr_session_config_cb_t xrsr_callback_session_config_t; +typedef bool (*xrsr_handler_send_t)(const void *data, size_t size, void *user_data); +typedef void (*xrsr_session_audio_cb_t)(int bytes_sent, void *user_data); + +typedef struct { + bool valid; + uint32_t packets_processed; + uint32_t packets_lost; + uint32_t samples_processed; + uint32_t samples_lost; + uint32_t decoder_failures; + uint32_t samples_buffered_max; + double snr_peak; + double snr_mean; +} xrsr_audio_stats_t; + +typedef struct { + bool result; + int stream_end_reason; + xrsr_audio_stats_t audio_stats; +} xrsr_stream_stats_t; + +typedef struct { + xrsr_session_end_reason_t session_end_reason; + int ret_code_protocol; + int ret_code_library; + int ret_code_internal; + const char *server_ip; + int time_dns; + int time_connect; + int stream_end_reason; + xrsr_stream_stats_t stream_stats; +} xrsr_session_stats_t; + +typedef struct xrsr_handlers_t { + void (*session_begin)(void *data, const uuid_t uuid, xrsr_src_t src, uint32_t dst_index, xrsr_keyword_detector_result_t *detector_result, xrsr_session_config_out_t *config_out, xrsr_session_config_in_t *config_in, rdkx_timestamp_t *timestamp, const char *transcription_in); + void (*session_config)(void *data, const uuid_t uuid, xrsr_session_config_update_t *session_config_update, rdkx_timestamp_t *timestamp); + void (*session_end)(void *data, const uuid_t uuid, xrsr_session_stats_t *stats, rdkx_timestamp_t *timestamp); + void (*stream_begin)(void *data, const uuid_t uuid, xrsr_src_t src, rdkx_timestamp_t *timestamp); + void (*stream_kwd)(void *data, const uuid_t uuid, rdkx_timestamp_t *timestamp); + void (*stream_audio)(void *data, const uuid_t uuid, const uint8_t *buffer, size_t size, rdkx_timestamp_t *timestamp); + void (*stream_end)(void *data, const uuid_t uuid, xrsr_stream_stats_t *stats, rdkx_timestamp_t *timestamp); + bool (*connected)(void *data, const uuid_t uuid, xrsr_handler_send_t send, void *param, rdkx_timestamp_t *timestamp, xrsr_session_config_update_t *session_config_update); + void (*disconnected)(void *data, const uuid_t uuid, xrsr_session_end_reason_t reason, bool retry, bool *detect_resume, rdkx_timestamp_t *timestamp); + void (*recv_msg)(void *data, const char *msg, size_t msg_len); + void (*source_error)(void *data, xrsr_src_t src); + void *data; +} xrsr_handlers_t; + +typedef struct { + const char *url; + xrsr_handlers_t handlers; + int formats; + uint32_t stream_time_min; + xrsr_stream_from_t stream_from; + int32_t stream_offset; + xrsr_stream_until_t stream_until; + const xrsr_dst_params_t *params[XRSR_POWER_MODE_QTY]; +} xrsr_dst_t; + +typedef struct { + xrsr_src_t src; + uint32_t dst_qty; + xrsr_dst_t dsts[XRSR_DST_QTY_MAX]; +} xrsr_route_t; + +struct xrsr_session_config_out_t { + bool detect_keyword; + bool has_stream; + bool push_to_talk; + xrsr_stream_from_t stream_from; + xrsr_audio_format_t format; + bool user_initiated; + xrsr_session_config_cb_t cb_session_config; +}; + +struct xrsr_session_config_in_t { + xrsr_src_t src; + struct { + xrsr_cert_t client_cert; + bool host_verify; + bool ocsp_verify_stapling; + bool ocsp_verify_ca; + const char *sat_token; + const char *user_agent; + const char *query_strs[XRSR_QUERY_STRING_QTY_MAX + 1]; + } http; + struct { + xrsr_cert_t client_cert; + const char *sat_token; + bool host_verify; + bool ocsp_verify_stapling; + bool ocsp_verify_ca; + bool cert_expired_allow; + bool cert_revoked_allow; + bool ocsp_expired_allow; + uint32_t keyword_begin; + uint32_t keyword_duration; + void *app_config; + } ws; +}; + +struct xrsr_session_config_update_t { + int dummy; +}; + +typedef struct { + bool delete_files; + bool enable; + bool use_curtail; + uint32_t file_qty_max; + uint32_t file_size_max; + const char *dir_path; +} xrsr_capture_config_t; + +typedef enum { + XRSR_AUDIO_CONTAINER_NONE = 0, + XRSR_AUDIO_CONTAINER_WAV = 1 +} xrsr_audio_container_t; + +typedef enum { + XRSR_SESSION_REQUEST_TYPE_INVALID = 0, + XRSR_SESSION_REQUEST_TYPE_TEXT = 1, + XRSR_SESSION_REQUEST_TYPE_AUDIO_FILE = 2, + XRSR_SESSION_REQUEST_TYPE_AUDIO_MIC = 3, + XRSR_SESSION_REQUEST_TYPE_AUDIO_FD = 4 +} xrsr_session_request_type_t; + +typedef struct { + xrsr_session_request_type_t type; + union { + struct { + const char *text; + } text; + struct { + const char *path; + } audio_file; + struct { + bool stream_params_required; + } audio_mic; + struct { + int audio_fd; + xrsr_audio_format_t audio_format; + xrsr_session_audio_cb_t callback; + void *user_data; + } audio_fd; + } value; +} xrsr_session_request_t; + +typedef struct { + const char *vsdk_config; + const char *host_name; + bool networked_standby; + bool local_mic; + bool local_mic_tap; + int dummy; +} xrsr_config_t; + +bool xrsr_open(const char *host_name, xrsr_route_t *routes, const xrsr_handlers_t *handlers, const xrsr_capture_config_t *capture_config, xrsr_power_mode_t power_mode, bool privacy, bool mask_pii, void *json_obj_vsdk); +void xrsr_close(void); +bool xrsr_route(xrsr_route_t *routes); +void xrsr_session_terminate(xrsr_src_t src); +bool xrsr_config_get(xrsr_config_t *config); +bool xrsr_power_mode_set(xrsr_power_mode_t power_mode); +bool xrsr_privacy_mode_set(bool enable); +bool xrsr_privacy_mode_get(bool *enable); +void xrsr_mask_pii_set(bool enable); +bool xrsr_session_request(xrsr_src_t src, xrsr_audio_format_t format, xrsr_session_request_t request, const uuid_t *uuid, bool low_latency, bool low_cpu_util); +bool xrsr_session_audio_fd_set(xrsr_src_t src, int audio_fd, xrsr_audio_format_t format, xrsr_session_audio_cb_t callback, void *user_data); +void xrsr_session_audio_stream_start(xrsr_src_t src); +void xrsr_session_keyword_info_set(xrsr_src_t src, uint32_t pre_keyword_sample_qty, uint32_t keyword_sample_qty); +bool xrsr_session_capture_start(xrsr_audio_container_t container, const char *file_path, bool raw_mic_enable); +bool xrsr_session_capture_stop(void); +bool xrsr_capture_config_set(const xrsr_capture_config_t *capture_config); +const char *xrsr_audio_container_str(xrsr_audio_container_t container); +const char *xrsr_src_str(xrsr_src_t src); +const char *xrsr_session_end_reason_str(xrsr_session_end_reason_t reason); + +#ifdef __cplusplus +} +#endif + +#endif /* _XRSR_H_ */ diff --git a/ci/mocks/control/xrsv_http.h b/ci/mocks/control/xrsv_http.h new file mode 100644 index 00000000..3a4fbee8 --- /dev/null +++ b/ci/mocks/control/xrsv_http.h @@ -0,0 +1,57 @@ +/* + * Stub for xrsv_http.h - Voice HTTP endpoint types + * + * Copyright 2024 RDK Management + * Licensed under the Apache License, Version 2.0 + */ +#ifndef _XRSV_HTTP_H_ +#define _XRSV_HTTP_H_ + +#include "xrsr.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef void *xrsv_http_object_t; + +typedef struct { + const char *device_id; + const char *partner_id; + const char *experience; + const char *app_id; + const char *language; + bool test_flag; + bool mask_pii; + void *user_data; +} xrsv_http_params_t; + +typedef struct { + const char *transcription; + long return_code; +} xrsv_http_recv_msg_t; + +typedef struct { + void (*session_begin)(const uuid_t uuid, xrsr_src_t src, uint32_t dst_index, xrsr_session_config_out_t *configuration, rdkx_timestamp_t *timestamp, void *user_data); + void (*session_end)(const uuid_t uuid, xrsr_session_stats_t *stats, rdkx_timestamp_t *timestamp, void *user_data); + void (*stream_begin)(const uuid_t uuid, xrsr_src_t src, rdkx_timestamp_t *timestamp, void *user_data); + void (*stream_end)(const uuid_t uuid, xrsr_stream_stats_t *stats, rdkx_timestamp_t *timestamp, void *user_data); + void (*connected)(const uuid_t uuid, rdkx_timestamp_t *timestamp, void *user_data); + void (*disconnected)(const uuid_t uuid, rdkx_timestamp_t *timestamp, void *user_data); + void (*recv_msg)(xrsv_http_recv_msg_t *msg, void *user_data); +} xrsv_http_handlers_t; + +xrsv_http_object_t xrsv_http_create(const xrsv_http_params_t *params); +void xrsv_http_destroy(xrsv_http_object_t obj); +bool xrsv_http_handlers(xrsv_http_object_t obj, const xrsv_http_handlers_t *handlers, xrsr_handlers_t *handlers_out); +void xrsv_http_update_device_id(xrsv_http_object_t obj, const char *device_id); +void xrsv_http_update_partner_id(xrsv_http_object_t obj, const char *partner_id); +void xrsv_http_update_experience(xrsv_http_object_t obj, const char *experience); +void xrsv_http_update_language(xrsv_http_object_t obj, const char *language); +void xrsv_http_update_mask_pii(xrsv_http_object_t obj, bool enable); + +#ifdef __cplusplus +} +#endif + +#endif /* _XRSV_HTTP_H_ */ diff --git a/ci/mocks/control/xrsv_ws_nextgen.h b/ci/mocks/control/xrsv_ws_nextgen.h new file mode 100644 index 00000000..9861e9cd --- /dev/null +++ b/ci/mocks/control/xrsv_ws_nextgen.h @@ -0,0 +1,98 @@ +/* + * Stub for xrsv_ws_nextgen.h - Voice WebSocket NextGen endpoint types + * + * Copyright 2024 RDK Management + * Licensed under the Apache License, Version 2.0 + */ +#ifndef _XRSV_WS_NEXTGEN_H_ +#define _XRSV_WS_NEXTGEN_H_ + +#include "xrsr.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef void *xrsv_ws_nextgen_object_t; + +typedef enum { + XRSV_WS_NEXTGEN_DEVICE_TYPE_STB = 0, + XRSV_WS_NEXTGEN_DEVICE_TYPE_TV = 1 +} xrsv_ws_nextgen_device_type_t; + +typedef struct { + const char *device_id; + const char *account_id; + const char *partner_id; + const char *experience; + const char *audio_profile; + const char *audio_model; + const char *language; + const char *device_mac; + const char *rf_protocol; + bool test_flag; + bool bypass_wuw_verify_success; + bool bypass_wuw_verify_failure; + bool mask_pii; + void *user_data; +} xrsv_ws_nextgen_params_t; + +typedef struct { + uint32_t keyword_sample_begin; + uint32_t keyword_sample_end; + uint32_t keyword_doa; + float keyword_sensitivity; + bool keyword_sensitivity_triggered; + float keyword_sensitivity_high; + bool keyword_sensitivity_high_support; + bool keyword_sensitivity_high_triggered; + float dynamic_gain; + float linear_confidence; + float nonlinear_confidence; + float signal_noise_ratio; + bool push_to_talk; + uint32_t par_eos_timeout; +} xrsv_ws_nextgen_stream_params_t; + +typedef struct { + void (*session_begin)(const uuid_t uuid, xrsr_src_t src, uint32_t dst_index, xrsr_session_config_out_t *configuration, xrsv_ws_nextgen_stream_params_t *stream_params, rdkx_timestamp_t *timestamp, void *user_data); + void (*session_end)(const uuid_t uuid, xrsr_session_stats_t *stats, rdkx_timestamp_t *timestamp, void *user_data); + void (*stream_begin)(const uuid_t uuid, xrsr_src_t src, rdkx_timestamp_t *timestamp, void *user_data); + void (*stream_kwd)(const uuid_t uuid, rdkx_timestamp_t *timestamp, void *user_data); + void (*stream_end)(const uuid_t uuid, xrsr_stream_stats_t *stats, rdkx_timestamp_t *timestamp, void *user_data); + void (*connected)(const uuid_t uuid, rdkx_timestamp_t *timestamp, void *user_data); + void (*disconnected)(const uuid_t uuid, bool retry, rdkx_timestamp_t *timestamp, void *user_data); + void (*sent_init)(const uuid_t uuid, rdkx_timestamp_t *timestamp, void *user_data); + void (*listening)(void *user_data); + void (*asr)(const char *str_transcription, bool final, void *user_data); + void (*conn_close)(const char *reason, long ret_code, void *user_data); + void (*response_vrex)(long ret_code, void *user_data); + void (*wuw_verification)(const uuid_t uuid, bool passed, long confidence, void *user_data); + void (*source_error)(xrsr_src_t src, void *user_data); + void (*tv_mute)(bool mute, void *user_data); + void (*tv_power)(bool power, bool toggle, void *user_data); + void (*tv_volume)(bool up, uint32_t repeat_count, void *user_data); + void (*msg)(const char *msg, unsigned long length, void *user_data); +} xrsv_ws_nextgen_handlers_t; + +xrsv_ws_nextgen_object_t xrsv_ws_nextgen_create(const xrsv_ws_nextgen_params_t *params); +void xrsv_ws_nextgen_destroy(xrsv_ws_nextgen_object_t obj); +bool xrsv_ws_nextgen_handlers(xrsv_ws_nextgen_object_t obj, const xrsv_ws_nextgen_handlers_t *handlers, xrsr_handlers_t *handlers_out); +bool xrsv_ws_nextgen_update_init_app(xrsv_ws_nextgen_object_t obj, const char *init_app); +bool xrsv_ws_nextgen_send_msg(xrsv_ws_nextgen_object_t obj, const char *msg); +void xrsv_ws_nextgen_update_account_id(xrsv_ws_nextgen_object_t obj, const char *account_id); +void xrsv_ws_nextgen_update_device_id(xrsv_ws_nextgen_object_t obj, const char *device_id); +void xrsv_ws_nextgen_update_device_type(xrsv_ws_nextgen_object_t obj, xrsv_ws_nextgen_device_type_t type); +void xrsv_ws_nextgen_update_partner_id(xrsv_ws_nextgen_object_t obj, const char *partner_id); +void xrsv_ws_nextgen_update_experience(xrsv_ws_nextgen_object_t obj, const char *experience); +void xrsv_ws_nextgen_update_language(xrsv_ws_nextgen_object_t obj, const char *language); +void xrsv_ws_nextgen_update_mask_pii(xrsv_ws_nextgen_object_t obj, bool enable); +void xrsv_ws_nextgen_update_audio_profile(xrsv_ws_nextgen_object_t obj, const char *profile); +void xrsv_ws_nextgen_update_audio_model(xrsv_ws_nextgen_object_t obj, const char *model); +void xrsv_ws_nextgen_update_audio_rf_protocol(xrsv_ws_nextgen_object_t obj, const char *rf_protocol); + +#ifdef __cplusplus +} +#endif + +#endif /* _XRSV_WS_NEXTGEN_H_ */ diff --git a/ci/mocks/devicesettings.h b/ci/mocks/devicesettings.h new file mode 100644 index 00000000..28927b64 --- /dev/null +++ b/ci/mocks/devicesettings.h @@ -0,0 +1,2297 @@ +/** +* If not stated otherwise in this file or this component's LICENSE +* file the following copyright and licenses apply: +* +* Copyright 2024 RDK Management +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* +**/ + +#pragma once + +#include +#include +#include +#include +#include +#include + +/* +* Copyright (c) 2007 Dave Airlie +* Copyright (c) 2007 Jakob Bornecrantz +* Copyright (c) 2008 Red Hat Inc. +* Copyright (c) 2007-2008 Tungsten Graphics, Inc., Cedar Park, TX., USA +* Copyright (c) 2007-2008 Intel Corporation +* Licensed under the MIT License +*/ +#define DRM_DISPLAY_MODE_LEN 32 +#define DRM_PROP_NAME_LEN 32 + +#define DRM_MODE_PROP_RANGE (1<<1) +#define DRM_MODE_PROP_ENUM (1<<3) /* enumerated type with text strings */ +#define DRM_MODE_PROP_BLOB (1<<4) +#define DRM_MODE_PROP_BITMASK (1<<5) /* bitmask of enumerated types */ + +#define DRM_MODE_PROP_LEGACY_TYPE ( \ + DRM_MODE_PROP_RANGE | \ + DRM_MODE_PROP_ENUM | \ + DRM_MODE_PROP_BLOB | \ + DRM_MODE_PROP_BITMASK) + +#define DRM_MODE_PROP_EXTENDED_TYPE 0x0000ffc0 + +typedef unsigned int drm_context_t; +typedef unsigned int drm_magic_t; +typedef unsigned int drm_handle_t; +typedef unsigned int drm_drawable_t; + + +#include +#include +#include +#include + +typedef enum _dsAudioPortType_t { + dsAUDIOPORT_TYPE_ID_LR, /**< RCA audio output. */ + dsAUDIOPORT_TYPE_HDMI, /**< HDMI audio output. */ + dsAUDIOPORT_TYPE_SPDIF, /**< S/PDIF audio output. */ + dsAUDIOPORT_TYPE_SPEAKER, /**< SPEAKER audio output. */ + dsAUDIOPORT_TYPE_HDMI_ARC, /** < HDMI ARC/EARC audio output. */ + dsAUDIOPORT_TYPE_HEADPHONE, /**< 3.5mm headphone jack. */ + dsAUDIOPORT_TYPE_MAX /**< Maximum index for audio port type. */ +} dsAudioPortType_t; + +typedef enum _dsAudioDuckingAction_t { + dsAUDIO_DUCKINGACTION_START = 0, + dsAUDIO_DUCKINGACTION_STOP = 1 +} dsAudioDuckingAction_t; + +typedef enum _dsAudioDuckingType_t { + dsAUDIO_DUCKINGTYPE_ABSOLUTE = 0, + dsAUDIO_DUCKINGTYPE_RELATIVE = 1 +} dsAudioDuckingType_t; + +typedef enum _dsVideoPortType_t { + dsVIDEOPORT_TYPE_RF = 0, ///< RF modulator (channel 3/4) video output + dsVIDEOPORT_TYPE_BB, ///< Baseband (composite, RCA) video output + dsVIDEOPORT_TYPE_SVIDEO, ///< S-Video video output + dsVIDEOPORT_TYPE_1394, ///< IEEE 1394 (Firewire) video output + dsVIDEOPORT_TYPE_DVI, ///< DVI (Panel-Link, HDCP) video output + dsVIDEOPORT_TYPE_COMPONENT, ///< Component video output + dsVIDEOPORT_TYPE_HDMI, ///< HDMI video output + dsVIDEOPORT_TYPE_HDMI_INPUT, ///< HDMI video input + dsVIDEOPORT_TYPE_INTERNAL, ///< Internal (integrated/internal display) video output + dsVIDEOPORT_TYPE_MAX ///< Out of range +} dsVideoPortType_t; + +typedef enum _dsAudioFormat_t { + dsAUDIO_FORMAT_NONE, + dsAUDIO_FORMAT_PCM, + dsAUDIO_FORMAT_DOLBY_AC3, + dsAUDIO_FORMAT_DOLBY_EAC3, + dsAUDIO_FORMAT_DOLBY_AC4, + dsAUDIO_FORMAT_DOLBY_MAT, + dsAUDIO_FORMAT_DOLBY_TRUEHD, + dsAUDIO_FORMAT_DOLBY_EAC3_ATMOS, + dsAUDIO_FORMAT_DOLBY_TRUEHD_ATMOS, + dsAUDIO_FORMAT_DOLBY_MAT_ATMOS, + dsAUDIO_FORMAT_DOLBY_AC4_ATMOS, + dsAUDIO_FORMAT_AAC, + dsAUDIO_FORMAT_VORBIS, + dsAUDIO_FORMAT_WMA, + dsAUDIO_FORMAT_UNKNOWN, + dsAUDIO_FORMAT_MAX /**< Maximum . */ +} dsAudioFormat_t; + +typedef enum _dsAudioCapabilities_t { + dsAUDIOSUPPORT_NONE = 0x0, + dsAUDIOSUPPORT_ATMOS = 0x01, + dsAUDIOSUPPORT_DD = 0x02, + dsAUDIOSUPPORT_DDPLUS = 0x04, + dsAUDIOSUPPORT_DAD = 0x08, + dsAUDIOSUPPORT_DAPv2 = 0x10, + dsAUDIOSUPPORT_MS12 = 0x20, + dsAUDIOSUPPORT_MS12V2 = 0x40, + dsAUDIOSUPPORT_Invalid = 0x80, +} dsAudioCapabilities_t; + +typedef enum _dsAudioARCTypes_t { + dsAUDIOARCSUPPORT_NONE = 0x0, + dsAUDIOARCSUPPORT_ARC = 0x01, + dsAUDIOARCSUPPORT_eARC = 0x02, +} dsAudioARCTypes_t; + +typedef enum _dsMS12Capabilities_t { + dsMS12SUPPORT_NONE = 0x0, + dsMS12SUPPORT_DolbyVolume = 0x01, + dsMS12SUPPORT_InteligentEqualizer = 0x02, + dsMS12SUPPORT_DialogueEnhancer = 0x04, + dsMS12SUPPORT_Invalid = 0x80, +} dsMS12Capabilities_t; + +typedef struct _dsVolumeLeveller_t { + int mode; // 0 = off, 1= on, 2= auto + int level; +} dsVolumeLeveller_t; + +typedef struct _dsSurroundVirtualizer_t { + int mode; // 0 = off, 1= on, 2= auto + int boost; +} dsSurroundVirtualizer_t; + +typedef enum StereoMode { + dsAUDIO_STEREO_UNKNOWN, /**< Unknown mode. */ + dsAUDIO_STEREO_MONO = 1, /**< Mono mode. */ + dsAUDIO_STEREO_STEREO, /**< Normal stereo mode (L+R). */ + dsAUDIO_STEREO_SURROUND, /**< Surround mode. */ + dsAUDIO_STEREO_PASSTHRU, /**< Passthrough mode. */ + dsAUDIO_STEREO_DD, /**< Dolby Digital. */ + dsAUDIO_STEREO_DDPLUS, /**< Dolby Digital Plus. */ + dsAUDIO_STEREO_MAX /**< Maximum index for audio stereo types. */ +} dsAudioStereoMode_t; + +typedef enum _dsATMOSCapability_t { + dsAUDIO_ATMOS_NOTSUPPORTED = 0, /**< ATMOS audio not supported */ + dsAUDIO_ATMOS_DDPLUSSTREAM, /**< can handle dd plus stream which is only way to pass ATMOS metadata */ + dsAUDIO_ATMOS_ATMOSMETADATA, /**< capable of parsing ATMOS metadata */ +} dsATMOSCapability_t; + +typedef enum _dsAudioInput_t +{ + dsAUDIO_INPUT_PRIMARY = 0, /**< Primary Audio Input is main audio input provided to audio mixer */ + dsAUDIO_INPUT_SYSTEM, /**< System Audio Input to audio mixer , e.g Beep Sounds */ + dsAUDIO_INPUT_MAX /**< Out of range */ +} dsAudioInput_t; + +typedef enum _dsHdcpProtocolVersion_t { + dsHDCP_VERSION_1X = 0, /**< HDCP Protocol version 1.x */ + dsHDCP_VERSION_2X, /**< HDCP Protocol version 2.x */ + dsHDCP_VERSION_MAX /**< Maximum index for HDCP protocol. */ +} dsHdcpProtocolVersion_t; + +typedef enum _dsHdcpStatus_t { + dsHDCP_STATUS_UNPOWERED = 0, /**< Connected Sink Device does not support HDCP */ + dsHDCP_STATUS_UNAUTHENTICATED, /**< HDCP Authentication Process is not initiated */ + dsHDCP_STATUS_AUTHENTICATED, /**< HDCP Authentication Process is initiated and Passed */ + dsHDCP_STATUS_AUTHENTICATIONFAILURE, /**< HDCP Authentication Failure or Link Integroty Failure */ + dsHDCP_STATUS_INPROGRESS, /**< HDCP Authentication in Progress */ + dsHDCP_STATUS_PORTDISABLED, /**< HDMI output port disabled */ + dsHDCP_STATUS_MAX /**< Maximum index for HDCP status. */ +} dsHdcpStatus_t; + +typedef enum _dsVideoResolution_t { + dsVIDEO_PIXELRES_720x480, /**< 720x480 Resolution. */ + dsVIDEO_PIXELRES_720x576, /**< 720x576 Resolution. */ + dsVIDEO_PIXELRES_1280x720, /**< 1280x720 Resolution. */ + dsVIDEO_PIXELRES_1920x1080, /**< 1920x1080 Resolution. */ + dsVIDEO_PIXELRES_3840x2160, /**< 3840x2160 Resolution. */ + dsVIDEO_PIXELRES_4096x2160, /**< 3840x2160 Resolution. */ + dsVIDEO_PIXELRES_MAX /**< Maximum index for Video ouptut resolutions. */ +} dsVideoResolution_t; + +// typedef enum _dsTVResolution_t { +// dsTV_RESOLUTION_480i = 0x0001, /**< 480i Resolution. */ +// dsTV_RESOLUTION_480p = 0x0002, /**< 480p Resolution. */ +// dsTV_RESOLUTION_576i = 0x0004, /**< 576p Resolution. */ +// dsTV_RESOLUTION_576p = 0x0008, /**< 576p Resolution. */ +// dsTV_RESOLUTION_720p = 0x0010, /**< 720p Resolution. */ +// dsTV_RESOLUTION_1080i = 0x0020, /**< 1080i Resolution. */ +// dsTV_RESOLUTION_1080p = 0x0040, /**< 1080p Resolution. */ +// dsTV_RESOLUTION_2160p30 = 0x0080, /**< 2160p30 Resolution. */ +// dsTV_RESOLUTION_2160p60 = 0x0100, /**< 2160p60 Resolution. */ +// } dsTVResolution_t; + +typedef enum _dsTVResolution_t { + dsTV_RESOLUTION_480i = 0x0001, + dsTV_RESOLUTION_480p = 0x0002, + dsTV_RESOLUTION_576i = 0x0004, + dsTV_RESOLUTION_576p = 0x0008, + dsTV_RESOLUTION_576p50 = 0x0010, + dsTV_RESOLUTION_720p = 0x0020, + dsTV_RESOLUTION_720p50 = 0x0040, + dsTV_RESOLUTION_1080i = 0x0080, + dsTV_RESOLUTION_1080p = 0x0100, + dsTV_RESOLUTION_1080p24 = 0x0200, + dsTV_RESOLUTION_1080p25 = 0x0400, + dsTV_RESOLUTION_1080i25 = 0x0800, + dsTV_RESOLUTION_1080p30 = 0x1000, + dsTV_RESOLUTION_1080i50 = 0x2000, + dsTV_RESOLUTION_1080p50 = 0x4000, + dsTV_RESOLUTION_1080p60 = 0x8000, + dsTV_RESOLUTION_2160p24 = 0x10000, + dsTV_RESOLUTION_2160p25 = 0x20000, + dsTV_RESOLUTION_2160p30 = 0x40000, + dsTV_RESOLUTION_2160p50 = 0x80000, + dsTV_RESOLUTION_2160p60 = 0x100000, +} dsTVResolution_t; + +typedef enum _dsVideoFrameRate_t { + dsVIDEO_FRAMERATE_UNKNOWN, /**< Unknown frame rate. */ + dsVIDEO_FRAMERATE_24, /**< Played at 24 frames per second. */ + dsVIDEO_FRAMERATE_25, /**< Played at 25 frames per second. */ + dsVIDEO_FRAMERATE_30, /**< Played at 30 frames per second. */ + dsVIDEO_FRAMERATE_60, /**< Played at 60 frames per second. */ + dsVIDEO_FRAMERATE_23dot98, /**< Played at 23.98 frames per second. */ + dsVIDEO_FRAMERATE_29dot97, /**< Played at 29.97 frames per second. */ + dsVIDEO_FRAMERATE_50, /**< Played at 50 frames per second. */ + dsVIDEO_FRAMERATE_59dot94, /**< Played at 59.94 frames per second. */ + dsVIDEO_FRAMERATE_100, /**< Played at 100 frames per second. */ + dsVIDEO_FRAMERATE_119dot88, /**< Played at 119.88 frames per second. */ + dsVIDEO_FRAMERATE_120, /**< Played at 120 frames per second. */ + dsVIDEO_FRAMERATE_200, /**< Played at 200 frames per second. */ + dsVIDEO_FRAMERATE_239dot76, /**< Played at 23.76 frames per second. */ + dsVIDEO_FRAMERATE_240, /**< Played at 240 frames per second. */ + dsVIDEO_FRAMERATE_MAX /**< Maximum index for video frame rates. */ +} dsVideoFrameRate_t; + +typedef enum _dsVideoZoom_t { + dsVIDEO_ZOOM_UNKNOWN = -1, /**< Unknown mode. */ + dsVIDEO_ZOOM_NONE = 0, /**< Decoder format conversion is inactive. */ + dsVIDEO_ZOOM_FULL, /**< Full screen (16:9 video is streched to fit 4:3 frame). */ + dsVIDEO_ZOOM_LB_16_9, /**< 16:9 Letterbox (16:9 video is placed in a 4:3 frame with a full letterbox effect). */ + dsVIDEO_ZOOM_LB_14_9, /**< 14:9 Letterbox (16:9 video is transferred into a 4:3 frame with 14:9 letterbox effect). */ + dsVIDEO_ZOOM_CCO, /**< Center Cut-out (16:9 video is cut to fill 4:3 frame with its center part). */ + dsVIDEO_ZOOM_PAN_SCAN, /**< Pan & Scan (16:9 is cut and panned to fille 4:3 frame, following MPEG pan & scan vectors). */ + dsVIDEO_ZOOM_LB_2_21_1_ON_4_3, /**< 2.21:1 Letterbox on 4:3 (video is transferred into 4:3 frame with a 2.21:1 letterbox effect). */ + dsVIDEO_ZOOM_LB_2_21_1_ON_16_9, /**< 2.21:1 Letterbox on 16:9 (video is transferred into 16:9 frame with a 2.21:1 letterbox effect). */ + dsVIDEO_ZOOM_PLATFORM, /**< Control over the decoder format conversions is managed by the platform. */ + dsVIDEO_ZOOM_16_9_ZOOM, /**< 16:9 Zoom (4:3 video is zoomed to fill 16:9 frame). */ + dsVIDEO_ZOOM_PILLARBOX_4_3, /**< Pillarbox 4:3 (4:3 video is placed in a 16:9 frame with a pillarbox effect) */ + dsVIDEO_ZOOM_WIDE_4_3, /**< Wide 4:3 (4:3 video is stretched to fill 16:9 frame). */ + dsVIDEO_ZOOM_MAX /**< Maximum index for screen zoom modes. */ +} dsVideoZoom_t; + +typedef enum _dsVideoAspectRatio_t { + dsVIDEO_ASPECT_RATIO_4x3, /**< 4:3 aspect ratio. */ + dsVIDEO_ASPECT_RATIO_16x9, /**< 16:9 aspect ratio. */ + dsVIDEO_ASPECT_RATIO_MAX /**< Maximum index for video aspect ratios. */ +} dsVideoAspectRatio_t; + +typedef enum _dsVideoStereoScopicMode_t { + dsVIDEO_SSMODE_UNKNOWN = 0, /**< Unknown mode. */ + dsVIDEO_SSMODE_2D, /**< 2D mode. */ + dsVIDEO_SSMODE_3D_SIDE_BY_SIDE, /**< 3D side by side (L/R) stereo mode. */ + dsVIDEO_SSMODE_3D_TOP_AND_BOTTOM, /**< 3D top & bottom stereo mode. */ + dsVIDEO_SSMODE_MAX /**< Maximum index for video stereoscopic modes. */ +} dsVideoStereoScopicMode_t; + +typedef struct _dsVideoPortResolution_t { + char name[32]; /**< Name the resolution (e.g. 480i, 480p, 1080p24). */ + dsVideoResolution_t pixelResolution; /**< The resolution associated with the name. */ + dsVideoAspectRatio_t aspectRatio; /**< The associated aspect ratio. */ + dsVideoStereoScopicMode_t stereoScopicMode; /**< The associated stereoscopic mode. */ + dsVideoFrameRate_t frameRate; /**< The associated frame rate. */ + bool interlaced; /**< The associated scan mode(@a true if interlaced, @a false if progressive). */ +} dsVideoPortResolution_t; + +typedef enum _dsHDRStandard_t { + dsHDRSTANDARD_NONE = 0x0, + dsHDRSTANDARD_HDR10 = 0x01, + dsHDRSTANDARD_HLG = 0x02, + dsHDRSTANDARD_DolbyVision = 0x04, + dsHDRSTANDARD_TechnicolorPrime = 0x08, + dsHDRSTANDARD_HDR10PLUS = 0x10, + dsHDRSTANDARD_SDR = 0x20, + dsHDRSTANDARD_Invalid = 0x80, +} dsHDRStandard_t; + +typedef enum _dsSURROUNDMode_t { + dsSURROUNDMODE_NONE = 0x0, + dsSURROUNDMODE_DD = 0x1, + dsSURROUNDMODE_DDPLUS = 0x2, +} dsSURROUNDMode_t; + +typedef enum _dsDisplayColorDepth_t { + dsDISPLAY_COLORDEPTH_UNKNOWN = 0x0, /* Unknown color depth */ + dsDISPLAY_COLORDEPTH_8BIT = 0x01, /* 8 bit color depth */ + dsDISPLAY_COLORDEPTH_10BIT = 0x02, /* 10 bit color depth */ + dsDISPLAY_COLORDEPTH_12BIT = 0x04, /* 12 bit color depth */ + dsDISPLAY_COLORDEPTH_AUTO = 0x08 /* Automatic color depth */ +} dsDisplayColorDepth_t; + +typedef enum _dsHdmiInPort_t { + dsHDMI_IN_PORT_NONE = -1, + dsHDMI_IN_PORT_0, + dsHDMI_IN_PORT_1, + dsHDMI_IN_PORT_2, + dsHDMI_IN_PORT_MAX +} dsHdmiInPort_t; + +typedef enum _dsHdmiInSignalStatus_t { + dsHDMI_IN_SIGNAL_STATUS_NONE = -1, + dsHDMI_IN_SIGNAL_STATUS_NOSIGNAL, + dsHDMI_IN_SIGNAL_STATUS_UNSTABLE, + dsHDMI_IN_SIGNAL_STATUS_NOTSUPPORTED, + dsHDMI_IN_SIGNAL_STATUS_STABLE, + dsHDMI_IN_SIGNAL_STATUS_MAX +} dsHdmiInSignalStatus_t; + +typedef enum dsAviContentType { + dsAVICONTENT_TYPE_GRAPHICS, /*!< Content type Graphics. - ITC=1, CN1=0, CN0=0 */ + dsAVICONTENT_TYPE_PHOTO, /*!< Content type Photo - ITC=1, CN1=0, CN0=1 */ + dsAVICONTENT_TYPE_CINEMA, /*!< Content type Cinema - ITC=1, CN1=1, CN0=0 */ + dsAVICONTENT_TYPE_GAME, /*!< Content type Game - ITC=1, CN1=1, CN0=1 */ + dsAVICONTENT_TYPE_NOT_SIGNALLED,/*!< Content type no data - ITC=0, CN1=0, CN0=0 */ + dsAVICONTENT_TYPE_MAX, /*!< Out of range */ +}dsAviContentType_t; + +struct dsSpd_infoframe_st { + uint8_t pkttype; + uint8_t version; + uint8_t length; /*length=25*/ + uint8_t rsd; + uint8_t checksum; + /*Vendor Name Character*/ + uint8_t vendor_name[8]; + /*Product Description Character*/ + uint8_t product_des[16]; + /*byte 25*/ + uint8_t source_info; +}; + +typedef enum tv_hdmi_edid_version_e { + HDMI_EDID_VER_14 = 0, + HDMI_EDID_VER_20, + HDMI_EDID_VER_MAX, +} tv_hdmi_edid_version_t; + +typedef enum _dsAudioPortState { + dsAUDIOPORT_STATE_UNINITIALIZED, + dsAUDIOPORT_STATE_INITIALIZED, + dsAUDIOPORT_STATE_MAX +} dsAudioPortState_t; + +typedef enum { + dsERR_NONE = 0, ///< Input output operation is successful + dsERR_GENERAL = 1, ///< Operation general error. + dsERR_INVALID_PARAM, ///< Invalid parameter is passed to the module + dsERR_INVALID_STATE, ///< Module is in an invalid state + dsERR_ALREADY_INITIALIZED, ///< Module is already initialised + dsERR_NOT_INITIALIZED, ///< Module is not initialised + dsERR_OPERATION_NOT_SUPPORTED, ///< Operation not supported + dsERR_RESOURCE_NOT_AVAILABLE, ///< Resources have failed to allocate + dsERR_OPERATION_FAILED, ///< The attempted operation has failed. Used when a SoC call has a failure + dsErr_MAX +} dsError_t; + +#define MAX_LANGUAGE_LEN 10 +#define DSMGR_MAX_VIDEO_PORT_NAME_LENGTH 128 + +typedef struct { + bool isEnabled; + bool result; + char port[DSMGR_MAX_VIDEO_PORT_NAME_LENGTH]; + } dsMgrStandbyVideoStateParam_t; + +typedef struct { + bool result; + bool isEnabled; + char port[DSMGR_MAX_VIDEO_PORT_NAME_LENGTH]; + } IARM_Bus_PWRMgr_StandbyVideoState_Param_t; + +typedef enum _dsSleepMode_t { + dsHOST_SLEEP_MODE_LIGHT, /**< Light sleep mode. */ + dsHOST_SLEEP_MODE_DEEP, /**< Deep sleep mode. */ + dsHOST_SLEEP_MODE_MAX, /**< Maximum index for sleep modes */ +} dsSleepMode_t; + +typedef enum __dsFPDTimeFormat_t { + dsFPD_TIME_12_HOUR, /**< 12 hour time format. */ + dsFPD_TIME_24_HOUR, /**< 24 hour time format. */ + dsFPD_TIME_STRING /**< Text string. */ +} dsFPDTimeFormat_t; + +typedef enum _dsCompInSignalStatus_t { + dsCOMP_IN_SIGNAL_STATUS_NONE = -1, + dsCOMP_IN_SIGNAL_STATUS_NOSIGNAL, + dsCOMP_IN_SIGNAL_STATUS_UNSTABLE, + dsCOMP_IN_SIGNAL_STATUS_NOTSUPPORTED, + dsCOMP_IN_SIGNAL_STATUS_STABLE, + dsCOMP_IN_SIGNAL_STATUS_MAX +} dsCompInSignalStatus_t; + +typedef enum _dsCompositeInPort_t { + dsCOMPOSITE_IN_PORT_NONE = -1, + dsCOMPOSITE_IN_PORT_0, + dsCOMPOSITE_IN_PORT_1, + dsCOMPOSITE_IN_PORT_MAX +} dsCompositeInPort_t; + +typedef enum dsHdmiMaxCapabilityVersion{ + HDMI_COMPATIBILITY_VERSION_14 = 0, /*!< Hdmi Compatibility Version 1.4 */ + HDMI_COMPATIBILITY_VERSION_20, /*!< Hdmi Compatibility Version 2.0 */ + HDMI_COMPATIBILITY_VERSION_21, /*!< Hdmi Compatibility Version 2.1 */ + HDMI_COMPATIBILITY_VERSION_MAX /*!< Out of bounds */ + }dsHdmiMaxCapabilityVersion_t; + +typedef enum dsVRRType { + dsVRR_NONE, + dsVRR_HDMI_VRR, + dsVRR_AMD_FREESYNC, + dsVRR_AMD_FREESYNC_PREMIUM, + dsVRR_AMD_FREESYNC_PREMIUM_PRO +} dsVRRType_t; + +typedef enum _dsAVIScanInformation_t { + dsAVI_SCAN_TYPE_NO_DATA = 0, ///< No data signalling - S1=0, S0=0 + dsAVI_SCAN_TYPE_OVERSCAN = 1, ///< Overscan signalling - S1=0, S0=1 + dsAVI_SCAN_TYPE_UNDERSCAN = 2, ///< Underscan signalling - S1=1, S0=0 + dsAVI_SCAN_TYPE_MAX ///< Out of range +} dsAVIScanInformation_t; + +typedef struct _dsHdmiInVrrStatus_t +{ + dsVRRType_t vrrType; /*! Type of VRR */ + double vrrAmdfreesyncFramerate_Hz; /*! Display VRR FrameRate in Hz */ +} dsHdmiInVrrStatus_t; + +/*! DS Manager Event Data */ +typedef struct _DSMgr_EventData_t { + union { + struct _RESOLUTION_DATA { + /* Declare Event Data structure for Video resolution Event */ + int width; /*!< Resolution Width */ + int height; /*!< Key code */ + } resn; /*Reolution data*/ + struct _DFC_DATA { + /* Declare Event Data structure for Zoom settings Event */ + int zoomsettings; + } dfc; /*zoom data*/ + + struct _AUDIOMODE_DATA { + /* Declare Event Data structure for Video resolution Event */ + int type; /*!< device type */ + int mode; /*!< device mode */ + } Audioport; /*Audio mode data*/ + + struct _ATMOS_CAPS_CHANGE { + dsATMOSCapability_t caps; + bool status; + } AtmosCapsChange; + + struct _HDMI_HPD_DATA { + /* Declare HDMI HPD Data */ + int event; + } hdmi_hpd; /*HDMI Hot Plug detect*/ + + struct _HDMI_HDCP_DATA { + /* Declare HDMI DCP Data */ + int hdcpStatus; + } hdmi_hdcp; /*HDMI HDCP Hot Plug detect*/ + + struct _HDMI_RXSENSE_DATA { + /* Declare HDMI Rx Sense status */ + int status; + } hdmi_rxsense; /*HDMI Rx Sense Data*/ + + struct _HDMI_IN_CONNECT_DATA { + dsHdmiInPort_t port; + bool isPortConnected; + } hdmi_in_connect; + + struct _HDMI_IN_STATUS_DATA { + /* Declare HDMI Input status*/ + dsHdmiInPort_t port; + bool isPresented; + } hdmi_in_status; /*HDMI in status change detect*/ + + struct _HDMI_IN_SIG_STATUS_DATA { + /* Declare HDMI In signal status*/ + dsHdmiInPort_t port; + dsHdmiInSignalStatus_t status; + } hdmi_in_sig_status; /*HDMI in signal change detect*/ + + struct _HDMI_IN_VIDEO_MODE_DATA { + /* Declare HDMI In signal status*/ + dsHdmiInPort_t port; + dsVideoPortResolution_t resolution; + } hdmi_in_video_mode; /*HDMI in video mode update*/ + + struct _COMPOSITE_IN_CONNECT_DATA { + dsCompositeInPort_t port; + bool isPortConnected; + } composite_in_connect; + + struct _COMPOSITE_IN_STATUS_DATA { + /* Declare Composite Input status*/ + dsCompositeInPort_t port; + bool isPresented; + } composite_in_status; /*Composite in status change detect*/ + + struct _COMPOSITE_IN_SIG_STATUS_DATA { + /* Declare Composite In signal status*/ + dsCompositeInPort_t port; + dsCompInSignalStatus_t status; + } composite_in_sig_status; /*Composite in signal change detect*/ + + struct _COMPOSITE_IN_VIDEO_MODE_DATA{ + /* Declare COMPOSITE In Video Mode*/ + dsCompositeInPort_t port; + dsVideoPortResolution_t resolution; + }composite_in_video_mode; /*Composite in video mode update*/ + + struct _FPD_TIME_FORMAT { + dsFPDTimeFormat_t eTimeFormat; + } FPDTimeFormat; + + struct _HDCP_PROTOCOL_DATA { + dsHdcpProtocolVersion_t protocolVersion; + } HDCPProtocolVersion; + struct _SLEEP_MODE_DATA { + dsSleepMode_t sleepMode; + } sleepModeInfo; + + struct _AUDIO_LEVEL_DATA { + int level; + } AudioLevelInfo; + + struct _AUDIO_OUT_CONNECT_DATA { + dsAudioPortType_t portType; + unsigned int uiPortNo; + bool isPortConnected; + } audio_out_connect; + + struct _AUDIO_FORMAT_DATA { + dsAudioFormat_t audioFormat; + } AudioFormatInfo; + + struct _LANGUAGE_DATA { + char audioLanguage[MAX_LANGUAGE_LEN]; + } AudioLanguageInfo; + + struct _FADER_CONTROL_DATA { + int mixerbalance; + } FaderControlInfo; + + struct _ASSOCIATED_AUDIO_MIXING_DATA { + bool mixing; + } AssociatedAudioMixingInfo; + + struct _VIDEO_FORMAT_DATA { + dsHDRStandard_t videoFormat; + } VideoFormatInfo; + + struct _AUDIO_PORTSTATE_DATA { + dsAudioPortState_t audioPortState; + } AudioPortStateInfo; + + struct _HDMI_IN_ALLM_MODE_DATA { + /* Declare HDMI In ALLM Mode*/ + dsHdmiInPort_t port; + bool allm_mode; + } hdmi_in_allm_mode; /*HDMI in ALLM Mode change*/ + + struct _HDMI_IN_VRR_MODE_DATA{ + /* Declare HDMI In VRR Mode*/ + dsHdmiInPort_t port; + dsVRRType_t vrr_type; + }hdmi_in_vrr_mode; /*HDMI in VRR Mode change*/ + + struct _HDMI_IN_CONTENT_TYPE_DATA{ + dsHdmiInPort_t port; + dsAviContentType_t aviContentType; + }hdmi_in_content_type; + struct _HDMI_IN_AV_LATENCY{ + int audio_output_delay; + int video_latency; + }hdmi_in_av_latency; /*HDMI in AVLatency change*/ + struct _DISPLAY_FRAMERATE_CHANGE { + char framerate[20]; + }DisplayFrameRateChange; + } data; +} IARM_Bus_DSMgr_EventData_t; + +typedef enum _dsDisplayEvent_t { + dsDISPLAY_EVENT_CONNECTED = 0, //!< Display connected event. + dsDISPLAY_EVENT_DISCONNECTED, //!< Display disconnected event. + dsDISPLAY_RXSENSE_ON, //!< Rx Sense ON event + dsDISPLAY_RXSENSE_OFF, //!< Rx Sense OFF event + dsDISPLAY_HDCPPROTOCOL_CHANGE, //!< HDCP Protocol Version Change event + dsDISPLAY_EVENT_MAX +} dsDisplayEvent_t; + +typedef enum _dsDisplayColorSpace_t +{ + dsDISPLAY_COLORSPACE_UNKNOWN = 0, ///< Unknown color space + dsDISPLAY_COLORSPACE_RGB = 1, ///< RGB color space + dsDISPLAY_COLORSPACE_YCbCr422 = 2, ///< YCbCr4.2.2 color space + dsDISPLAY_COLORSPACE_YCbCr444 = 3, ///< YCbCr4.4.4 color space + dsDISPLAY_COLORSPACE_YCbCr420 = 4, ///< YCbCr4.2.0 color space + dsDISPLAY_COLORSPACE_AUTO = 5, ///< Automatic color space + dsDISPLAY_COLORSPACE_MAX ///< Out of range +} dsDisplayColorSpace_t; + +typedef enum _dsDisplayQuantizationRange_t +{ + dsDISPLAY_QUANTIZATIONRANGE_UNKNOWN = 0, ///< Unknown quantization range + dsDISPLAY_QUANTIZATIONRANGE_LIMITED = 1, ///< Limited quantization range + dsDISPLAY_QUANTIZATIONRANGE_FULL = 2, ///< Full quantization range + dsDISPLAY_QUANTIZATIONRANGE_MAX ///< Out of range +} dsDisplayQuantizationRange_t; + +typedef uint32_t dsFPDColor_t; +#define dsFPDColor_Make(R8,G8,B8) (((R8)<< 8)|((G8)<<8)|((B8) )) +#define dsFPD_COLOR_WHITE dsFPDColor_Make(0xFF, 0xFF, 0xFF) + +typedef struct _dsFPDColorConfig_t{ + int id; + dsFPDColor_t color; +}dsFPDColorConfig_t; + +namespace device { + +template +using List = std::vector; + +} + +namespace device { + +class Exception : public std::exception { + int _err; + std::string _msg; + +public: + Exception(const char* msg = "No Message for this exception") throw() + : _msg(msg) + { + } + + Exception(int err, const char* msg = "No Message for this Exception") throw() + : _err(err) + , _msg(msg){}; + + virtual const std::string& getMessage() const + { + return _msg; + } + + virtual int getCode() const + { + return _err; + } + + virtual const char* what() const throw() + { + return _msg.c_str(); + } + + virtual ~Exception() throw(){}; +}; + +} + +namespace device { +class AudioStereoModeImpl { +public: + virtual ~AudioStereoModeImpl() = default; + virtual const std::string& getName() const = 0; + + virtual std::string toString() = 0; + +}; + +class AudioStereoMode { +protected: + static AudioStereoModeImpl* impl; + int audioMode; + +public: + AudioStereoMode(); + static void setImpl(AudioStereoModeImpl* newImpl); + const std::string& getName() const; + + static const int kMono; //!< Indicates audio mode of type mono. + static const int kStereo; //!< Indicates audio mode of type stereo. + static const int kSurround; //!< Indicates audio mode of type surround. + static const int kPassThru; //!< Indicates audio mode of type pass through. + static const int kDD; //!< Indicates audio mode of type dolby digital. + static const int kDDPlus; //!< Indicates audio mode of type dolby digital plus. + static const int kMax; //!< Indicates maximum number of audio modes supported. + + bool operator==(const AudioStereoMode& other) const { + return audioMode == other.audioMode; + } + AudioStereoMode& operator=(int mode) { + audioMode = mode; + return *this; +} + + std::string toString(); + AudioStereoMode(int id); +}; + +} + +namespace device { + +class AudioOutputPortTypeImpl { +public: + virtual ~AudioOutputPortTypeImpl() = default; + + virtual int getId() const = 0; +}; + +class AudioOutputPortType { +protected: + static AudioOutputPortTypeImpl* impl; + +public: + AudioOutputPortType(); + static void setImpl(AudioOutputPortTypeImpl* newImpl); + + static const int kHDMI; + static const int kARC; + static const int kSPDIF; + static const int kSPEAKER; + static const int kHEADPHONE; + int getId() const; + + +}; + +} +namespace device { + +class AudioOutputPortImpl { +public: + virtual ~AudioOutputPortImpl() = default; + + virtual const AudioOutputPortType& getType() const = 0; + + virtual const std::string& getName() const = 0; + virtual std::vector getMS12AudioProfileList() const = 0; + virtual void getAudioCapabilities(int* capabilities) = 0; + virtual void getMS12Capabilities(int* capabilities) = 0; + virtual bool isAudioMSDecode() const = 0; + + virtual bool getEnablePersist() = 0; + virtual void getHdmiArcPortId(int *portId) = 0; + virtual bool isConnected() = 0; + virtual void setDRCMode(int DRCMode) = 0; + virtual void setCompression (int compresionLevel) = 0; + virtual int getCompression() = 0; + virtual void setDolbyVolumeMode(bool dolbyVolumeMode) = 0; + virtual void setDialogEnhancement(int enhancerlevel) = 0; + virtual int getDialogEnhancement() = 0; + virtual void resetDialogEnhancement() = 0; + virtual void setIntelligentEqualizerMode (int intelligentEqualizerMode) = 0; + virtual int getIntelligentEqualizerMode() = 0; + virtual void setGraphicEqualizerMode (int graphicEqualizerMode) = 0; + virtual int getGraphicEqualizerMode() = 0; + virtual void setMS12AudioProfile(std::string audioProfileName) = 0; + virtual void resetVolumeLeveller() = 0; + virtual void resetSurroundVirtualizer() = 0; + virtual void resetBassEnhancer() = 0; + virtual void getSupportedARCTypes(int *types) = 0; + virtual void setEnablePersist(bool pEnable) = 0; + virtual dsError_t setEnablePort(bool pEnable) = 0; + virtual bool isMuted() = 0; + virtual void setAudioAtmosOutputMode (int enable) = 0; + virtual bool getSinkDeviceAtmosCapability(dsATMOSCapability_t& atmosCapability) = 0; + virtual void setAudioDelayOffset(int audioDelayOffsetMs) = 0; + virtual void setAudioDelay(int audioDelayMs) = 0; + virtual void getAudioDelay(uint32_t audioDelayMs) = 0; + virtual void getSecondaryLanguage(std::string secondaryLanguage) = 0; + virtual void setSecondaryLanguage(std::string secondaryLanguage) = 0; + virtual void setPrimaryLanguage(std::string primaryLanguage) = 0; + virtual void getPrimaryLanguage(std::string primaryLanguage) = 0; + virtual void getFaderControl(int *mixerBalance) = 0; + virtual void setFaderControl(int mixerBalance) = 0; + virtual void setAssociatedAudioMixing(bool mixing) = 0; + virtual void setGain(float newGain) = 0; + virtual void setMISteering(bool MISteering) = 0; + virtual void setSurroundVirtualizer(dsSurroundVirtualizer_t surroundVirtualizer) = 0; + virtual void setBassEnhancer(int bassBoost) = 0; + virtual void enableSurroundDecoder(bool enableSurroundDecoder) = 0; + virtual void setVolumeLeveller(dsVolumeLeveller_t volumeLeveller) = 0; + virtual bool getMISteering() = 0; + virtual dsSurroundVirtualizer_t getSurroundVirtualizer() = 0; + virtual int getDRCMode() = 0; + virtual float getLevel() = 0; + virtual float getGain() = 0; + virtual bool isSurroundDecoderEnabled() = 0; + virtual int getBassEnhancer() = 0; + virtual dsVolumeLeveller_t getVolumeLeveller() = 0; + virtual bool getStereoAuto() = 0; + virtual void setStereoAuto(bool stereoAuto, bool persist) = 0; + virtual std::string getMS12AudioProfile() = 0; + virtual void setMS12AudioProfileSetttingsOverride(std::string audioProfileState,std::string audioProfileName,std::string audioProfileSettingsName, std::string audioProfileSettingValue) = 0; + virtual void setLevel(float level) = 0; + virtual void setMuted(bool muted) = 0; + virtual void getAssociatedAudioMixing(bool *mixing) = 0; + virtual bool isEnabled() = 0; + virtual void setSAD(std::vector sad_list) = 0; + virtual void reInitializeAudioOutputPort() = 0; + virtual void getAudioDelayOffset (uint32_t audioDelayOffsetMs) = 0; + // virtual const List getSupportedStereoModes() const = 0; + virtual std::vector getSupportedStereoModes() const = 0; + + + + + virtual AudioStereoMode getStereoMode(const bool toPersist) const= 0; + + virtual AudioStereoMode getStereoMode() const= 0; + + + virtual void enableARC(dsAudioARCTypes_t type, bool enable) = 0; + + virtual uint32_t getDolbyVolumeMode() const = 0; + + virtual void setStereoMode(const std::string &mode, bool persist) = 0; + + +}; + +class AudioOutputPort { +protected: + static AudioOutputPortImpl* impl; + +public: + AudioOutputPort(); + static void setImpl(AudioOutputPortImpl* newImpl); + static AudioOutputPort& getInstance(); + + const AudioOutputPortType& getType() const; + + // dsATMOSCapability_t atmosCapability=dsATMOSCapability_t::dsAUDIO_ATMOS_ATMOSMETADATA; + const std::string& getName() const; + std::vector getMS12AudioProfileList() const; + void getAudioCapabilities(int* capabilities); + void getMS12Capabilities(int* capabilities); + bool isAudioMSDecode(); + void reInitializeAudioOutputPort(); + bool getEnablePersist(); + void getHdmiArcPortId(int *portId); + bool isConnected(); + + int getDRCMode(); + void setDRCMode(int DRCMode); + void setCompression (int compresionLevel); + int getCompression(); + void setDolbyVolumeMode(bool dolbyVolumeMode); + + void setDialogEnhancement(int enhancerlevel); + int getDialogEnhancement(); + void setIntelligentEqualizerMode (int intelligentEqualizerMode); + int getIntelligentEqualizerMode(); + void setGraphicEqualizerMode (int graphicEqualizerMode); + int getGraphicEqualizerMode(); + void setMS12AudioProfile(std::string audioProfileName); + void resetVolumeLeveller(); + void resetSurroundVirtualizer(); + void resetBassEnhancer(); + void resetDialogEnhancement(); + void getSupportedARCTypes(int *types); + void setEnablePersist(bool pEnable); + dsError_t setEnablePort(bool pEnable); + bool isMuted(); + void setAudioAtmosOutputMode (int enable); + bool getSinkDeviceAtmosCapability(dsATMOSCapability_t& atmosCapability); + void setAudioDelayOffset(int audioDelayOffsetMs); + void setAudioDelay(int audioDelayMs); + void getAudioDelay(uint32_t audioDelayMs); + void getSecondaryLanguage(std::string secondaryLanguage); + void setSecondaryLanguage(std::string secondaryLanguage); + void setPrimaryLanguage(std::string primaryLanguage); + void getPrimaryLanguage(std::string primaryLanguage); + void getFaderControl(int *mixerBalance); + void setFaderControl(int mixerBalance); + void setAssociatedAudioMixing(bool mixing); + void setGain(float newGain); + void setMISteering(bool MISteering); + void setSurroundVirtualizer(dsSurroundVirtualizer_t surroundVirtualizer); + void setBassEnhancer(int bassBoost); + void enableSurroundDecoder(bool enableSurroundDecoder); + void setVolumeLeveller(dsVolumeLeveller_t volumeLeveller); + bool getMISteering(); + dsSurroundVirtualizer_t getSurroundVirtualizer(); + float getLevel(); + float getGain(); + bool isSurroundDecoderEnabled(); + int getBassEnhancer(); + dsVolumeLeveller_t getVolumeLeveller(); + bool getStereoAuto(); + void setStereoAuto(bool stereoAuto, bool persist); + std::string getMS12AudioProfile(); + void setMS12AudioProfileSetttingsOverride(std::string audioProfileState,std::string audioProfileName,std::string audioProfileSettingsName, std::string audioProfileSettingValue); + void setLevel(float level); + void setMuted(bool muted); + void getAssociatedAudioMixing(bool *mixing); + bool isEnabled(); + void setSAD(std::vector sad_list); + void getAudioDelayOffset (uint32_t audioDelayOffsetMs); + + // const List getSupportedStereoModes() const; + const std::vector getSupportedStereoModes() const; + + AudioStereoMode getStereoMode(const bool toPersist) const; + + AudioStereoMode getStereoMode() const; + + void enableARC(dsAudioARCTypes_t type, bool enable); + uint32_t getDolbyVolumeMode() const; + void setStereoMode(const std::string &mode, bool persist); + void setAudioDucking(dsAudioDuckingAction_t action, dsAudioDuckingType_t type, float level) { + (void)action; + (void)type; + (void)level; + } + + + + +}; + +} + +namespace device { +class CompositeInputImpl { +public: + virtual ~CompositeInputImpl() = default; + virtual uint8_t getNumberOfInputs() const = 0; + virtual bool isPortConnected(int8_t Port) const = 0; + virtual void selectPort(int8_t Port) const = 0; + virtual void scaleVideo(int32_t x, int32_t y, int32_t width, int32_t height) const = 0; +}; + +class CompositeInput { +protected: + static CompositeInputImpl* impl; + +public: + CompositeInput(); + static void setImpl(CompositeInputImpl* newImpl); + static CompositeInput& getInstance(); + + uint8_t getNumberOfInputs() const; + bool isPortConnected(int8_t port) const; + void selectPort(int8_t port) const; + void scaleVideo(int32_t x, int32_t y, int32_t width, int32_t height) const; +}; + +} + +namespace device { + +class HdmiInputImpl { +public: + virtual ~HdmiInputImpl() = default; + + virtual uint8_t getNumberOfInputs() const = 0; + virtual bool isPortConnected(int8_t Port) const = 0; + virtual std::string getCurrentVideoMode() const = 0; + virtual void selectPort(int8_t Port,bool audioMix = false, int videoPlane = 0,bool topMost = false) const = 0; + virtual void scaleVideo(int32_t x, int32_t y, int32_t width, int32_t height) const = 0; + // virtual void setAudioMixerLevels(dsAudioInput_t gain, int volume) const = 0; + virtual void getEDIDBytesInfo(int iHdmiPort, std::vector& edid) const = 0; + virtual void getHDMISPDInfo(int iHdmiPort, std::vector& data) const = 0; + virtual void setEdidVersion(int iHdmiPort, int iEdidVersion) const = 0; + virtual void getEdidVersion(int iHdmiPort, int* iEdidVersion) const = 0; + virtual void getHdmiALLMStatus(int iHdmiPort, bool* allmStatus) const = 0; + virtual void getVRRStatus(int iHdmiPort, dsHdmiInVrrStatus_t *vrrStatus) const = 0; + virtual void getSupportedGameFeatures(std::vector& featureList) const = 0; + virtual void getAVLatency(int *audio_output_delay, int *video_latency) const = 0; + virtual void setEdid2AllmSupport(int iHdmiPort, bool allmsupport) const = 0; + virtual void getEdid2AllmSupport(int iHdmiPort, bool *allmsupport) const = 0; + virtual void setVRRSupport(int iHdmiPort, bool vrrsupport) const = 0; + virtual void getVRRSupport(int iHdmiPort, bool *vrrsupport) const = 0; + virtual void getCurrentVideoModeObj (dsVideoPortResolution_t &resolution) const = 0; + virtual void getHdmiVersion (int iHdmiPort, dsHdmiMaxCapabilityVersion_t *capversion) const = 0; + virtual dsError_t getHDMIARCPortId(int &portId) const = 0; +}; + +class HdmiInput { +protected: + static HdmiInputImpl* impl; + +public: + HdmiInput(); + static void setImpl(HdmiInputImpl* newImpl); + static HdmiInput& getInstance(); // Changed return type + + uint8_t getNumberOfInputs() const; + bool isPortConnected(int8_t port) const; + std::string getCurrentVideoMode() const; + void selectPort(int8_t Port,bool audioMix = false, int videoPlane = 0,bool topMost = false) const; + void scaleVideo(int32_t x, int32_t y, int32_t width, int32_t height) const; + void getEDIDBytesInfo(int iHdmiPort, std::vector& edid) const; + void getHDMISPDInfo(int iHdmiPort, std::vector& data) const; + void setEdidVersion(int iHdmiPort, int iEdidVersion) const; + void getEdidVersion(int iHdmiPort, int* iEdidVersion) const; + + void getHdmiALLMStatus(int iHdmiPort, bool* allmStatus) const; + void getVRRStatus(int iHdmiPort, dsHdmiInVrrStatus_t *vrrStatus) const; + void getSupportedGameFeatures(std::vector& featureList) const; + void getAVLatency(int *audio_output_delay, int *video_latency)const; + void setEdid2AllmSupport(int iport, bool allmSupport) const; + void getEdid2AllmSupport(int iport, bool *allmSupport) const; + void setVRRSupport(int iHdmiPort, bool vrrsupport) const; + void getVRRSupport(int iHdmiPort, bool *vrrsupport) const; + void getCurrentVideoModeObj (dsVideoPortResolution_t &resolution) const; + void getHdmiVersion (int iHdmiPort, dsHdmiMaxCapabilityVersion_t *capversion) const; + dsError_t getHDMIARCPortId(int &portId) const; +}; + +} + +namespace device { +class SleepMode; +class SleepModeImpl { +public: + virtual ~SleepModeImpl() = default; + virtual SleepMode & getInstanceById(int id) = 0; + virtual SleepMode & getInstanceByName(const std::string &name) = 0; + virtual List getSleepModes() = 0; + virtual const std::string& toString() const = 0; +}; + +class SleepMode { +protected: + static SleepModeImpl* impl; + +public: + SleepMode(); + static void setImpl(SleepModeImpl* newImpl); + + static SleepMode& getInstance(); + static SleepMode& getInstance(int id); + static SleepMode& getInstance(const std::string &name); + + List getSleepModes(); + const std::string& toString() const; +}; +} + + +namespace device { + +class VideoDFCImpl { +public: + virtual ~VideoDFCImpl() = default; + virtual const std::string& getName() const = 0; + +}; + +class VideoDFC { +protected: + static VideoDFCImpl* impl; + +public: + VideoDFC(); + static void setImpl(VideoDFCImpl* newImpl); + const std::string& getName() const; + +}; + +} + +namespace device { + +class VideoDeviceImpl { +public: + virtual ~VideoDeviceImpl() = default; + + virtual int getFRFMode(int* frfmode) const = 0; + virtual int setFRFMode(int frfmode) const = 0; + virtual int getCurrentDisframerate(char* framerate) const = 0; + virtual int setDisplayframerate(const char* framerate) const = 0; + virtual void setDFC(std::string zoomSetting) = 0; + virtual const VideoDFC& getDFC() = 0; + virtual void getHDRCapabilities(int* capabilities) = 0; + virtual void getSettopSupportedResolutions(std::list& resolutions) = 0; +}; + +class VideoDevice { +protected: + static VideoDeviceImpl* impl; + +public: + VideoDevice(); + + static void setImpl(VideoDeviceImpl* newImpl); + static VideoDevice& getInstance(); + + int getFRFMode(int* frfmode) const; + int setFRFMode(int frfmode) const; + int getCurrentDisframerate(char* framerate) const; + int setDisplayframerate(const char* framerate) const; + + const VideoDFC& getDFC(); + void setDFC(std::string zoomSetting); + void getHDRCapabilities(int* capabilities); + void getSettopSupportedResolutions(std::list& resolutions); + +}; + +} + +namespace device { + +class DSConstant { +private: + bool enabled; + +protected: + int _id; + std::string _name; + + +public: + + DSConstant() : enabled(false), _id(0), _name("_UNASSIGNED NAME_"){}; + + DSConstant(const int id, const std::string &name) : enabled(false), _id(id), _name(name){}; + + virtual ~DSConstant() {}; + + virtual bool operator==(int id) const { + return id == _id; + } + +}; + +} + +namespace device { + class PixelResolution : public DSConstant{ + public: + static const int k720x480; //!< Indicates 720x480 video resolution. + static const int k720x576; //!< Indicates 720x576 video resolution. + static const int k1280x720; //!< Indicates 1280x720 video resolution. + static const int k1366x768; //!< Indicates 1366x768 video resolution. + static const int k1920x1080; //!< Indicates 1920x1080 video resolution. + + static const int k3840x2160; //!< Indicates 3840x2160 video resolution. + static const int k4096x2160; //!< Indicates 4096x2160 video resolution. + + static const int kMax; //!< Indicates the maximum number of video resolutions supported. + + PixelResolution(int id); + PixelResolution() = default; + virtual ~PixelResolution() = default; + }; +} + +namespace device { + + class FrameRate : public DSConstant { + float _value; //!< Indicates the supported frame rate value in fps. + public: + static const int kUnknown; //!< Indicates video frame rate of unknown type. + static const int k24; //!< Indicates video frame rate of 24 fps. + static const int k25; //!< Indicates video frame rate of 25 fps. + static const int k30; //!< Indicates video frame rate of 30 fps. + static const int k60; //!< Indicates video frame rate of 60 fps. + static const int k23dot98; //!< Indicates video frame rate of 23.98 fps. + static const int k29dot97; //!< Indicates video frame rate of 29.97 fps. + static const int k50; //!< Indicates video frame rate of 50 fps. + static const int k59dot94; //!< Indicates video frame rate of 59.94 fps. + static const int kMax; //!< Indicates maximum number of frame rates supported. + + virtual ~FrameRate() = default; + + FrameRate(int id); + FrameRate(float value); + }; + +} + +namespace device { + +class VideoResolutionImpl { +public: + virtual ~VideoResolutionImpl() = default; + + virtual const std::string& getName() const = 0; + virtual const PixelResolution& getPixelResolution() const = 0; + virtual const FrameRate& getFrameRate() const = 0; +}; + +class VideoResolution { +protected: + static VideoResolutionImpl* impl; + +public: + static void setImpl(VideoResolutionImpl* newImpl); + const std::string& getName() const; + const PixelResolution & getPixelResolution() const; + const FrameRate & getFrameRate() const; +}; + +} + +namespace device { + +class VideoOutputPortTypeImpl { +public: + virtual ~VideoOutputPortTypeImpl() = default; + + virtual int getId() const = 0; + virtual const List getSupportedResolutions() const = 0; +}; + +class VideoOutputPortType : public DSConstant{ +protected: + static VideoOutputPortTypeImpl* impl; + +public: + VideoOutputPortType(); + VideoOutputPortType(int type){ + _id = type; + } + + static void setImpl(VideoOutputPortTypeImpl* newImpl); + + int getId() const; + const List getSupportedResolutions() const; + + static const int kRF; + static const int kBaseband; + static const int kSVideo; + static const int k1394; + static const int kDVI; + static const int kComponent; + static const int kHDMI; + static const int kInternal; + static const int kScart; + static const int kMax; +}; + +} + +namespace device{ + class DisplayImpl{ + public: + virtual ~DisplayImpl() = default; + + virtual void getEDIDBytes(std::vector &edid) const = 0; + virtual bool isConnectedDeviceRepeater() = 0; + virtual int getSurroundMode() = 0; + virtual void setAllmEnabled(bool enable) = 0; + virtual void setAVIContentType(int contentType) = 0; + virtual void setAVIScanInformation(int scanInfo) = 0; + }; + class Display { + protected: + static DisplayImpl* impl; + + public: + static void setImpl(DisplayImpl* newImpl); + static Display& getInstance(); + + void getEDIDBytes(std::vector& edid); + int getSurroundMode(); + bool isConnectedDeviceRepeater(); + void setAllmEnabled(bool enable); + void setAVIContentType(int contentType); + void setAVIScanInformation(int scanInfo); + +}; + +} + +namespace device { + +class VideoOutputPortImpl { +public: + virtual ~VideoOutputPortImpl() = default; + + virtual const VideoOutputPortType& getType() const = 0; + virtual const std::string& getName() const = 0; + virtual const VideoResolution& getDefaultResolution() const = 0; + virtual int getHDCPProtocol() = 0; + virtual int getHDCPReceiverProtocol() = 0; + virtual int getHDCPCurrentProtocol() = 0; + virtual int getHDCPStatus() = 0; + virtual AudioOutputPort& getAudioOutputPort() const = 0; + virtual bool isDisplayConnected() = 0; + virtual bool isContentProtected() = 0; + virtual Display& getDisplay() = 0; + virtual bool setScartParameter(std::string sScartParameter, std::string sScartParameterData) = 0; + + virtual void getTVHDRCapabilities(int* capabilities) = 0; + virtual bool setForceHDRMode (dsHDRStandard_t mode) = 0; + virtual int getPreferredColorDepth(bool persist) = 0; + virtual void getColorDepthCapabilities(unsigned int *capabilities) = 0; + virtual void setPreferredColorDepth(dsDisplayColorDepth_t colorDepth, bool persist) = 0; + virtual bool getCurrentOutputSettings(int& videoEOTF, int& matrixCoefficients, int& colorSpace, int& colorDepth, int& quantizationRange) = 0; + virtual bool isConnected() const = 0; + virtual void setResolution(std::string resolution, bool persist, bool isIgnoreEdid) = 0; + + virtual const VideoResolution& getResolution() const =0; + + virtual void getSupportedTvResolutions(int *tvResolutions) = 0; + virtual int getVideoEOTF() = 0; + virtual bool isActive() = 0; + virtual void setAllmEnabled(bool enable) = 0; + + virtual int GetHdmiPreference() = 0; + virtual bool SetHdmiPreference(dsHdcpProtocolVersion_t hdcpProtocol) = 0; + virtual int getColorSpace() const = 0; + virtual int getColorDepth() const = 0; + virtual int getQuantizationRange() const = 0; + virtual bool IsOutputHDR() = 0; + + +}; + +class VideoOutputPort { +protected: + static VideoOutputPortImpl* impl; + +public: + VideoOutputPort(); + + static void setImpl(VideoOutputPortImpl* newImpl); + static VideoOutputPort& getInstance(); + + const VideoOutputPortType& getType() const; + const std::string& getName() const; + const VideoResolution& getDefaultResolution() const; + int getHDCPProtocol(); + int getHDCPReceiverProtocol(); + int getHDCPCurrentProtocol(); + int getHDCPStatus(); + AudioOutputPort& getAudioOutputPort(); + bool isDisplayConnected(); + bool isContentProtected(); + Display& getDisplay(); + void getSupportedTvResolutions(int *tvResolutions); + const VideoResolution& getResolution() const; + + void setResolution(std::string resolution, bool persist, bool isIgnoreEdid); + bool getCurrentOutputSettings(int& videoEOTF, int& matrixCoefficients, int& colorSpace, int& colorDepth, int& quantizationRange); + + void setPreferredColorDepth(dsDisplayColorDepth_t colorDepth, bool persist); + void getColorDepthCapabilities(unsigned int *capabilities); + int getPreferredColorDepth(bool persist); + bool setForceHDRMode (dsHDRStandard_t mode); + void getTVHDRCapabilities(int* capabilities); + bool setScartParameter(std::string sScartParameter, std::string sScartParameterData); + int getVideoEOTF(); + bool isActive(); + void setAllmEnabled(bool enable); + int GetHdmiPreference(); + bool SetHdmiPreference(dsHdcpProtocolVersion_t hdcpProtocol); + int getColorSpace() const; + int getColorDepth() const; + int getQuantizationRange() const; + bool IsOutputHDR(); + +}; + +} + +namespace device { + +class VideoOutputPortConfigImpl { +public: + virtual ~VideoOutputPortConfigImpl() = default; + + virtual VideoOutputPortType& getPortType(int id) = 0; + virtual VideoOutputPort& getPort(const std::string& name) = 0; +}; + +class VideoOutputPortConfig { +protected: + static VideoOutputPortConfigImpl* impl; + +public: + VideoOutputPortConfig(); + + static void setImpl(VideoOutputPortConfigImpl* newImpl); + static VideoOutputPortConfig& getInstance(); + + VideoOutputPortType& getPortType(int id); + VideoOutputPort& getPort(const std::string& name); +}; + +} + +class ManagerImpl { +public: + virtual ~ManagerImpl() = default; + + virtual void Initialize() = 0; + virtual void DeInitialize() = 0; +}; + +namespace device { +class Manager { +protected: + static ManagerImpl* impl; + +public: + Manager(); + + static void setImpl(ManagerImpl* newImpl); + static Manager& getInstance(); + + inline static bool IsInitialized = false; + static void Initialize(); + static void DeInitialize(); +}; +} + +namespace device { + +class HostImpl; +class IDisplayEventsImpl; +class IAudioOutputPortEventsImpl; +class IDisplayDeviceEventsImpl; +class IHdmiInEventsImpl; +class IVideoDeviceEventsImpl; +class IVideoOutputPortEventsImpl; +class ICompositeInEventsImpl; + +class Host { +protected: + static HostImpl* impl; + +public: + static void setImpl(HostImpl* newImpl); + static Host& getInstance(); + + SleepMode getPreferredSleepMode(); + int setPreferredSleepMode(const SleepMode mode); + List getAvailableSleepModes(); + List getVideoOutputPorts(); + List getAudioOutputPorts(); + List getVideoDevices(); + VideoOutputPort& getVideoOutputPort(const std::string& name); + AudioOutputPort& getAudioOutputPort(const std::string& name); + void getHostEDID(std::vector& edid) const; + std::string getDefaultVideoPortName(); + std::string getDefaultAudioPortName(); + + void getMS12ConfigDetails(std::string type); + bool isHDMIOutPortPresent(); + void getSecondaryLanguage(std::string secondaryLanguage); + void setSecondaryLanguage(std::string secondaryLanguage); + void getSinkDeviceAtmosCapability(dsATMOSCapability_t atmosCapability); + void getFaderControl(int *mixerBalance); + void setFaderControl(int mixerBalance); + void setPrimaryLanguage(std::string primaryLanguage); + void getPrimaryLanguage(std::string primaryLanguage); + void setAudioAtmosOutputMode (int enable); + void setAssociatedAudioMixing(bool mixing); + void getCurrentAudioFormat(dsAudioFormat_t audioFormat); + void getAssociatedAudioMixing(bool *mixing); + void setAudioMixerLevels(dsAudioInput_t gain, int volume) ; + +class IDisplayEvents { + protected: + static IDisplayEventsImpl* impl; + + public: + static void setImpl(IDisplayEventsImpl* newImpl); + static IDisplayEvents& getInstance(); + virtual void OnDisplayRxSense(dsDisplayEvent_t displayEvent); +}; + +class IAudioOutputPortEvents { + protected: + static IAudioOutputPortEventsImpl* impl; + + public: + static void setImpl(IAudioOutputPortEventsImpl* newImpl); + static IAudioOutputPortEvents& getInstance(); + virtual void OnAudioOutHotPlug(dsAudioPortType_t portType, uint32_t uiPortNumber, bool isPortConnected); + virtual void OnAudioFormatUpdate(dsAudioFormat_t audioFormat); + virtual void OnDolbyAtmosCapabilitiesChanged(dsATMOSCapability_t atmosCapability, bool status); + virtual void OnAudioPortStateChanged(dsAudioPortState_t audioPortState); + virtual void OnAssociatedAudioMixingChanged(bool mixing); + virtual void OnAudioFaderControlChanged(int mixerBalance); + virtual void OnAudioPrimaryLanguageChanged(const std::string& primaryLanguage); + virtual void OnAudioSecondaryLanguageChanged(const std::string& secondaryLanguage); + virtual void OnAudioModeEvent(dsAudioPortType_t audioPortType, dsAudioStereoMode_t audioStereoMode); + virtual void OnAudioLevelChangedEvent(int audioLevel); +}; + +class IDisplayDeviceEvents { + protected: + static IDisplayDeviceEventsImpl* impl; + public: + static void setImpl(IDisplayDeviceEventsImpl* newImpl); + static IDisplayDeviceEvents& getInstance(); + + virtual void OnDisplayHDMIHotPlug(dsDisplayEvent_t displayEvent); +}; + +class IHdmiInEvents { + protected: + static IHdmiInEventsImpl* impl; + + public: + static void setImpl(IHdmiInEventsImpl* newImpl); + static IHdmiInEvents& getInstance(); + + virtual void OnHdmiInEventHotPlug(dsHdmiInPort_t port, bool isConnected); + virtual void OnHdmiInEventSignalStatus(dsHdmiInPort_t port, dsHdmiInSignalStatus_t signalStatus); + virtual void OnHdmiInEventStatus(dsHdmiInPort_t activePort, bool isPresented); + virtual void OnHdmiInVideoModeUpdate(dsHdmiInPort_t port, const dsVideoPortResolution_t& videoPortResolution); + virtual void OnHdmiInAllmStatus(dsHdmiInPort_t port, bool allmStatus); + virtual void OnHdmiInAVIContentType(dsHdmiInPort_t port, dsAviContentType_t aviContentType); + virtual void OnHdmiInVRRStatus(dsHdmiInPort_t port, dsVRRType_t vrrType); + virtual void OnHdmiInAVLatency(int audioDelay, int videoDelay); +}; + +class ICompositeInEvents { + protected: + static ICompositeInEventsImpl* impl; + + public: + static void setImpl(ICompositeInEventsImpl* newImpl); + static ICompositeInEvents& getInstance(); + + virtual void OnCompositeInHotPlug(dsCompositeInPort_t port, bool isConnected); + virtual void OnCompositeInSignalStatus(dsCompositeInPort_t port, dsCompInSignalStatus_t signalStatus); + virtual void OnCompositeInStatus(dsCompositeInPort_t activePort, bool isPresented); + virtual void OnCompositeInVideoModeUpdate(dsCompositeInPort_t activePort, dsVideoPortResolution_t videoResolution); + }; + +class IVideoDeviceEvents { + protected: + static IVideoDeviceEventsImpl* impl; + + public: + static void setImpl(IVideoDeviceEventsImpl* newImpl); + static IVideoDeviceEvents& getInstance(); + + virtual void OnZoomSettingsChanged(dsVideoZoom_t zoomSetting); + virtual void OnDisplayFrameratePreChange(const std::string& frameRate); + virtual void OnDisplayFrameratePostChange(const std::string& frameRate); +}; + +class IVideoOutputPortEvents { + protected: + static IVideoOutputPortEventsImpl* impl; + + public: + static void setImpl(IVideoOutputPortEventsImpl* newImpl); + static IVideoOutputPortEvents& getInstance(); + + virtual void OnResolutionPreChange(const int width, const int height); + virtual void OnResolutionPostChange(const int width, const int height); + virtual void OnVideoFormatUpdate(dsHDRStandard_t videoFormatHDR); + virtual void OnHDCPStatusChange(dsHdcpStatus_t hdcpStatus); +}; + +virtual dsError_t Register(IVideoDeviceEvents* listener, const std::string& clientName = ""); +virtual dsError_t UnRegister(IVideoDeviceEvents* listener); +virtual dsError_t Register(IDisplayEvents* listener, const std::string& clientName = ""); +virtual dsError_t UnRegister(IDisplayEvents* listener); +virtual dsError_t Register(IAudioOutputPortEvents* listener, const std::string& clientName = ""); +virtual dsError_t UnRegister(IAudioOutputPortEvents* listener); +virtual dsError_t Register(IDisplayDeviceEvents* listener, const std::string& clientName = ""); +virtual dsError_t UnRegister(IDisplayDeviceEvents* listener); +virtual dsError_t Register(IHdmiInEvents* listener, const std::string& clientName = ""); +virtual dsError_t UnRegister(IHdmiInEvents* listener); +virtual dsError_t Register(IVideoOutputPortEvents* listener, const std::string& clientName = ""); +virtual dsError_t UnRegister(IVideoOutputPortEvents* listener); +virtual dsError_t Register(ICompositeInEvents* listener, const std::string& clientName = ""); +virtual dsError_t UnRegister(ICompositeInEvents* listener); +}; + +class HostImpl { +public: + virtual ~HostImpl() = default; + virtual SleepMode getPreferredSleepMode() = 0; + virtual int setPreferredSleepMode(const SleepMode mode) = 0; + virtual List getAvailableSleepModes() = 0; + virtual List getVideoOutputPorts() = 0; + virtual List getAudioOutputPorts() = 0; + virtual List getVideoDevices() = 0; + virtual VideoOutputPort& getVideoOutputPort(const std::string& name) = 0; + virtual AudioOutputPort& getAudioOutputPort(const std::string& name) = 0; + virtual void getHostEDID(std::vector& edid) const = 0; + virtual std::string getDefaultVideoPortName() = 0; + virtual std::string getDefaultAudioPortName() = 0; + + virtual void getMS12ConfigDetails(std::string type)=0; + virtual bool isHDMIOutPortPresent() = 0; + virtual void getSecondaryLanguage(std::string secondaryLanguage) = 0; + virtual void setSecondaryLanguage(std::string secondaryLanguage) = 0; + virtual void getSinkDeviceAtmosCapability(dsATMOSCapability_t atmosCapability) = 0; + virtual void getFaderControl(int *mixerBalance) = 0; + virtual void setFaderControl(int mixerBalance) = 0; + virtual void setPrimaryLanguage(std::string primaryLanguage) = 0; + virtual void getPrimaryLanguage(std::string primaryLanguage) = 0; + virtual void setAudioAtmosOutputMode (int enable) = 0; + virtual void setAssociatedAudioMixing(bool mixing) = 0; + virtual void getCurrentAudioFormat(dsAudioFormat_t audioFormat) = 0; + virtual void getAssociatedAudioMixing(bool *mixing) = 0; + virtual void setAudioMixerLevels(dsAudioInput_t inputType, int volumeLevel) = 0; + + virtual dsError_t Register(Host::IDisplayEvents* listener) = 0; + virtual dsError_t UnRegister(Host::IDisplayEvents* listener) = 0; + virtual dsError_t Register(Host::IAudioOutputPortEvents* listener) = 0; + virtual dsError_t UnRegister(Host::IAudioOutputPortEvents* listener) = 0; + virtual dsError_t Register(Host::IDisplayDeviceEvents* listener) = 0; + virtual dsError_t UnRegister(Host::IDisplayDeviceEvents* listener) = 0; + virtual dsError_t Register(Host::IHdmiInEvents* listener) = 0; + virtual dsError_t UnRegister(Host::IHdmiInEvents* listener) = 0; + virtual dsError_t Register(Host::IVideoDeviceEvents* listener) = 0; + virtual dsError_t UnRegister(Host::IVideoDeviceEvents* listener) = 0; + virtual dsError_t Register(Host::IVideoOutputPortEvents* listener) = 0; + virtual dsError_t UnRegister(Host::IVideoOutputPortEvents* listener) = 0; + virtual dsError_t Register(Host::ICompositeInEvents* listener) = 0; + virtual dsError_t UnRegister(Host::ICompositeInEvents* listener) = 0; +}; + + +class IDisplayEventsImpl { +public: + virtual ~IDisplayEventsImpl() = default; + virtual void OnDisplayRxSense(dsDisplayEvent_t displayEvent) = 0; +}; + +class IAudioOutputPortEventsImpl { +public: + virtual ~IAudioOutputPortEventsImpl() = default; + + virtual void OnAudioOutHotPlug(dsAudioPortType_t portType, uint32_t uiPortNumber, bool isPortConnected) = 0; + virtual void OnAudioFormatUpdate(dsAudioFormat_t audioFormat) = 0; + virtual void OnDolbyAtmosCapabilitiesChanged(dsATMOSCapability_t atmosCapability, bool status) = 0; + virtual void OnAudioPortStateChanged(dsAudioPortState_t audioPortState) = 0; + virtual void OnAssociatedAudioMixingChanged(bool mixing) = 0; + virtual void OnAudioFaderControlChanged(int mixerBalance) = 0; + virtual void OnAudioPrimaryLanguageChanged(const std::string& primaryLanguage) = 0; + virtual void OnAudioSecondaryLanguageChanged(const std::string& secondaryLanguage) = 0; + virtual void OnAudioModeEvent(dsAudioPortType_t audioPortType, dsAudioStereoMode_t audioStereoMode) = 0; + virtual void OnAudioLevelChangedEvent(int audioLevel) = 0; + +}; + +class IDisplayDeviceEventsImpl { +public: + virtual ~IDisplayDeviceEventsImpl() = default; + + virtual void OnDisplayHDMIHotPlug(dsDisplayEvent_t displayEvent) = 0; +}; + +class IHdmiInEventsImpl { +public: + virtual ~IHdmiInEventsImpl() = default; + + virtual void OnHdmiInEventHotPlug(dsHdmiInPort_t port, bool isConnected) = 0; + virtual void OnHdmiInEventSignalStatus(dsHdmiInPort_t port, dsHdmiInSignalStatus_t signalStatus) = 0; + virtual void OnHdmiInEventStatus(dsHdmiInPort_t activePort, bool isPresented) = 0; + virtual void OnHdmiInVideoModeUpdate(dsHdmiInPort_t port, const dsVideoPortResolution_t& videoPortResolution) = 0; + virtual void OnHdmiInAllmStatus(dsHdmiInPort_t port, bool allmStatus) = 0; + virtual void OnHdmiInAVIContentType(dsHdmiInPort_t port, dsAviContentType_t aviContentType) = 0; + virtual void OnHdmiInVRRStatus(dsHdmiInPort_t port, dsVRRType_t vrrType) = 0; + virtual void OnHdmiInAVLatency(int audioDelay, int videoDelay) = 0; + +}; + + class ICompositeInEventsImpl { + public: + virtual ~ICompositeInEventsImpl() = default; + virtual void OnCompositeInHotPlug(dsCompositeInPort_t port, bool isConnected) = 0; + virtual void OnCompositeInSignalStatus(dsCompositeInPort_t port, dsCompInSignalStatus_t signalStatus) = 0; + virtual void OnCompositeInStatus(dsCompositeInPort_t activePort, bool isPresented) = 0; + virtual void OnCompositeInVideoModeUpdate(dsCompositeInPort_t activePort, dsVideoPortResolution_t videoResolution) = 0; + }; + +class IVideoDeviceEventsImpl { +public: + virtual ~IVideoDeviceEventsImpl() = default; + + virtual void OnZoomSettingsChanged(dsVideoZoom_t zoomSetting) = 0; + virtual void OnDisplayFrameratePreChange(const std::string& frameRate) = 0; + virtual void OnDisplayFrameratePostChange(const std::string& frameRate) = 0; + +}; + +class IVideoOutputPortEventsImpl { +public: + virtual ~IVideoOutputPortEventsImpl() = default; + + virtual void OnResolutionPreChange(const int width, const int height) = 0; + virtual void OnResolutionPostChange(const int width, const int height) = 0; + virtual void OnVideoFormatUpdate(dsHDRStandard_t videoFormatHDR) = 0; + virtual void OnHDCPStatusChange(dsHdcpStatus_t hdcpStatus) = 0; + +}; + +} + +namespace device { +class FrontPanelIndicator { +public: + class Color; + class ColorImpl { + public: + virtual ~ColorImpl() = default; + virtual const Color& getInstanceById(int id) = 0; + virtual const Color& getInstanceByName(const std::string& name) = 0; + virtual std::string getName() const = 0; + }; + + class Color { +protected: + static ColorImpl* impl; + +public: + Color(); + + static void setImpl(ColorImpl* newImpl); + static Color& getInstance(); + static const Color& getInstance(int id); + static const Color& getInstance(const std::string& name); + + static const int kWhite; + + std::string getName() const; + virtual ~Color(); + }; + + // static FrontPanelIndicator& getInstance() + // { + // static FrontPanelIndicator instance; + // return instance; + // } + + class FrontPanelIndicatorImpl { + public: + virtual ~FrontPanelIndicatorImpl() = default; + virtual FrontPanelIndicator& getInstanceInt(int id) = 0; + virtual FrontPanelIndicator& getInstanceString(const std::string& name) = 0; + virtual void setState(const bool bState) const = 0; + virtual std::string getName() const = 0; + virtual void setBrightness(const int brightness, const bool toPersist = false) const = 0; + virtual int getBrightness(const bool persist=false) const = 0; + virtual void setColor(const Color &newColor, const bool toPersist) const = 0; + virtual void setColorInt(const uint32_t color, const bool toPersist) const = 0; + virtual void getBrightnessLevels(int &levels,int &min,int &max) const = 0; + virtual int getColorMode() const = 0; + virtual std::string getColorName() const = 0; + virtual List getSupportedColors() const =0; + }; + + // FrontPanelIndicatorImpl* impl; + + public: + static FrontPanelIndicatorImpl* impl; + FrontPanelIndicator(); + + static void setImpl(FrontPanelIndicatorImpl* newImpl); + + static FrontPanelIndicator& getInstance(const std::string& name); + static FrontPanelIndicator& getInstance(int id); + static FrontPanelIndicator& getInstance(); + + void setState(const bool bState) const; + std::string getName() const; + void setBrightness(const int brightness, const bool toPersist = false) const; + int getBrightness(const bool persist = false) const; + void setColor(const Color& newColor, const bool toPersist = false) const; + void setColor(const uint32_t color, const bool toPersist = false) const; + // void setColorInt(const uint32_t color, const bool toPersist) const; + void getBrightnessLevels(int& levels, int& min, int& max) const; + int getColorMode() const; + std::string getColorName() const; + List getSupportedColors() const; + +}; + +class FrontPanelTextDisplay; +class FrontPanelTextDisplayImpl { +public: + virtual ~FrontPanelTextDisplayImpl() = default; + virtual int getCurrentTimeFormat() const = 0; + virtual void setTimeFormat(const int iTimeFormat) const = 0; + virtual void setText(const std::string text) const = 0; + virtual void setMode(int mode) const = 0; + virtual int getTextBrightness() const = 0; + virtual void setTextBrightness(const int brightness) const = 0; + virtual FrontPanelTextDisplay& getInstanceById(int id) = 0; + virtual FrontPanelTextDisplay& getInstanceByName(const std::string& name) = 0; +}; + +class FrontPanelTextDisplay : public FrontPanelIndicator{ +protected: + static FrontPanelTextDisplayImpl* impl; + +public: + FrontPanelTextDisplay(); + + static void setImpl(FrontPanelTextDisplayImpl* newImpl); + + int getCurrentTimeFormat() const; + void setTimeFormat(const int iTimeFormat); + static FrontPanelTextDisplay& getInstance(const std::string& name); + static FrontPanelTextDisplay& getInstance(int id); + static FrontPanelTextDisplay& getInstance(); + static const int kModeClock12Hr; + static const int kModeClock24Hr; + + void setText(const std::string text); + void setMode(int mode); + int getTextBrightness() const; + void setTextBrightness(const int brightness) const; +}; + +class FrontPanelConfig; +class FrontPanelConfigImpl { +public: + virtual ~FrontPanelConfigImpl() = default; + virtual List getIndicators() const = 0; + virtual FrontPanelTextDisplay& getTextDisplay() const = 0; + virtual FrontPanelTextDisplay& getTextDisplay(const std::string &name) const = 0; + virtual List getTextDisplays() const = 0; + virtual FrontPanelTextDisplay& getTextDisplay(int id) const = 0; +}; + +class FrontPanelConfig { +protected: + static FrontPanelConfigImpl* impl; + +public: + FrontPanelConfig(); + + static void setImpl(FrontPanelConfigImpl* newImpl); + static FrontPanelConfig& getInstance(); + + List getIndicators(); + FrontPanelTextDisplay& getTextDisplay(const std::string& name); + List getTextDisplays(); + FrontPanelTextDisplay& getTextDisplay(int id); + FrontPanelTextDisplay& getTextDisplay() const; +}; + +} + + +#define RT_OK 0 +#define RT_ERROR 1 +#define RT_ERROR_QUEUE_EMPTY 1006 + + +typedef uint32_t rtError; +typedef void(*remoteDisconnectCallback)(void *data); + +class rtValue; + +class rtIObject +{ + public: + typedef unsigned long refcount_t; + + virtual ~rtIObject(){ + } +}; + +class rtString{ + public: + std::string mData; + rtString(const char* s){ + mData = s; + } + rtString(const rtString& s){ + mData = s.mData; + } + rtString(){ + mData = ""; + } + const char* cString() const{ + return mData.c_str(); + } + rtString& operator=(const char* s){ + mData = s; + return *this; + } + + rtString& operator=(const rtString& s){ + mData = s.mData; + return *this; + } + +}; +typedef rtError (*rtFunctionCB)(int numArgs, const rtValue* args, rtValue* result, void* context); + +class rtFunctionCallback{ + public: + rtFunctionCallback(rtFunctionCB cb, void* context = NULL){ + + } + ~rtFunctionCallback() = default; + +}; + +/* +Based on pxCore, Copyright 2015-2018 John Robinson +Licensed under the Apache License, Version 2.0 +*/ +template +class rtRef +{ +public: + rtRef(): mRef(NULL) {} + rtRef(const T* p): mRef(NULL) {asn(p); } + rtRef(const rtRef& r): mRef(NULL) {asn(r.getPtr());} + rtRef(rtRef&& r) noexcept: mRef(r.mRef) {r.mRef = nullptr;} + virtual ~rtRef() { + } + + T* operator->() const {return mRef;} + operator T* () const {return mRef;} + T* getPtr() const {return mRef;} + T* ptr() const {return mRef;} + T& operator*() const {return *mRef;} + + bool operator! () const {return mRef == NULL; } + inline rtRef& operator=(const T* p) {asn(p); return *this;} + inline rtRef& operator=(const rtRef& r) {asn(r.mRef); return *this;} + + inline friend bool operator==(const T* lhs,const rtRef& rhs) {return lhs==rhs.mRef;} + inline friend bool operator==(const rtRef& lhs,const T* rhs) {return lhs.mRef==rhs;} + inline friend bool operator==(const rtRef& lhs,const rtRef& rhs) {return lhs.mRef==rhs.mRef;} + + void asn(const T* p) + { + if (mRef != p) + { + if (mRef) + { + delete mRef; + mRef = NULL; + } + mRef = const_cast(p); + + } + } + + T* mRef; +}; + +class rtObjectBaseImpl{ + public: + virtual ~rtObjectBaseImpl() = default; + virtual rtError set(const char* name, const char* value) const = 0; + virtual rtError set(const char* name, bool value) const = 0; + virtual rtError set(const char* name, const rtValue& value) const = 0; + virtual rtString get(const char* name) const = 0; + virtual rtError sendReturns(const char* messageName, rtString& result) const = 0; +}; + +class rtObjectBase{ +protected: + static rtObjectBaseImpl* impl; +public: + + static rtObjectBase& getInstance(); + static void setImpl(rtObjectBaseImpl* newImpl); + + rtError set(const char* name, const char* value); + rtError set(const char* name, bool value); + rtError set(const char* name, const rtValue& value); + + //To avoid linker issues with templated code, the complete definition of this + //templated function is included in this header file instead of separating it to .cpp + template + rtError sendReturns(const char* messageName, T& result) { + return impl->sendReturns(messageName, result); + } + + template + T get(const char* name) { + return impl->get(name); + } + virtual ~rtObjectBase() = default; +}; + +class rtMapObject: public rtObjectBase, public rtIObject{ + public: + virtual ~rtMapObject() = default; + +}; + +class rtObjectRef; +class rtObjectRefImpl{ + public: + virtual rtError send(const char* messageName, const rtValue& arg1) = 0; + virtual rtError send(const char* messageName) = 0; + virtual rtError send(const char* messageName, const char* method, rtFunctionCallback* callback) = 0; + virtual rtError send(const char* messageName, rtObjectRef& base) = 0; + +}; + +class rtObjectRef : public rtRef, public rtObjectBase{ +protected: + static rtObjectRefImpl* impl; +public: + + + static rtObjectRef& getInstance(); + + static void setImpl(rtObjectRefImpl* newImpl); + + rtObjectRef(); + + rtObjectRef(const rtObjectRef&); + + rtObjectRef(const rtMapObject* o); + + rtObjectRef& operator=(rtMapObject* o); + + rtObjectRef& operator=(const rtObjectRef&); + + rtObjectRef& operator=(rtIObject* o); + + rtObjectRef& operator=(rtObjectRef&&); + + rtError send(const char* messageName); + + rtError send(const char* messageName, const char* method, rtFunctionCallback* callback); + + rtError send(const char* messageName, const rtValue& arg1); + + rtError send(const char* messageName, rtObjectRef& base); + virtual ~rtObjectRef(); + +}; + +class rtArrayObject; + +struct rtValue_{ + std::string stringValue; + bool boolValue; +}; + +class rtValueImpl{ + public: + virtual void rtValueConstructor(bool v) const = 0; + virtual void rtValueConstructor(const char* v) const = 0; + virtual void rtValueConstructor(rtArrayObject* v) const = 0; + virtual void rtValueConstructor(const rtString& v) const = 0; +}; + +class rtValue +{ + protected: + static rtValueImpl* impl; + public: + rtValue_ mValue; + + static rtValue& getInstance(); + static void setImpl(rtValueImpl* newImpl); + + rtValue(); + rtValue(bool v); + rtValue(const char* v); + rtValue(const rtString& v); + rtValue(rtIObject* v); + + rtValue(const rtObjectRef& v); + rtValue(const rtValue& v); + ~rtValue(); + rtValue& operator=(bool v); + rtValue& operator=(const char* v); + rtValue& operator=(const rtString& v); + rtValue& operator=(const rtIObject* v); + rtValue& operator=(const rtObjectRef& v); + rtValue& operator=(const rtValue& v); + + rtObjectRef toObject() const; + void setString (const char* v); + void setString (const rtString& v); + +}; + +class rtArrayObjectImpl{ + public: + virtual void pushBack(const char* v) const = 0; + virtual void pushBack(rtValue v) const = 0; +}; + + +class rtArrayObject : public rtObjectBase, public rtIObject{ +protected: + static rtArrayObjectImpl* impl; +public: + static rtArrayObject& getInstance(); + static void setImpl(rtArrayObjectImpl* newImpl); + + void pushBack(const char* v); + void pushBack(rtValue v); + virtual ~rtArrayObject() = default; + +}; + +class rtRemoteEnvironment{ + + +}; + +class floatingRtFunctionsImpl{ + public: + virtual ~floatingRtFunctionsImpl() = default; + virtual rtError rtRemoteLocateObject(rtRemoteEnvironment *env, const char* str, rtObjectRef& obj, int x, remoteDisconnectCallback back, void *cbdata=NULL) = 0; + virtual rtRemoteEnvironment* rtEnvironmentGetGlobal() = 0; + virtual rtError rtRemoteShutdown(rtRemoteEnvironment *env) = 0; + virtual rtError rtRemoteInit(rtRemoteEnvironment *env) = 0; + virtual rtError rtRemoteProcessSingleItem() = 0; + virtual char* rtStrError(rtError err) = 0; + +}; + +class floatingRtFunctions{ +public: + static floatingRtFunctionsImpl* impl; + static floatingRtFunctions& getInstance(); + static void setImpl(floatingRtFunctionsImpl* newImpl); + +}; + + rtError rtRemoteProcessSingleItem(); + rtError rtRemoteLocateObject(rtRemoteEnvironment* env, const char* str, rtObjectRef& obj, int x, remoteDisconnectCallback back, void* cbdata = nullptr); + rtRemoteEnvironment* rtEnvironmentGetGlobal(); + rtError rtRemoteInit(rtRemoteEnvironment* env); + rtError rtRemoteShutdown(rtRemoteEnvironment* env); + char* rtStrError(rtError err); + + +namespace edid_parser { + + enum edid_status_e { + EDID_STATUS_OK, + EDID_STATUS_INVALID_PARAMETER, + EDID_STATUS_NOT_SUPPORTED, + EDID_STATUS_INVALID_HEADER, + EDID_STATUS_INVALID_CHECKSUM + }; + + enum edid_native_e { + EDID_NATIVE, + EDID_NOT_NATIVE + }; + + enum edid_progressive_e { + EDID_PROGRESSIVE, + EDID_INTERLACED + }; + + enum HDR_standard_t { + HDR_standard_NONE = 0x0, + HDR_standard_HDR10 = 0x01, // SMPTE ST 2084 + HDR_standard_HLG = 0x02, // Hybrid Log-Gamma + HDR_standard_DolbyVersion = 0x04, // ? + HDR_standard_SDR = 0x08, // Traditional gamma - SDR Luminance Range + HDR_standard_Traditional_HDR = 0x10 // Traditional gamma - HDR Luminance Range + }; + + struct edid_res_t { + int width; + int height; + int refresh; + edid_progressive_e progressive; + edid_native_e native; + }; + + enum colorimetry_info_t { + COLORIMETRY_INFO_NONE = 0x0, + COLORIMETRY_INFO_XVYCC601 = 0x01, + COLORIMETRY_INFO_XVYCC709 = 0x02, + COLORIMETRY_INFO_SYCC601 = 0x04, + COLORIMETRY_INFO_ADOBEYCC601 = 0x08, + COLORIMETRY_INFO_ADOBERGB = 0x10, + COLORIMETRY_INFO_BT2020CL = 0x20, + COLORIMETRY_INFO_BT2020NCL = 0x40, + COLORIMETRY_INFO_BT2020RGB = 0x80, + COLORIMETRY_INFO_DCI_P3 = 0x100 + }; + + struct edid_data_t { + edid_res_t res; + // bitmask of HDR_standard_t values + uint8_t hdr_capabilities; + char manufacturer_name[4]; /* Manufacturer name of the display device.*/ + int32_t product_code; /* Product code of the display device. */ + int32_t serial_number; /* Serial number of the display device. */ + int32_t manufacture_week; /* Manufacturing week of the display device. */ + int32_t manufacture_year; /* Manufacturing year of the display device. */ + uint8_t edid_version[2]; /* EDID version. */ + uint8_t physical_address_a; /* Physical Address for HDMI node A */ + uint8_t physical_address_b; /* Physical Address for HDMI node B */ + uint8_t physical_address_c; /* Physical Address for HDMI node C */ + uint8_t physical_address_d; /* Physical Address for HDMI node D */ + char monitor_name[14]; /* Connected display monitor name. */ + uint32_t colorimetry_info; /* bitmask of enum colorimetry_info_t */ +}; + + class edidParserImpl{ + public: + static edidParserImpl* impl; + + static void setImpl(edidParserImpl* newImpl); + + virtual edid_status_e EDID_Parse(unsigned char* bytes, size_t count, edid_data_t* data_ptr) = 0; + virtual edid_status_e EDID_Verify(unsigned char* bytes, size_t count) = 0; + + }; + + edid_status_e EDID_Parse(unsigned char* bytes, size_t count, edid_data_t* data_ptr); + edid_status_e EDID_Verify(unsigned char* bytes, size_t count); +} + +class drmImpl{ + public: + virtual ~drmImpl() = default; + static drmImpl* impl; + static void setImpl(drmImpl* newImpl); + + virtual drmModeEncoderPtr drmModeGetEncoder(int fd, uint32_t encoder_id) = 0; + virtual void drmModeFreeEncoder(drmModeEncoderPtr* encoder) = 0; + virtual drmModeConnectorPtr drmModeGetConnector(int fd, uint32_t connectorId) = 0; + virtual drmModeCrtcPtr drmModeGetCrtc(int fd, uint32_t crtcId) = 0; + virtual drmModeResPtr drmModeGetResources(int fd) = 0; + virtual void drmModeFreeConnector( drmModeConnectorPtr ptr ) = 0; + virtual void drmModeFreeCrtc( drmModeCrtcPtr ptr ) = 0; + virtual void drmModeFreeResources( drmModeResPtr ptr ) = 0; + virtual drmModePropertyPtr drmModeGetProperty(int fd, uint32_t propertyId) = 0; + virtual void drmModeFreeProperty(drmModePropertyPtr ptr) = 0; + virtual drmModePlaneResPtr drmModeGetPlaneResources(int fd) = 0; + virtual drmModePlanePtr drmModeGetPlane(int fd, uint32_t plane_id) = 0; + virtual drmModeObjectPropertiesPtr drmModeObjectGetProperties(int fd,uint32_t object_id, uint32_t object_type) = 0; + virtual void drmModeFreeObjectProperties(drmModeObjectPropertiesPtr ptr) = 0; + virtual void drmModeFreePlane( drmModePlanePtr ptr ) = 0; + virtual void drmModeFreePlaneResources(drmModePlaneResPtr ptr) = 0; + virtual void drmModeFreeFB(drmModeFBPtr ptr) = 0; + virtual drmModeFBPtr drmModeGetFB(int fd, uint32_t bufferId) = 0; + virtual void drmModeFreeEncoder( drmModeEncoderPtr ptr ) = 0; + virtual int drmSetClientCap(int fd, uint64_t capability, uint64_t value) = 0; + +}; + +//drmModeEncoderPtr drmModeGetEncoder(int fd, uint32_t encoder_id); +//void drmModeFreeEncoder(drmModeEncoderPtr* encoder); +//drmModeConnectorPtr drmModeGetConnector(int fd, uint32_t connectorId); +//drmModeCrtcPtr drmModeGetCrtc(int fd, uint32_t crtcId); +//drmModeResPtr drmModeGetResources(int fd); +//void drmModeFreeConnector( drmModeConnectorPtr ptr ); +//void drmModeFreeCrtc( drmModeCrtcPtr ptr ); +//void drmModeFreeResources( drmModeResPtr ptr ); +//drmModePropertyPtr drmModeGetProperty(int fd, uint32_t propertyId); +//void drmModeFreeProperty(drmModePropertyPtr ptr); +//drmModePlaneResPtrResPtr drmModeGetPlaneResources(int fd); +//drmModePlaneResPtr drmModeGetPlane(int fd, uint32_t plane_id); +//drmModeObjectPropertiesPtr drmModeObjectGetProperties(int fd,uint32_t object_id, uint32_t object_type); +//void drmModeFreeObjectProperties(drmModeObjectPropertiesPtr ptr); +//void drmModeFreePlane( drmModePlaneResPtr ptr ); +//void drmModeFreePlaneResources(drmModePlaneResPtrResPtr ptr); + diff --git a/ci/mocks/mfrTypes.h b/ci/mocks/mfrTypes.h new file mode 100644 index 00000000..55ef63e5 --- /dev/null +++ b/ci/mocks/mfrTypes.h @@ -0,0 +1,651 @@ +/* + * If not stated otherwise in this file or this component's LICENSE 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. +*/ + +/** + * @addtogroup HPK Hardware Porting Kit + * @{ + * @par The Hardware Porting Kit + * HPK is the next evolution of the well-defined Hardware Abstraction Layer + * (HAL), but augmented with more comprehensive documentation and test suites + * that OEM or SOC vendors can use to self-certify their ports before taking + * them to RDKM for validation or to an operator for final integration and + * deployment. The Hardware Porting Kit effectively enables an OEM and/or SOC + * vendor to self-certify their own Video Accelerator devices, with minimal RDKM + * assistance + * + */ +/** @defgroup MFR MFR Module + * @{ + */ +/** @defgroup MFR_HAL MFR HAL + * @{ + * @par Application API Specification + * MFR HAL provides an interface for reading and writing device serialization information and doing image flashing operations + */ + +/** @defgroup PLAT_MFR_DATA PLAT MFR DATA + * @{ + */ + +/** + * @file mfrTypes.h + * + * @brief MFR HAL header + * + * This file defines APIs, datatypes and error codes used by the MFR HAL + * + * @par Document + * Document reference. + * + * @par Open Issues (in no particular order) + * -# None + * + * @par Assumptions + * -# None + * + * @par Abbreviations + * - MFR: Manufacturer library + * - HDMI: High-Definition multimedia Interface + * - HDCP: High-Bandwidth digital content protection + * - MOCA: Multimedia over coax alliance + * - auth: Authentication + * - DTCP: Digital transmission content protection + * - CDL: Code download + * - RCDL: Remote code download + * - CA: Certificate authority + * - DVR: Digital video recording + * - SVN: Software version number + * - CRC: Cyclic redundancy check + * - oui: Organizationally unique identifier + * - DRI: Disaster recovery image + * - PDRI: Peripheral disaster recovery image + * - WIFI: Wireless fidelity + * - MAC: Media access control address + * - RF4CE: Radio frequency for consumer electronics + * - DTB: Device tree binary + * - PMI: Product manufacturer information + * - SOC: System on chip + * - TV: Television + * - BDRI: Backup disaster recovery image + * - CPD: Critical panel data + * - WB: White balancing + * - ALS: Ambient light sensor + * - LUX: Unit of luminance or illumination of a one metre square area + * - PCI: Peripheral component interconnect + * - AV: Audio video + * - TPV: TPV technology limited + * - FTA: Factory test app + * - WPS: Wi-Fi protected setup + */ + + +#ifndef _MFR_TYPES_H +#define _MFR_TYPES_H + +#include +#include +#include + + +/** + * @brief MFR status codes. + * + */ +typedef enum _mfrError_t +{ + mfrERR_NONE = 0, ///< Input output operation is successful + mfrERR_GENERAL = 0x1000, ///< Operation general error. This enum is deprecated + mfrERR_INVALID_PARAM, ///< Invalid argument is passed to the module + mfrERR_NOT_INITIALIZED, ///< Module is not initialised + mfrERR_OPERATION_NOT_SUPPORTED, ///< Not suppoted operation is performed + mfrERR_UNKNOWN, ///< Unknown error. This enum is deprecated + /* Please add Error Code here */ + mfrERR_MEMORY_EXHAUSTED, ///< Memory exhausted + mfrERR_SRC_FILE_ERROR, ///< File related errors + mfrERR_WRITE_FLASH_FAILED, ///< Flash write failed + mfrERR_UPDATE_BOOT_PARAMS_FAILED, ///< Boot params update failed + mfrERR_FAILED_CRC_CHECK, ///< CRC check failed + mfrERR_BAD_IMAGE_HEADER, ///< Bad image header error. Invalid Image(Not a valid image to flash in the partition) + mfrERR_IMPROPER_SIGNATURE, ///< Improper signature error. Invalidate section data available in the image + mfrERR_IMAGE_TOO_BIG, ///< Image too big error + mfrERR_FAILED_INVALID_SIGNING_TIME, ///< Invalid image signing time value + mfrERR_FAILED_INVALID_SVN, ///< Invalid SVN error + mfrERR_FAILED_IMAGE_SIGNING_TIME_OLDER, ///< Image signing time is older than expected. By comparing the signing time available in flash data with current image timing. return mfrERR_FAILED_IMAGE_SIGNING_TIME_OLDER flash signing image time is older + mfrERR_FAILED_IMAGE_SVN_OLDER, ///< SVN is older + mfrERR_FAILED_SAME_DRI_CODE_VERSION, ///< Same DRI trying to write again. Current DRI image is requested to flash again. If curren image is corrupted this operation will corrupt the alternate bank also + mfrERR_FAILED_SAME_PCI_CODE_VERSION, ///< Same PCI trying to write again. Current PCI image is requested to flash again. If curren image is corrupted this operation will corrupt the alternate bank also + mfrERR_IMAGE_FILE_OPEN_FAILED, ///< Not able to open image file + mfrERR_GET_FLASHED_IMAGE_DETAILS_FAILED, ///< Not able to retrieve the flashed image details + mfrERR_FLASH_VERIFY_FAILED, ///< Not able to verify the flash + mfrERR_ALREADY_INITIALIZED, ///< Module already initialised + mfrERR_FLASH_READ_FAILED, ///< Flash read failed + mfrERR_FLASH_SOFT_LOCK_FAILED, ///< Flash soft lock failed + mfrERR_TEMP_READ_FAILED, ///< Temperature read failed + mfrERR_MAX ///< Out of range - required to be the last item of the enum +} mfrError_t; + +/** + * @brief Serialization data + * + */ +typedef struct _mfrSerializedData_t +{ + char * buf; ///< Buffer containing the data + size_t bufLen; ///< Length of the data buffer + void (* freeBuf) (char *buf); ///< Function used to free the buffer. If NULL, the user does not need to free the buffer +} mfrSerializedData_t; + +/** + * @brief Serialization data types. All values are platform specific + * + * + * White balancing calibration for TV sources involves applying calibration to the linear playback streams. + * White balancing calibration for AV involves applying calibration specifically to the composite source + * + */ +typedef enum _mfrSerializedType_t +{ + mfrSERIALIZED_TYPE_MANUFACTURER = 0, ///< manufacture field. ASCII string + mfrSERIALIZED_TYPE_MANUFACTUREROUI, ///< manufacture oui field. HEX string value + mfrSERIALIZED_TYPE_MODELNAME, ///< model name field. ASCII string + mfrSERIALIZED_TYPE_DESCRIPTION, ///< description field. ASCII string + mfrSERIALIZED_TYPE_PRODUCTCLASS, ///< product class field. ASCII string + mfrSERIALIZED_TYPE_SERIALNUMBER, ///< serial number field. Alphanumerical string value + mfrSERIALIZED_TYPE_HARDWAREVERSION, ///< Hardware version field. String value + mfrSERIALIZED_TYPE_SOFTWAREVERSION, ///< software field. Decimal stirng value + mfrSERIALIZED_TYPE_PROVISIONINGCODE, ///< provisioning code field. String value + mfrSERIALIZED_TYPE_FIRSTUSEDATE, ///< first use date field. String value + mfrSERIALIZED_TYPE_DEVICEMAC, ///< device mac field. HEX string MAC value separated with colon + mfrSERIALIZED_TYPE_MOCAMAC, ///< MOCA mac field. HEX string MAC value separated with colon + mfrSERIALIZED_TYPE_HDMIHDCP, ///< HDMI HDCP field. String value + + mfrSERIALIZED_TYPE_PDRIVERSION, ///< PDRI version field. It provide the primary Disaster Recovery Image version information + mfrSERIALIZED_TYPE_WIFIMAC, ///< wifi mac field. HEX string MAC value separated with colon + mfrSERIALIZED_TYPE_BLUETOOTHMAC, ///< bluetooth MAC field. HEX string MAC value separated with colon + mfrSERIALIZED_TYPE_WPSPIN, ///< WPS PIN filed. Decimal string + mfrSERIALIZED_TYPE_MANUFACTURING_SERIALNUMBER, ///< manufacturing serial number field. Alphanumerical string value + mfrSERIALIZED_TYPE_ETHERNETMAC, ///< ethernet MAC field. HEX string MAC value separated with colon + mfrSERIALIZED_TYPE_ESTBMAC, ///< estb mac field. HEX string MAC value separated with colon. Device MAC is same as the ethernet (mfrSERIALIZED_TYPE_ETHERNETMAC) mac + mfrSERIALIZED_TYPE_RF4CEMAC, ///< RF4CE MAC field. HEX string MAC value separated with colon + + mfrSERIALIZED_TYPE_PROVISIONED_MODELNAME, ///< provisioned model name field + mfrSERIALIZED_TYPE_PMI, ///< PMI field. Alphanumerical string value of the model + mfrSERIALIZED_TYPE_HWID, ///< hardware ID field. HEX sting value of hardware id + mfrSERIALIZED_TYPE_MODELNUMBER, ///< Model number field. HEX sting value of model number + /* boot data */ + mfrSERIALIZED_TYPE_SOC_ID, ///< SOC id field. String value + mfrSERIALIZED_TYPE_IMAGENAME, ///< image name field. Alphanumerical name of the monolitic image flashed + mfrSERIALIZED_TYPE_IMAGETYPE, ///< image type field. Alphanumerical type name of the image. Eg: PC1 + mfrSERIALIZED_TYPE_BLVERSION, ///< boot loader version field. Boot loader version value separated with dots. Eg: 6.9.7 + /* provisional data */ + mfrSERIALIZED_TYPE_REGION, ///< region field. String value + /* other data */ + mfrSERIALIZED_TYPE_BDRIVERSION, ///< BDRI version field. It provide the Backup DRI version information + + /* led data */ + mfrSERIALIZED_TYPE_LED_WHITE_LEVEL, ///< led white level field. String value + mfrSERIALIZED_TYPE_LED_PATTERN, ///< led pattern field. String value + mfrSERIALIZED_TYPE_MAX, ///< Out of range - required to be the last item of the enum +#ifdef PANEL_SERIALIZATION_TYPES + //As MFR HAL is a precompiled binary across all existing platforms, a distinct region is allocated for panel-based enums, beginning at 0x51. + //This approach allows us to utilize the same type field for corresponding APIs. + mfrSERIALIZED_TYPE_COREBOARD_SERIALNUMBER=0x51, ///< core board serial number field + mfrSERIALIZED_TYPE_FACTORYBOOT, ///< factory boot field. String value + mfrSERIALIZED_TYPE_COUNTRYCODE, ///< country code field. To configure country code + mfrSERIALIZED_TYPE_LANGUAGECODE, ///< language code field.To configure language code + mfrSERIALIZED_TYPE_MANUFACTURERDATA, ///< manufacture data field. To configure HDCP filename, PCBA serial number, project id, logo, device lock information + mfrSERIALIZED_TYPE_CPD_SIZE, ///< CPD size field. It represent the Size of the Critical panel data + mfrSERIALIZED_TYPE_PANEL_ID, ///< panel id field. It is unique ID to represent the each unique version(ex: 43", 55" inches etc) of panel + mfrSERIALIZED_TYPE_PANEL_TYPE, ///< panel type field. Its unique id mapped with each panel ID + mfrSERIALIZED_TYPE_PANEL_HDMI_WB_DATA_NORMAL, ///< HDMI WB data normal field. Standard colour temperature in HDMI source, to adjust r,g,b gain equally to achieve accurate color reproduction. + mfrSERIALIZED_TYPE_PANEL_HDMI_WB_DATA_COLD, ///< HDMI WB data cold field. COLD colour temperature in HDMI source, to adjust the blue gain alone to achieve blueish color pattern + mfrSERIALIZED_TYPE_PANEL_HDMI_WB_DATA_WARM, ///< HDMI WB data warm field. WARM colour temperature in HDMI source, to adjust the red gain alone to achieve reddish colour pattern + mfrSERIALIZED_TYPE_PANEL_HDMI_WB_DATA_USER, ///< HDMI WB data user field. User can change the picture modes as per their requirement in USER colour temperature mode + mfrSERIALIZED_TYPE_PANEL_TV_WB_DATA_NORMAL, ///< panel TV WB data normal field Standard colour temperature in TV source, to adjust r,g,b gain equally to achieve accurate color reproduction. Applicable for linear playback streams + mfrSERIALIZED_TYPE_PANEL_TV_WB_DATA_COLD, ///< panel TV WB data cold field. COLD colour temperature in TV source, to adjust the blue gain alone to to achieve blueish color pattern. Applicable for linear playback streams + mfrSERIALIZED_TYPE_PANEL_TV_WB_DATA_WARM, ///< panel TV WB data warm field. WARM colour temperature in TV source, to adjust the red gain alone to to achieve reddish colour pattern. Applicable for linear playback streams + mfrSERIALIZED_TYPE_PANEL_TV_WB_DATA_USER, ///< panel TV WB data user field. User can change the picture modes as per their requirement in USER colour temperature mode. Applicable for linear playback streams + mfrSERIALIZED_TYPE_PANEL_AV_WB_DATA_NORMAL, ///< panel AV WB data normal field what is the difference between TV and AV white balance here. TV targets for Linear playback source and For AV target composite source. Applicable for composite source + mfrSERIALIZED_TYPE_PANEL_AV_WB_DATA_COLD, ///< panel AV WB data cold field. COLD colour temperature in AV source, to adjust the blue gain alone to to achieve blueish color pattern. Applicable for composite source + mfrSERIALIZED_TYPE_PANEL_AV_WB_DATA_WARM, ///< panel AV WB data warm field. WARM colour temperature in AV source, to adjust the red gain alone to to achieve reddish colour pattern. Applicable for composite source + mfrSERIALIZED_TYPE_PANEL_AV_WB_DATA_USER, ///< panel AV WB data user field. User can change the picture modes as per their requirement in USER colour temperature mode. Applicable for composite source + mfrSERIALIZED_TYPE_PANEL_DTB_VERSION, ///< Version of the device tree binary(DTB) + mfrSERIALIZED_TYPE_PANEL_DTB_DATA_SIZE, ///< Size of the device tree binary(DTB) + mfrSERIALIZED_TYPE_PANEL_DTB_DATA, ///< panel DTB data. The DTB file contains a binary-formatted flattened device tree data + + /* panel data*/ + mfrSERIALIZED_TYPE_PANEL_DATA_FUNCTION_STATUS, + mfrSERIALIZED_TYPE_PANEL_DATA_AGEING_TIME, + mfrSERIALIZED_TYPE_PANEL_DATA_POWER_ON_TIME, + mfrSERIALIZED_TYPE_PANEL_DATA_BACKLIGHT_TIME, + mfrSERIALIZED_TYPE_PANEL_DATA_VALID, + mfrSERIALIZED_TYPE_PANEL_DATA_TPV_APP_VERSION, + mfrSERIALIZED_TYPE_PANEL_ALS_CALIBRATION_INDEX0, + mfrSERIALIZED_TYPE_PANEL_ALS_CALIBRATION_INDEX1, + /*Gamma data*/ + mfrSERIALIZED_TYPE_PANEL_GAMMA_CALIBRATED_NORMAL, + mfrSERIALIZED_TYPE_PANEL_GAMMA_CALIBRATED_COLD, + mfrSERIALIZED_TYPE_PANEL_GAMMA_CALIBRATED_WARM, + mfrSERIALIZED_TYPE_PANEL_GAMMA_CALIBRATED_BOOST_NORMAL, + mfrSERIALIZED_TYPE_PANEL_GAMMA_CALIBRATED_BOOST_COLD, + mfrSERIALIZED_TYPE_PANEL_GAMMA_CALIBRATED_BOOST_WARM, + /*WB data boost*/ + mfrSERIALIZED_TYPE_PANEL_HDMI_WB_DATA_BOOST_NORMAL, + mfrSERIALIZED_TYPE_PANEL_HDMI_WB_DATA_BOOST_COLD, + mfrSERIALIZED_TYPE_PANEL_HDMI_WB_DATA_BOOST_WARM, + /*Tmax*/ + mfrSERIALIZED_TYPE_PANEL_PEAK_BRIGHTNESS_NONBOOST, + mfrSERIALIZED_TYPE_PANEL_PEAK_BRIGHTNESS_BOOST, + mfrSERIALIZED_TYPE_PANEL_PEAK_BRIGHTNESS_BURST, + mfrSERIALIZED_TYPE_PANEL_HDMI_WB_DATA_SUPERCOLD, + mfrSERIALIZED_TYPE_PANEL_HDMI_WB_DATA_BOOST_SUPERCOLD, + mfrSERIALIZED_TYPE_PANEL_GAMMA_CALIBRATED_SUPERCOLD, + mfrSERIALIZED_TYPE_PANEL_GAMMA_CALIBRATED_BOOST_SUPERCOLD, + mfrSERIALIZED_TYPE_PANEL_MAX, +#endif + mfrSERIALIZED_TYPE_SKYMODELNAME = 8000, //Sky specific MFRLib flags + mfrSERIALIZED_TYPE_DE_SERIAL_PREFIX, //Sky specific MFRLib flags +} mfrSerializedType_t; + + +/** + * @brief MFR image types + * + */ +typedef enum _mfrImageType_t +{ + mfrIMAGE_TYPE_CDL, ///< CDL image type + mfrIMAGE_TYPE_RCDL, ///< RCDL image type. + mfrUPGRADE_IMAGE_MONOLITHIC, ///< Monolithic image type + mfrUPGRADE_IMAGE_PACKAGEHEADER, ///< Package header image type + mfrIMAGE_TYPE_MAX, ///< Out of range - required to be the last item of the enum +} mfrImageType_t; + + +/** + * @brief MFR image write progress status + * + */ + typedef enum _mfrUpgradeProgress_t + { + mfrUPGRADE_PROGRESS_NOT_STARTED = 0, ///< not started + mfrUPGRADE_PROGRESS_STARTED, ///< in progress + mfrUPGRADE_PROGRESS_ABORTED, ///< failed + mfrUPGRADE_PROGRESS_VERIFYING, ///< Verifying + mfrUPGRADE_PROGRESS_FLASHING, ///< Flashing + mfrUPGRADE_PROGRESS_REBOOTING, ///< Rebooting + mfrUPGRADE_PROGRESS_COMPLETED, ///< success + mfrUPGRADE_PROGRESS_MAX ///< Out of range - required to be the last item of the enum + } mfrUpgradeProgress_t; + + +/** + * @brief MFR boot loader patterns + * + */ +typedef enum _mfrBlPattern_t +{ + mfrBL_PATTERN_NORMAL = 0, ///< normal boot loader pattern. This Boot pattern enable both LOGO as well LED ON during boot up + mfrBL_PATTERN_SILENT, ///< silent boot loader pattern. Keep the led off + mfrBL_PATTERN_SILENT_LED_ON, ///< silent LED on pattern. This Boot pattern enable only LED and disable LOGO during this boot up + mfrBL_PATTERN_LOGO_DISABLED, ///< Logo is disabled + mfrBL_PATTERN_MAX, ///< Out of range - required to be the last item of the enum +} mfrBlPattern_t; + +/** + * @brief MFR image upgrade status + * + */ +typedef struct _mfrUpgradeStatus_t +{ + mfrUpgradeProgress_t progress; ///< MFR upgrade progress status. @see mfrUpgradeProgress_t + mfrError_t error; ///< Error @see mfrError_t + char error_string[32]; ///< Error string + int percentage; ///< MFR upgrade percentage +} mfrUpgradeStatus_t; + +/** + * @brief MFR image upgrade status notify stucture + * + */ +typedef struct _mfrUpgradeStatusNotify_t +{ + void * cbData; ///< Upgrade status notify call back data + void (*cb) (mfrUpgradeStatus_t * status); ///< Upgrade status notify call back + int interval; ///< number of seconds between two callbacks. 0 means invoking callback only once to report final upgrade result +} mfrUpgradeStatusNotify_t; + +/** + * @brief Initializes the MFR library + * + * This function will initialize all the respective internal components responsible for MFR functionalities. + * This API need to be called before any other APIs in this module@n + * + * @return mfrError_t - Status + * @retval mfrERR_NONE - Success + * @retval mfrERR_ALREADY_INITIALIZED - Module is already initialised + * @retval mfrERR_MEMORY_EXHAUSTED - memory allocation failure + * + * @warning This API is Not thread safe + * + */ +mfrError_t mfr_init( void ); + +/** + * @brief Initialize the mfr partition. + * + * mfr_init invokes this mfr_partition_init. + * This function should be call once before accessing serialized data. + * + * @return mfrError_t - Status + * @retval mfrERR_NONE - Success + * @retval mfrERR_ALREADY_INITIALIZED - Module is already initialised + * @retval mfrERR_NOT_INITIALIZED - Module is not initialised + * + * + * @pre mfr_init() should be called before calling this API. If this precondition is not met, the API will return mfrERR_NOT_INITIALIZED. +*/ +mfrError_t mfr_partition_init(void); + +/** + * @brief Uninitializes the MFR library + * + * This function will uninitialize all the respective internal components responsible for MFR functionalities. + * + * @return mfrError_t - Status + * @retval mfrERR_NONE - Success + * @retval mfrERR_NOT_INITIALIZED - Module is not initialised + * + * @warning This API is Not thread safe + * + */ +mfrError_t mfr_term( void ); + +/** + * @brief Retrieves serialized Read-Only data from device + * + * + * @param [in] type : specifies the serialized data type to be read. @see mfrSerializedType_t + * @param [in] data : serialized data for the specific type requested. (buffer location, length, and func to free the buffer). @see mfrSerializedData_t + * + * @return mfrError_t - Status + * @retval mfrERR_NONE - Success + * @retval mfrERR_NOT_INITIALIZED - Module is not initialised + * @retval mfrERR_INVALID_PARAM - Parameter passed to this function is invalid + * @retval mfrERR_MEMORY_EXHAUSTED - memory allocation failure + * @retval mfrERR_FAILED_CRC_CHECK - CRC check failed + * @retval mfrERR_FLASH_READ_FAILED - Flash read failed + * + * @note The serialized data is returned as a byte stream. It is upto the application to deserialize and make sense of the data returned. + * Even if the serialized data returned is "string", the buffer is not required to contain the null-terminator + * + * @pre mfr_init() should be called before calling this API. If this precondition is not met, the API will return mfrERR_NOT_INITIALIZED. + * @warning This API is Not thread safe + * + */ +mfrError_t mfrGetSerializedData( mfrSerializedType_t type, mfrSerializedData_t *data ); + +/** + * @brief Sets the read write Serialization data on device + * + * @param [in] type : specifies the serialized data type to write. @see mfrSerializedType_t + * @param [in] data : serialized data to set for the specific type requested. (buffer location, length, and func to free the buffer). @see mfrSerializedData_t + * + * @return mfrError_t - Status + * @retval mfrERR_NONE - Success + * @retval mfrERR_NOT_INITIALIZED - Module is not initialised + * @retval mfrERR_INVALID_PARAM - Parameter passed to this function is invalid + * @retval mfrERR_MEMORY_EXHAUSTED - memory allocation failure + * @retval mfrERR_FAILED_CRC_CHECK - CRC check failed + * @retval mfrERR_WRITE_FLASH_FAILED - Flash write failed + * @retval mfrERR_FLASH_READ_FAILED - Flash read failed + * @retval mfrERR_FLASH_VERIFY_FAILED - Flash verification failed + * + * @pre mfr_init() should be called before calling this API. If this precondition is not met, the API will return mfrERR_NOT_INITIALIZED. + * @warning This API is Not thread safe + * + */ +mfrError_t mfrSetSerializedData( mfrSerializedType_t type, mfrSerializedData_t *data); + +/** + * @brief Writes the image into flash + * + * The process should follow these major steps: + * 1) Verify the validity of the image and flash + * 2) Update boot params and switch banks to prepare for a reboot event + * 3) All upgrades should be done in the alternate bank. The current bank should not be disturbed + * + * State Transition: + * 0) Before the API is invoked, the Upgrade process should be in PROGRESS_NOT_STARTED state + * 1) After the API returns with success, the Upgrade process moves to PROGRESS_STARTED state + * 2) After the API returns with error, the Upgrade process stays in PROGRESS_NOT_STARTED state. Notify function will not be invoked + * 3) The notify function is called at regular interval with process = PROGRESS_STARTED + * 4) The last invocation of notify function should have either progress = PROGRESS_COMPLETED or progress = PROGRESS_ABORTED with error code set + * + * @note mfrWriteImage() should work without any issue when device transition to DEEPSLEEP state and Wakeup. During DEEPSLEEP state processor will + * cache all the pc and stack state and will enter to low power state. On wakeup system will use the saved pc and stack and resume from the same point. + * + * @param [in] name : the filename of the image file + * @param [in] path : the path of the image file in the file system + * @param [in] type : the type (format, signature type) of the image. This can dictate the handling of the image within the MFR library. @see mfrImageType_t + * @param[in] notify: function to provide status of the image flashing process. @see mfrUpgradeStatusNotify_t + * + * + * @return mfrError_t - Status + * + * @retval mfrERR_NONE - Success + * @retval mfrERR_NOT_INITIALIZED - Module is not initialised + * @retval mfrERR_INVALID_PARAM - Parameter passed to this function is invalid + * @retval mfrERR_MEMORY_EXHAUSTED - memory allocation failure + * @retval mfrERR_FAILED_CRC_CHECK - CRC is failed + * @retval mfrERR_WRITE_FLASH_FAILED - Flash write failed + * @retval mfrERR_FLASH_VERIFY_FAILED - Flash verification failed + * @retval mfrERR_BAD_IMAGE_HEADER - Image header is corrupted + * @retval mfrERR_IMPROPER_SIGNATURE - Image signature is invalid + * @retval mfrERR_IMAGE_TOO_BIG - Image size is more than allocated maximum + * @retval mfrERR_FAILED_INVALID_SIGNING_TIME - Image signing time invalid + * @retval mfrERR_FAILED_IMAGE_SVN_OLDER - software version number is older than existing image + * @retval mfrERR_FAILED_SAME_DRI_CODE_VERSION - DRI code version is same + * @retval mfrERR_FAILED_SAME_PCI_CODE_VERSION - PCI code version is same + * @retval mfrERR_IMAGE_FILE_OPEN_FAILED - Not able to open the input image file + * @retval mfrERR_GET_FLASHED_IMAGE_DETAILS_FAILED - Not able to get the current image version details + * + * + * @pre mfr_init() should be called before calling this API. If this precondition is not met, the API will return mfrERR_NOT_INITIALIZED. . + * @warning This API is Not thread safe + * + */ +mfrError_t mfrWriteImage(const char *name, const char *path, mfrImageType_t type, mfrUpgradeStatusNotify_t notify); + +/** + * @brief Deletes the PDRI image if it is present + * + * @return mfrError_t - Status + * @retval mfrERR_NONE - Success + * @retval mfrERR_NOT_INITIALIZED - Module is not initialised + * @retval mfrERR_WRITE_FLASH_FAILED - Flash write failed + * @retval mfrERR_FLASH_VERIFY_FAILED - Flash verification failed + * + * @pre mfr_init() should be called before calling this API. If this precondition is not met, the API will return mfrERR_NOT_INITIALIZED. + * @warning This API is Not thread safe + * + */ +mfrError_t mfrDeletePDRI(void); + +/** + * @brief Deletes the platform images. Deletes the main image from primary and secondary bank + * + * @return mfrError_t - Status + * @retval mfrERR_NONE - Success + * @retval mfrERR_NOT_INITIALIZED - Module is not initialised + * @retval mfrERR_WRITE_FLASH_FAILED - Flash write failed + * @retval mfrERR_FLASH_VERIFY_FAILED - Flash verification failed + * + * @pre mfr_init() should be called before calling this API. If this precondition is not met, the API will return mfrERR_NOT_INITIALIZED. + * @warning This API is Not thread safe + * + */ +mfrError_t mfrScrubAllBanks(void); + +/** + * @brief Sets bootloader LED pattern + * + * This function stores the bootup pattern in the persistance storage for bootloader to read + * and control the front panel LED and/or TV backlight sequence on bootup + * + * @param [in] pattern : options are defined by enum mfrBlPattern_t. @see mfrBlPattern_t + * + * @return mfrError_t - Status + * @retval mfrERR_NONE - Success + * @retval mfrERR_NOT_INITIALIZED - Module is not initialised + * @retval mfrERR_INVALID_PARAM - Parameter passed to this function is invalid + * @retval mfrERR_WRITE_FLASH_FAILED - Flash write failed + * @retval mfrERR_FLASH_VERIFY_FAILED - Flash verification failed + * + * @pre mfr_init() should be called before calling this API. If this precondition is not met, the API will return mfrERR_NOT_INITIALIZED. + * @warning This API is Not thread safe + * + */ +mfrError_t mfrSetBootloaderPattern(mfrBlPattern_t pattern); + +/** + * @brief API to update Primary Splash screen Image and to override the default the Splash screen image + * + * @param [in] path : char pointer which holds the path of input bootloader OSD image. + * + * @return mfrError_t - Status + * @retval mfrERR_NONE - Success + * @retval mfrERR_NOT_INITIALIZED - Module is not initialised + * @retval mfrERR_INVALID_PARAM - Parameter passed to this function is invalid + * @retval mfrERR_IMAGE_FILE_OPEN_FAILED - Failed to open the downloaded splash screen file + * @retval mfrERR_MEMORY_EXHAUSTED - memory allocation failure + * + * @pre mfr_init() should be called before calling this API. If this precondition is not met, the API will return mfrERR_NOT_INITIALIZED. + * @warning This API is Not thread safe + * + */ +mfrError_t mfrSetBlSplashScreen(const char *path); + +/** + * @brief API to clear the primary Splash screen Image and to make + * use of default Splash screen image + * + * @return mfrError_t - Status + * @retval mfrERR_NONE - Success + * @retval mfrERR_NOT_INITIALIZED - Module is not initialised + * @retval mfrERR_IMAGE_FILE_OPEN_FAILED - Failed to open the downloaded splash screen file + * @retval mfrERR_MEMORY_EXHAUSTED - memory allocation failure + * + * @pre mfr_init() should be called before calling this API. If this precondition is not met, the API will return mfrERR_NOT_INITIALIZED. + * @warning This API is Not thread safe + * + */ +mfrError_t mfrClearBlSplashScreen(void); + +/** +* @brief API to retrive the secure time from TEE +* +* @param [in] params : unit32 timeptr to get the UTC time in seconds +* +* @return Error Code: Return mfrERR_NONE if operation is successful, mfrERR_GENERAL if it fails +*/ +mfrError_t mfrGetSecureTime(uint32_t *timeptr); + +/** +* @brief API to set the secure time from TEE +* +* @param [in] params : unit32 timeptr to set the UTC time in seconds +* +* @return Error Code: Return mfrERR_NONE if operation is successful, mfrERR_GENERAL if it fails +*/ +mfrError_t mfrSetSecureTime(uint32_t *timeptr); + + +/** + * @brief API to set the fsr flag into the emmc raw area + * + * @param [in] params : uint16_t fsrflag to set the FSR flag + * + * @return mfrError_t - Status + * @retval mfrERR_NONE - Success + * @retval mfrERR_NOT_INITIALIZED - Module is not initialised + * @retval mfrERR_INVALID_PARAM - Parameter passed to this function is invalid + * @return Error Code: Return mfrERR_NONE if operation is successful, mfrERR_GENERAL if it fails + * + **/ +mfrError_t mfrSetFSRflag(uint16_t *newFsrFlag); + +/** + * @brief API to get the fsr flag from emmc + * + * @param [in] params : uint16_t fsrflag to get the FSR flag + * + * @return mfrError_t - Status + * @retval mfrERR_NONE - Success + * @retval mfrERR_INVALID_PARAM - Parameter passed to this function is invalid + * @retval mfrERR_NOT_INITIALIZED - Module is not initialised + * @return Error Code: Return mfrERR_NONE if operation is successful, mfrERR_GENERAL if it fails + * + **/ +mfrError_t mfrGetFSRflag(uint16_t *newFsrFlag); + +/** +* @brief API to retrive the secure time from TEE +* +* @param [in] params : unit32 timeptr to get the UTC time in seconds +* +* @return Error Code: Return mfrERR_NONE if operation is successful, mfrERR_GENERAL if it fails +*/ +mfrError_t mfrGetSecureTime(uint32_t *timeptr); + +/** +* @brief API to set the secure time from TEE +* +* @param [in] params : unit32 timeptr to set the UTC time in seconds +* +* @return Error Code: Return mfrERR_NONE if operation is successful, mfrERR_GENERAL if it fails +*/ +mfrError_t mfrSetSecureTime(uint32_t *timeptr); + + +/** +* @brief API to set the fsr flag into the emmc raw area +* +* @param [in] params : unit32 fsrflag to set the FSR flag +* +* @return Error Code: Return mfrERR_NONE if operation is successful, mfrERR_GENERAL if it fails +*/ +mfrError_t mfrSetFSRflag(uint16_t *newFsrFlag); + + +/** +* @brief API to get the fsr flag from emmc +* +* @param [in] params : unit32 fsrflag to get the FSR flag +* +* @return Error Code: Return mfrERR_NONE if operation is successful, mfrERR_GENERAL if it fails +*/ +mfrError_t mfrGetFSRflag(uint16_t *newFsrFlag); + +#endif + +/** @} */ // End of PLAT_MFR_DATA +/** @} */ // End of MFR_HAL +/** @} */ // End of MFR Module +/** @} */ // End of HPK diff --git a/ci/mocks/secure_wrappermock.h b/ci/mocks/secure_wrappermock.h new file mode 100755 index 00000000..37dd7a2e --- /dev/null +++ b/ci/mocks/secure_wrappermock.h @@ -0,0 +1,37 @@ +/** +* If not stated otherwise in this file or this component's LICENSE +* file the following copyright and licenses apply: +* +* Copyright 2024 RDK Management +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +**/ + +#pragma once +#include +#include + +# ifdef __cplusplus +extern "C" { +# endif + + +FILE *v_secure_popen(const char *direction, const char *command, ...); + +int v_secure_pclose(FILE *); + +int v_secure_system(const char *command, ...); + +# ifdef __cplusplus +} +# endif diff --git a/ci/patches/00010-R4.4-Add-support-for-project-dir.patch b/ci/patches/00010-R4.4-Add-support-for-project-dir.patch new file mode 100755 index 00000000..dbb94881 --- /dev/null +++ b/ci/patches/00010-R4.4-Add-support-for-project-dir.patch @@ -0,0 +1,116 @@ +diff --git a/JsonGenerator/source/class_emitter.py b/JsonGenerator/source/class_emitter.py +index 7f2fb01..67a6469 100644 +--- a/JsonGenerator/source/class_emitter.py ++++ b/JsonGenerator/source/class_emitter.py +@@ -113,7 +113,6 @@ + emit.Line("#include ") + emit.Line() + +- emit.Line("#include \"definitions.h\"") + + if not config.NO_INCLUDES: + if if_file.endswith(".h"): +diff --git a/ProxyStubGenerator/StubGenerator.py b/ProxyStubGenerator/StubGenerator.py +index 6e079b6..d2de681 100755 +--- a/ProxyStubGenerator/StubGenerator.py ++++ b/ProxyStubGenerator/StubGenerator.py +@@ -193,7 +193,7 @@ + + + # Generate interface information in lua +-def GenerateLuaData(emit, interfaces_list, enums_list, source_file=None, tree=None, ns=None): ++def GenerateLuaData(emit, interfaces_list, enums_list, project_dir, source_file=None, tree=None, ns=None): + + if not source_file: + assert(tree==None) +@@ -535,7 +535,7 @@ + + return tree + +-def GenerateStubs2(output_file, source_file, tree, ns, scan_only=False): ++def GenerateStubs2(output_file, source_file, project_dir, tree, ns, scan_only=False): + log.Info("Scanning '%s' (in %s)..." % (source_file, ns)) + + if not FORCE and (os.path.exists(output_file) and (os.path.getmtime(source_file) < os.path.getmtime(output_file))): +@@ -579,7 +579,7 @@ + emit.Line + emit.Line() + +- if os.path.isfile(os.path.join(os.path.dirname(source_file), "Module.h")): ++ if os.path.isfile(os.path.join(project_dir, "Module.h")): + emit.Line('#include "Module.h"') + + if os.path.isfile(os.path.join(os.path.dirname(source_file), interface_header_name)): +@@ -2085,6 +2085,8 @@ + help="include an additional C++ header file, may be used multiple times (default: include 'Ids.h')") + argparser.add_argument('-I', dest="includePaths", metavar="INCLUDE_DIR", action='append', default=[], type=str, + help='add an include search path, can be used multiple times') ++ argparser.add_argument("--projectdir",dest="project_dir",metavar="DIR",type=str,default="", ++ help="specify the project directory") + + args = argparser.parse_args(sys.argv[1:]) + SHOW_WARNINGS = not args.no_warnings +@@ -2221,7 +2223,10 @@ + + for source_file in interface_files: + try: +- _extra_includes = [ os.path.join("@" + os.path.dirname(source_file), IDS_DEFINITIONS_FILE) ] ++ if args.project_dir is not None: ++ _extra_includes = [ os.path.join("@" + args.project_dir, IDS_DEFINITIONS_FILE) ] ++ else: ++ _extra_includes = [ os.path.join("@" + os.path.dirname(source_file), IDS_DEFINITIONS_FILE) ] + _extra_includes.extend(args.extra_includes) + + tree = Parse(source_file, args.includePaths, +@@ -2242,7 +2247,7 @@ + some_omitted = False + + for ns in INTERFACE_NAMESPACES: +- output, some_omitted = GenerateStubs2(output_file, source_file, tree, ns, scan_only) ++ output, some_omitted = GenerateStubs2(output_file, source_file, args.project_dir, tree, ns, scan_only) + + new_faces += output + +@@ -2265,7 +2270,7 @@ + log.Print("(lua generator) Scanning %s..." % os.path.basename(source_file)) + + for ns in INTERFACE_NAMESPACES: +- GenerateLuaData(Emitter(lua_file, INDENT_SIZE), lua_interfaces, lua_enums, source_file, tree, ns) ++ GenerateLuaData(Emitter(lua_file, INDENT_SIZE), lua_interfaces, lua_enums, args.project_dir, source_file, tree, ns) + + except NotModifiedException as err: + log.Print("skipped file %s, up-to-date" % os.path.basename(output_file)) +@@ -2316,7 +2321,7 @@ + if args.lua_code: + # Epilogue + for ns in INTERFACE_NAMESPACES: +- GenerateLuaData(Emitter(lua_file, INDENT_SIZE), lua_interfaces, lua_enums) ++ GenerateLuaData(Emitter(lua_file, INDENT_SIZE), lua_interfaces, lua_enums,args.project_dir) + log.Print("Created %s (%s interfaces, %s enums)" % (lua_file.name, len(lua_interfaces), len(lua_enums))) + + else: + +diff --git a/cmake/FindProxyStubGenerator.cmake.in b/cmake/FindProxyStubGenerator.cmake.in +index 1344452..a8dbcea 100644 +--- a/cmake/FindProxyStubGenerator.cmake.in ++++ b/cmake/FindProxyStubGenerator.cmake.in. +@@ -31,7 +31,7 @@ function(ProxyStubGenerator) + endif() + + set(optionsArgs SECURE COHERENT TRACES VERBOSE NO_WARNINGS KEEP FORCE_GENERATE) +- set(oneValueArgs OUTDIR) ++ set(oneValueArgs OUTDIR PROJECT_DIR) + set(multiValueArgs INPUT INCLUDE INCLUDE_PATH NAMESPACE) + + cmake_parse_arguments(Argument "${optionsArgs}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} ) +@@ -81,6 +81,10 @@ function(ProxyStubGenerator) + list(APPEND _execute_command "--outdir" "${Argument_OUTDIR}") + endif() + ++ if(Argument_PROJECT_DIR) ++ list(APPEND _execute_command "--projectdir" "${Argument_PROJECT_DIR}") ++ endif() ++ + foreach(_include ${Argument_INCLUDE}) + list(APPEND _execute_command "-I" "${_include}") + endforeach(_include) diff --git a/ci/patches/1004-Add-support-for-project-dir.patch b/ci/patches/1004-Add-support-for-project-dir.patch new file mode 100755 index 00000000..26fdee12 --- /dev/null +++ b/ci/patches/1004-Add-support-for-project-dir.patch @@ -0,0 +1,42 @@ +diff --git a/Source/plugins/CMakeLists.txt b/Source/plugins/CMakeLists.txt +index 4d362d545..9357c647c 100644 +--- a/Source/plugins/CMakeLists.txt ++++ b/Source/plugins/CMakeLists.txt +@@ -20,14 +20,14 @@ + string(TOLOWER ${NAMESPACE} NAMESPACE_LIB) + + option(VIRTUALINPUT_TOOLS "Build VirtualInput tools" OFF) +- +-ProxyStubGenerator(NAMESPACE "WPEFramework::PluginHost" INPUT "${CMAKE_CURRENT_SOURCE_DIR}/IPlugin.h" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated") +-ProxyStubGenerator(NAMESPACE "WPEFramework::PluginHost" INPUT "${CMAKE_CURRENT_SOURCE_DIR}/IShell.h" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated") +-ProxyStubGenerator(NAMESPACE "WPEFramework::Exchange" INPUT "${CMAKE_CURRENT_SOURCE_DIR}/IController.h" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated" INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/..") +-ProxyStubGenerator(NAMESPACE "WPEFramework::PluginHost" INPUT "${CMAKE_CURRENT_SOURCE_DIR}/IControllerDeprecated.h" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated" INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/..") +-ProxyStubGenerator(NAMESPACE "WPEFramework::PluginHost" INPUT "${CMAKE_CURRENT_SOURCE_DIR}/IStateControl.h" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated") +-ProxyStubGenerator(NAMESPACE "WPEFramework::PluginHost" INPUT "${CMAKE_CURRENT_SOURCE_DIR}/ISubSystem.h" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated") +-ProxyStubGenerator(NAMESPACE "WPEFramework::PluginHost" INPUT "${CMAKE_CURRENT_SOURCE_DIR}/IDispatcher.h" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated") ++set(PROJECT_DIR "${CMAKE_CURRENT_SOURCE_DIR}") ++ProxyStubGenerator(NAMESPACE "WPEFramework::PluginHost" INPUT "${CMAKE_CURRENT_SOURCE_DIR}/IPlugin.h" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated" PROJECT_DIR ${PROJECT_DIR}) ++ProxyStubGenerator(NAMESPACE "WPEFramework::PluginHost" INPUT "${CMAKE_CURRENT_SOURCE_DIR}/IShell.h" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated" PROJECT_DIR ${PROJECT_DIR}) ++ProxyStubGenerator(NAMESPACE "WPEFramework::Exchange" INPUT "${CMAKE_CURRENT_SOURCE_DIR}/IController.h" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated" INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/.." PROJECT_DIR ${PROJECT_DIR}) ++ProxyStubGenerator(NAMESPACE "WPEFramework::PluginHost" INPUT "${CMAKE_CURRENT_SOURCE_DIR}/IControllerDeprecated.h" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated" INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/.." PROJECT_DIR ${PROJECT_DIR}) ++ProxyStubGenerator(NAMESPACE "WPEFramework::PluginHost" INPUT "${CMAKE_CURRENT_SOURCE_DIR}/IStateControl.h" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated" PROJECT_DIR ${PROJECT_DIR}) ++ProxyStubGenerator(NAMESPACE "WPEFramework::PluginHost" INPUT "${CMAKE_CURRENT_SOURCE_DIR}/ISubSystem.h" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated" PROJECT_DIR ${PROJECT_DIR}) ++ProxyStubGenerator(NAMESPACE "WPEFramework::PluginHost" INPUT "${CMAKE_CURRENT_SOURCE_DIR}/IDispatcher.h" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated" PROJECT_DIR ${PROJECT_DIR}) + + JsonGenerator(CODE NAMESPACE WPEFramework::Exchange::Controller INPUT ${CMAKE_CURRENT_SOURCE_DIR}/IController.h OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/generated/jsonrpc" INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/.." NO_INCLUDES LEGACY_ALT) + +diff --git a/Source/com/CMakeLists.txt b/Source/com/CMakeLists.txt +index 1de9ac176..bcf9489d1 100644 +--- a/Source/com/CMakeLists.txt ++++ b/Source/com/CMakeLists.txt +@@ -16,8 +16,8 @@ + # limitations under the License. + + set(TARGET ${NAMESPACE}COM) +- +-ProxyStubGenerator(NAMESPACE "WPEFramework::RPC" INPUT "${CMAKE_CURRENT_SOURCE_DIR}/ICOM.h" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated") ++set(PROJECT_DIR "${CMAKE_CURRENT_SOURCE_DIR}") ++ProxyStubGenerator(NAMESPACE "WPEFramework::RPC" INPUT "${CMAKE_CURRENT_SOURCE_DIR}/ICOM.h" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated" PROJECT_DIR ${PROJECT_DIR}) + + add_library(${TARGET} SHARED + Administrator.cpp diff --git a/ci/patches/RDKEMW-733-Add-ENTOS-IDS.patch b/ci/patches/RDKEMW-733-Add-ENTOS-IDS.patch new file mode 100755 index 00000000..c8fd3213 --- /dev/null +++ b/ci/patches/RDKEMW-733-Add-ENTOS-IDS.patch @@ -0,0 +1,21 @@ +From: Sitaram, Soundaryaa +Date: 05 Feb 2025 17:24:43 +0000 +Subject: [PATCH] ENTOS IDs offset to be adjusted in rdkservices-apis + +Upstream-Status: None +Signed-off-by: ssitar583 +--- +diff --git a/Source/com/Ids.h b/Source/com/Ids.h +index cf2060333..75d235bbd 100644 +--- a/Source/com/Ids.h ++++ b/Source/com/Ids.h +@@ -74,7 +74,8 @@ namespace RPC { + ID_COMREQUEST_NOTIFICATION = (ID_OFFSET_INTERNAL + 0x003D), + ID_SYSTEM_METADATA = (ID_OFFSET_INTERNAL + 0x003E), + +- ID_EXTERNAL_INTERFACE_OFFSET = (ID_OFFSET_INTERNAL + 0x0040) ++ ID_EXTERNAL_INTERFACE_OFFSET = (ID_OFFSET_INTERNAL + 0x0040), ++ ID_EXTERNAL_CC_INTERFACE_OFFSET = (0xCC00) // ends on 0xDFFF + }; + } + } diff --git a/ci/patches/Use_Legact_Alt_Based_On_ThunderTools_R4.4.3.patch b/ci/patches/Use_Legact_Alt_Based_On_ThunderTools_R4.4.3.patch new file mode 100755 index 00000000..c5b4a36f --- /dev/null +++ b/ci/patches/Use_Legact_Alt_Based_On_ThunderTools_R4.4.3.patch @@ -0,0 +1,20 @@ +commit 810aae64cb31c907698e468b615797750094b847 +Author: Pesala Lakshmi Jwala Priya +Date: Thu Aug 29 12:31:30 2024 +0530 + + Alt change + +diff --git a/Source/plugins/CMakeLists.txt b/Source/plugins/CMakeLists.txt +index 4d362d54..cdb53cdc 100644 +--- a/Source/plugins/CMakeLists.txt ++++ b/Source/plugins/CMakeLists.txt +@@ -29,7 +29,7 @@ ProxyStubGenerator(NAMESPACE "WPEFramework::PluginHost" INPUT "${CMAKE_CURRENT_S + ProxyStubGenerator(NAMESPACE "WPEFramework::PluginHost" INPUT "${CMAKE_CURRENT_SOURCE_DIR}/ISubSystem.h" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated") + ProxyStubGenerator(NAMESPACE "WPEFramework::PluginHost" INPUT "${CMAKE_CURRENT_SOURCE_DIR}/IDispatcher.h" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated") + +-JsonGenerator(CODE NAMESPACE WPEFramework::Exchange::Controller INPUT ${CMAKE_CURRENT_SOURCE_DIR}/IController.h OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/generated/jsonrpc" INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/.." NO_INCLUDES) ++JsonGenerator(CODE NAMESPACE WPEFramework::Exchange::Controller INPUT ${CMAKE_CURRENT_SOURCE_DIR}/IController.h OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/generated/jsonrpc" INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/.." NO_INCLUDES LEGACY_ALT) + + add_library(${TARGET} SHARED + Channel.cpp + diff --git a/ci/patches/error_code_R4_4.patch b/ci/patches/error_code_R4_4.patch new file mode 100644 index 00000000..954ca083 --- /dev/null +++ b/ci/patches/error_code_R4_4.patch @@ -0,0 +1,64 @@ +diff --git a/Source/WPEFramework/PluginServer.h b/Source/WPEFramework/PluginServer.h +index e87933d9a..591385222 100644 +--- a/Source/WPEFramework/PluginServer.h ++++ b/Source/WPEFramework/PluginServer.h +@@ -1535,6 +1535,22 @@ namespace PluginHost { + response->Error.SetError(Core::ERROR_ILLEGAL_STATE); + response->Error.Text = _T("The service is in an illegal state!!!."); + break; ++ case Core::ERROR_INVALID_PARAMETER: ++ response->Error.SetError(Core::ERROR_INVALID_SIGNATURE); ++ response->Error.Text = _T("Invalid Parameter"); ++ break; ++ case Core::ERROR_INVALID_DEVICENAME: ++ response->Error.SetError(Core::ERROR_INVALID_DEVICENAME); ++ response->Error.Text = _T("Invalid device name"); ++ break; ++ case Core::ERROR_INVALID_MOUNTPOINT: ++ response->Error.SetError(Core::ERROR_INVALID_MOUNTPOINT); ++ response->Error.Text = _T("Invalid mount path"); ++ break; ++ case Core::ERROR_FIRMWAREUPDATE_INPROGRESS: ++ response->Error.SetError(Core::ERROR_FIRMWAREUPDATE_INPROGRESS); ++ response->Error.Text = _T("Firmware update already in progress"); ++ break; + case static_cast(~0): + response.Release(); + break; +diff --git a/Source/core/JSONRPC.h b/Source/core/JSONRPC.h +index a9c4360fb..5fcef161d 100644 +--- a/Source/core/JSONRPC.h ++++ b/Source/core/JSONRPC.h +@@ -98,6 +98,15 @@ namespace Core { + case Core::ERROR_TIMEDOUT: + Code = -32000; // Server defined, now mapped to Timed out + break; ++ case Core::ERROR_INVALID_DEVICENAME: ++ Code = -32001; // Invalid device name ++ break; ++ case Core::ERROR_INVALID_MOUNTPOINT: ++ Code = -32002; // Invalid mount path ++ break; ++ case Core::ERROR_FIRMWAREUPDATE_INPROGRESS: ++ Code = -32003; // Firmware update inprogress ++ break; + default: + Code = static_cast(frameworkError); + break; +diff --git a/Source/core/Portability.h b/Source/core/Portability.h +index 01e34d398..a5728eebf 100644 +--- a/Source/core/Portability.h ++++ b/Source/core/Portability.h +@@ -874,7 +874,11 @@ namespace Core { + ERROR_CODE(ERROR_HIBERNATED, 46) \ + ERROR_CODE(ERROR_INPROC, 47) \ + ERROR_CODE(ERROR_FAILED_REGISTERED, 48) \ +- ERROR_CODE(ERROR_FAILED_UNREGISTERED, 49) ++ ERROR_CODE(ERROR_FAILED_UNREGISTERED, 49) \ ++ ERROR_CODE(ERROR_INVALID_PARAMETER, 54) \ ++ ERROR_CODE(ERROR_INVALID_DEVICENAME, 59) \ ++ ERROR_CODE(ERROR_INVALID_MOUNTPOINT, 60) \ ++ ERROR_CODE(ERROR_FIRMWAREUPDATE_INPROGRESS,61) + + #define ERROR_CODE(CODE, VALUE) CODE = VALUE, + From 68525ce582f27f222a61098a15220244e111996b Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Tue, 14 Apr 2026 16:06:32 +0000 Subject: [PATCH 09/72] More testing --- ci/mocks/control/xrsr.h | 6 +- ci/mocks/devicesettings/AudioOutputPortMock.h | 117 +++++++ .../devicesettings/AudioOutputPortTypeMock.h | 32 ++ ci/mocks/devicesettings/AudioStereoModeMock.h | 35 +++ ci/mocks/devicesettings/ColorMock.h | 32 ++ ci/mocks/devicesettings/CompositeInputMock.h | 35 +++ ci/mocks/devicesettings/DisplayMock.h | 36 +++ ci/mocks/devicesettings/DrmMock.h | 50 +++ ci/mocks/devicesettings/EdidParserMock.h | 30 ++ .../devicesettings/FloatingRtFunctionsMock.h | 35 +++ .../devicesettings/FrontPanelConfigMock.h | 33 ++ .../devicesettings/FrontPanelIndicatorMock.h | 40 +++ .../FrontPanelTextDisplayMock.h | 35 +++ ci/mocks/devicesettings/HdmiCecMock.h | 107 +++++++ ci/mocks/devicesettings/HdmiInputMock.h | 51 ++++ ci/mocks/devicesettings/HostMock.h | 148 +++++++++ ci/mocks/devicesettings/ManagerMock.h | 32 ++ ci/mocks/devicesettings/MotionDetectionMock.h | 53 ++++ ci/mocks/devicesettings/RtArrayObjectMock.h | 31 ++ ci/mocks/devicesettings/RtObjectBaseMock.h | 34 +++ ci/mocks/devicesettings/RtObjectRefMock.h | 33 ++ ci/mocks/devicesettings/SleepModeMock.h | 32 ++ ci/mocks/devicesettings/VideoDFCMock.h | 32 ++ ci/mocks/devicesettings/VideoDeviceMock.h | 39 +++ .../VideoOutputPortConfigMock.h | 32 ++ ci/mocks/devicesettings/VideoOutputPortMock.h | 61 ++++ .../devicesettings/VideoOutputPortTypeMock.h | 32 ++ ci/mocks/devicesettings/VideoResolutionMock.h | 34 +++ ci/mocks/thunder/COMLinkMock.h | 50 +++ ci/mocks/thunder/Communicator.cpp | 30 ++ ci/mocks/thunder/Communicator.h | 286 ++++++++++++++++++ ci/mocks/thunder/CommunicatorMock.h | 53 ++++ ci/mocks/thunder/DispatcherMock.h | 55 ++++ ci/mocks/thunder/FactoriesImplementation.h | 66 ++++ ci/mocks/thunder/Module.cpp | 22 ++ ci/mocks/thunder/Module.h | 27 ++ ci/mocks/thunder/ServiceMock.h | 92 ++++++ ci/mocks/thunder/SystemInfo.h | 85 ++++++ ci/mocks/thunder/ThunderPortability.h | 52 ++++ ci/mocks/thunder/WorkerPoolImplementation.h | 63 ++++ ci/mocks/thunder/mockauthservices.h | 89 ++++++ 41 files changed, 2235 insertions(+), 2 deletions(-) create mode 100644 ci/mocks/devicesettings/AudioOutputPortMock.h create mode 100644 ci/mocks/devicesettings/AudioOutputPortTypeMock.h create mode 100644 ci/mocks/devicesettings/AudioStereoModeMock.h create mode 100644 ci/mocks/devicesettings/ColorMock.h create mode 100644 ci/mocks/devicesettings/CompositeInputMock.h create mode 100644 ci/mocks/devicesettings/DisplayMock.h create mode 100644 ci/mocks/devicesettings/DrmMock.h create mode 100644 ci/mocks/devicesettings/EdidParserMock.h create mode 100644 ci/mocks/devicesettings/FloatingRtFunctionsMock.h create mode 100644 ci/mocks/devicesettings/FrontPanelConfigMock.h create mode 100644 ci/mocks/devicesettings/FrontPanelIndicatorMock.h create mode 100644 ci/mocks/devicesettings/FrontPanelTextDisplayMock.h create mode 100644 ci/mocks/devicesettings/HdmiCecMock.h create mode 100644 ci/mocks/devicesettings/HdmiInputMock.h create mode 100644 ci/mocks/devicesettings/HostMock.h create mode 100644 ci/mocks/devicesettings/ManagerMock.h create mode 100644 ci/mocks/devicesettings/MotionDetectionMock.h create mode 100644 ci/mocks/devicesettings/RtArrayObjectMock.h create mode 100644 ci/mocks/devicesettings/RtObjectBaseMock.h create mode 100644 ci/mocks/devicesettings/RtObjectRefMock.h create mode 100644 ci/mocks/devicesettings/SleepModeMock.h create mode 100644 ci/mocks/devicesettings/VideoDFCMock.h create mode 100644 ci/mocks/devicesettings/VideoDeviceMock.h create mode 100644 ci/mocks/devicesettings/VideoOutputPortConfigMock.h create mode 100644 ci/mocks/devicesettings/VideoOutputPortMock.h create mode 100644 ci/mocks/devicesettings/VideoOutputPortTypeMock.h create mode 100644 ci/mocks/devicesettings/VideoResolutionMock.h create mode 100644 ci/mocks/thunder/COMLinkMock.h create mode 100755 ci/mocks/thunder/Communicator.cpp create mode 100755 ci/mocks/thunder/Communicator.h create mode 100755 ci/mocks/thunder/CommunicatorMock.h create mode 100644 ci/mocks/thunder/DispatcherMock.h create mode 100644 ci/mocks/thunder/FactoriesImplementation.h create mode 100644 ci/mocks/thunder/Module.cpp create mode 100644 ci/mocks/thunder/Module.h create mode 100644 ci/mocks/thunder/ServiceMock.h create mode 100644 ci/mocks/thunder/SystemInfo.h create mode 100755 ci/mocks/thunder/ThunderPortability.h create mode 100644 ci/mocks/thunder/WorkerPoolImplementation.h create mode 100644 ci/mocks/thunder/mockauthservices.h diff --git a/ci/mocks/control/xrsr.h b/ci/mocks/control/xrsr.h index 88ea90ba..373eddcf 100644 --- a/ci/mocks/control/xrsr.h +++ b/ci/mocks/control/xrsr.h @@ -28,8 +28,10 @@ /* Minimal opaque placeholders to avoid requiring OpenSSL dev headers in mocks. */ typedef struct xrsr_x509_stub X509; typedef struct xrsr_evp_pkey_stub EVP_PKEY; -typedef struct xrsr_x509_stack_stub X509_STACK; -#define STACK_OF(type) type##_STACK +typedef struct stack_st_X509 X509_STACK; +#ifndef STACK_OF +#define STACK_OF(type) struct stack_st_##type +#endif #ifdef __cplusplus extern "C" { #endif diff --git a/ci/mocks/devicesettings/AudioOutputPortMock.h b/ci/mocks/devicesettings/AudioOutputPortMock.h new file mode 100644 index 00000000..148ac73f --- /dev/null +++ b/ci/mocks/devicesettings/AudioOutputPortMock.h @@ -0,0 +1,117 @@ +/** +* If not stated otherwise in this file or this component's LICENSE +* file the following copyright and licenses apply: +* +* Copyright 2024 RDK Management +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +**/ + +#pragma once + +#include +#include + +#include "audioOutputPort.hpp" + +class AudioOutputPortMock : public device::AudioOutputPortImpl { +public: + virtual ~AudioOutputPortMock() = default; + + MOCK_METHOD(const std::string&, getName, (), (const, override)); + MOCK_METHOD(std::vector, getMS12AudioProfileList, (), (const, override)); + MOCK_METHOD(void, getAudioCapabilities, (int* capabilities), (override)); + MOCK_METHOD(void, getMS12Capabilities, (int* capabilities), (override)); + MOCK_METHOD(bool, isAudioMSDecode, (), (const,override)); + + MOCK_METHOD(bool, getEnablePersist, (), (override)); + MOCK_METHOD(void, getHdmiArcPortId, (int *portId), (override)); + MOCK_METHOD(bool, isConnected, (), (override)); + MOCK_METHOD(void, setDRCMode, (int DRCMode), (override)); + MOCK_METHOD(void, setCompression, (int compressionLevel), (override)); + MOCK_METHOD(int, getCompression, (), (override)); + MOCK_METHOD(void, setDolbyVolumeMode, (bool dolbyVolumeMode), (override)); + MOCK_METHOD(void, setDialogEnhancement, (int enhancerlevel), (override)); + MOCK_METHOD(int, getDialogEnhancement, (), (override)); + MOCK_METHOD(void, setIntelligentEqualizerMode, (int intelligentEqualizerMode), (override)); + MOCK_METHOD(int, getIntelligentEqualizerMode, (), (override)); + MOCK_METHOD(void, setGraphicEqualizerMode, (int graphicEqualizerMode), (override)); + MOCK_METHOD(int, getGraphicEqualizerMode, (), (override)); + MOCK_METHOD(void, setMS12AudioProfile, (std::string audioProfileName), (override)); + MOCK_METHOD(void, resetVolumeLeveller, (), (override)); + MOCK_METHOD(void, resetSurroundVirtualizer, (), (override)); + MOCK_METHOD(void, resetBassEnhancer, (), (override)); + MOCK_METHOD(void, resetDialogEnhancement, (), (override)); + MOCK_METHOD(void, getSupportedARCTypes, (int *types), (override)); + MOCK_METHOD(void, setEnablePersist, (bool pEnable), (override)); + MOCK_METHOD(dsError_t, setEnablePort, (bool pEnable), (override)); + MOCK_METHOD(bool, isMuted, (), (override)); + MOCK_METHOD(void, setAudioAtmosOutputMode, (int enable), (override)); + MOCK_METHOD(bool, getSinkDeviceAtmosCapability, (dsATMOSCapability_t& atmosCapability), (override)); + MOCK_METHOD(void, setAudioDelayOffset, (int audioDelayOffsetMs), (override)); + MOCK_METHOD(void, setAudioDelay, (int audioDelayMs), (override)); + MOCK_METHOD(void, getAudioDelay, (uint32_t audioDelayMs), (override)); + MOCK_METHOD(void, getAudioDelayOffset, (uint32_t audioDelayOffsetMs), (override)); + MOCK_METHOD(void, getSecondaryLanguage, (std::string secondaryLanguage), (override)); + MOCK_METHOD(void,setSecondaryLanguage, (std::string secondaryLanguage), (override)); + MOCK_METHOD(void, setPrimaryLanguage, (std::string primaryLanguage), (override)); + MOCK_METHOD(void, getPrimaryLanguage, (std::string primaryLanguage), (override)); + MOCK_METHOD(void, getFaderControl, (int *mixerBalance), (override)); + MOCK_METHOD(void, setFaderControl, (int mixerBalance), (override)); + MOCK_METHOD(void, setAssociatedAudioMixing, (bool mixing), (override)); + MOCK_METHOD(void, setGain, (float newGain), (override)); + MOCK_METHOD(void, setMISteering, (bool MISteering), (override)); + MOCK_METHOD(void, setSurroundVirtualizer, (dsSurroundVirtualizer_t surroundVirtualizer), (override)); + MOCK_METHOD(void, setBassEnhancer, (int bassBoost), (override)); + MOCK_METHOD(void, enableSurroundDecoder, (bool enableSurroundDecoder), (override)); + MOCK_METHOD(void, setVolumeLeveller, (dsVolumeLeveller_t volumeLeveller), (override)); + MOCK_METHOD(bool, getMISteering, (), (override)); + MOCK_METHOD(dsSurroundVirtualizer_t, getSurroundVirtualizer, (), (override)); + MOCK_METHOD(int, getDRCMode, (), (override)); + MOCK_METHOD(float, getLevel, (), (override)); + MOCK_METHOD(float, getGain, (), (override)); + MOCK_METHOD(bool, isSurroundDecoderEnabled, (), (override)); + MOCK_METHOD(int, getBassEnhancer, (), (override)); + MOCK_METHOD(dsVolumeLeveller_t, getVolumeLeveller, (), (override)); + MOCK_METHOD(bool, getStereoAuto, (), (override)); + + MOCK_METHOD(std::string, getMS12AudioProfile, (), (override)); + MOCK_METHOD(void, setMS12AudioProfileSetttingsOverride, (std::string audioProfileState,std::string audioProfileName,std::string audioProfileSettingsName, std::string audioProfileSettingValue), (override)); + + MOCK_METHOD(void, setLevel, (float level), (override)); + MOCK_METHOD(void, setMuted, (bool muted), (override)); + MOCK_METHOD(void, getAssociatedAudioMixing, (bool *mixing), (override)); + MOCK_METHOD(bool, isEnabled, (), (override)); + MOCK_METHOD(void, setSAD, (std::vector sad_list), (override)); + MOCK_METHOD(void, setStereoAuto, (bool stereoAuto, bool persist), (override)); + MOCK_METHOD(void, reInitializeAudioOutputPort, (), (override)); + + MOCK_METHOD(std::vector, getSupportedStereoModes, (), (const, override)); + + MOCK_METHOD(void, enableARC, (dsAudioARCTypes_t type, bool enable), (override)); + + MOCK_METHOD(void, setStereoMode, (const std::string &mode, bool persist), (override)); + + MOCK_METHOD(device::AudioStereoMode, getStereoMode, (const bool toPersist), (const, override)); + + + MOCK_METHOD(device::AudioStereoMode, getStereoMode, (), (const, override)); + + MOCK_METHOD(uint32_t, getDolbyVolumeMode, (), (const, override)); + + MOCK_METHOD(const device::AudioOutputPortType&, getType, (), (const, override)); + + + + +}; diff --git a/ci/mocks/devicesettings/AudioOutputPortTypeMock.h b/ci/mocks/devicesettings/AudioOutputPortTypeMock.h new file mode 100644 index 00000000..1e941840 --- /dev/null +++ b/ci/mocks/devicesettings/AudioOutputPortTypeMock.h @@ -0,0 +1,32 @@ +/* +* If not stated otherwise in this file or this component's LICENSE file the +* following copyright and licenses apply: +* +* Copyright 2025 RDK Management +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#pragma once + +#include + +#include "audioOutputPortType.hpp" + +class AudioOutputPortTypeMock : public device::AudioOutputPortTypeImpl { +public: + virtual ~AudioOutputPortTypeMock() = default; + + MOCK_METHOD(int, getId, (), (const, override)); + // MOCK_METHOD(const device::List, getSupportedResolutions, (), (const, override)); +}; \ No newline at end of file diff --git a/ci/mocks/devicesettings/AudioStereoModeMock.h b/ci/mocks/devicesettings/AudioStereoModeMock.h new file mode 100644 index 00000000..292ebd5b --- /dev/null +++ b/ci/mocks/devicesettings/AudioStereoModeMock.h @@ -0,0 +1,35 @@ +/* +* If not stated otherwise in this file or this component's LICENSE file the +* following copyright and licenses apply: +* +* Copyright 2025 RDK Management +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#pragma once + +#include + +#include "AudioStereoMode.hpp" + +class AudioStereoModeMock : public device::AudioStereoModeImpl { +public: + virtual ~AudioStereoModeMock() = default; + + + MOCK_METHOD(const std::string&, getName, (), (const, override)); + MOCK_METHOD( std::string, toString, (), (override)); + + +}; diff --git a/ci/mocks/devicesettings/ColorMock.h b/ci/mocks/devicesettings/ColorMock.h new file mode 100644 index 00000000..17529786 --- /dev/null +++ b/ci/mocks/devicesettings/ColorMock.h @@ -0,0 +1,32 @@ +/** +* If not stated otherwise in this file or this component's LICENSE +* file the following copyright and licenses apply: +* +* Copyright 2024 RDK Management +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +**/ + +#pragma once + +#include + +class ColorMock : public device::FrontPanelIndicator::ColorImpl { +public: + virtual ~ColorMock() = default; + + MOCK_METHOD(const device::FrontPanelIndicator::Color&, getInstanceById, (int id), (override)); + MOCK_METHOD(const device::FrontPanelIndicator::Color&, getInstanceByName, (const std::string& name), (override)); + MOCK_METHOD(std::string,getName, (), (const, override)); + +}; diff --git a/ci/mocks/devicesettings/CompositeInputMock.h b/ci/mocks/devicesettings/CompositeInputMock.h new file mode 100644 index 00000000..ce638fdd --- /dev/null +++ b/ci/mocks/devicesettings/CompositeInputMock.h @@ -0,0 +1,35 @@ +/** +* If not stated otherwise in this file or this component's LICENSE +* file the following copyright and licenses apply: +* +* Copyright 2024 RDK Management +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +**/ + +#pragma once + +#include + +#include "compositeIn.hpp" + +class CompositeInputImplMock : public device::CompositeInputImpl { +public: + virtual ~CompositeInputImplMock() = default; + + MOCK_METHOD(uint8_t, getNumberOfInputs, (), (const, override)); + MOCK_METHOD(bool, isPortConnected, (int8_t Port), (const, override)); + MOCK_METHOD(void, selectPort, (int8_t Port), (const, override)); + MOCK_METHOD(void, scaleVideo, (int32_t x, int32_t y, int32_t width, int32_t height), (const, override)); + +}; diff --git a/ci/mocks/devicesettings/DisplayMock.h b/ci/mocks/devicesettings/DisplayMock.h new file mode 100644 index 00000000..af818a18 --- /dev/null +++ b/ci/mocks/devicesettings/DisplayMock.h @@ -0,0 +1,36 @@ +/** +* If not stated otherwise in this file or this component's LICENSE +* file the following copyright and licenses apply: +* +* Copyright 2024 RDK Management +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +**/ + +#pragma once + +#include + +#include "devicesettings.h" + +class DisplayMock : public device::DisplayImpl { +public: + virtual ~DisplayMock() = default; + + MOCK_METHOD(void, getEDIDBytes, (std::vector &edid), (const, override)); + MOCK_METHOD(bool, isConnectedDeviceRepeater, (), (override)); + MOCK_METHOD(int, getSurroundMode, (), (override)); + MOCK_METHOD(void, setAllmEnabled, (bool enable), (override)); + MOCK_METHOD(void, setAVIContentType, (int contentType), (override)); + MOCK_METHOD(void, setAVIScanInformation, (int scanInfo), (override)); +}; diff --git a/ci/mocks/devicesettings/DrmMock.h b/ci/mocks/devicesettings/DrmMock.h new file mode 100644 index 00000000..64821642 --- /dev/null +++ b/ci/mocks/devicesettings/DrmMock.h @@ -0,0 +1,50 @@ +/** +* If not stated otherwise in this file or this component's LICENSE +* file the following copyright and licenses apply: +* +* Copyright 2024 RDK Management +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +**/ + +#pragma once + +#include +#include + +class DRMMock : public drmImpl { +public: + virtual ~DRMMock() = default; + + MOCK_METHOD(drmModeEncoderPtr, drmModeGetEncoder, (int fd, uint32_t encoder_id), (override)); + MOCK_METHOD(void, drmModeFreeEncoder, (drmModeEncoderPtr* encoder), (override)); + MOCK_METHOD(drmModeConnectorPtr, drmModeGetConnector, (int fd, uint32_t connectorId), (override)); + MOCK_METHOD(drmModeCrtcPtr, drmModeGetCrtc, (int fd, uint32_t crtcId), (override)); + MOCK_METHOD(drmModeResPtr, drmModeGetResources, (int fd), (override)); + MOCK_METHOD(void, drmModeFreeConnector, (drmModeConnectorPtr ptr), (override)); + MOCK_METHOD(void, drmModeFreeCrtc, (drmModeCrtcPtr ptr), (override)); + MOCK_METHOD(void, drmModeFreeResources, (drmModeResPtr ptr), (override)); + MOCK_METHOD(drmModePropertyPtr, drmModeGetProperty, (int fd, uint32_t propertyId), (override)); + MOCK_METHOD(void, drmModeFreeProperty, (drmModePropertyPtr ptr), (override)); + MOCK_METHOD(drmModePlaneResPtr, drmModeGetPlaneResources, (int fd), (override)); + MOCK_METHOD(drmModePlanePtr, drmModeGetPlane, (int fd, uint32_t plane_id), (override)); + MOCK_METHOD(drmModeObjectPropertiesPtr, drmModeObjectGetProperties, (int fd, uint32_t object_id, uint32_t object_type), (override)); + MOCK_METHOD(void, drmModeFreeObjectProperties, (drmModeObjectPropertiesPtr ptr), (override)); + MOCK_METHOD(void, drmModeFreePlane, (drmModePlanePtr ptr), (override)); + MOCK_METHOD(void, drmModeFreePlaneResources, (drmModePlaneResPtr ptr), (override)); + MOCK_METHOD(int, drmSetClientCap, (int fd, uint64_t capability, uint64_t value), (override)); + MOCK_METHOD(void, drmModeFreeFB, (drmModeFBPtr ptr), (override)); + MOCK_METHOD(drmModeFBPtr, drmModeGetFB, (int fd, uint32_t bufferId), (override)); + MOCK_METHOD(void, drmModeFreeEncoder, (drmModeEncoderPtr ptr), (override)); + +}; \ No newline at end of file diff --git a/ci/mocks/devicesettings/EdidParserMock.h b/ci/mocks/devicesettings/EdidParserMock.h new file mode 100644 index 00000000..e8313a9c --- /dev/null +++ b/ci/mocks/devicesettings/EdidParserMock.h @@ -0,0 +1,30 @@ +/** +* If not stated otherwise in this file or this component's LICENSE +* file the following copyright and licenses apply: +* +* Copyright 2024 RDK Management +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +**/ + +#pragma once + +#include + +#include "devicesettings.h" +class EdidParserMock : public edid_parser::edidParserImpl { +public: + virtual ~EdidParserMock() = default; + MOCK_METHOD(edid_parser::edid_status_e, EDID_Parse, (unsigned char* bytes, size_t count, edid_parser::edid_data_t* data_ptr), (override)); + MOCK_METHOD(edid_parser::edid_status_e, EDID_Verify, (unsigned char* bytes, size_t count), (override)); +}; diff --git a/ci/mocks/devicesettings/FloatingRtFunctionsMock.h b/ci/mocks/devicesettings/FloatingRtFunctionsMock.h new file mode 100644 index 00000000..599ee049 --- /dev/null +++ b/ci/mocks/devicesettings/FloatingRtFunctionsMock.h @@ -0,0 +1,35 @@ +/* + * If not stated otherwise in this file or this component's LICENSE file the + * following copyright and licenses apply: + * + * Copyright 2022 RDK Management + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#pragma once + +#include + +class floatingRtFunctionsMock : public floatingRtFunctionsImpl { +public: + virtual ~floatingRtFunctionsMock() = default; + + MOCK_METHOD(rtError, rtRemoteLocateObject, (rtRemoteEnvironment *env, const char* str, rtObjectRef& obj, int x, remoteDisconnectCallback back, void *cbdata), (override)); + MOCK_METHOD(rtRemoteEnvironment*, rtEnvironmentGetGlobal, (), (override)); + MOCK_METHOD(rtError,rtRemoteShutdown, (rtRemoteEnvironment *env), (override)); + MOCK_METHOD(rtError,rtRemoteInit, (rtRemoteEnvironment *env), (override)); + MOCK_METHOD(rtError,rtRemoteProcessSingleItem, (), (override)); + MOCK_METHOD(char*, rtStrError, (rtError err), (override)); + + +}; diff --git a/ci/mocks/devicesettings/FrontPanelConfigMock.h b/ci/mocks/devicesettings/FrontPanelConfigMock.h new file mode 100644 index 00000000..8acbbd45 --- /dev/null +++ b/ci/mocks/devicesettings/FrontPanelConfigMock.h @@ -0,0 +1,33 @@ +/** +* If not stated otherwise in this file or this component's LICENSE +* file the following copyright and licenses apply: +* +* Copyright 2024 RDK Management +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +**/ + +#pragma once + +#include + +class FrontPanelConfigMock : public device::FrontPanelConfigImpl { +public: + virtual ~FrontPanelConfigMock() = default; + + MOCK_METHOD(device::List,getIndicators, (), (const, override)); + MOCK_METHOD(device::FrontPanelTextDisplay&,getTextDisplay, (const std::string &name), (const, override)); + MOCK_METHOD(device::FrontPanelTextDisplay&,getTextDisplay, (int id), (const, override)); + MOCK_METHOD(device::FrontPanelTextDisplay&,getTextDisplay, (), (const, override)); + MOCK_METHOD(device::List,getTextDisplays, (), (const, override)); +}; diff --git a/ci/mocks/devicesettings/FrontPanelIndicatorMock.h b/ci/mocks/devicesettings/FrontPanelIndicatorMock.h new file mode 100644 index 00000000..8618b619 --- /dev/null +++ b/ci/mocks/devicesettings/FrontPanelIndicatorMock.h @@ -0,0 +1,40 @@ +/** +* If not stated otherwise in this file or this component's LICENSE +* file the following copyright and licenses apply: +* +* Copyright 2024 RDK Management +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +**/ + +#pragma once + +#include + +class FrontPanelIndicatorMock : public device::FrontPanelIndicator::FrontPanelIndicatorImpl { +public: + virtual ~FrontPanelIndicatorMock() = default; + + MOCK_METHOD(device::FrontPanelIndicator&, getInstanceString, (const std::string& name), (override)); + MOCK_METHOD(device::FrontPanelIndicator&, getInstanceInt, (int id), (override)); + MOCK_METHOD(void,setState, (const bool bState), (const, override)); + MOCK_METHOD(std::string,getName, (), (const, override)); + MOCK_METHOD(void,setBrightness, (const int brightness, const bool toPersist), (const, override)); + MOCK_METHOD(int,getBrightness, (const bool persist), (const, override)); + MOCK_METHOD(void,setColor, (const device::FrontPanelIndicator::Color &newColor, const bool toPersist), (const, override)); + MOCK_METHOD(void,setColorInt, (const uint32_t color, const bool toPersist), (const, override)); + MOCK_METHOD(void,getBrightnessLevels, (int &levels,int &min,int &max), (const, override)); + MOCK_METHOD(int,getColorMode, (), (const, override)); + MOCK_METHOD(std::string,getColorName, (), (const, override)); + MOCK_METHOD(device::List,getSupportedColors, (), (const, override)); +}; diff --git a/ci/mocks/devicesettings/FrontPanelTextDisplayMock.h b/ci/mocks/devicesettings/FrontPanelTextDisplayMock.h new file mode 100644 index 00000000..1923b4ab --- /dev/null +++ b/ci/mocks/devicesettings/FrontPanelTextDisplayMock.h @@ -0,0 +1,35 @@ +/** +* If not stated otherwise in this file or this component's LICENSE +* file the following copyright and licenses apply: +* +* Copyright 2024 RDK Management +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +**/ + +#pragma once + +#include + +class FrontPanelTextDisplayMock : public device::FrontPanelTextDisplayImpl { +public: + virtual ~FrontPanelTextDisplayMock() = default; + MOCK_METHOD(device::FrontPanelTextDisplay&, getInstanceByName, (const std::string& name), (override)); + MOCK_METHOD(device::FrontPanelTextDisplay&, getInstanceById, (int id), (override)); + MOCK_METHOD(int,getCurrentTimeFormat, (), (const, override)); + MOCK_METHOD(void,setTimeFormat, (const int iTimeFormat), (const, override)); + MOCK_METHOD(int,getTextBrightness, (), (const, override)); + MOCK_METHOD(void,setTextBrightness, (const int brightness), (const, override)); + MOCK_METHOD(void,setText, (const std::string text), (const, override)); + MOCK_METHOD(void,setMode, (const int mode), (const, override)); +}; diff --git a/ci/mocks/devicesettings/HdmiCecMock.h b/ci/mocks/devicesettings/HdmiCecMock.h new file mode 100644 index 00000000..73cd7ed2 --- /dev/null +++ b/ci/mocks/devicesettings/HdmiCecMock.h @@ -0,0 +1,107 @@ +/** +* If not stated otherwise in this file or this component's LICENSE +* file the following copyright and licenses apply: +* +* Copyright 2024 RDK Management +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +**/ + +#pragma once +#include +#include "HdmiCec.h" + +class LibCCECImplMock : public LibCCECImpl { +public: + virtual ~LibCCECImplMock() = default; + + MOCK_METHOD(void, init, (const char *name), (const, override)); + MOCK_METHOD(void, init, (), (const, override)); + MOCK_METHOD(void, term, (), (const, override)); + MOCK_METHOD(void, getPhysicalAddress, (unsigned int *physicalAddress), (const, override)); + MOCK_METHOD(int, addLogicalAddress, (const LogicalAddress &source), (const, override)); + MOCK_METHOD(int, getLogicalAddress, (int devType), (const, override)); +}; + +class SystemAudioStatusImplMock : public SystemAudioStatusImpl { +public: + virtual ~SystemAudioStatusImplMock() = default; + + MOCK_METHOD(int, toInt, (), (const, override)); +}; + +class AudioStatusImplMock : public AudioStatusImpl { +public: + virtual ~AudioStatusImplMock() = default; + + MOCK_METHOD(int, getAudioMuteStatus, (), (const, override)); + MOCK_METHOD(int, getAudioVolume, (), (const, override)); +}; + +class PowerStatusImplMock : public PowerStatusImpl { +public: + virtual ~PowerStatusImplMock() = default; + + MOCK_METHOD(int, toInt, (), (const, override)); +}; + +class AbortReasonImplMock : public AbortReasonImpl { +public: + virtual ~AbortReasonImplMock() = default; + + MOCK_METHOD(int, toInt, (), (const, override)); +}; + +class ShortAudioDescriptorImplMock : public ShortAudioDescriptorImpl { +public: + virtual ~ShortAudioDescriptorImplMock() = default; + + MOCK_METHOD(uint32_t, getAudiodescriptor, (), (const, override)); +}; + +class ConnectionImplMock : public ConnectionImpl { +public: + virtual ~ConnectionImplMock() = default; + + MOCK_METHOD(void, open, (), (const, override)); + MOCK_METHOD(void, close, (), (const, override)); + MOCK_METHOD(void, addFrameListener, (FrameListener *listener), (const, override)); + MOCK_METHOD(void, ping, (const LogicalAddress &from, const LogicalAddress &to, const Throw_e &doThrow), (const, override)); + MOCK_METHOD(void, sendToAsync, (const LogicalAddress &to, const CECFrame &frame), (const, override)); + MOCK_METHOD(void, sendTo, (const LogicalAddress &to, const CECFrame &frame), (const, override)); + MOCK_METHOD(void, sendTo, (const LogicalAddress &to, const CECFrame &frame, int timeout), (const, override)); + MOCK_METHOD(void, poll, (const LogicalAddress &from, const Throw_e &doThrow), (const, override)); + MOCK_METHOD(void, sendAsync, (const CECFrame &frame), (const, override)); +}; + +class LogicalAddressImplMock : public LogicalAddressImpl { +public: + virtual ~LogicalAddressImplMock() = default; + + MOCK_METHOD(int, getType, (), (const, override)); +}; + +class MessageEncoderMock : public MessageEncoderImpl{ +public: + virtual ~MessageEncoderMock() = default; + + MOCK_METHOD(CECFrame&, encode, (const DataBlock &m), (const, override)); + MOCK_METHOD(CECFrame&, encode, (const UserControlPressed &m), (const, override)); +}; + +class MessageDecoderMock : public MessageDecoderImpl{ +public: + virtual ~MessageDecoderMock() = default; + + MOCK_METHOD(void, decode, (const CECFrame& in), (const, override)); +}; diff --git a/ci/mocks/devicesettings/HdmiInputMock.h b/ci/mocks/devicesettings/HdmiInputMock.h new file mode 100644 index 00000000..ae5faf75 --- /dev/null +++ b/ci/mocks/devicesettings/HdmiInputMock.h @@ -0,0 +1,51 @@ +/** +* If not stated otherwise in this file or this component's LICENSE +* file the following copyright and licenses apply: +* +* Copyright 2024 RDK Management +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +**/ + +#pragma once + +#include + +#include "hdmiIn.hpp" + +class HdmiInputImplMock : public device::HdmiInputImpl { +public: + virtual ~HdmiInputImplMock() = default; + + MOCK_METHOD(uint8_t, getNumberOfInputs, (), (const, override)); + MOCK_METHOD(bool, isPortConnected, (int8_t Port), (const, override)); + MOCK_METHOD(std::string, getCurrentVideoMode, (), (const, override)); + MOCK_METHOD(void, selectPort, (int8_t Port,bool audioMix, int videoPlane,bool topMost), (const, override)); + MOCK_METHOD(void, scaleVideo, (int32_t x, int32_t y, int32_t width, int32_t height), (const, override)); + MOCK_METHOD(void, getEDIDBytesInfo, (int iHdmiPort, std::vector &edid), (const, override)); + MOCK_METHOD(void, getHDMISPDInfo, (int iHdmiPort, std::vector &data), (const, override)); + MOCK_METHOD(void, setEdidVersion, (int iHdmiPort, int iEdidVersion), (const, override)); + MOCK_METHOD(void, getEdidVersion, (int iHdmiPort, int *iEdidVersion), (const, override)); + MOCK_METHOD(void, setEdid2AllmSupport, (int iHdmiPort, bool allmSupport), (const, override)); + MOCK_METHOD(void, getEdid2AllmSupport, (int iHdmiPort, bool *allmSupport), (const, override)); + MOCK_METHOD(void, setVRRSupport, (int iHdmiPort, bool vrrsupport), (const, override)); + MOCK_METHOD(void, getVRRSupport, (int iHdmiPort, bool *vrrsupport), (const, override)); + // MOCK_METHOD(void, setAudioMixerLevels, (dsAudioInput_t gain, int volume), (const, override)); + MOCK_METHOD(void, getHdmiALLMStatus, (int iHdmiPort, bool *allmStatus), (const, override)); + MOCK_METHOD(void, getVRRStatus, (int iHdmiPort, dsHdmiInVrrStatus_t *vrrStatus), (const, override)); + MOCK_METHOD(void, getSupportedGameFeatures, (std::vector &featureList), (const, override)); + MOCK_METHOD(void, getAVLatency, (int *audio_output_delay,int *video_latency), (const, override)); + MOCK_METHOD(void, getCurrentVideoModeObj, (dsVideoPortResolution_t& resolution), (const, override)); + MOCK_METHOD(void, getHdmiVersion, (int iHdmiPort, dsHdmiMaxCapabilityVersion_t *capVersion), (const, override)); + MOCK_METHOD(dsError_t, getHDMIARCPortId, (int &portId), (const, override)); +}; diff --git a/ci/mocks/devicesettings/HostMock.h b/ci/mocks/devicesettings/HostMock.h new file mode 100644 index 00000000..c73e6af1 --- /dev/null +++ b/ci/mocks/devicesettings/HostMock.h @@ -0,0 +1,148 @@ +/** +* If not stated otherwise in this file or this component's LICENSE +* file the following copyright and licenses apply: +* +* Copyright 2024 RDK Management +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +**/ + +#pragma once + +#include + +#include "host.hpp" + +class HostImplMock : public device::HostImpl { +public: + virtual ~HostImplMock() = default; + + MOCK_METHOD(device::SleepMode, getPreferredSleepMode, (), (override)); + MOCK_METHOD(int, setPreferredSleepMode, (const device::SleepMode), (override)); + MOCK_METHOD(device::List, getAvailableSleepModes, (), (override)); + MOCK_METHOD(device::List, getVideoOutputPorts, (), (override)); + MOCK_METHOD(device::List, getAudioOutputPorts, (), (override)); + MOCK_METHOD(device::List, getVideoDevices, (), (override)); + MOCK_METHOD(device::VideoOutputPort&, getVideoOutputPort, (const std::string& name), (override)); + MOCK_METHOD(device::AudioOutputPort&, getAudioOutputPort, (const std::string& name), (override)); + MOCK_METHOD(void, getHostEDID, (std::vector & edid), (const, override)); + MOCK_METHOD(std::string, getDefaultVideoPortName, (), (override)); + //MOCK_METHOD(void, setAudioMixerLevels, (dsAudioInput_t aInput, int volume), (override)); + MOCK_METHOD(std::string, getDefaultAudioPortName, (), (override)); + + MOCK_METHOD(void, getMS12ConfigDetails, (std::string type), (override)); + MOCK_METHOD(bool, isHDMIOutPortPresent, (), (override)); + MOCK_METHOD(void, getSinkDeviceAtmosCapability, (dsATMOSCapability_t atmosCapability), (override)); + MOCK_METHOD(void, getSecondaryLanguage, (std::string secondaryLanguage), (override)); + MOCK_METHOD(void,setSecondaryLanguage, (std::string secondaryLanguage), (override)); + MOCK_METHOD(void, getFaderControl, (int *mixerBalance), (override)); + MOCK_METHOD(void, setFaderControl, (int mixerBalance), (override)); + MOCK_METHOD(void, setPrimaryLanguage, (std::string primaryLanguage), (override)); + MOCK_METHOD(void, getPrimaryLanguage, (std::string primaryLanguage), (override)); + MOCK_METHOD(void, setAudioAtmosOutputMode, (int enable), (override)); + MOCK_METHOD(void, setAssociatedAudioMixing, (bool mixing), (override)); + MOCK_METHOD(void, getCurrentAudioFormat, (dsAudioFormat_t audioFormat), (override)); + MOCK_METHOD(void, getAssociatedAudioMixing, (bool *mixing), (override)); + MOCK_METHOD(void, setAudioMixerLevels, (dsAudioInput_t gain, int volume), (override)); + + MOCK_METHOD(dsError_t, Register, (device::Host::IDisplayEvents* listener), (override)); + MOCK_METHOD(dsError_t, UnRegister, (device::Host::IDisplayEvents* listener), (override)); + MOCK_METHOD(dsError_t, Register, (device::Host::IAudioOutputPortEvents* listener), (override)); + MOCK_METHOD(dsError_t, UnRegister, (device::Host::IAudioOutputPortEvents* listener), (override)); + MOCK_METHOD(dsError_t, Register, (device::Host::IDisplayDeviceEvents* listener), (override)); + MOCK_METHOD(dsError_t, UnRegister, (device::Host::IDisplayDeviceEvents* listener), (override)); + MOCK_METHOD(dsError_t, Register, (device::Host::IHdmiInEvents* listener), (override)); + MOCK_METHOD(dsError_t, UnRegister, (device::Host::IHdmiInEvents* listener), (override)); + MOCK_METHOD(dsError_t, Register, (device::Host::IVideoDeviceEvents* listener), (override)); + MOCK_METHOD(dsError_t, UnRegister, (device::Host::IVideoDeviceEvents* listener), (override)); + MOCK_METHOD(dsError_t, Register, (device::Host::IVideoOutputPortEvents* listener), (override)); + MOCK_METHOD(dsError_t, UnRegister, (device::Host::IVideoOutputPortEvents* listener), (override)); + MOCK_METHOD(dsError_t, Register, (device::Host::ICompositeInEvents* listener), (override)); + MOCK_METHOD(dsError_t, UnRegister, (device::Host::ICompositeInEvents* listener), (override)); +}; + +class IDisplayEventsImplMock : public device::IDisplayEventsImpl { +public: + virtual ~IDisplayEventsImplMock() = default; + + MOCK_METHOD(void, OnDisplayRxSense, (dsDisplayEvent_t displayEvent), (override)); +}; + +class IAudioOutputPortEventsImplMock : public device::IAudioOutputPortEventsImpl { +public: + virtual ~IAudioOutputPortEventsImplMock() = default; + + MOCK_METHOD(void, OnAudioOutHotPlug, (dsAudioPortType_t portType, uint32_t uiPortNumber, bool isPortConnected), (override)); + MOCK_METHOD(void, OnAudioFormatUpdate, (dsAudioFormat_t audioFormat), (override)); + MOCK_METHOD(void, OnDolbyAtmosCapabilitiesChanged, (dsATMOSCapability_t atmosCapability, bool status), (override)); + MOCK_METHOD(void, OnAudioPortStateChanged, (dsAudioPortState_t audioPortState), (override)); + MOCK_METHOD(void, OnAssociatedAudioMixingChanged, (bool mixing), (override)); + MOCK_METHOD(void, OnAudioFaderControlChanged, (int mixerBalance), (override)); + MOCK_METHOD(void, OnAudioPrimaryLanguageChanged, (const std::string& primaryLanguage), (override)); + MOCK_METHOD(void, OnAudioSecondaryLanguageChanged, (const std::string& secondaryLanguage), (override)); + MOCK_METHOD(void, OnAudioModeEvent, (dsAudioPortType_t audioPortType, dsAudioStereoMode_t audioStereoMode), (override)); + MOCK_METHOD(void, OnAudioLevelChangedEvent, (int audioLevel), (override)); +}; + +class IDisplayDeviceEventsImplMock : public device::IDisplayDeviceEventsImpl { +public: + virtual ~IDisplayDeviceEventsImplMock() = default; + + MOCK_METHOD(void, OnDisplayHDMIHotPlug, (dsDisplayEvent_t displayEvent), (override)); +}; + +class IHdmiInEventsImplMock : public device::IHdmiInEventsImpl { +public: + virtual ~IHdmiInEventsImplMock() = default; + + MOCK_METHOD(void, OnHdmiInEventHotPlug, (dsHdmiInPort_t port, bool isConnected), (override)); + MOCK_METHOD(void, OnHdmiInEventSignalStatus, (dsHdmiInPort_t port, dsHdmiInSignalStatus_t signalStatus), (override)); + MOCK_METHOD(void, OnHdmiInEventStatus, (dsHdmiInPort_t activePort, bool isPresented), (override)); + MOCK_METHOD(void, OnHdmiInVideoModeUpdate, (dsHdmiInPort_t port, const dsVideoPortResolution_t& videoPortResolution), (override)); + MOCK_METHOD(void, OnHdmiInAllmStatus, (dsHdmiInPort_t port, bool allmStatus), (override)); + MOCK_METHOD(void, OnHdmiInAVIContentType, (dsHdmiInPort_t port, dsAviContentType_t aviContentType), (override)); + MOCK_METHOD(void, OnHdmiInVRRStatus, (dsHdmiInPort_t port, dsVRRType_t vrrType), (override)); + MOCK_METHOD(void, OnHdmiInAVLatency, (int audioDelay, int videoDelay), (override)); + +}; + +class ICompositeInEventsImplMock : public device::ICompositeInEventsImpl { +public: + virtual ~ICompositeInEventsImplMock() = default; + + MOCK_METHOD(void, OnCompositeInHotPlug, (dsCompositeInPort_t port, bool isConnected), (override)); + MOCK_METHOD(void, OnCompositeInSignalStatus, (dsCompositeInPort_t port, dsCompInSignalStatus_t signalStatus), (override)); + MOCK_METHOD(void, OnCompositeInStatus, (dsCompositeInPort_t activePort, bool isPresented), (override)); + MOCK_METHOD(void, OnCompositeInVideoModeUpdate, (dsCompositeInPort_t activePort, dsVideoPortResolution_t videoResolution), (override)); +}; + +class IVideoDeviceEventsImplMock : public device::IVideoDeviceEventsImpl { +public: + virtual ~IVideoDeviceEventsImplMock() = default; + + MOCK_METHOD(void, OnZoomSettingsChanged, (dsVideoZoom_t zoomSetting), (override)); + MOCK_METHOD(void, OnDisplayFrameratePreChange, (const std::string& frameRate), (override)); + MOCK_METHOD(void, OnDisplayFrameratePostChange, (const std::string& frameRate), (override)); + +}; + +class IVideoOutputPortEventsImplMock : public device::IVideoOutputPortEventsImpl { +public: + virtual ~IVideoOutputPortEventsImplMock() = default; + + MOCK_METHOD(void, OnResolutionPreChange, (const int width, const int height), (override)); + MOCK_METHOD(void, OnResolutionPostChange, (const int width, const int height), (override)); + MOCK_METHOD(void, OnVideoFormatUpdate,(dsHDRStandard_t videoFormatHDR),(override)); + MOCK_METHOD(void, OnHDCPStatusChange,(dsHdcpStatus_t hdcpStatus),(override)); + +}; diff --git a/ci/mocks/devicesettings/ManagerMock.h b/ci/mocks/devicesettings/ManagerMock.h new file mode 100644 index 00000000..8cfab31c --- /dev/null +++ b/ci/mocks/devicesettings/ManagerMock.h @@ -0,0 +1,32 @@ +/** +* If not stated otherwise in this file or this component's LICENSE +* file the following copyright and licenses apply: +* +* Copyright 2024 RDK Management +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +**/ + +#pragma once + +#include + +#include "manager.hpp" + +class ManagerImplMock : public ManagerImpl { +public: + virtual ~ManagerImplMock() = default; + + MOCK_METHOD(void, Initialize, (), (override)); + MOCK_METHOD(void, DeInitialize, (), (override)); +}; diff --git a/ci/mocks/devicesettings/MotionDetectionMock.h b/ci/mocks/devicesettings/MotionDetectionMock.h new file mode 100644 index 00000000..70c5012d --- /dev/null +++ b/ci/mocks/devicesettings/MotionDetectionMock.h @@ -0,0 +1,53 @@ +/** +* If not stated otherwise in this file or this component's LICENSE +* file the following copyright and licenses apply: +* +* Copyright 2024 RDK Management +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +**/ + +#pragma once + +#include + + +class MotionDetectionImplMock : public MotionDetectionImpl { +public: + + MotionDetectionImplMock():MotionDetectionImpl() + { + ON_CALL(*this, MOTION_DETECTION_Platform_Init()) + .WillByDefault(::testing::Return(MOTION_DETECTION_RESULT_SUCCESS)); + + ON_CALL(*this, MOTION_DETECTION_Platform_Term()) + .WillByDefault(::testing::Return(MOTION_DETECTION_RESULT_SUCCESS)); + } + + virtual ~MotionDetectionImplMock() = default; + + MOCK_METHOD(MOTION_DETECTION_Result_t, MOTION_DETECTION_Platform_Init, (), (override)); + MOCK_METHOD(MOTION_DETECTION_Result_t, MOTION_DETECTION_Platform_Term, (), (override)); + MOCK_METHOD(MOTION_DETECTION_Result_t, MOTION_DETECTION_RegisterEventCallback, (MOTION_DETECTION_OnMotionEventCallback motionEvent), (override)); + + MOCK_METHOD(MOTION_DETECTION_Result_t, MOTION_DETECTION_GetMotionDetectors, (MOTION_DETECTION_CurrentSensorSettings_t* motionDetectors), (override)); + MOCK_METHOD(MOTION_DETECTION_Result_t, MOTION_DETECTION_ArmMotionDetector, (MOTION_DETECTION_Mode_t mode, std::string index), (override)); + MOCK_METHOD(MOTION_DETECTION_Result_t, MOTION_DETECTION_DisarmMotionDetector, (std::string index), (override)); + MOCK_METHOD(MOTION_DETECTION_Result_t, MOTION_DETECTION_IsMotionDetectorArmed, (std::string index, bool* armState), (override)); + MOCK_METHOD(MOTION_DETECTION_Result_t, MOTION_DETECTION_SetNoMotionPeriod, (std::string index, int period), (override)); + MOCK_METHOD(MOTION_DETECTION_Result_t, MOTION_DETECTION_GetNoMotionPeriod, (std::string index, unsigned int* period), (override)); + MOCK_METHOD(MOTION_DETECTION_Result_t, MOTION_DETECTION_SetSensitivity, (std::string index, std::string sensitivity, int inferredMode), (override)); + MOCK_METHOD(MOTION_DETECTION_Result_t, MOTION_DETECTION_GetSensitivity, (std::string index, char** sensitivity, int* currentMode), (override)); + MOCK_METHOD(MOTION_DETECTION_Result_t, MOTION_DETECTION_SetActivePeriod, (std::string index, MOTION_DETECTION_TimeRange_t timeSet), (override)); + MOCK_METHOD(MOTION_DETECTION_Result_t, MOTION_DETECTION_GetActivePeriod, (MOTION_DETECTION_TimeRange_t* timeSet), (override)); +}; diff --git a/ci/mocks/devicesettings/RtArrayObjectMock.h b/ci/mocks/devicesettings/RtArrayObjectMock.h new file mode 100644 index 00000000..670f03f4 --- /dev/null +++ b/ci/mocks/devicesettings/RtArrayObjectMock.h @@ -0,0 +1,31 @@ +/* + * If not stated otherwise in this file or this component's LICENSE file the + * following copyright and licenses apply: + * + * Copyright 2022 RDK Management + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#pragma once + +#include + +class rtArrayObjectMock : public rtArrayObjectImpl { +public: + virtual ~rtArrayObjectMock() = default; + + MOCK_METHOD(void, pushBack, (const char* v), (const, override)); + MOCK_METHOD(void, pushBack, (rtValue v), (const, override)); + + +}; diff --git a/ci/mocks/devicesettings/RtObjectBaseMock.h b/ci/mocks/devicesettings/RtObjectBaseMock.h new file mode 100644 index 00000000..564f6b10 --- /dev/null +++ b/ci/mocks/devicesettings/RtObjectBaseMock.h @@ -0,0 +1,34 @@ +/* + * If not stated otherwise in this file or this component's LICENSE file the + * following copyright and licenses apply: + * + * Copyright 2022 RDK Management + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#pragma once + +#include + +class rtObjectBaseMock : public rtObjectBaseImpl { +public: + virtual ~rtObjectBaseMock() = default; + + MOCK_METHOD(rtError, set, (const char* name, const char* value), (const, override)); + MOCK_METHOD(rtError, set, (const char* name, const rtValue& value), (const, override)); + MOCK_METHOD(rtError, set, (const char* name, bool value), (const, override)); + MOCK_METHOD(rtString, get, (const char* name), (const, override)); + MOCK_METHOD(rtError, sendReturns, (const char* messageName, rtString& result), (const, override)); + + +}; diff --git a/ci/mocks/devicesettings/RtObjectRefMock.h b/ci/mocks/devicesettings/RtObjectRefMock.h new file mode 100644 index 00000000..634a9e4c --- /dev/null +++ b/ci/mocks/devicesettings/RtObjectRefMock.h @@ -0,0 +1,33 @@ +/* + * If not stated otherwise in this file or this component's LICENSE file the + * following copyright and licenses apply: + * + * Copyright 2022 RDK Management + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#pragma once + +#include + +class rtObjectRefMock : public rtObjectRefImpl { +public: + virtual ~rtObjectRefMock() = default; + + MOCK_METHOD(rtError, send, (const char* messageName), (override)); + MOCK_METHOD(rtError, send, (const char* messageName, const char* method, rtFunctionCallback* callback), (override)); + MOCK_METHOD(rtError, send, (const char* messageName, const rtValue& arg1), (override)); + MOCK_METHOD(rtError, send, (const char* messageName, rtObjectRef& base), (override)); + + +}; diff --git a/ci/mocks/devicesettings/SleepModeMock.h b/ci/mocks/devicesettings/SleepModeMock.h new file mode 100644 index 00000000..dac4b8b8 --- /dev/null +++ b/ci/mocks/devicesettings/SleepModeMock.h @@ -0,0 +1,32 @@ +/** +* If not stated otherwise in this file or this component's LICENSE +* file the following copyright and licenses apply: +* +* Copyright 2024 RDK Management +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +**/ + +#pragma once + +#include + +class SleepModeMock : public device::SleepModeImpl { +public: + virtual ~SleepModeMock() = default; + + MOCK_METHOD(device::SleepMode&, getInstanceById, (int id), (override)); + MOCK_METHOD(device::SleepMode&, getInstanceByName, (const std::string &name), (override)); + MOCK_METHOD(device::List, getSleepModes, (), (override)); + MOCK_METHOD(const std::string&, toString, (), (const, override)); +}; diff --git a/ci/mocks/devicesettings/VideoDFCMock.h b/ci/mocks/devicesettings/VideoDFCMock.h new file mode 100644 index 00000000..57bf7e44 --- /dev/null +++ b/ci/mocks/devicesettings/VideoDFCMock.h @@ -0,0 +1,32 @@ +/* +* If not stated otherwise in this file or this component's LICENSE file the +* following copyright and licenses apply: +* +* Copyright 2025 RDK Management +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#pragma once + +#include + +#include "VideoDFC.hpp" + +class VideoDFCMock : public device::VideoDFCImpl { +public: + virtual ~VideoDFCMock() = default; + + + MOCK_METHOD(const std::string&, getName, (), (const, override)); +}; diff --git a/ci/mocks/devicesettings/VideoDeviceMock.h b/ci/mocks/devicesettings/VideoDeviceMock.h new file mode 100644 index 00000000..09cc3e30 --- /dev/null +++ b/ci/mocks/devicesettings/VideoDeviceMock.h @@ -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. +**/ + +#pragma once + +#include + +#include "host.hpp" + +class VideoDeviceMock : public device::VideoDeviceImpl { +public: + virtual ~VideoDeviceMock() = default; + + MOCK_METHOD(int, getFRFMode, (int* frfmode), (const, override)); + MOCK_METHOD(int, setFRFMode, (int frfmode), (const, override)); + MOCK_METHOD(int, getCurrentDisframerate, (char* framerate), (const, override)); + MOCK_METHOD(int, setDisplayframerate, (const char* framerate), (const, override)); + MOCK_METHOD(void, getHDRCapabilities, (int* capabilities), (override)); + MOCK_METHOD(void, getSettopSupportedResolutions, (std::list& resolutions), (override)); + MOCK_METHOD(void, setDFC, (std::string zoomSetting), (override)); + // MOCK_METHOD(const VideoDFC&, getDFC, (), (const, override)); + MOCK_METHOD(const device::VideoDFC&, getDFC, (), (override)); +}; diff --git a/ci/mocks/devicesettings/VideoOutputPortConfigMock.h b/ci/mocks/devicesettings/VideoOutputPortConfigMock.h new file mode 100644 index 00000000..202d5a92 --- /dev/null +++ b/ci/mocks/devicesettings/VideoOutputPortConfigMock.h @@ -0,0 +1,32 @@ +/** +* If not stated otherwise in this file or this component's LICENSE +* file the following copyright and licenses apply: +* +* Copyright 2024 RDK Management +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +**/ + +#pragma once + +#include + +#include "videoOutputPortConfig.hpp" + +class VideoOutputPortConfigImplMock : public device::VideoOutputPortConfigImpl { +public: + virtual ~VideoOutputPortConfigImplMock() = default; + + MOCK_METHOD(device::VideoOutputPortType&, getPortType, (int id), (override)); + MOCK_METHOD(device::VideoOutputPort&, getPort, (const std::string& name), (override)); +}; diff --git a/ci/mocks/devicesettings/VideoOutputPortMock.h b/ci/mocks/devicesettings/VideoOutputPortMock.h new file mode 100644 index 00000000..5296bd40 --- /dev/null +++ b/ci/mocks/devicesettings/VideoOutputPortMock.h @@ -0,0 +1,61 @@ +/** +* If not stated otherwise in this file or this component's LICENSE +* file the following copyright and licenses apply: +* +* Copyright 2024 RDK Management +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +**/ + +#pragma once + +#include + +#include "videoOutputPort.hpp" + +class VideoOutputPortMock : public device::VideoOutputPortImpl { +public: + virtual ~VideoOutputPortMock() = default; + + MOCK_METHOD(const device::VideoOutputPortType&, getType, (), (const, override)); + MOCK_METHOD(const std::string&, getName, (), (const, override)); + MOCK_METHOD(const device::VideoResolution&, getDefaultResolution, (), (const, override)); + MOCK_METHOD(int, getHDCPProtocol, (), (override)); + MOCK_METHOD(int, getHDCPReceiverProtocol, (), (override)); + MOCK_METHOD(int, getHDCPCurrentProtocol, (), (override)); + MOCK_METHOD(device::AudioOutputPort&, getAudioOutputPort, (), (const, override)); + MOCK_METHOD(bool, isDisplayConnected, (), (override)); + MOCK_METHOD(int, getHDCPStatus, (), (override)); + MOCK_METHOD(bool, isContentProtected, (), (override)); + MOCK_METHOD(device::Display&, getDisplay, (), (override)); + MOCK_METHOD(bool, setScartParameter, (std::string sScartParameter, std::string sScartParameterData), (override)); + MOCK_METHOD(void, getTVHDRCapabilities, (int* capabilities), (override)); + MOCK_METHOD(bool, setForceHDRMode, (dsHDRStandard_t mode), (override)); + MOCK_METHOD(int, getPreferredColorDepth, (bool persist), (override)); + MOCK_METHOD(void, getColorDepthCapabilities, (unsigned int* capabilities), (override)); + MOCK_METHOD(void, setPreferredColorDepth, (dsDisplayColorDepth_t colorDepth, bool persist), (override)); + MOCK_METHOD(bool, getCurrentOutputSettings, (int& videoEOTF, int& matrixCoefficients, int& colorSpace, int& colorDepth, int& quantizationRange), (override)); + MOCK_METHOD(bool, isConnected, (), (const, override)); + MOCK_METHOD(void, setResolution, (std::string resolution, bool persist, bool isIgnoreEdid), (override)); + MOCK_METHOD(const device::VideoResolution&, getResolution, (), (const, override)); + MOCK_METHOD(void, getSupportedTvResolutions, (int* tvResolutions), (override)); + MOCK_METHOD(int, getVideoEOTF, (), (override)); + MOCK_METHOD(bool, isActive, (), (override)); + MOCK_METHOD(void, setAllmEnabled, (bool enable), (override)); + MOCK_METHOD(int, GetHdmiPreference, (), (override)); + MOCK_METHOD(bool, SetHdmiPreference, (dsHdcpProtocolVersion_t hdcpProtocol), (override)); + MOCK_METHOD(int, getColorSpace, (), (const, override)); + MOCK_METHOD(int, getColorDepth, (), (const, override)); + MOCK_METHOD(int, getQuantizationRange, (), (const, override)); + MOCK_METHOD(bool, IsOutputHDR, (), (override)); +}; diff --git a/ci/mocks/devicesettings/VideoOutputPortTypeMock.h b/ci/mocks/devicesettings/VideoOutputPortTypeMock.h new file mode 100644 index 00000000..b65fbb67 --- /dev/null +++ b/ci/mocks/devicesettings/VideoOutputPortTypeMock.h @@ -0,0 +1,32 @@ +/** +* If not stated otherwise in this file or this component's LICENSE +* file the following copyright and licenses apply: +* +* Copyright 2024 RDK Management +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +**/ + +#pragma once + +#include + +#include "videoOutputPortType.hpp" + +class VideoOutputPortTypeMock : public device::VideoOutputPortTypeImpl { +public: + virtual ~VideoOutputPortTypeMock() = default; + + MOCK_METHOD(int, getId, (), (const, override)); + MOCK_METHOD(const device::List, getSupportedResolutions, (), (const, override)); +}; diff --git a/ci/mocks/devicesettings/VideoResolutionMock.h b/ci/mocks/devicesettings/VideoResolutionMock.h new file mode 100644 index 00000000..fe536353 --- /dev/null +++ b/ci/mocks/devicesettings/VideoResolutionMock.h @@ -0,0 +1,34 @@ +/** +* If not stated otherwise in this file or this component's LICENSE +* file the following copyright and licenses apply: +* +* Copyright 2024 RDK Management +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +**/ + +#pragma once + +#include + +#include "videoResolution.hpp" +#include "pixelResolution.hpp" + +class VideoResolutionMock : public device::VideoResolutionImpl { +public: + virtual ~VideoResolutionMock() = default; + + MOCK_METHOD(const std::string&, getName, (), (const, override)); + MOCK_METHOD(const device::PixelResolution&, getPixelResolution, (), (const, override)); + MOCK_METHOD(const device::FrameRate&, getFrameRate, (), (const, override)); +}; diff --git a/ci/mocks/thunder/COMLinkMock.h b/ci/mocks/thunder/COMLinkMock.h new file mode 100644 index 00000000..48930142 --- /dev/null +++ b/ci/mocks/thunder/COMLinkMock.h @@ -0,0 +1,50 @@ +/** +* 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. +**/ + +#ifndef RDKSERVICES_TESTS_MOCKS_COMLINKMOCK_H_ +#define RDKSERVICES_TESTS_MOCKS_COMLINKMOCK_H_ + +#include + +#include "Module.h" + +#ifndef USE_THUNDER_R4 +class COMLinkMock : public WPEFramework::PluginHost::IShell::ICOMLink { +public: + virtual ~COMLinkMock() = default; + + MOCK_METHOD(void, Register, (WPEFramework::RPC::IRemoteConnection::INotification*), (override)); + MOCK_METHOD(void, Unregister, (WPEFramework::RPC::IRemoteConnection::INotification*), (override)); + MOCK_METHOD(WPEFramework::RPC::IRemoteConnection*, RemoteConnection, (const uint32_t), (override)); + MOCK_METHOD(void*, Instantiate, (const WPEFramework::RPC::Object&, const uint32_t, uint32_t&, const string&, const string&), (override)); +}; +#else +class COMLinkMock : public WPEFramework::PluginHost::IShell::ICOMLink { +public: + virtual ~COMLinkMock() = default; + + MOCK_METHOD(void, Register, (WPEFramework::RPC::IRemoteConnection::INotification*), (override)); + MOCK_METHOD(void, Unregister, (const WPEFramework::RPC::IRemoteConnection::INotification*), (override)); + MOCK_METHOD(void, Register, (INotification*), (override)); + MOCK_METHOD(void, Unregister, (INotification*), (override)); + MOCK_METHOD(WPEFramework::RPC::IRemoteConnection*, RemoteConnection, (const uint32_t), (override)); + MOCK_METHOD(void*, Instantiate, (const WPEFramework::RPC::Object&, const uint32_t, uint32_t&), (override)); +}; +#endif /* ! USE_THUNDER_R4 */ +#endif //RDKSERVICES_TESTS_MOCKS_COMLINKMOCK_H_ diff --git a/ci/mocks/thunder/Communicator.cpp b/ci/mocks/thunder/Communicator.cpp new file mode 100755 index 00000000..2bb1bceb --- /dev/null +++ b/ci/mocks/thunder/Communicator.cpp @@ -0,0 +1,30 @@ +/* +* If not stated otherwise in this file or this component's LICENSE file the +* following copyright and licenses apply: +* +* Copyright 2025 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. +*/ + +#include "Communicator.h" +#include + +ICommunicatorClient* WPEFramework::RPC::CommunicatorClient::impl = nullptr; + +void WPEFramework::RPC::CommunicatorClient::setImpl(ICommunicatorClient* newImpl) +{ + // Handles both resetting 'impl' to nullptr and assigning a new value to 'impl' + EXPECT_TRUE ((nullptr == impl) || (nullptr == newImpl)); + impl = newImpl; +} diff --git a/ci/mocks/thunder/Communicator.h b/ci/mocks/thunder/Communicator.h new file mode 100755 index 00000000..5d0524b8 --- /dev/null +++ b/ci/mocks/thunder/Communicator.h @@ -0,0 +1,286 @@ +/* +* If not stated otherwise in this file or this component's LICENSE file the +* following copyright and licenses apply: +* +* Copyright 2025 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 __COM_PROCESSLAUNCH_H +#define __COM_PROCESSLAUNCH_H + +#include +#include "Proxy.h" +#include "NodeId.h" +#include "IPCConnector.h" + +using std::string; +const uint32_t CommunicationTimeOut = 3000; + +class ICommunicatorClient { +public: + virtual ~ICommunicatorClient() = default; + virtual uint32_t Open(const uint32_t waitTime) = 0; + virtual void* Open(const std::string& className, const uint32_t version, const uint32_t waitTime) = 0; + virtual void* Acquire(const uint32_t waitTime, const std::string& className, const uint32_t versionId) = 0; + virtual uint32_t Offer(void* offer, const uint32_t version, const uint32_t waitTime) = 0; + virtual uint32_t Revoke(void* offer, const uint32_t version, const uint32_t waitTime) = 0; + virtual uint32_t Close(const uint32_t waitTime) = 0; + virtual void* Acquire(const std::string& className, const uint32_t interfaceId, const uint32_t versionId) = 0; +}; + +namespace WPEFramework { +namespace RPC { + class Object { + public: + enum class HostType { + LOCAL, + DISTRIBUTED, + CONTAINER + }; + + Object() + : _locator() + , _className() + , _callsign() + , _interface(~0) + , _version(~0) + , _user() + , _group() + , _threads() + , _priority() + , _type(HostType::LOCAL) + , _systemRootPath() + , _remoteAddress() + , _configuration() + { + } + Object(const Object& copy) + : _locator(copy._locator) + , _className(copy._className) + , _callsign(copy._callsign) + , _interface(copy._interface) + , _version(copy._version) + , _user(copy._user) + , _group(copy._group) + , _threads(copy._threads) + , _priority(copy._priority) + , _type(copy._type) + , _systemRootPath(copy._systemRootPath) + , _remoteAddress(copy._remoteAddress) + , _configuration(copy._configuration) + { + } + Object(const string& locator, + const string& className, + const string& callsign, + const uint32_t interface, + const uint32_t version, + const string& user, + const string& group, + const uint8_t threads, + const int8_t priority, + const HostType type, + const string& systemRootPath, + const string& remoteAddress, + const string& configuration) + : _locator(locator) + , _className(className) + , _callsign(callsign) + , _interface(interface) + , _version(version) + , _user(user) + , _group(group) + , _threads(threads) + , _priority(priority) + , _type(type) + , _systemRootPath(systemRootPath) + , _remoteAddress(remoteAddress) + , _configuration(configuration) + { + } + ~Object() + { + } + + Object& operator=(const Object& RHS) + { + _locator = RHS._locator; + _className = RHS._className; + _callsign = RHS._callsign; + _interface = RHS._interface; + _version = RHS._version; + _user = RHS._user; + _group = RHS._group; + _threads = RHS._threads; + _priority = RHS._priority; + _systemRootPath = RHS._systemRootPath; + _type = RHS._type; + _remoteAddress = RHS._remoteAddress; + _configuration = RHS._configuration; + + return (*this); + } + + public: + inline const string& Locator() const + { + return (_locator); + } + inline const string& ClassName() const + { + return (_className); + } + inline const string& Callsign() const + { + return (_callsign); + } + inline uint32_t Interface() const + { + return (_interface); + } + inline uint32_t Version() const + { + return (_version); + } + inline const string& User() const + { + return (_user); + } + inline const string& Group() const + { + return (_group); + } + inline uint8_t Threads() const + { + return (_threads); + } + inline int8_t Priority() const + { + return (_priority); + } + inline HostType Type() const + { + return (_type); + } + inline const string& SystemRootPath() const + { + return (_systemRootPath); + } + inline const Core::NodeId RemoteAddress() const + { + return (Core::NodeId(_remoteAddress.c_str())); + } + inline const string& Configuration() const + { + return (_configuration); + } + + private: + string _locator; + string _className; + string _callsign; + uint32_t _interface; + uint32_t _version; + string _user; + string _group; + uint8_t _threads; + int8_t _priority; + HostType _type; + string _systemRootPath; + string _remoteAddress; + string _configuration; + }; + + class CommunicatorClient{ + protected: + static ICommunicatorClient* impl; + + public: + class Source { + bool IsOpen() const + { + return true; + } + }; + CommunicatorClient() = delete; + CommunicatorClient(CommunicatorClient&&) = delete; + CommunicatorClient(const CommunicatorClient&) = delete; + CommunicatorClient& operator=(CommunicatorClient&&) = delete; + CommunicatorClient& operator=(const CommunicatorClient&) = delete; + + static void setImpl(ICommunicatorClient* newImpl); + + CommunicatorClient(const Core::NodeId& remoteNode) { + //Mock CommunicatorClient constructor. + } + + CommunicatorClient(const Core::NodeId& remoteNode, const Core::ProxyType& handler) { + //Mock CommunicatorClient constructor. + } + + ~CommunicatorClient() { + } + + public: + inline uint32_t ConnectionId() const { + return _connectionId; + } + + // Open a communication channel with this process, no need for an initial exchange + uint32_t Open(const uint32_t waitTime) + { + return impl->Open(waitTime); + } + template + INTERFACE* Open(const std::string& className, const uint32_t version = static_cast(~0), const uint32_t waitTime = CommunicationTimeOut) + { + return static_cast(impl->Open(className, version, waitTime)); + } + template + INTERFACE* Acquire(const uint32_t waitTime, const std::string& className, const uint32_t versionId) + { + return static_cast(impl->Acquire(waitTime, className, versionId)); + } + template + uint32_t Offer(INTERFACE* offer, const uint32_t version = static_cast(~0), const uint32_t waitTime = CommunicationTimeOut) + { + return static_cast(impl->Offer(static_cast(offer), version, CommunicationTimeOut)); + } + template + uint32_t Revoke(INTERFACE* offer, const uint32_t version = static_cast(~0), const uint32_t waitTime = CommunicationTimeOut) + { + return static_cast(impl->Revoke(static_cast(offer), version, CommunicationTimeOut)); + } + uint32_t Close(const uint32_t waitTime) + { + if (impl) + return impl->Close(waitTime); + return Core::ERROR_GENERAL; + } + virtual void* Acquire(const std::string& className, const uint32_t interfaceId, const uint32_t versionId) + { + return impl->Acquire(className, interfaceId, versionId); + } + protected: + void StateChange() { + //Mock CommunicatorClient StateChange is calling. + } + private: + uint32_t _connectionId; + }; +} +} +#endif // __COM_PROCESSLAUNCH_H + diff --git a/ci/mocks/thunder/CommunicatorMock.h b/ci/mocks/thunder/CommunicatorMock.h new file mode 100755 index 00000000..60bfdcef --- /dev/null +++ b/ci/mocks/thunder/CommunicatorMock.h @@ -0,0 +1,53 @@ +/* +* If not stated otherwise in this file or this component's LICENSE file the +* following copyright and licenses apply: +* +* Copyright 2025 RDK Management +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#pragma once + +#include +#include "Communicator.h" + +#if 0 +class CommunicatorClientMock : public ICommunicatorClient +{ +public: + virtual ~CommunicatorClientMock() = default; + + MOCK_METHOD(uint32_t, Open, (const uint32_t waitTime), (override)); + MOCK_METHOD(INTERFACE*, Open, (const std::string& className, const uint32_t version, const uint32_t waitTime), (override)); + MOCK_METHOD(INTERFACE*, Acquire, (const uint32_t waitTime, const std::string& className, const uint32_t versionId), (override)); + MOCK_METHOD(uint32_t, Offer, (INTERFACE* offer, const uint32_t version, const uint32_t waitTime), (override)); + MOCK_METHOD(uint32_t, Revoke, (INTERFACE* offer, const uint32_t version, const uint32_t waitTime), (override)); + MOCK_METHOD(uint32_t, Close, (const uint32_t waitTime), (override)); +}; +#else +class CommunicatorClientMock : public ICommunicatorClient { +public: + virtual ~CommunicatorClientMock() = default; + MOCK_METHOD(void, AddRef, (), (const)); + MOCK_METHOD(uint32_t, Release, (), (const)); + MOCK_METHOD(uint32_t, Open, (const uint32_t waitTime), (override)); + MOCK_METHOD(void*, Open, (const std::string& className, const uint32_t version, const uint32_t waitTime), (override)); + MOCK_METHOD(void*, Acquire, (const uint32_t waitTime, const std::string& className, const uint32_t versionId), (override)); + MOCK_METHOD(uint32_t, Offer, (void* offer, const uint32_t version, const uint32_t waitTime), (override)); + MOCK_METHOD(uint32_t, Revoke, (void* offer, const uint32_t version, const uint32_t waitTime), (override)); + MOCK_METHOD(uint32_t, Close, (const uint32_t waitTime), (override)); + MOCK_METHOD(void*, Acquire, (const std::string& className, const uint32_t interfaceId, const uint32_t versionId), (override)); +}; + +#endif diff --git a/ci/mocks/thunder/DispatcherMock.h b/ci/mocks/thunder/DispatcherMock.h new file mode 100644 index 00000000..fdc40b63 --- /dev/null +++ b/ci/mocks/thunder/DispatcherMock.h @@ -0,0 +1,55 @@ +/* + * 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. + */ + +#ifndef DISPATCHERMOCK_H +#define DISPATCHERMOCK_H + +#include + +#include "Module.h" + +#ifndef USE_THUNDER_R4 + class DispatcherMock: public WPEFramework::PluginHost::IDispatcher{ + public: + virtual ~DispatcherMock() = default; + MOCK_METHOD(void, AddRef, (), (const, override)); + MOCK_METHOD(uint32_t, Release, (), (const, override)); + MOCK_METHOD(void*, QueryInterface, (const uint32_t interfaceNummer), (override)); + MOCK_METHOD(void, Activate, (WPEFramework::PluginHost::IShell* service)); + MOCK_METHOD(void, Deactivate, ()); + MOCK_METHOD(WPEFramework::Core::ProxyType, Invoke, (const string&, uint32_t, const WPEFramework::Core::JSONRPC::Message&), (override)); +}; +#else + class DispatcherMock: public WPEFramework::PluginHost::ILocalDispatcher{ + public: + virtual ~DispatcherMock() = default; + MOCK_METHOD(void, AddRef, (), (const, override)); + MOCK_METHOD(uint32_t, Release, (), (const, override)); + MOCK_METHOD(void*, QueryInterface, (const uint32_t interfaceNummer), (override)); + MOCK_METHOD(void, Activate, (WPEFramework::PluginHost::IShell* service)); + MOCK_METHOD(void, Deactivate, ()); + MOCK_METHOD(void, Dropped, (const uint32_t)); + MOCK_METHOD(uint32_t, Invoke, (const uint32_t channelId, const uint32_t id, const string& token, const string& method, const string& parameters, string& response), (override)); + MOCK_METHOD(WPEFramework::Core::hresult, Invoke, (WPEFramework::PluginHost::IDispatcher::ICallback* callback, const uint32_t channelId, const uint32_t id, const string& token, const string& method, const string& parameters /* @restrict:(4M-1) */, string& response /* @restrict:(4M-1) @out */), (override)); + MOCK_METHOD(WPEFramework::Core::hresult, Revoke, (WPEFramework::PluginHost::IDispatcher::ICallback* callback), (override)); + MOCK_METHOD(WPEFramework::Core::hresult, Validate, (const string& token, const string& method, const string& paramaters /* @restrict:(4M-1) */), (const, override)); + MOCK_METHOD(WPEFramework::PluginHost::ILocalDispatcher*, Local, (), (override)); +}; +#endif /* ! USE_THUNDER_R4 */ +#endif //DISPATCHERMOCK_H diff --git a/ci/mocks/thunder/FactoriesImplementation.h b/ci/mocks/thunder/FactoriesImplementation.h new file mode 100644 index 00000000..2fe178f8 --- /dev/null +++ b/ci/mocks/thunder/FactoriesImplementation.h @@ -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. +**/ + +#pragma once + +#include + +#include "Module.h" + +class FactoriesImplementation : public WPEFramework::PluginHost::IFactories { +public: + FactoriesImplementation(const FactoriesImplementation&) = delete; + FactoriesImplementation& operator=(const FactoriesImplementation&) = delete; + + FactoriesImplementation() + : _requestFactory(5) + , _responseFactory(5) + , _fileBodyFactory(5) + , _jsonRPCFactory(5) + { + // Defaults: + ON_CALL(*this, Request()) + .WillByDefault(::testing::Invoke( + [&]() { return (_requestFactory.Element()); })); + ON_CALL(*this, Response()) + .WillByDefault(::testing::Invoke( + [&]() { return (_responseFactory.Element()); })); + ON_CALL(*this, FileBody()) + .WillByDefault(::testing::Invoke( + [&]() { return (_fileBodyFactory.Element()); })); + ON_CALL(*this, JSONRPC()) + .WillByDefault(::testing::Invoke( + [&]() { + return (WPEFramework::Core::ProxyType>(_jsonRPCFactory.Element())); + })); + } + + virtual ~FactoriesImplementation() = default; + + MOCK_METHOD(WPEFramework::Core::ProxyType, Request, (), (override)); + MOCK_METHOD(WPEFramework::Core::ProxyType, Response, (), (override)); + MOCK_METHOD(WPEFramework::Core::ProxyType, FileBody, (), (override)); + MOCK_METHOD(WPEFramework::Core::ProxyType>, JSONRPC, (), (override)); + +private: + WPEFramework::Core::ProxyPoolType _requestFactory; + WPEFramework::Core::ProxyPoolType _responseFactory; + WPEFramework::Core::ProxyPoolType _fileBodyFactory; + WPEFramework::Core::ProxyPoolType _jsonRPCFactory; +}; diff --git a/ci/mocks/thunder/Module.cpp b/ci/mocks/thunder/Module.cpp new file mode 100644 index 00000000..cd6d4d14 --- /dev/null +++ b/ci/mocks/thunder/Module.cpp @@ -0,0 +1,22 @@ +/** +* 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. +**/ + +#include "Module.h" + +MODULE_NAME_DECLARATION(BUILD_REFERENCE) diff --git a/ci/mocks/thunder/Module.h b/ci/mocks/thunder/Module.h new file mode 100644 index 00000000..c7532ae3 --- /dev/null +++ b/ci/mocks/thunder/Module.h @@ -0,0 +1,27 @@ +/** +* If not stated otherwise in this file or this component's LICENSE +* file the following copyright and licenses apply: +* +* Copyright 2024 RDK Management +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +**/ + +#pragma once + +#ifndef MODULE_NAME +#define MODULE_NAME RdkServicesL1Test +#endif + +#include +#include diff --git a/ci/mocks/thunder/ServiceMock.h b/ci/mocks/thunder/ServiceMock.h new file mode 100644 index 00000000..1652dbdd --- /dev/null +++ b/ci/mocks/thunder/ServiceMock.h @@ -0,0 +1,92 @@ +/* + * If not stated otherwise in this file or this component's LICENSE file the + * following copyright and licenses apply: + * + * Copyright 2022 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 SERVICEMOCK_H +#define SERVICEMOCK_H + +#include + +#include "Module.h" + +class ServiceMock : public WPEFramework::PluginHost::IShell { +public: + virtual ~ServiceMock() = default; + + MOCK_METHOD(void, AddRef, (), (const, override)); + MOCK_METHOD(uint32_t, Release, (), (const, override)); + MOCK_METHOD(string, Versions, (), (const, override)); + MOCK_METHOD(string, Locator, (), (const, override)); + MOCK_METHOD(string, ClassName, (), (const, override)); + MOCK_METHOD(string, Callsign, (), (const, override)); + MOCK_METHOD(string, WebPrefix, (), (const, override)); + MOCK_METHOD(string, ConfigLine, (), (const, override)); + MOCK_METHOD(string, PersistentPath, (), (const, override)); + MOCK_METHOD(string, VolatilePath, (), (const, override)); + MOCK_METHOD(string, DataPath, (), (const, override)); + MOCK_METHOD(state, State, (), (const, override)); +#ifdef USE_THUNDER_R4 + MOCK_METHOD(WPEFramework::Core::hresult, Activate, (const reason), (override)); + MOCK_METHOD(WPEFramework::Core::hresult, Deactivate, (const reason), (override)); + MOCK_METHOD(WPEFramework::Core::hresult, Unavailable, (const reason), (override)); + MOCK_METHOD(WPEFramework::Core::hresult, ConfigLine, (const string& config), (override)); + MOCK_METHOD(WPEFramework::Core::hresult, SystemRootPath, (const string& systemRootPath), (override)); + MOCK_METHOD(WPEFramework::Core::hresult, Hibernate, (const uint32_t timeout), (override)); + MOCK_METHOD(string, SystemPath, (), (const, override)); + MOCK_METHOD(string, PluginPath, (), (const, override)); + MOCK_METHOD(WPEFramework::PluginHost::IShell::startup, Startup, (), (const, override)); + MOCK_METHOD(WPEFramework::Core::hresult, Startup, (const startup value), (override)); + MOCK_METHOD(WPEFramework::Core::hresult, Resumed, (const bool value), (override)); + MOCK_METHOD(WPEFramework::Core::hresult, Metadata, (string& info), (const, override)); +#else + MOCK_METHOD(bool, AutoStart, (), (const, override)); + MOCK_METHOD(string, Version, (), (const, override)); + MOCK_METHOD(uint32_t, Activate, (const reason), (override)); + MOCK_METHOD(uint32_t, Deactivate, (const reason), (override)); + MOCK_METHOD(uint32_t, Unavailable, (const reason), (override)); + MOCK_METHOD(uint8_t, Major, (), (const, override)); + MOCK_METHOD(uint8_t, Minor, (), (const, override)); + MOCK_METHOD(uint8_t, Patch, (), (const, override)); + MOCK_METHOD(uint32_t, ConfigLine, (const string& config), (override)); + MOCK_METHOD(uint32_t, SystemRootPath, (const string& systemRootPath), (override)); + MOCK_METHOD(uint32_t, Hibernate, (const string &processSequence, const uint32_t timeout), (override)); + MOCK_METHOD(uint32_t, Wakeup, (const string &processSequence, const uint32_t timeout), (override)); +#endif + MOCK_METHOD(bool, Resumed, (), (const, override)); + MOCK_METHOD(bool, IsSupported, (const uint8_t), (const, override)); + MOCK_METHOD(void, EnableWebServer, (const string&, const string&), (override)); + MOCK_METHOD(void, DisableWebServer, (), (override)); + MOCK_METHOD(WPEFramework::PluginHost::ISubSystem*, SubSystems, (), (override)); + MOCK_METHOD(uint32_t, Submit, (const uint32_t, const WPEFramework::Core::ProxyType&), (override)); + MOCK_METHOD(void, Notify, (const string&), (override)); + MOCK_METHOD(void*, QueryInterface, (const uint32_t), (override)); + MOCK_METHOD(void*, QueryInterfaceByCallsign, (const uint32_t, const string&), (override)); + MOCK_METHOD(void, Register, (WPEFramework::PluginHost::IPlugin::INotification*), (override)); + MOCK_METHOD(void, Unregister, (WPEFramework::PluginHost::IPlugin::INotification*), (override)); + MOCK_METHOD(string, Model, (), (const, override)); + MOCK_METHOD(bool, Background, (), (const, override)); + MOCK_METHOD(string, Accessor, (), (const, override)); + MOCK_METHOD(string, ProxyStubPath, (), (const, override)); + MOCK_METHOD(string, HashKey, (), (const, override)); + MOCK_METHOD(string, Substitute, (const string&), (const, override)); + MOCK_METHOD(WPEFramework::PluginHost::IShell::ICOMLink*, COMLink, (), (override)); + MOCK_METHOD(reason, Reason, (), (const, override)); + MOCK_METHOD(string, SystemRootPath, (), (const, override)); +}; + +#endif //SERVICEMOCK_H diff --git a/ci/mocks/thunder/SystemInfo.h b/ci/mocks/thunder/SystemInfo.h new file mode 100644 index 00000000..52a8b75d --- /dev/null +++ b/ci/mocks/thunder/SystemInfo.h @@ -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. +**/ + +#pragma once + +#include + +#include "Module.h" + +class SystemInfo : public WPEFramework::PluginHost::ISubSystem { +private: + SystemInfo(const SystemInfo&) = delete; + SystemInfo& operator=(const SystemInfo&) = delete; + +public: + SystemInfo() + : _flags(0) + { + // Defaults: + ON_CALL(*this, Set(::testing::_, ::testing::_)) + .WillByDefault(::testing::Invoke( + [&](const subsystem type, WPEFramework::Core::IUnknown* information) { + _subsystems.emplace(type, information); + + if (type >= NEGATIVE_START) { + _flags &= ~(1 << (type - NEGATIVE_START)); + } else { + _flags |= (1 << type); + } + })); + ON_CALL(*this, Get(::testing::_)) + .WillByDefault(::testing::Invoke( + [&](const subsystem type) -> const WPEFramework::Core::IUnknown* { + const WPEFramework::Core::IUnknown* result(nullptr); + + auto it = _subsystems.find(type); + if (it != _subsystems.end()) { + result = it->second; + } + + return result; + })); + ON_CALL(*this, IsActive(::testing::_)) + .WillByDefault(::testing::Invoke( + [&](const subsystem type) -> bool { + return ((type < END_LIST) && ((_flags & (1 << type)) != 0)); + })); + } + virtual ~SystemInfo() = default; + +public: + MOCK_METHOD(void, Register, (WPEFramework::PluginHost::ISubSystem::INotification * notification), (override)); + MOCK_METHOD(void, Unregister, (WPEFramework::PluginHost::ISubSystem::INotification * notification), (override)); + MOCK_METHOD(string, BuildTreeHash, (), (const, override)); + MOCK_METHOD(void, Set, (const subsystem type, WPEFramework::Core::IUnknown* information), (override)); + MOCK_METHOD(const WPEFramework::Core::IUnknown*, Get, (const subsystem type), (const, override)); + MOCK_METHOD(bool, IsActive, (const subsystem type), (const, override)); +#ifdef USE_THUNDER_R4 + MOCK_METHOD(string, Version, (), (const, override)); +#endif /*USE_THUNDER_R4 */ + + BEGIN_INTERFACE_MAP(SystemInfo) + INTERFACE_ENTRY(WPEFramework::PluginHost::ISubSystem) + END_INTERFACE_MAP + +private: + std::map _subsystems; + uint32_t _flags; +}; diff --git a/ci/mocks/thunder/ThunderPortability.h b/ci/mocks/thunder/ThunderPortability.h new file mode 100755 index 00000000..d0f43f80 --- /dev/null +++ b/ci/mocks/thunder/ThunderPortability.h @@ -0,0 +1,52 @@ +/** +* If not stated otherwise in this file or this component's LICENSE +* file the following copyright and licenses apply: +* +* Copyright 2024 RDK Management +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +**/ + +#pragma once + +#include +#include + +#ifdef USE_THUNDER_R4 +#define EVENT_SUBSCRIBE(__A__, __B__, __C__, __D__) \ + { \ + auto ret = plugin->Subscribe(__A__, __B__, __C__); \ + EXPECT_EQ(Core::ERROR_NONE, ret); \ + (void)__D__; \ + } + +#define EVENT_UNSUBSCRIBE(__A__, __B__, __C__, __D__) \ + { \ + auto ret = plugin->Unsubscribe(__A__, __B__, __C__); \ + EXPECT_EQ(Core::ERROR_NONE, ret); \ + (void)__D__; \ + } + +#define DECL_CORE_JSONRPC_CONX Core::JSONRPC::Context +#define INIT_CONX(__X__, __Y__) connection(__X__, __Y__, "") +#define PLUGINHOST_DISPATCHER PluginHost::ILocalDispatcher +#define PLUGINHOST_DISPATCHER_ID PluginHost::ILocalDispatcher::ID +#else +#define EVENT_SUBSCRIBE(__A__, __B__, __C__, __D__) { handler.Subscribe(__A__, __B__, __C__, __D__); } +#define EVENT_UNSUBSCRIBE(__A__, __B__, __C__, __D__) { handler.Unsubscribe(__A__, __B__, __C__, __D__); } + +#define DECL_CORE_JSONRPC_CONX Core::JSONRPC::Connection +#define INIT_CONX(__X__, __Y__) connection(__X__, __Y__) +#define PLUGINHOST_DISPATCHER PluginHost::IDispatcher +#define PLUGINHOST_DISPATCHER_ID PluginHost::IDispatcher::ID +#endif diff --git a/ci/mocks/thunder/WorkerPoolImplementation.h b/ci/mocks/thunder/WorkerPoolImplementation.h new file mode 100644 index 00000000..bb746615 --- /dev/null +++ b/ci/mocks/thunder/WorkerPoolImplementation.h @@ -0,0 +1,63 @@ +/** +* If not stated otherwise in this file or this component's LICENSE +* file the following copyright and licenses apply: +* +* Copyright 2024 RDK Management +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +**/ + +#pragma once + +#include + +#include "Module.h" + +class WorkerPoolImplementation : public WPEFramework::Core::WorkerPool { +private: + class Dispatcher : public WPEFramework::Core::ThreadPool::IDispatcher { + public: + Dispatcher(const Dispatcher&) = delete; + Dispatcher& operator=(const Dispatcher&) = delete; + + Dispatcher() = default; + ~Dispatcher() override = default; + + private: + void Initialize() override {} + void Deinitialize() override {} + void Dispatch(WPEFramework::Core::IDispatch* job) override + { + job->Dispatch(); + } + }; + +public: + WorkerPoolImplementation() = delete; + WorkerPoolImplementation(const WorkerPoolImplementation&) = delete; + WorkerPoolImplementation& operator=(const WorkerPoolImplementation&) = delete; + + WorkerPoolImplementation(const uint8_t threads, const uint32_t stackSize, const uint32_t queueSize) + : WPEFramework::Core::WorkerPool(threads - 1, stackSize, queueSize, &_dispatcher) + , _dispatcher() + { + } + + virtual ~WorkerPoolImplementation() + { + WPEFramework::Core::WorkerPool::Stop(); + } + +private: + Dispatcher _dispatcher; +}; diff --git a/ci/mocks/thunder/mockauthservices.h b/ci/mocks/thunder/mockauthservices.h new file mode 100644 index 00000000..e3dc7152 --- /dev/null +++ b/ci/mocks/thunder/mockauthservices.h @@ -0,0 +1,89 @@ +/* + * 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. + */ + +#ifndef MOCKAUTHSERVICES_H +#define MOCKAUTHSERVICES_H + +#include + +#include "Module.h" + +class MockAuthService : public WPEFramework::Exchange::IAuthService { +public: + virtual ~MockAuthService() = default; + MOCK_METHOD(uint32_t, GetActivationStatus, (ActivationStatusResult&), (override)); + MOCK_METHOD(uint32_t, SetActivationStatus, (const std::string&, SuccessMsgResult&), (override)); + MOCK_METHOD(uint32_t, ClearAuthToken, (SuccessMsgResult&), (override)); + MOCK_METHOD(uint32_t, ClearSessionToken, (SuccessMsgResult&), (override)); + MOCK_METHOD(uint32_t, ClearServiceAccessToken, (SuccessMsgResult&), (override)); + MOCK_METHOD(uint32_t, ClearLostAndFoundAccessToken, (SuccessMsgResult&), (override)); + MOCK_METHOD(uint32_t, ClearServiceAccountId, (SuccessMsgResult&), (override)); + MOCK_METHOD(uint32_t, ClearCustomProperties, (SuccessMsgResult&), (override)); + MOCK_METHOD(uint32_t, GetCustomProperties, (std::string&, bool&), (override)); + MOCK_METHOD(uint32_t, SetCustomProperties, (const std::string&, bool&), (override)); + MOCK_METHOD(uint32_t, GetAlternateIds, (std::string&, std::string&, bool&), (override)); + MOCK_METHOD(uint32_t, SetAlternateIds, (const std::string&, std::string&, bool&), (override)); + MOCK_METHOD(uint32_t, GetTransitionData, (std::string&, std::string&, bool&), (override)); + MOCK_METHOD(void, AddRef, (), (const, override)); + MOCK_METHOD(uint32_t, Release, (), (const, override)); + MOCK_METHOD(void*, QueryInterface, (uint32_t), (override)); + MOCK_METHOD(uint32_t, Register, (IAuthService::INotification*), (override)); + MOCK_METHOD(uint32_t, Unregister, (IAuthService::INotification*), (override)); + MOCK_METHOD(uint32_t, Configure, (), (override)); + MOCK_METHOD(uint32_t, GetInfo, (GetInfoResult&), (override)); + MOCK_METHOD(uint32_t, GetDeviceInfo, (GetDeviceInfoResult&), (override)); + MOCK_METHOD(uint32_t, GetDeviceId, (GetDeviceIdResult&), (override)); + MOCK_METHOD(uint32_t, SetDeviceId, (const std::string&, SuccessMsgResult&), (override)); + MOCK_METHOD(uint32_t, SetPartnerId, (const std::string&, SetPartnerIdResult&), (override)); + MOCK_METHOD(uint32_t, GetAuthToken, (const bool, const bool, GetAuthTokenResult&), (override)); + MOCK_METHOD(uint32_t, GetSessionToken, (GetSessionTokenResult&), (override)); + MOCK_METHOD(uint32_t, SetSessionToken, (const int32_t&, const std::string&, uint32_t, const std::string&, const std::string&, SuccessMsgResult&), (override)); + MOCK_METHOD(uint32_t, GetServiceAccessToken, (GetServiceAccessTokenResult&), (override)); + MOCK_METHOD(uint32_t, SetServiceAccessToken, (const int32_t&, const std::string&, uint32_t, SuccessMsgResult&), (override)); + MOCK_METHOD(uint32_t, GetServiceAccountId, (GetServiceAccountIdResult&), (override)); + MOCK_METHOD(uint32_t, SetServiceAccountId, (const std::string&, SuccessMsgResult&), (override)); + MOCK_METHOD(uint32_t, SetAuthIdToken, (const std::string&, SuccessMsgResult&), (override)); + MOCK_METHOD(uint32_t, Ready, (const std::string&, SuccessMsgResult&), (override)); + MOCK_METHOD(uint32_t, GetBootstrapProperty, (const std::string&, GetBootstrapPropResult&), (override)); + MOCK_METHOD(uint32_t, ActivationStarted, (SuccessResult&), (override)); + MOCK_METHOD(uint32_t, ActivationComplete, (SuccessResult&), (override)); + MOCK_METHOD(uint32_t, GetLostAndFoundAccessToken, (std::string&, std::string&, bool&), (override)); + MOCK_METHOD(uint32_t, SetLostAndFoundAccessToken, (const std::string&, SuccessMsgResult&), (override)); + MOCK_METHOD(uint32_t, GetXDeviceId, (GetXDeviceIdResult&), (override)); + MOCK_METHOD(uint32_t, SetXDeviceId, (const std::string&, SuccessMsgResult&), (override)); + MOCK_METHOD(uint32_t, GetExperience, (GetExpResult&), (override)); + MOCK_METHOD(uint32_t, SetExperience, (const std::string&, SuccessMsgResult&), (override)); + MOCK_METHOD(uint32_t, GetXifaId, (GetxifaIdResult&), (override)); + MOCK_METHOD(uint32_t, SetXifaId, (const std::string&, SuccessMsgResult&), (override)); + MOCK_METHOD(uint32_t, GetAdvtOptOut, (AdvtOptOutResult&), (override)); + MOCK_METHOD(uint32_t, SetAdvtOptOut, (const bool&, SuccessMsgResult&), (override)); + MOCK_METHOD(WPEFramework::Core::hresult, SetContentAccessToken, (const std::string&, const uint32_t, bool&), (override)); + MOCK_METHOD(WPEFramework::Core::hresult, GetContentAccessToken, (std::string&, uint32_t&), (override)); +}; + +class MockIAuthenticate : public WPEFramework::PluginHost::IAuthenticate { +public: + MOCK_METHOD(void*, QueryInterfaceByCallsign, (const uint32_t, const string&)); + MOCK_METHOD(uint32_t, CreateToken, (uint16_t, const uint8_t*, std::string&)); + MOCK_METHOD(uint32_t, Release, (), (const, override)); + MOCK_METHOD(void*, QueryInterface, (uint32_t), (override)); + MOCK_METHOD(void, AddRef, (), (const, override)); + MOCK_METHOD(WPEFramework::PluginHost::ISecurity*, Officer, (const std::string& token), (override)); +}; +#endif From 906513cf144754c3381a795537617b6800941164 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Tue, 14 Apr 2026 16:15:12 +0000 Subject: [PATCH 10/72] Test --- ci/mocks/control/xrsr.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ci/mocks/control/xrsr.h b/ci/mocks/control/xrsr.h index 373eddcf..5fa7a34a 100644 --- a/ci/mocks/control/xrsr.h +++ b/ci/mocks/control/xrsr.h @@ -26,9 +26,17 @@ #include "xr_timestamp.h" /* Minimal opaque placeholders to avoid requiring OpenSSL dev headers in mocks. */ +#if defined(__has_include) +#if __has_include() +#include +#endif +#endif + +#ifndef OPENSSL_TYPES_H typedef struct xrsr_x509_stub X509; typedef struct xrsr_evp_pkey_stub EVP_PKEY; typedef struct stack_st_X509 X509_STACK; +#endif #ifndef STACK_OF #define STACK_OF(type) struct stack_st_##type #endif From 9d6bdede2f2bb61bad3da945167b0152e27cdb51 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Tue, 14 Apr 2026 16:42:16 +0000 Subject: [PATCH 11/72] Adding missing new lines and updating copyright --- ci/mocks/Iarm.h | 2 +- ci/mocks/Rfc.h | 2 +- ci/mocks/Telemetry.h | 2 +- ci/mocks/control/comcastIrKeyCodes.h | 2 +- ci/mocks/control/irMgr.h | 2 +- ci/mocks/control/rdkversion.h | 2 +- ci/mocks/control/rdkx_logger.h | 2 +- ci/mocks/control/xr_fdc.h | 2 +- ci/mocks/control/xr_mq.h | 2 +- ci/mocks/control/xr_timestamp.h | 2 +- ci/mocks/control/xr_voice_sdk.h | 2 +- ci/mocks/control/xraudio.h | 2 +- ci/mocks/control/xrsr.h | 2 +- ci/mocks/control/xrsv_http.h | 2 +- ci/mocks/control/xrsv_ws_nextgen.h | 2 +- ci/mocks/devicesettings.h | 2 +- ci/mocks/devicesettings/AudioOutputPortMock.h | 2 +- ci/mocks/devicesettings/AudioOutputPortTypeMock.h | 4 ++-- ci/mocks/devicesettings/AudioStereoModeMock.h | 2 +- ci/mocks/devicesettings/ColorMock.h | 2 +- ci/mocks/devicesettings/CompositeInputMock.h | 2 +- ci/mocks/devicesettings/DisplayMock.h | 2 +- ci/mocks/devicesettings/DrmMock.h | 4 ++-- ci/mocks/devicesettings/EdidParserMock.h | 2 +- ci/mocks/devicesettings/FloatingRtFunctionsMock.h | 2 +- ci/mocks/devicesettings/FrontPanelConfigMock.h | 2 +- ci/mocks/devicesettings/FrontPanelIndicatorMock.h | 2 +- ci/mocks/devicesettings/FrontPanelTextDisplayMock.h | 2 +- ci/mocks/devicesettings/HdmiCecMock.h | 2 +- ci/mocks/devicesettings/HdmiInputMock.h | 2 +- ci/mocks/devicesettings/HostMock.h | 2 +- ci/mocks/devicesettings/ManagerMock.h | 2 +- ci/mocks/devicesettings/MotionDetectionMock.h | 2 +- ci/mocks/devicesettings/RtArrayObjectMock.h | 2 +- ci/mocks/devicesettings/RtObjectBaseMock.h | 2 +- ci/mocks/devicesettings/RtObjectRefMock.h | 2 +- ci/mocks/devicesettings/SleepModeMock.h | 2 +- ci/mocks/devicesettings/VideoDFCMock.h | 2 +- ci/mocks/devicesettings/VideoDeviceMock.h | 2 +- ci/mocks/devicesettings/VideoOutputPortConfigMock.h | 2 +- ci/mocks/devicesettings/VideoOutputPortMock.h | 2 +- ci/mocks/devicesettings/VideoOutputPortTypeMock.h | 2 +- ci/mocks/devicesettings/VideoResolutionMock.h | 2 +- ci/mocks/mfrTypes.h | 2 +- ci/mocks/secure_wrappermock.h | 2 +- ci/mocks/thunder/COMLinkMock.h | 2 +- ci/mocks/thunder/Communicator.cpp | 2 +- ci/mocks/thunder/Communicator.h | 2 +- ci/mocks/thunder/CommunicatorMock.h | 2 +- ci/mocks/thunder/DispatcherMock.h | 2 +- ci/mocks/thunder/FactoriesImplementation.h | 2 +- ci/mocks/thunder/Module.cpp | 2 +- ci/mocks/thunder/Module.h | 2 +- ci/mocks/thunder/ServiceMock.h | 2 +- ci/mocks/thunder/SystemInfo.h | 2 +- ci/mocks/thunder/ThunderPortability.h | 2 +- ci/mocks/thunder/WorkerPoolImplementation.h | 2 +- ci/mocks/thunder/mockauthservices.h | 2 +- 58 files changed, 60 insertions(+), 60 deletions(-) diff --git a/ci/mocks/Iarm.h b/ci/mocks/Iarm.h index 03cd08d4..ad4a5480 100644 --- a/ci/mocks/Iarm.h +++ b/ci/mocks/Iarm.h @@ -2,7 +2,7 @@ * If not stated otherwise in this file or this component's LICENSE * file the following copyright and licenses apply: * -* Copyright 2024 RDK Management +* Copyright 2026 RDK Management * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/ci/mocks/Rfc.h b/ci/mocks/Rfc.h index e7f001df..2354f194 100644 --- a/ci/mocks/Rfc.h +++ b/ci/mocks/Rfc.h @@ -2,7 +2,7 @@ * If not stated otherwise in this file or this component's LICENSE * file the following copyright and licenses apply: * -* Copyright 2024 RDK Management +* Copyright 2026 RDK Management * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/ci/mocks/Telemetry.h b/ci/mocks/Telemetry.h index 4ae4133c..f5c26c71 100644 --- a/ci/mocks/Telemetry.h +++ b/ci/mocks/Telemetry.h @@ -2,7 +2,7 @@ * If not stated otherwise in this file or this component's LICENSE * file the following copyright and licenses apply: * -* Copyright 2024 RDK Management +* Copyright 2026 RDK Management * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/ci/mocks/control/comcastIrKeyCodes.h b/ci/mocks/control/comcastIrKeyCodes.h index 123661fa..d0028cee 100644 --- a/ci/mocks/control/comcastIrKeyCodes.h +++ b/ci/mocks/control/comcastIrKeyCodes.h @@ -1,7 +1,7 @@ /* * Stub for comcastIrKeyCodes.h * - * Copyright 2024 RDK Management + * Copyright 2026 RDK Management * Licensed under the Apache License, Version 2.0 */ #ifndef _COMCAST_IR_KEY_CODES_H_ diff --git a/ci/mocks/control/irMgr.h b/ci/mocks/control/irMgr.h index f1fe0313..1d3cebb9 100644 --- a/ci/mocks/control/irMgr.h +++ b/ci/mocks/control/irMgr.h @@ -1,7 +1,7 @@ /* * Stub for irMgr.h - IR Manager types * - * Copyright 2024 RDK Management + * Copyright 2026 RDK Management * Licensed under the Apache License, Version 2.0 */ #ifndef _IR_MGR_H_ diff --git a/ci/mocks/control/rdkversion.h b/ci/mocks/control/rdkversion.h index 3527916c..fd27f7e3 100644 --- a/ci/mocks/control/rdkversion.h +++ b/ci/mocks/control/rdkversion.h @@ -1,7 +1,7 @@ /* * Stub for rdkversion.h * - * Copyright 2024 RDK Management + * Copyright 2026 RDK Management * Licensed under the Apache License, Version 2.0 */ #ifndef _RDKVERSION_H_ diff --git a/ci/mocks/control/rdkx_logger.h b/ci/mocks/control/rdkx_logger.h index 984f663b..4ea58c39 100644 --- a/ci/mocks/control/rdkx_logger.h +++ b/ci/mocks/control/rdkx_logger.h @@ -2,7 +2,7 @@ * If not stated otherwise in this file or this component's license file the * following copyright and licenses apply: * - * Copyright 2024 RDK Management + * Copyright 2026 RDK Management * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/ci/mocks/control/xr_fdc.h b/ci/mocks/control/xr_fdc.h index 7af85a31..fd952a2c 100644 --- a/ci/mocks/control/xr_fdc.h +++ b/ci/mocks/control/xr_fdc.h @@ -1,7 +1,7 @@ /* * Stub for xr_fdc.h - File Descriptor Check * - * Copyright 2024 RDK Management + * Copyright 2026 RDK Management * Licensed under the Apache License, Version 2.0 */ #ifndef _XR_FDC_H_ diff --git a/ci/mocks/control/xr_mq.h b/ci/mocks/control/xr_mq.h index ece5597c..fa238de7 100644 --- a/ci/mocks/control/xr_mq.h +++ b/ci/mocks/control/xr_mq.h @@ -2,7 +2,7 @@ * If not stated otherwise in this file or this component's license file the * following copyright and licenses apply: * - * Copyright 2024 RDK Management + * Copyright 2026 RDK Management * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/ci/mocks/control/xr_timestamp.h b/ci/mocks/control/xr_timestamp.h index 0a185e47..efa2d9f6 100644 --- a/ci/mocks/control/xr_timestamp.h +++ b/ci/mocks/control/xr_timestamp.h @@ -2,7 +2,7 @@ * If not stated otherwise in this file or this component's license file the * following copyright and licenses apply: * - * Copyright 2024 RDK Management + * Copyright 2026 RDK Management * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/ci/mocks/control/xr_voice_sdk.h b/ci/mocks/control/xr_voice_sdk.h index f4a385e5..d150e4f5 100644 --- a/ci/mocks/control/xr_voice_sdk.h +++ b/ci/mocks/control/xr_voice_sdk.h @@ -1,7 +1,7 @@ /* * Stub for xr_voice_sdk.h * - * Copyright 2024 RDK Management + * Copyright 2026 RDK Management * Licensed under the Apache License, Version 2.0 */ #ifndef _XR_VOICE_SDK_H_ diff --git a/ci/mocks/control/xraudio.h b/ci/mocks/control/xraudio.h index f28f5c25..0738c738 100644 --- a/ci/mocks/control/xraudio.h +++ b/ci/mocks/control/xraudio.h @@ -1,7 +1,7 @@ /* * Stub for xraudio.h - Audio types * - * Copyright 2024 RDK Management + * Copyright 2026 RDK Management * Licensed under the Apache License, Version 2.0 */ #ifndef _XRAUDIO_H_ diff --git a/ci/mocks/control/xrsr.h b/ci/mocks/control/xrsr.h index 5fa7a34a..e166c8c5 100644 --- a/ci/mocks/control/xrsr.h +++ b/ci/mocks/control/xrsr.h @@ -2,7 +2,7 @@ * If not stated otherwise in this file or this component's license file the * following copyright and licenses apply: * - * Copyright 2024 RDK Management + * Copyright 2026 RDK Management * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/ci/mocks/control/xrsv_http.h b/ci/mocks/control/xrsv_http.h index 3a4fbee8..4104f14c 100644 --- a/ci/mocks/control/xrsv_http.h +++ b/ci/mocks/control/xrsv_http.h @@ -1,7 +1,7 @@ /* * Stub for xrsv_http.h - Voice HTTP endpoint types * - * Copyright 2024 RDK Management + * Copyright 2026 RDK Management * Licensed under the Apache License, Version 2.0 */ #ifndef _XRSV_HTTP_H_ diff --git a/ci/mocks/control/xrsv_ws_nextgen.h b/ci/mocks/control/xrsv_ws_nextgen.h index 9861e9cd..f4cfe207 100644 --- a/ci/mocks/control/xrsv_ws_nextgen.h +++ b/ci/mocks/control/xrsv_ws_nextgen.h @@ -1,7 +1,7 @@ /* * Stub for xrsv_ws_nextgen.h - Voice WebSocket NextGen endpoint types * - * Copyright 2024 RDK Management + * Copyright 2026 RDK Management * Licensed under the Apache License, Version 2.0 */ #ifndef _XRSV_WS_NEXTGEN_H_ diff --git a/ci/mocks/devicesettings.h b/ci/mocks/devicesettings.h index 28927b64..3a13f946 100644 --- a/ci/mocks/devicesettings.h +++ b/ci/mocks/devicesettings.h @@ -2,7 +2,7 @@ * If not stated otherwise in this file or this component's LICENSE * file the following copyright and licenses apply: * -* Copyright 2024 RDK Management +* Copyright 2026 RDK Management * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/ci/mocks/devicesettings/AudioOutputPortMock.h b/ci/mocks/devicesettings/AudioOutputPortMock.h index 148ac73f..2ce1d9f7 100644 --- a/ci/mocks/devicesettings/AudioOutputPortMock.h +++ b/ci/mocks/devicesettings/AudioOutputPortMock.h @@ -2,7 +2,7 @@ * If not stated otherwise in this file or this component's LICENSE * file the following copyright and licenses apply: * -* Copyright 2024 RDK Management +* Copyright 2026 RDK Management * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/ci/mocks/devicesettings/AudioOutputPortTypeMock.h b/ci/mocks/devicesettings/AudioOutputPortTypeMock.h index 1e941840..7a35182b 100644 --- a/ci/mocks/devicesettings/AudioOutputPortTypeMock.h +++ b/ci/mocks/devicesettings/AudioOutputPortTypeMock.h @@ -2,7 +2,7 @@ * If not stated otherwise in this file or this component's LICENSE file the * following copyright and licenses apply: * -* Copyright 2025 RDK Management +* Copyright 2026 RDK Management * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,4 +29,4 @@ class AudioOutputPortTypeMock : public device::AudioOutputPortTypeImpl { MOCK_METHOD(int, getId, (), (const, override)); // MOCK_METHOD(const device::List, getSupportedResolutions, (), (const, override)); -}; \ No newline at end of file +}; diff --git a/ci/mocks/devicesettings/AudioStereoModeMock.h b/ci/mocks/devicesettings/AudioStereoModeMock.h index 292ebd5b..34161c15 100644 --- a/ci/mocks/devicesettings/AudioStereoModeMock.h +++ b/ci/mocks/devicesettings/AudioStereoModeMock.h @@ -2,7 +2,7 @@ * If not stated otherwise in this file or this component's LICENSE file the * following copyright and licenses apply: * -* Copyright 2025 RDK Management +* Copyright 2026 RDK Management * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/ci/mocks/devicesettings/ColorMock.h b/ci/mocks/devicesettings/ColorMock.h index 17529786..f51f8aab 100644 --- a/ci/mocks/devicesettings/ColorMock.h +++ b/ci/mocks/devicesettings/ColorMock.h @@ -2,7 +2,7 @@ * If not stated otherwise in this file or this component's LICENSE * file the following copyright and licenses apply: * -* Copyright 2024 RDK Management +* Copyright 2026 RDK Management * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/ci/mocks/devicesettings/CompositeInputMock.h b/ci/mocks/devicesettings/CompositeInputMock.h index ce638fdd..d105e238 100644 --- a/ci/mocks/devicesettings/CompositeInputMock.h +++ b/ci/mocks/devicesettings/CompositeInputMock.h @@ -2,7 +2,7 @@ * If not stated otherwise in this file or this component's LICENSE * file the following copyright and licenses apply: * -* Copyright 2024 RDK Management +* Copyright 2026 RDK Management * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/ci/mocks/devicesettings/DisplayMock.h b/ci/mocks/devicesettings/DisplayMock.h index af818a18..34aeaa82 100644 --- a/ci/mocks/devicesettings/DisplayMock.h +++ b/ci/mocks/devicesettings/DisplayMock.h @@ -2,7 +2,7 @@ * If not stated otherwise in this file or this component's LICENSE * file the following copyright and licenses apply: * -* Copyright 2024 RDK Management +* Copyright 2026 RDK Management * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/ci/mocks/devicesettings/DrmMock.h b/ci/mocks/devicesettings/DrmMock.h index 64821642..51b13432 100644 --- a/ci/mocks/devicesettings/DrmMock.h +++ b/ci/mocks/devicesettings/DrmMock.h @@ -2,7 +2,7 @@ * If not stated otherwise in this file or this component's LICENSE * file the following copyright and licenses apply: * -* Copyright 2024 RDK Management +* Copyright 2026 RDK Management * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,4 +47,4 @@ class DRMMock : public drmImpl { MOCK_METHOD(drmModeFBPtr, drmModeGetFB, (int fd, uint32_t bufferId), (override)); MOCK_METHOD(void, drmModeFreeEncoder, (drmModeEncoderPtr ptr), (override)); -}; \ No newline at end of file +}; diff --git a/ci/mocks/devicesettings/EdidParserMock.h b/ci/mocks/devicesettings/EdidParserMock.h index e8313a9c..d1643328 100644 --- a/ci/mocks/devicesettings/EdidParserMock.h +++ b/ci/mocks/devicesettings/EdidParserMock.h @@ -2,7 +2,7 @@ * If not stated otherwise in this file or this component's LICENSE * file the following copyright and licenses apply: * -* Copyright 2024 RDK Management +* Copyright 2026 RDK Management * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/ci/mocks/devicesettings/FloatingRtFunctionsMock.h b/ci/mocks/devicesettings/FloatingRtFunctionsMock.h index 599ee049..04c82e1f 100644 --- a/ci/mocks/devicesettings/FloatingRtFunctionsMock.h +++ b/ci/mocks/devicesettings/FloatingRtFunctionsMock.h @@ -2,7 +2,7 @@ * If not stated otherwise in this file or this component's LICENSE file the * following copyright and licenses apply: * - * Copyright 2022 RDK Management + * Copyright 2026 RDK Management * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/ci/mocks/devicesettings/FrontPanelConfigMock.h b/ci/mocks/devicesettings/FrontPanelConfigMock.h index 8acbbd45..dd511667 100644 --- a/ci/mocks/devicesettings/FrontPanelConfigMock.h +++ b/ci/mocks/devicesettings/FrontPanelConfigMock.h @@ -2,7 +2,7 @@ * If not stated otherwise in this file or this component's LICENSE * file the following copyright and licenses apply: * -* Copyright 2024 RDK Management +* Copyright 2026 RDK Management * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/ci/mocks/devicesettings/FrontPanelIndicatorMock.h b/ci/mocks/devicesettings/FrontPanelIndicatorMock.h index 8618b619..daa5ad29 100644 --- a/ci/mocks/devicesettings/FrontPanelIndicatorMock.h +++ b/ci/mocks/devicesettings/FrontPanelIndicatorMock.h @@ -2,7 +2,7 @@ * If not stated otherwise in this file or this component's LICENSE * file the following copyright and licenses apply: * -* Copyright 2024 RDK Management +* Copyright 2026 RDK Management * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/ci/mocks/devicesettings/FrontPanelTextDisplayMock.h b/ci/mocks/devicesettings/FrontPanelTextDisplayMock.h index 1923b4ab..2f07c3f3 100644 --- a/ci/mocks/devicesettings/FrontPanelTextDisplayMock.h +++ b/ci/mocks/devicesettings/FrontPanelTextDisplayMock.h @@ -2,7 +2,7 @@ * If not stated otherwise in this file or this component's LICENSE * file the following copyright and licenses apply: * -* Copyright 2024 RDK Management +* Copyright 2026 RDK Management * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/ci/mocks/devicesettings/HdmiCecMock.h b/ci/mocks/devicesettings/HdmiCecMock.h index 73cd7ed2..95840cbb 100644 --- a/ci/mocks/devicesettings/HdmiCecMock.h +++ b/ci/mocks/devicesettings/HdmiCecMock.h @@ -2,7 +2,7 @@ * If not stated otherwise in this file or this component's LICENSE * file the following copyright and licenses apply: * -* Copyright 2024 RDK Management +* Copyright 2026 RDK Management * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/ci/mocks/devicesettings/HdmiInputMock.h b/ci/mocks/devicesettings/HdmiInputMock.h index ae5faf75..2849703a 100644 --- a/ci/mocks/devicesettings/HdmiInputMock.h +++ b/ci/mocks/devicesettings/HdmiInputMock.h @@ -2,7 +2,7 @@ * If not stated otherwise in this file or this component's LICENSE * file the following copyright and licenses apply: * -* Copyright 2024 RDK Management +* Copyright 2026 RDK Management * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/ci/mocks/devicesettings/HostMock.h b/ci/mocks/devicesettings/HostMock.h index c73e6af1..0a28c127 100644 --- a/ci/mocks/devicesettings/HostMock.h +++ b/ci/mocks/devicesettings/HostMock.h @@ -2,7 +2,7 @@ * If not stated otherwise in this file or this component's LICENSE * file the following copyright and licenses apply: * -* Copyright 2024 RDK Management +* Copyright 2026 RDK Management * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/ci/mocks/devicesettings/ManagerMock.h b/ci/mocks/devicesettings/ManagerMock.h index 8cfab31c..cb2a0049 100644 --- a/ci/mocks/devicesettings/ManagerMock.h +++ b/ci/mocks/devicesettings/ManagerMock.h @@ -2,7 +2,7 @@ * If not stated otherwise in this file or this component's LICENSE * file the following copyright and licenses apply: * -* Copyright 2024 RDK Management +* Copyright 2026 RDK Management * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/ci/mocks/devicesettings/MotionDetectionMock.h b/ci/mocks/devicesettings/MotionDetectionMock.h index 70c5012d..52633841 100644 --- a/ci/mocks/devicesettings/MotionDetectionMock.h +++ b/ci/mocks/devicesettings/MotionDetectionMock.h @@ -2,7 +2,7 @@ * If not stated otherwise in this file or this component's LICENSE * file the following copyright and licenses apply: * -* Copyright 2024 RDK Management +* Copyright 2026 RDK Management * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/ci/mocks/devicesettings/RtArrayObjectMock.h b/ci/mocks/devicesettings/RtArrayObjectMock.h index 670f03f4..e3f14e30 100644 --- a/ci/mocks/devicesettings/RtArrayObjectMock.h +++ b/ci/mocks/devicesettings/RtArrayObjectMock.h @@ -2,7 +2,7 @@ * If not stated otherwise in this file or this component's LICENSE file the * following copyright and licenses apply: * - * Copyright 2022 RDK Management + * Copyright 2026 RDK Management * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/ci/mocks/devicesettings/RtObjectBaseMock.h b/ci/mocks/devicesettings/RtObjectBaseMock.h index 564f6b10..f1ae10d7 100644 --- a/ci/mocks/devicesettings/RtObjectBaseMock.h +++ b/ci/mocks/devicesettings/RtObjectBaseMock.h @@ -2,7 +2,7 @@ * If not stated otherwise in this file or this component's LICENSE file the * following copyright and licenses apply: * - * Copyright 2022 RDK Management + * Copyright 2026 RDK Management * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/ci/mocks/devicesettings/RtObjectRefMock.h b/ci/mocks/devicesettings/RtObjectRefMock.h index 634a9e4c..ab03d45c 100644 --- a/ci/mocks/devicesettings/RtObjectRefMock.h +++ b/ci/mocks/devicesettings/RtObjectRefMock.h @@ -2,7 +2,7 @@ * If not stated otherwise in this file or this component's LICENSE file the * following copyright and licenses apply: * - * Copyright 2022 RDK Management + * Copyright 2026 RDK Management * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/ci/mocks/devicesettings/SleepModeMock.h b/ci/mocks/devicesettings/SleepModeMock.h index dac4b8b8..56f99475 100644 --- a/ci/mocks/devicesettings/SleepModeMock.h +++ b/ci/mocks/devicesettings/SleepModeMock.h @@ -2,7 +2,7 @@ * If not stated otherwise in this file or this component's LICENSE * file the following copyright and licenses apply: * -* Copyright 2024 RDK Management +* Copyright 2026 RDK Management * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/ci/mocks/devicesettings/VideoDFCMock.h b/ci/mocks/devicesettings/VideoDFCMock.h index 57bf7e44..736d0a1f 100644 --- a/ci/mocks/devicesettings/VideoDFCMock.h +++ b/ci/mocks/devicesettings/VideoDFCMock.h @@ -2,7 +2,7 @@ * If not stated otherwise in this file or this component's LICENSE file the * following copyright and licenses apply: * -* Copyright 2025 RDK Management +* Copyright 2026 RDK Management * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/ci/mocks/devicesettings/VideoDeviceMock.h b/ci/mocks/devicesettings/VideoDeviceMock.h index 09cc3e30..05ddd966 100644 --- a/ci/mocks/devicesettings/VideoDeviceMock.h +++ b/ci/mocks/devicesettings/VideoDeviceMock.h @@ -2,7 +2,7 @@ * If not stated otherwise in this file or this component's LICENSE * file the following copyright and licenses apply: * -* Copyright 2024 RDK Management +* Copyright 2026 RDK Management * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/ci/mocks/devicesettings/VideoOutputPortConfigMock.h b/ci/mocks/devicesettings/VideoOutputPortConfigMock.h index 202d5a92..3f3fb095 100644 --- a/ci/mocks/devicesettings/VideoOutputPortConfigMock.h +++ b/ci/mocks/devicesettings/VideoOutputPortConfigMock.h @@ -2,7 +2,7 @@ * If not stated otherwise in this file or this component's LICENSE * file the following copyright and licenses apply: * -* Copyright 2024 RDK Management +* Copyright 2026 RDK Management * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/ci/mocks/devicesettings/VideoOutputPortMock.h b/ci/mocks/devicesettings/VideoOutputPortMock.h index 5296bd40..3ea471d1 100644 --- a/ci/mocks/devicesettings/VideoOutputPortMock.h +++ b/ci/mocks/devicesettings/VideoOutputPortMock.h @@ -2,7 +2,7 @@ * If not stated otherwise in this file or this component's LICENSE * file the following copyright and licenses apply: * -* Copyright 2024 RDK Management +* Copyright 2026 RDK Management * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/ci/mocks/devicesettings/VideoOutputPortTypeMock.h b/ci/mocks/devicesettings/VideoOutputPortTypeMock.h index b65fbb67..8975bd56 100644 --- a/ci/mocks/devicesettings/VideoOutputPortTypeMock.h +++ b/ci/mocks/devicesettings/VideoOutputPortTypeMock.h @@ -2,7 +2,7 @@ * If not stated otherwise in this file or this component's LICENSE * file the following copyright and licenses apply: * -* Copyright 2024 RDK Management +* Copyright 2026 RDK Management * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/ci/mocks/devicesettings/VideoResolutionMock.h b/ci/mocks/devicesettings/VideoResolutionMock.h index fe536353..a5c0aeb1 100644 --- a/ci/mocks/devicesettings/VideoResolutionMock.h +++ b/ci/mocks/devicesettings/VideoResolutionMock.h @@ -2,7 +2,7 @@ * If not stated otherwise in this file or this component's LICENSE * file the following copyright and licenses apply: * -* Copyright 2024 RDK Management +* Copyright 2026 RDK Management * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/ci/mocks/mfrTypes.h b/ci/mocks/mfrTypes.h index 55ef63e5..8fba1467 100644 --- a/ci/mocks/mfrTypes.h +++ b/ci/mocks/mfrTypes.h @@ -2,7 +2,7 @@ * If not stated otherwise in this file or this component's LICENSE file the * following copyright and licenses apply: * - * Copyright 2016 RDK Management + * Copyright 2026 RDK Management * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/ci/mocks/secure_wrappermock.h b/ci/mocks/secure_wrappermock.h index 37dd7a2e..04122b99 100755 --- a/ci/mocks/secure_wrappermock.h +++ b/ci/mocks/secure_wrappermock.h @@ -2,7 +2,7 @@ * If not stated otherwise in this file or this component's LICENSE * file the following copyright and licenses apply: * -* Copyright 2024 RDK Management +* Copyright 2026 RDK Management * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/ci/mocks/thunder/COMLinkMock.h b/ci/mocks/thunder/COMLinkMock.h index 48930142..8907e70a 100644 --- a/ci/mocks/thunder/COMLinkMock.h +++ b/ci/mocks/thunder/COMLinkMock.h @@ -2,7 +2,7 @@ * If not stated otherwise in this file or this component's LICENSE * file the following copyright and licenses apply: * -* Copyright 2024 RDK Management +* Copyright 2026 RDK Management * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/ci/mocks/thunder/Communicator.cpp b/ci/mocks/thunder/Communicator.cpp index 2bb1bceb..5de37d50 100755 --- a/ci/mocks/thunder/Communicator.cpp +++ b/ci/mocks/thunder/Communicator.cpp @@ -2,7 +2,7 @@ * If not stated otherwise in this file or this component's LICENSE file the * following copyright and licenses apply: * -* Copyright 2025 RDK Management +* Copyright 2026 RDK Management * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/ci/mocks/thunder/Communicator.h b/ci/mocks/thunder/Communicator.h index 5d0524b8..4af3a850 100755 --- a/ci/mocks/thunder/Communicator.h +++ b/ci/mocks/thunder/Communicator.h @@ -2,7 +2,7 @@ * If not stated otherwise in this file or this component's LICENSE file the * following copyright and licenses apply: * -* Copyright 2025 RDK Management +* Copyright 2026 RDK Management * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/ci/mocks/thunder/CommunicatorMock.h b/ci/mocks/thunder/CommunicatorMock.h index 60bfdcef..522d5cf0 100755 --- a/ci/mocks/thunder/CommunicatorMock.h +++ b/ci/mocks/thunder/CommunicatorMock.h @@ -2,7 +2,7 @@ * If not stated otherwise in this file or this component's LICENSE file the * following copyright and licenses apply: * -* Copyright 2025 RDK Management +* Copyright 2026 RDK Management * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/ci/mocks/thunder/DispatcherMock.h b/ci/mocks/thunder/DispatcherMock.h index fdc40b63..c26986a8 100644 --- a/ci/mocks/thunder/DispatcherMock.h +++ b/ci/mocks/thunder/DispatcherMock.h @@ -2,7 +2,7 @@ * If not stated otherwise in this file or this component's LICENSE file the * following copyright and licenses apply: * - * Copyright 2023 RDK Management + * Copyright 2026 RDK Management * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/ci/mocks/thunder/FactoriesImplementation.h b/ci/mocks/thunder/FactoriesImplementation.h index 2fe178f8..da57617a 100644 --- a/ci/mocks/thunder/FactoriesImplementation.h +++ b/ci/mocks/thunder/FactoriesImplementation.h @@ -2,7 +2,7 @@ * If not stated otherwise in this file or this component's LICENSE * file the following copyright and licenses apply: * -* Copyright 2024 RDK Management +* Copyright 2026 RDK Management * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/ci/mocks/thunder/Module.cpp b/ci/mocks/thunder/Module.cpp index cd6d4d14..9fe0ab6e 100644 --- a/ci/mocks/thunder/Module.cpp +++ b/ci/mocks/thunder/Module.cpp @@ -2,7 +2,7 @@ * If not stated otherwise in this file or this component's LICENSE * file the following copyright and licenses apply: * -* Copyright 2024 RDK Management +* Copyright 2026 RDK Management * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/ci/mocks/thunder/Module.h b/ci/mocks/thunder/Module.h index c7532ae3..1f49ab64 100644 --- a/ci/mocks/thunder/Module.h +++ b/ci/mocks/thunder/Module.h @@ -2,7 +2,7 @@ * If not stated otherwise in this file or this component's LICENSE * file the following copyright and licenses apply: * -* Copyright 2024 RDK Management +* Copyright 2026 RDK Management * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/ci/mocks/thunder/ServiceMock.h b/ci/mocks/thunder/ServiceMock.h index 1652dbdd..a5dc9d2e 100644 --- a/ci/mocks/thunder/ServiceMock.h +++ b/ci/mocks/thunder/ServiceMock.h @@ -2,7 +2,7 @@ * If not stated otherwise in this file or this component's LICENSE file the * following copyright and licenses apply: * - * Copyright 2022 RDK Management + * Copyright 2026 RDK Management * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/ci/mocks/thunder/SystemInfo.h b/ci/mocks/thunder/SystemInfo.h index 52a8b75d..baaab5bb 100644 --- a/ci/mocks/thunder/SystemInfo.h +++ b/ci/mocks/thunder/SystemInfo.h @@ -2,7 +2,7 @@ * If not stated otherwise in this file or this component's LICENSE * file the following copyright and licenses apply: * -* Copyright 2024 RDK Management +* Copyright 2026 RDK Management * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/ci/mocks/thunder/ThunderPortability.h b/ci/mocks/thunder/ThunderPortability.h index d0f43f80..392e1883 100755 --- a/ci/mocks/thunder/ThunderPortability.h +++ b/ci/mocks/thunder/ThunderPortability.h @@ -2,7 +2,7 @@ * If not stated otherwise in this file or this component's LICENSE * file the following copyright and licenses apply: * -* Copyright 2024 RDK Management +* Copyright 2026 RDK Management * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/ci/mocks/thunder/WorkerPoolImplementation.h b/ci/mocks/thunder/WorkerPoolImplementation.h index bb746615..f0e8ee86 100644 --- a/ci/mocks/thunder/WorkerPoolImplementation.h +++ b/ci/mocks/thunder/WorkerPoolImplementation.h @@ -2,7 +2,7 @@ * If not stated otherwise in this file or this component's LICENSE * file the following copyright and licenses apply: * -* Copyright 2024 RDK Management +* Copyright 2026 RDK Management * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/ci/mocks/thunder/mockauthservices.h b/ci/mocks/thunder/mockauthservices.h index e3dc7152..cc56c400 100644 --- a/ci/mocks/thunder/mockauthservices.h +++ b/ci/mocks/thunder/mockauthservices.h @@ -2,7 +2,7 @@ * If not stated otherwise in this file or this component's LICENSE file the * following copyright and licenses apply: * - * Copyright 2023 RDK Management + * Copyright 2026 RDK Management * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. From 4eabde28e077feb40e9bede85d14bba0aee2f052 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Tue, 14 Apr 2026 16:49:00 +0000 Subject: [PATCH 12/72] Adding copilot instructions to give more context about the ci dir --- .github/copilot-instructions.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .github/copilot-instructions.md diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 00000000..eb76f05e --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1,14 @@ +# Copilot Instructions + +## Repository overview +This is the **ctrlm-main** (Control Manager) plugin — a Thunder/WPEFramework plugin for RDK remote control management. + +## ci/ directory +The `ci/` directory contains **native CI build support files only**. It is not part of the application. + +- `ci/build_dependencies.sh` / `ci/cov_build.sh` — scripts that build the plugin in a CI container without a full RDK target image +- `ci/mocks/` — minimal stub headers that stand in for platform libraries (IARM, DeviceSettings, RFC, Telemetry, xr-voice-sdk, etc.) that are unavailable in the CI environment. These are **not** production implementations. +- `ci/patches/` — temporary patches applied to Thunder/ThunderTools during CI builds only +- `ci/headers/` — empty stub headers generated at CI build time; not committed to source + +When suggesting code or answering questions, treat `ci/mocks/` as CI scaffolding, not as authoritative API definitions. For real API shapes refer to the installed headers under `install/usr/include/` or the upstream repositories (Thunder, entservices-apis, xr-voice-sdk). From 59274cdbb6b12696e6bfe327a41d76bd4b686602 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Tue, 14 Apr 2026 17:10:28 +0000 Subject: [PATCH 13/72] Updates --- ci/build_dependencies.sh | 18 ++++++++++++++++++ ci/cov_build.sh | 18 ++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh index d46c2575..9b564bba 100644 --- a/ci/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -1,4 +1,22 @@ #!/bin/bash +# +# If not stated otherwise in this file or this component's license file the +# following copyright and licenses apply: +# +# Copyright 2026 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 -x set -e ############################## diff --git a/ci/cov_build.sh b/ci/cov_build.sh index e8348b96..2abfeb52 100644 --- a/ci/cov_build.sh +++ b/ci/cov_build.sh @@ -1,4 +1,22 @@ #!/bin/bash +# +# If not stated otherwise in this file or this component's license file the +# following copyright and licenses apply: +# +# Copyright 2026 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 -x set -e ############################## From 1780b232df3ad61102b64fc54e1537db0a486569 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Tue, 14 Apr 2026 17:46:01 +0000 Subject: [PATCH 14/72] Testing changes --- ci/build_dependencies.sh | 10 +++++++++- ci/cov_build.sh | 3 +++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh index 9b564bba..49fe3b62 100644 --- a/ci/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -61,7 +61,8 @@ git clone --depth 1 --branch R4.4.1 https://github.com/rdkcentral/Thunder.git git clone --depth 1 --branch develop https://github.com/rdkcentral/entservices-apis.git -git clone --depth 1 https://github.com/rdkcentral/xr-voice-sdk.git +git clone https://github.com/rdkcentral/xr-voice-sdk.git +git -C xr-voice-sdk checkout e55c99a0ec947b0ad3efc308bf8e3de0a42140d5 ############################ # 3. Build Thunder-Tools @@ -124,6 +125,7 @@ echo "========================================================================== echo "Creating stub headers" HEADERS_DIR="$GITHUB_WORKSPACE/ci/headers" +XRSDK_HEADERS_DIR="$HEADERS_DIR/xr-voice-sdk" mkdir -p "${HEADERS_DIR}" mkdir -p "${HEADERS_DIR}/rdk/iarmbus" mkdir -p "${HEADERS_DIR}/rdk/ds" @@ -137,6 +139,12 @@ mkdir -p "${HEADERS_DIR}/audiocapturemgr" mkdir -p "${HEADERS_DIR}/ccec/drivers" mkdir -p "${HEADERS_DIR}/network" mkdir -p "${HEADERS_DIR}/nopoll" +mkdir -p "${XRSDK_HEADERS_DIR}" + +cp "$GITHUB_WORKSPACE/xr-voice-sdk/src/xr_voice_sdk.h" "${XRSDK_HEADERS_DIR}/" +cp "$GITHUB_WORKSPACE/xr-voice-sdk/src/xr-speech-vrex/xrsv.h" "${XRSDK_HEADERS_DIR}/" +cp "$GITHUB_WORKSPACE/xr-voice-sdk/src/xr-timestamp/xr_timestamp.h" "${XRSDK_HEADERS_DIR}/" +cp "$GITHUB_WORKSPACE/xr-voice-sdk/src/xr-fdc/xr_fdc.h" "${XRSDK_HEADERS_DIR}/" cd "${HEADERS_DIR}" diff --git a/ci/cov_build.sh b/ci/cov_build.sh index 2abfeb52..eb3d12f6 100644 --- a/ci/cov_build.sh +++ b/ci/cov_build.sh @@ -27,6 +27,7 @@ ls -la ${GITHUB_WORKSPACE} # Build control (ctrlm-main) echo "building control (ctrlm-main)" +XRSDK_REAL_HEADERS="$GITHUB_WORKSPACE/ci/headers/xr-voice-sdk" CTRL_STUBS="$GITHUB_WORKSPACE/ci/mocks/control" MOCK_DIR="$GITHUB_WORKSPACE/ci/mocks" HEADERS_DIR="$GITHUB_WORKSPACE/ci/headers" @@ -65,6 +66,7 @@ cmake -G Ninja -S "$GITHUB_WORKSPACE" -B build/control \ -DCTRLM_CONFIG_JSON_MAIN_SUB="${EMPTY_JSON}" \ -DCTRLM_CONFIG_JSON_MAIN_ADD="${EMPTY_JSON}" \ -DCMAKE_CXX_FLAGS=" \ +-I ${XRSDK_REAL_HEADERS} \ -I ${CTRL_STUBS} \ -I ${MOCK_DIR} \ -I ${MOCK_DIR}/thunder \ @@ -95,6 +97,7 @@ cmake -G Ninja -S "$GITHUB_WORKSPACE" -B build/control \ -DDISABLE_SECURITY_TOKEN \ -DUSE_THUNDER_R4=ON -DTHUNDER_VERSION=4 -DTHUNDER_VERSION_MAJOR=4 -DTHUNDER_VERSION_MINOR=4" \ -DCMAKE_C_FLAGS=" \ +-I ${XRSDK_REAL_HEADERS} \ -I ${CTRL_STUBS} \ -I ${MOCK_DIR} \ -I ${HEADERS_DIR} \ From cb35a136d8435015678c5422c84dc3cd20eb1302 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Tue, 14 Apr 2026 18:42:14 +0000 Subject: [PATCH 15/72] Slowly removing mock headers for actual ones in xr-audio-sdk --- ci/build_dependencies.sh | 7 ++++--- ci/mocks/control/xr_fdc.h | 23 ----------------------- 2 files changed, 4 insertions(+), 26 deletions(-) delete mode 100644 ci/mocks/control/xr_fdc.h diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh index 49fe3b62..fd73aa7f 100644 --- a/ci/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -141,10 +141,11 @@ mkdir -p "${HEADERS_DIR}/network" mkdir -p "${HEADERS_DIR}/nopoll" mkdir -p "${XRSDK_HEADERS_DIR}" -cp "$GITHUB_WORKSPACE/xr-voice-sdk/src/xr_voice_sdk.h" "${XRSDK_HEADERS_DIR}/" -cp "$GITHUB_WORKSPACE/xr-voice-sdk/src/xr-speech-vrex/xrsv.h" "${XRSDK_HEADERS_DIR}/" -cp "$GITHUB_WORKSPACE/xr-voice-sdk/src/xr-timestamp/xr_timestamp.h" "${XRSDK_HEADERS_DIR}/" +# xr_fdc.h and xrsv.h are compatible with control's usage; copy them from xr-voice-sdk source. +# xr_voice_sdk.h is NOT copied: it requires rdkx_logger.h installed types unavailable in source form. +# xr_timestamp.h is NOT copied: control's source uses the pointer-form API in the ci/mocks/control/ stub. cp "$GITHUB_WORKSPACE/xr-voice-sdk/src/xr-fdc/xr_fdc.h" "${XRSDK_HEADERS_DIR}/" +cp "$GITHUB_WORKSPACE/xr-voice-sdk/src/xr-speech-vrex/xrsv.h" "${XRSDK_HEADERS_DIR}/" cd "${HEADERS_DIR}" diff --git a/ci/mocks/control/xr_fdc.h b/ci/mocks/control/xr_fdc.h deleted file mode 100644 index fd952a2c..00000000 --- a/ci/mocks/control/xr_fdc.h +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Stub for xr_fdc.h - File Descriptor Check - * - * Copyright 2026 RDK Management - * Licensed under the Apache License, Version 2.0 - */ -#ifndef _XR_FDC_H_ -#define _XR_FDC_H_ - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -int32_t xr_fdc_check(uint32_t limit_soft, uint32_t limit_hard, bool log_fds); - -#ifdef __cplusplus -} -#endif - -#endif /* _XR_FDC_H_ */ From ce02dc49b6742880132fe714625295ccf241aabe Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Tue, 14 Apr 2026 18:55:46 +0000 Subject: [PATCH 16/72] More changes to move away from mock headers --- ci/build_dependencies.sh | 9 +- ci/mocks/control/xr_mq.h | 50 ---- ci/mocks/control/xrsr.h | 357 ----------------------------- ci/mocks/control/xrsv_http.h | 57 ----- ci/mocks/control/xrsv_ws_nextgen.h | 98 -------- 5 files changed, 7 insertions(+), 564 deletions(-) delete mode 100644 ci/mocks/control/xr_mq.h delete mode 100644 ci/mocks/control/xrsr.h delete mode 100644 ci/mocks/control/xrsv_http.h delete mode 100644 ci/mocks/control/xrsv_ws_nextgen.h diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh index fd73aa7f..5bd67561 100644 --- a/ci/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -61,6 +61,7 @@ git clone --depth 1 --branch R4.4.1 https://github.com/rdkcentral/Thunder.git git clone --depth 1 --branch develop https://github.com/rdkcentral/entservices-apis.git +# 1.0.13 git clone https://github.com/rdkcentral/xr-voice-sdk.git git -C xr-voice-sdk checkout e55c99a0ec947b0ad3efc308bf8e3de0a42140d5 @@ -141,11 +142,15 @@ mkdir -p "${HEADERS_DIR}/network" mkdir -p "${HEADERS_DIR}/nopoll" mkdir -p "${XRSDK_HEADERS_DIR}" -# xr_fdc.h and xrsv.h are compatible with control's usage; copy them from xr-voice-sdk source. +# Copy real xr-voice-sdk headers where control's source matches the real API. # xr_voice_sdk.h is NOT copied: it requires rdkx_logger.h installed types unavailable in source form. -# xr_timestamp.h is NOT copied: control's source uses the pointer-form API in the ci/mocks/control/ stub. +# xr_timestamp.h is NOT copied: control's source uses a pointer-form API that differs from the real by-value API. cp "$GITHUB_WORKSPACE/xr-voice-sdk/src/xr-fdc/xr_fdc.h" "${XRSDK_HEADERS_DIR}/" cp "$GITHUB_WORKSPACE/xr-voice-sdk/src/xr-speech-vrex/xrsv.h" "${XRSDK_HEADERS_DIR}/" +cp "$GITHUB_WORKSPACE/xr-voice-sdk/src/xr-speech-router/xrsr.h" "${XRSDK_HEADERS_DIR}/" +cp "$GITHUB_WORKSPACE/xr-voice-sdk/src/xr-mq/xr_mq.h" "${XRSDK_HEADERS_DIR}/" +cp "$GITHUB_WORKSPACE/xr-voice-sdk/src/xr-speech-vrex/xrsv_http/xrsv_http.h" "${XRSDK_HEADERS_DIR}/" +cp "$GITHUB_WORKSPACE/xr-voice-sdk/src/xr-speech-vrex/xrsv_ws_nextgen/xrsv_ws_nextgen.h" "${XRSDK_HEADERS_DIR}/" cd "${HEADERS_DIR}" diff --git a/ci/mocks/control/xr_mq.h b/ci/mocks/control/xr_mq.h deleted file mode 100644 index fa238de7..00000000 --- a/ci/mocks/control/xr_mq.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * If not stated otherwise in this file or this component's license file the - * following copyright and licenses apply: - * - * Copyright 2026 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 _XR_MQ_H_ -#define _XR_MQ_H_ - -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* xr_mq_t is an integer (OS queue descriptor), not a pointer */ -typedef int xr_mq_t; - -#define XR_MQ_INVALID ((xr_mq_t)-1) - -typedef struct { - uint32_t max_msg; /* field name used by ctrlm source (must be first — matches designated init order) */ - size_t max_msg_size; -} xr_mq_attr_t; - -xr_mq_t xr_mq_create(const xr_mq_attr_t *attr); -void xr_mq_destroy(xr_mq_t mq); -bool xr_mq_push(xr_mq_t mq, const void *msg, size_t msg_size); -bool xr_mq_pop(xr_mq_t mq, void *msg, size_t msg_size); -bool xr_mq_pop_timeout(xr_mq_t mq, void *msg, size_t msg_size, int32_t timeout_ms); - -#ifdef __cplusplus -} -#endif - -#endif /* _XR_MQ_H_ */ diff --git a/ci/mocks/control/xrsr.h b/ci/mocks/control/xrsr.h deleted file mode 100644 index e166c8c5..00000000 --- a/ci/mocks/control/xrsr.h +++ /dev/null @@ -1,357 +0,0 @@ -/* - * If not stated otherwise in this file or this component's license file the - * following copyright and licenses apply: - * - * Copyright 2026 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 _XRSR_H_ -#define _XRSR_H_ - -#include -#include -#include -#include -#include "xr_timestamp.h" - -/* Minimal opaque placeholders to avoid requiring OpenSSL dev headers in mocks. */ -#if defined(__has_include) -#if __has_include() -#include -#endif -#endif - -#ifndef OPENSSL_TYPES_H -typedef struct xrsr_x509_stub X509; -typedef struct xrsr_evp_pkey_stub EVP_PKEY; -typedef struct stack_st_X509 X509_STACK; -#endif -#ifndef STACK_OF -#define STACK_OF(type) struct stack_st_##type -#endif -#ifdef __cplusplus -extern "C" { -#endif - -#define XRSR_SAT_TOKEN_LEN_MAX (2048) -#define XRSR_QUERY_STRING_QTY_MAX (16) -#define XRSR_SESSION_BY_TEXT_MAX (256) -#define XRSR_DST_PARAM_LEN_MAX (256) -#define XRSR_USER_AGENT_LEN_MAX (512) -#define XRSR_DST_QTY_MAX (4) - -/* Source types */ -typedef enum { - XRSR_SRC_RCU_PTT = 0, - XRSR_SRC_RCU_FF = 1, - XRSR_SRC_MICROPHONE = 2, - XRSR_SRC_MICROPHONE_TAP = 3, - XRSR_SRC_INVALID = 4 -} xrsr_src_t; - -/* Audio format values used in ctrlm. */ -enum { - XRSR_AUDIO_FORMAT_NONE = 0, - XRSR_AUDIO_FORMAT_PCM = (1 << 0), - XRSR_AUDIO_FORMAT_PCM_32_BIT = (1 << 1), - XRSR_AUDIO_FORMAT_PCM_32_BIT_MULTI = (1 << 2), - XRSR_AUDIO_FORMAT_PCM_RAW = (1 << 3), - XRSR_AUDIO_FORMAT_ADPCM = (1 << 4), - XRSR_AUDIO_FORMAT_ADPCM_FRAME = (1 << 5), - XRSR_AUDIO_FORMAT_OPUS = (1 << 6), - XRSR_AUDIO_FORMAT_OPUS_XVP = (1 << 7), - XRSR_AUDIO_FORMAT_MAX = (1 << 8) -}; - -typedef struct { - uint32_t size_packet; - uint32_t size_header; - uint32_t offset_step_size_index; - uint32_t offset_predicted_sample_lsb; - uint32_t offset_predicted_sample_msb; - uint32_t offset_sequence_value; - uint32_t shift_sequence_value; - uint32_t sequence_value_min; - uint32_t sequence_value_max; -} xrsr_audio_format_adpcm_frame_t; - -typedef struct { - int type; - union { - xrsr_audio_format_adpcm_frame_t adpcm_frame; - } value; -} xrsr_audio_format_t; - -typedef enum { - XRSR_SESSION_END_REASON_EOS = 0, - XRSR_SESSION_END_REASON_TERMINATE = 1, - XRSR_SESSION_END_REASON_EOT = 2, - XRSR_SESSION_END_REASON_DISCONNECT_REMOTE = 3, - XRSR_SESSION_END_REASON_ERROR_AUDIO_BEGIN = 4, - XRSR_SESSION_END_REASON_ERROR_AUDIO_DURATION = 5, - XRSR_SESSION_END_REASON_INVALID = 6 -} xrsr_session_end_reason_t; - -typedef enum { - XRSR_STREAM_FROM_BEGINNING = 0, - XRSR_STREAM_FROM_KEYWORD = 1, - XRSR_STREAM_FROM_KEYWORD_BEGIN = 2, - XRSR_STREAM_FROM_LIVE = 3, - XRSR_STREAM_FROM_INVALID = 4 -} xrsr_stream_from_t; - -typedef enum { - XRSR_STREAM_UNTIL_END_OF_STREAM = 0, - XRSR_STREAM_UNTIL_END_OF_SPEECH = 1, - XRSR_STREAM_UNTIL_END_OF_KEYWORD = 2, - XRSR_STREAM_UNTIL_INVALID = 3 -} xrsr_stream_until_t; - -typedef enum { - XRSR_POWER_MODE_FULL = 0, - XRSR_POWER_MODE_LOW = 1, - XRSR_POWER_MODE_SLEEP = 2, - XRSR_POWER_MODE_QTY = 3 -} xrsr_power_mode_t; - -typedef enum { - XRSR_KWD_RESULT_DETECTED = 0, - XRSR_KWD_RESULT_NOT_DETECTED = 1, - XRSR_KWD_RESULT_INVALID = 2 -} xrsr_keyword_detector_result_t; - -typedef enum { - XRSR_CERT_TYPE_P12 = 0, - XRSR_CERT_TYPE_X509 = 1, - XRSR_CERT_TYPE_PEM = 2 -} xrsr_cert_type_t; - -typedef struct { - xrsr_cert_type_t type; - union { - struct { - const char *filename; - const char *passphrase; - } p12; - struct { - X509 *x509; - EVP_PKEY *pkey; - STACK_OF(X509) *chain; - } x509; - struct { - const char *filename_cert; - const char *filename_pkey; - const char *filename_chain; - const char *passphrase; - } pem; - } cert; -} xrsr_cert_t; - -typedef struct { - uint32_t connect_check_interval; - uint32_t timeout_connect; - uint32_t timeout_inactivity; - uint32_t timeout_session; - bool ipv4_fallback; - uint32_t backoff_delay; -} xrsr_dst_params_t; - -typedef struct xrsr_session_config_in_t xrsr_session_config_in_t; -typedef struct xrsr_session_config_out_t xrsr_session_config_out_t; -typedef struct xrsr_session_config_update_t xrsr_session_config_update_t; - -typedef void (*xrsr_session_config_cb_t)(const uuid_t uuid, xrsr_session_config_in_t *config_in); -typedef xrsr_session_config_cb_t xrsr_callback_session_config_t; -typedef bool (*xrsr_handler_send_t)(const void *data, size_t size, void *user_data); -typedef void (*xrsr_session_audio_cb_t)(int bytes_sent, void *user_data); - -typedef struct { - bool valid; - uint32_t packets_processed; - uint32_t packets_lost; - uint32_t samples_processed; - uint32_t samples_lost; - uint32_t decoder_failures; - uint32_t samples_buffered_max; - double snr_peak; - double snr_mean; -} xrsr_audio_stats_t; - -typedef struct { - bool result; - int stream_end_reason; - xrsr_audio_stats_t audio_stats; -} xrsr_stream_stats_t; - -typedef struct { - xrsr_session_end_reason_t session_end_reason; - int ret_code_protocol; - int ret_code_library; - int ret_code_internal; - const char *server_ip; - int time_dns; - int time_connect; - int stream_end_reason; - xrsr_stream_stats_t stream_stats; -} xrsr_session_stats_t; - -typedef struct xrsr_handlers_t { - void (*session_begin)(void *data, const uuid_t uuid, xrsr_src_t src, uint32_t dst_index, xrsr_keyword_detector_result_t *detector_result, xrsr_session_config_out_t *config_out, xrsr_session_config_in_t *config_in, rdkx_timestamp_t *timestamp, const char *transcription_in); - void (*session_config)(void *data, const uuid_t uuid, xrsr_session_config_update_t *session_config_update, rdkx_timestamp_t *timestamp); - void (*session_end)(void *data, const uuid_t uuid, xrsr_session_stats_t *stats, rdkx_timestamp_t *timestamp); - void (*stream_begin)(void *data, const uuid_t uuid, xrsr_src_t src, rdkx_timestamp_t *timestamp); - void (*stream_kwd)(void *data, const uuid_t uuid, rdkx_timestamp_t *timestamp); - void (*stream_audio)(void *data, const uuid_t uuid, const uint8_t *buffer, size_t size, rdkx_timestamp_t *timestamp); - void (*stream_end)(void *data, const uuid_t uuid, xrsr_stream_stats_t *stats, rdkx_timestamp_t *timestamp); - bool (*connected)(void *data, const uuid_t uuid, xrsr_handler_send_t send, void *param, rdkx_timestamp_t *timestamp, xrsr_session_config_update_t *session_config_update); - void (*disconnected)(void *data, const uuid_t uuid, xrsr_session_end_reason_t reason, bool retry, bool *detect_resume, rdkx_timestamp_t *timestamp); - void (*recv_msg)(void *data, const char *msg, size_t msg_len); - void (*source_error)(void *data, xrsr_src_t src); - void *data; -} xrsr_handlers_t; - -typedef struct { - const char *url; - xrsr_handlers_t handlers; - int formats; - uint32_t stream_time_min; - xrsr_stream_from_t stream_from; - int32_t stream_offset; - xrsr_stream_until_t stream_until; - const xrsr_dst_params_t *params[XRSR_POWER_MODE_QTY]; -} xrsr_dst_t; - -typedef struct { - xrsr_src_t src; - uint32_t dst_qty; - xrsr_dst_t dsts[XRSR_DST_QTY_MAX]; -} xrsr_route_t; - -struct xrsr_session_config_out_t { - bool detect_keyword; - bool has_stream; - bool push_to_talk; - xrsr_stream_from_t stream_from; - xrsr_audio_format_t format; - bool user_initiated; - xrsr_session_config_cb_t cb_session_config; -}; - -struct xrsr_session_config_in_t { - xrsr_src_t src; - struct { - xrsr_cert_t client_cert; - bool host_verify; - bool ocsp_verify_stapling; - bool ocsp_verify_ca; - const char *sat_token; - const char *user_agent; - const char *query_strs[XRSR_QUERY_STRING_QTY_MAX + 1]; - } http; - struct { - xrsr_cert_t client_cert; - const char *sat_token; - bool host_verify; - bool ocsp_verify_stapling; - bool ocsp_verify_ca; - bool cert_expired_allow; - bool cert_revoked_allow; - bool ocsp_expired_allow; - uint32_t keyword_begin; - uint32_t keyword_duration; - void *app_config; - } ws; -}; - -struct xrsr_session_config_update_t { - int dummy; -}; - -typedef struct { - bool delete_files; - bool enable; - bool use_curtail; - uint32_t file_qty_max; - uint32_t file_size_max; - const char *dir_path; -} xrsr_capture_config_t; - -typedef enum { - XRSR_AUDIO_CONTAINER_NONE = 0, - XRSR_AUDIO_CONTAINER_WAV = 1 -} xrsr_audio_container_t; - -typedef enum { - XRSR_SESSION_REQUEST_TYPE_INVALID = 0, - XRSR_SESSION_REQUEST_TYPE_TEXT = 1, - XRSR_SESSION_REQUEST_TYPE_AUDIO_FILE = 2, - XRSR_SESSION_REQUEST_TYPE_AUDIO_MIC = 3, - XRSR_SESSION_REQUEST_TYPE_AUDIO_FD = 4 -} xrsr_session_request_type_t; - -typedef struct { - xrsr_session_request_type_t type; - union { - struct { - const char *text; - } text; - struct { - const char *path; - } audio_file; - struct { - bool stream_params_required; - } audio_mic; - struct { - int audio_fd; - xrsr_audio_format_t audio_format; - xrsr_session_audio_cb_t callback; - void *user_data; - } audio_fd; - } value; -} xrsr_session_request_t; - -typedef struct { - const char *vsdk_config; - const char *host_name; - bool networked_standby; - bool local_mic; - bool local_mic_tap; - int dummy; -} xrsr_config_t; - -bool xrsr_open(const char *host_name, xrsr_route_t *routes, const xrsr_handlers_t *handlers, const xrsr_capture_config_t *capture_config, xrsr_power_mode_t power_mode, bool privacy, bool mask_pii, void *json_obj_vsdk); -void xrsr_close(void); -bool xrsr_route(xrsr_route_t *routes); -void xrsr_session_terminate(xrsr_src_t src); -bool xrsr_config_get(xrsr_config_t *config); -bool xrsr_power_mode_set(xrsr_power_mode_t power_mode); -bool xrsr_privacy_mode_set(bool enable); -bool xrsr_privacy_mode_get(bool *enable); -void xrsr_mask_pii_set(bool enable); -bool xrsr_session_request(xrsr_src_t src, xrsr_audio_format_t format, xrsr_session_request_t request, const uuid_t *uuid, bool low_latency, bool low_cpu_util); -bool xrsr_session_audio_fd_set(xrsr_src_t src, int audio_fd, xrsr_audio_format_t format, xrsr_session_audio_cb_t callback, void *user_data); -void xrsr_session_audio_stream_start(xrsr_src_t src); -void xrsr_session_keyword_info_set(xrsr_src_t src, uint32_t pre_keyword_sample_qty, uint32_t keyword_sample_qty); -bool xrsr_session_capture_start(xrsr_audio_container_t container, const char *file_path, bool raw_mic_enable); -bool xrsr_session_capture_stop(void); -bool xrsr_capture_config_set(const xrsr_capture_config_t *capture_config); -const char *xrsr_audio_container_str(xrsr_audio_container_t container); -const char *xrsr_src_str(xrsr_src_t src); -const char *xrsr_session_end_reason_str(xrsr_session_end_reason_t reason); - -#ifdef __cplusplus -} -#endif - -#endif /* _XRSR_H_ */ diff --git a/ci/mocks/control/xrsv_http.h b/ci/mocks/control/xrsv_http.h deleted file mode 100644 index 4104f14c..00000000 --- a/ci/mocks/control/xrsv_http.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Stub for xrsv_http.h - Voice HTTP endpoint types - * - * Copyright 2026 RDK Management - * Licensed under the Apache License, Version 2.0 - */ -#ifndef _XRSV_HTTP_H_ -#define _XRSV_HTTP_H_ - -#include "xrsr.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef void *xrsv_http_object_t; - -typedef struct { - const char *device_id; - const char *partner_id; - const char *experience; - const char *app_id; - const char *language; - bool test_flag; - bool mask_pii; - void *user_data; -} xrsv_http_params_t; - -typedef struct { - const char *transcription; - long return_code; -} xrsv_http_recv_msg_t; - -typedef struct { - void (*session_begin)(const uuid_t uuid, xrsr_src_t src, uint32_t dst_index, xrsr_session_config_out_t *configuration, rdkx_timestamp_t *timestamp, void *user_data); - void (*session_end)(const uuid_t uuid, xrsr_session_stats_t *stats, rdkx_timestamp_t *timestamp, void *user_data); - void (*stream_begin)(const uuid_t uuid, xrsr_src_t src, rdkx_timestamp_t *timestamp, void *user_data); - void (*stream_end)(const uuid_t uuid, xrsr_stream_stats_t *stats, rdkx_timestamp_t *timestamp, void *user_data); - void (*connected)(const uuid_t uuid, rdkx_timestamp_t *timestamp, void *user_data); - void (*disconnected)(const uuid_t uuid, rdkx_timestamp_t *timestamp, void *user_data); - void (*recv_msg)(xrsv_http_recv_msg_t *msg, void *user_data); -} xrsv_http_handlers_t; - -xrsv_http_object_t xrsv_http_create(const xrsv_http_params_t *params); -void xrsv_http_destroy(xrsv_http_object_t obj); -bool xrsv_http_handlers(xrsv_http_object_t obj, const xrsv_http_handlers_t *handlers, xrsr_handlers_t *handlers_out); -void xrsv_http_update_device_id(xrsv_http_object_t obj, const char *device_id); -void xrsv_http_update_partner_id(xrsv_http_object_t obj, const char *partner_id); -void xrsv_http_update_experience(xrsv_http_object_t obj, const char *experience); -void xrsv_http_update_language(xrsv_http_object_t obj, const char *language); -void xrsv_http_update_mask_pii(xrsv_http_object_t obj, bool enable); - -#ifdef __cplusplus -} -#endif - -#endif /* _XRSV_HTTP_H_ */ diff --git a/ci/mocks/control/xrsv_ws_nextgen.h b/ci/mocks/control/xrsv_ws_nextgen.h deleted file mode 100644 index f4cfe207..00000000 --- a/ci/mocks/control/xrsv_ws_nextgen.h +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Stub for xrsv_ws_nextgen.h - Voice WebSocket NextGen endpoint types - * - * Copyright 2026 RDK Management - * Licensed under the Apache License, Version 2.0 - */ -#ifndef _XRSV_WS_NEXTGEN_H_ -#define _XRSV_WS_NEXTGEN_H_ - -#include "xrsr.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef void *xrsv_ws_nextgen_object_t; - -typedef enum { - XRSV_WS_NEXTGEN_DEVICE_TYPE_STB = 0, - XRSV_WS_NEXTGEN_DEVICE_TYPE_TV = 1 -} xrsv_ws_nextgen_device_type_t; - -typedef struct { - const char *device_id; - const char *account_id; - const char *partner_id; - const char *experience; - const char *audio_profile; - const char *audio_model; - const char *language; - const char *device_mac; - const char *rf_protocol; - bool test_flag; - bool bypass_wuw_verify_success; - bool bypass_wuw_verify_failure; - bool mask_pii; - void *user_data; -} xrsv_ws_nextgen_params_t; - -typedef struct { - uint32_t keyword_sample_begin; - uint32_t keyword_sample_end; - uint32_t keyword_doa; - float keyword_sensitivity; - bool keyword_sensitivity_triggered; - float keyword_sensitivity_high; - bool keyword_sensitivity_high_support; - bool keyword_sensitivity_high_triggered; - float dynamic_gain; - float linear_confidence; - float nonlinear_confidence; - float signal_noise_ratio; - bool push_to_talk; - uint32_t par_eos_timeout; -} xrsv_ws_nextgen_stream_params_t; - -typedef struct { - void (*session_begin)(const uuid_t uuid, xrsr_src_t src, uint32_t dst_index, xrsr_session_config_out_t *configuration, xrsv_ws_nextgen_stream_params_t *stream_params, rdkx_timestamp_t *timestamp, void *user_data); - void (*session_end)(const uuid_t uuid, xrsr_session_stats_t *stats, rdkx_timestamp_t *timestamp, void *user_data); - void (*stream_begin)(const uuid_t uuid, xrsr_src_t src, rdkx_timestamp_t *timestamp, void *user_data); - void (*stream_kwd)(const uuid_t uuid, rdkx_timestamp_t *timestamp, void *user_data); - void (*stream_end)(const uuid_t uuid, xrsr_stream_stats_t *stats, rdkx_timestamp_t *timestamp, void *user_data); - void (*connected)(const uuid_t uuid, rdkx_timestamp_t *timestamp, void *user_data); - void (*disconnected)(const uuid_t uuid, bool retry, rdkx_timestamp_t *timestamp, void *user_data); - void (*sent_init)(const uuid_t uuid, rdkx_timestamp_t *timestamp, void *user_data); - void (*listening)(void *user_data); - void (*asr)(const char *str_transcription, bool final, void *user_data); - void (*conn_close)(const char *reason, long ret_code, void *user_data); - void (*response_vrex)(long ret_code, void *user_data); - void (*wuw_verification)(const uuid_t uuid, bool passed, long confidence, void *user_data); - void (*source_error)(xrsr_src_t src, void *user_data); - void (*tv_mute)(bool mute, void *user_data); - void (*tv_power)(bool power, bool toggle, void *user_data); - void (*tv_volume)(bool up, uint32_t repeat_count, void *user_data); - void (*msg)(const char *msg, unsigned long length, void *user_data); -} xrsv_ws_nextgen_handlers_t; - -xrsv_ws_nextgen_object_t xrsv_ws_nextgen_create(const xrsv_ws_nextgen_params_t *params); -void xrsv_ws_nextgen_destroy(xrsv_ws_nextgen_object_t obj); -bool xrsv_ws_nextgen_handlers(xrsv_ws_nextgen_object_t obj, const xrsv_ws_nextgen_handlers_t *handlers, xrsr_handlers_t *handlers_out); -bool xrsv_ws_nextgen_update_init_app(xrsv_ws_nextgen_object_t obj, const char *init_app); -bool xrsv_ws_nextgen_send_msg(xrsv_ws_nextgen_object_t obj, const char *msg); -void xrsv_ws_nextgen_update_account_id(xrsv_ws_nextgen_object_t obj, const char *account_id); -void xrsv_ws_nextgen_update_device_id(xrsv_ws_nextgen_object_t obj, const char *device_id); -void xrsv_ws_nextgen_update_device_type(xrsv_ws_nextgen_object_t obj, xrsv_ws_nextgen_device_type_t type); -void xrsv_ws_nextgen_update_partner_id(xrsv_ws_nextgen_object_t obj, const char *partner_id); -void xrsv_ws_nextgen_update_experience(xrsv_ws_nextgen_object_t obj, const char *experience); -void xrsv_ws_nextgen_update_language(xrsv_ws_nextgen_object_t obj, const char *language); -void xrsv_ws_nextgen_update_mask_pii(xrsv_ws_nextgen_object_t obj, bool enable); -void xrsv_ws_nextgen_update_audio_profile(xrsv_ws_nextgen_object_t obj, const char *profile); -void xrsv_ws_nextgen_update_audio_model(xrsv_ws_nextgen_object_t obj, const char *model); -void xrsv_ws_nextgen_update_audio_rf_protocol(xrsv_ws_nextgen_object_t obj, const char *rf_protocol); - -#ifdef __cplusplus -} -#endif - -#endif /* _XRSV_WS_NEXTGEN_H_ */ From 1bc21060586dd117b8b463ec463912e51582c636 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Wed, 15 Apr 2026 14:11:52 +0000 Subject: [PATCH 17/72] Updating credit related text for LICENSE, NOTICE, source, and copyright --- LICENSE | 23 +++++++++++++++++++ NOTICE | 10 ++++++++ ...010-R4.4-Add-support-for-project-dir.patch | 2 ++ .../1004-Add-support-for-project-dir.patch | 2 ++ ci/patches/RDKEMW-733-Add-ENTOS-IDS.patch | 1 + ...act_Alt_Based_On_ThunderTools_R4.4.3.patch | 1 + ci/patches/error_code_R4_4.patch | 2 ++ 7 files changed, 41 insertions(+) diff --git a/LICENSE b/LICENSE index d6456956..5c3c293d 100644 --- a/LICENSE +++ b/LICENSE @@ -200,3 +200,26 @@ 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. + + +MIT License + +Copyright (c) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/NOTICE b/NOTICE index d103597c..1c76658f 100644 --- a/NOTICE +++ b/NOTICE @@ -18,3 +18,13 @@ Some files in this repository were originally generated from XML using qdbusxml2 Copyright 2024 Comcast Cable Communications Management, LLC Licensed under the Apache License, Version 2.0 + +Copyright (c) 2007 Dave Airlie +Copyright (c) 2007 Jakob Bornecrantz +Copyright (c) 2008 Red Hat Inc. +Copyright (c) 2007-2008 Tungsten Graphics, Inc., Cedar Park, TX., USA +Copyright (c) 2007-2008 Intel Corporation +Licensed under the MIT License + +Based on pxCore, Copyright 2015-2018 John Robinson +Licensed under the Apache License, Version 2.0 diff --git a/ci/patches/00010-R4.4-Add-support-for-project-dir.patch b/ci/patches/00010-R4.4-Add-support-for-project-dir.patch index dbb94881..60c0129a 100755 --- a/ci/patches/00010-R4.4-Add-support-for-project-dir.patch +++ b/ci/patches/00010-R4.4-Add-support-for-project-dir.patch @@ -1,3 +1,5 @@ +Source: Copied from entservices-testframework/patches/00010-R4.4-Add-support-for-project-dir.patch + diff --git a/JsonGenerator/source/class_emitter.py b/JsonGenerator/source/class_emitter.py index 7f2fb01..67a6469 100644 --- a/JsonGenerator/source/class_emitter.py diff --git a/ci/patches/1004-Add-support-for-project-dir.patch b/ci/patches/1004-Add-support-for-project-dir.patch index 26fdee12..e612bd8a 100755 --- a/ci/patches/1004-Add-support-for-project-dir.patch +++ b/ci/patches/1004-Add-support-for-project-dir.patch @@ -1,3 +1,5 @@ +Source: Copied from entservices-testframework/patches/1004-Add-support-for-project-dir.patch + diff --git a/Source/plugins/CMakeLists.txt b/Source/plugins/CMakeLists.txt index 4d362d545..9357c647c 100644 --- a/Source/plugins/CMakeLists.txt diff --git a/ci/patches/RDKEMW-733-Add-ENTOS-IDS.patch b/ci/patches/RDKEMW-733-Add-ENTOS-IDS.patch index c8fd3213..3f9f9eb7 100755 --- a/ci/patches/RDKEMW-733-Add-ENTOS-IDS.patch +++ b/ci/patches/RDKEMW-733-Add-ENTOS-IDS.patch @@ -1,6 +1,7 @@ From: Sitaram, Soundaryaa Date: 05 Feb 2025 17:24:43 +0000 Subject: [PATCH] ENTOS IDs offset to be adjusted in rdkservices-apis +Source: Author email patch from Soundaryaa_Sitaram@comcast.com, copied from entservices-testframework/patches/RDKEMW-733-Add-ENTOS-IDS.patch Upstream-Status: None Signed-off-by: ssitar583 diff --git a/ci/patches/Use_Legact_Alt_Based_On_ThunderTools_R4.4.3.patch b/ci/patches/Use_Legact_Alt_Based_On_ThunderTools_R4.4.3.patch index c5b4a36f..3e1dea87 100755 --- a/ci/patches/Use_Legact_Alt_Based_On_ThunderTools_R4.4.3.patch +++ b/ci/patches/Use_Legact_Alt_Based_On_ThunderTools_R4.4.3.patch @@ -1,6 +1,7 @@ commit 810aae64cb31c907698e468b615797750094b847 Author: Pesala Lakshmi Jwala Priya Date: Thu Aug 29 12:31:30 2024 +0530 +Source: Commit 810aae64cb31c907698e468b615797750094b847 by Pesala Lakshmi Jwala Priya , copied from entservices-testframework/patches/Use_Legact_Alt_Based_On_ThunderTools_R4.4.3.patch Alt change diff --git a/ci/patches/error_code_R4_4.patch b/ci/patches/error_code_R4_4.patch index 954ca083..47e9cd92 100644 --- a/ci/patches/error_code_R4_4.patch +++ b/ci/patches/error_code_R4_4.patch @@ -1,3 +1,5 @@ +Source: Copied from entservices-testframework/patches/error_code_R4_4.patch + diff --git a/Source/WPEFramework/PluginServer.h b/Source/WPEFramework/PluginServer.h index e87933d9a..591385222 100644 --- a/Source/WPEFramework/PluginServer.h From 1dd27437db9dfbe399166c425659220dc26068c1 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Wed, 15 Apr 2026 14:57:44 +0000 Subject: [PATCH 18/72] Using test framework again, but in a way of not modifying it (testing) --- .github/copilot-instructions.md | 7 +- ci/build_dependencies.sh | 5 +- ci/cov_build.sh | 4 +- ci/mocks/Iarm.h | 923 ------- ci/mocks/Rfc.h | 114 - ci/mocks/Telemetry.h | 61 - ci/mocks/control/comcastIrKeyCodes.h | 49 - ci/mocks/control/irMgr.h | 42 - ci/mocks/control/rdkversion.h | 33 - ci/mocks/control/rdkx_logger.h | 204 -- ci/mocks/control/xr_timestamp.h | 44 - ci/mocks/control/xr_voice_sdk.h | 42 - ci/mocks/control/xraudio.h | 47 - ci/mocks/devicesettings.h | 2297 ----------------- ci/mocks/devicesettings/AudioOutputPortMock.h | 117 - .../devicesettings/AudioOutputPortTypeMock.h | 32 - ci/mocks/devicesettings/AudioStereoModeMock.h | 35 - ci/mocks/devicesettings/ColorMock.h | 32 - ci/mocks/devicesettings/CompositeInputMock.h | 35 - ci/mocks/devicesettings/DisplayMock.h | 36 - ci/mocks/devicesettings/DrmMock.h | 50 - ci/mocks/devicesettings/EdidParserMock.h | 30 - .../devicesettings/FloatingRtFunctionsMock.h | 35 - .../devicesettings/FrontPanelConfigMock.h | 33 - .../devicesettings/FrontPanelIndicatorMock.h | 40 - .../FrontPanelTextDisplayMock.h | 35 - ci/mocks/devicesettings/HdmiCecMock.h | 107 - ci/mocks/devicesettings/HdmiInputMock.h | 51 - ci/mocks/devicesettings/HostMock.h | 148 -- ci/mocks/devicesettings/ManagerMock.h | 32 - ci/mocks/devicesettings/MotionDetectionMock.h | 53 - ci/mocks/devicesettings/RtArrayObjectMock.h | 31 - ci/mocks/devicesettings/RtObjectBaseMock.h | 34 - ci/mocks/devicesettings/RtObjectRefMock.h | 33 - ci/mocks/devicesettings/SleepModeMock.h | 32 - ci/mocks/devicesettings/VideoDFCMock.h | 32 - ci/mocks/devicesettings/VideoDeviceMock.h | 39 - .../VideoOutputPortConfigMock.h | 32 - ci/mocks/devicesettings/VideoOutputPortMock.h | 61 - .../devicesettings/VideoOutputPortTypeMock.h | 32 - ci/mocks/devicesettings/VideoResolutionMock.h | 34 - ci/mocks/mfrTypes.h | 651 ----- ci/mocks/secure_wrappermock.h | 37 - ci/mocks/thunder/COMLinkMock.h | 50 - ci/mocks/thunder/Communicator.cpp | 30 - ci/mocks/thunder/Communicator.h | 286 -- ci/mocks/thunder/CommunicatorMock.h | 53 - ci/mocks/thunder/DispatcherMock.h | 55 - ci/mocks/thunder/FactoriesImplementation.h | 66 - ci/mocks/thunder/Module.cpp | 22 - ci/mocks/thunder/Module.h | 27 - ci/mocks/thunder/ServiceMock.h | 92 - ci/mocks/thunder/SystemInfo.h | 85 - ci/mocks/thunder/ThunderPortability.h | 52 - ci/mocks/thunder/WorkerPoolImplementation.h | 63 - ci/mocks/thunder/mockauthservices.h | 89 - 56 files changed, 10 insertions(+), 6781 deletions(-) delete mode 100644 ci/mocks/Iarm.h delete mode 100644 ci/mocks/Rfc.h delete mode 100644 ci/mocks/Telemetry.h delete mode 100644 ci/mocks/control/comcastIrKeyCodes.h delete mode 100644 ci/mocks/control/irMgr.h delete mode 100644 ci/mocks/control/rdkversion.h delete mode 100644 ci/mocks/control/rdkx_logger.h delete mode 100644 ci/mocks/control/xr_timestamp.h delete mode 100644 ci/mocks/control/xr_voice_sdk.h delete mode 100644 ci/mocks/control/xraudio.h delete mode 100644 ci/mocks/devicesettings.h delete mode 100644 ci/mocks/devicesettings/AudioOutputPortMock.h delete mode 100644 ci/mocks/devicesettings/AudioOutputPortTypeMock.h delete mode 100644 ci/mocks/devicesettings/AudioStereoModeMock.h delete mode 100644 ci/mocks/devicesettings/ColorMock.h delete mode 100644 ci/mocks/devicesettings/CompositeInputMock.h delete mode 100644 ci/mocks/devicesettings/DisplayMock.h delete mode 100644 ci/mocks/devicesettings/DrmMock.h delete mode 100644 ci/mocks/devicesettings/EdidParserMock.h delete mode 100644 ci/mocks/devicesettings/FloatingRtFunctionsMock.h delete mode 100644 ci/mocks/devicesettings/FrontPanelConfigMock.h delete mode 100644 ci/mocks/devicesettings/FrontPanelIndicatorMock.h delete mode 100644 ci/mocks/devicesettings/FrontPanelTextDisplayMock.h delete mode 100644 ci/mocks/devicesettings/HdmiCecMock.h delete mode 100644 ci/mocks/devicesettings/HdmiInputMock.h delete mode 100644 ci/mocks/devicesettings/HostMock.h delete mode 100644 ci/mocks/devicesettings/ManagerMock.h delete mode 100644 ci/mocks/devicesettings/MotionDetectionMock.h delete mode 100644 ci/mocks/devicesettings/RtArrayObjectMock.h delete mode 100644 ci/mocks/devicesettings/RtObjectBaseMock.h delete mode 100644 ci/mocks/devicesettings/RtObjectRefMock.h delete mode 100644 ci/mocks/devicesettings/SleepModeMock.h delete mode 100644 ci/mocks/devicesettings/VideoDFCMock.h delete mode 100644 ci/mocks/devicesettings/VideoDeviceMock.h delete mode 100644 ci/mocks/devicesettings/VideoOutputPortConfigMock.h delete mode 100644 ci/mocks/devicesettings/VideoOutputPortMock.h delete mode 100644 ci/mocks/devicesettings/VideoOutputPortTypeMock.h delete mode 100644 ci/mocks/devicesettings/VideoResolutionMock.h delete mode 100644 ci/mocks/mfrTypes.h delete mode 100755 ci/mocks/secure_wrappermock.h delete mode 100644 ci/mocks/thunder/COMLinkMock.h delete mode 100755 ci/mocks/thunder/Communicator.cpp delete mode 100755 ci/mocks/thunder/Communicator.h delete mode 100755 ci/mocks/thunder/CommunicatorMock.h delete mode 100644 ci/mocks/thunder/DispatcherMock.h delete mode 100644 ci/mocks/thunder/FactoriesImplementation.h delete mode 100644 ci/mocks/thunder/Module.cpp delete mode 100644 ci/mocks/thunder/Module.h delete mode 100644 ci/mocks/thunder/ServiceMock.h delete mode 100644 ci/mocks/thunder/SystemInfo.h delete mode 100755 ci/mocks/thunder/ThunderPortability.h delete mode 100644 ci/mocks/thunder/WorkerPoolImplementation.h delete mode 100644 ci/mocks/thunder/mockauthservices.h diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index eb76f05e..b0634934 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -7,8 +7,9 @@ This is the **ctrlm-main** (Control Manager) plugin — a Thunder/WPEFramework p The `ci/` directory contains **native CI build support files only**. It is not part of the application. - `ci/build_dependencies.sh` / `ci/cov_build.sh` — scripts that build the plugin in a CI container without a full RDK target image -- `ci/mocks/` — minimal stub headers that stand in for platform libraries (IARM, DeviceSettings, RFC, Telemetry, xr-voice-sdk, etc.) that are unavailable in the CI environment. These are **not** production implementations. - `ci/patches/` — temporary patches applied to Thunder/ThunderTools during CI builds only -- `ci/headers/` — empty stub headers generated at CI build time; not committed to source +- `ci/headers/` — empty stub headers and real xr-voice-sdk headers generated/copied at CI build time; not committed to source -When suggesting code or answering questions, treat `ci/mocks/` as CI scaffolding, not as authoritative API definitions. For real API shapes refer to the installed headers under `install/usr/include/` or the upstream repositories (Thunder, entservices-apis, xr-voice-sdk). +Mock/stub headers for platform libraries (IARM, DeviceSettings, RFC, Telemetry, etc.) are sourced from `entservices-testframework/Tests/mocks/` at CI build time, not stored in this repo. Real xr-voice-sdk headers are copied into `ci/headers/xr-voice-sdk/` and placed first on the include path to override those mocks. + +When suggesting code or answering questions, treat CI mocks as scaffolding, not as authoritative API definitions. For real API shapes refer to the installed headers under `install/usr/include/` or the upstream repositories (Thunder, entservices-apis, xr-voice-sdk). diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh index 5bd67561..46c1439d 100644 --- a/ci/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -65,6 +65,9 @@ git clone --depth 1 --branch develop https://github.com/rdkcentral/entservices-a git clone https://github.com/rdkcentral/xr-voice-sdk.git git -C xr-voice-sdk checkout e55c99a0ec947b0ad3efc308bf8e3de0a42140d5 +git clone https://github.com/rdkcentral/entservices-testframework.git +git -C entservices-testframework checkout 584e3ec70fd5e044982910b4eb15c465808bb6d1 + ############################ # 3. Build Thunder-Tools echo "======================================================================================" @@ -144,13 +147,13 @@ mkdir -p "${XRSDK_HEADERS_DIR}" # Copy real xr-voice-sdk headers where control's source matches the real API. # xr_voice_sdk.h is NOT copied: it requires rdkx_logger.h installed types unavailable in source form. -# xr_timestamp.h is NOT copied: control's source uses a pointer-form API that differs from the real by-value API. cp "$GITHUB_WORKSPACE/xr-voice-sdk/src/xr-fdc/xr_fdc.h" "${XRSDK_HEADERS_DIR}/" cp "$GITHUB_WORKSPACE/xr-voice-sdk/src/xr-speech-vrex/xrsv.h" "${XRSDK_HEADERS_DIR}/" cp "$GITHUB_WORKSPACE/xr-voice-sdk/src/xr-speech-router/xrsr.h" "${XRSDK_HEADERS_DIR}/" cp "$GITHUB_WORKSPACE/xr-voice-sdk/src/xr-mq/xr_mq.h" "${XRSDK_HEADERS_DIR}/" cp "$GITHUB_WORKSPACE/xr-voice-sdk/src/xr-speech-vrex/xrsv_http/xrsv_http.h" "${XRSDK_HEADERS_DIR}/" cp "$GITHUB_WORKSPACE/xr-voice-sdk/src/xr-speech-vrex/xrsv_ws_nextgen/xrsv_ws_nextgen.h" "${XRSDK_HEADERS_DIR}/" +cp "$GITHUB_WORKSPACE/xr-voice-sdk/src/xr-timestamp/xr_timestamp.h" "${XRSDK_HEADERS_DIR}/" cd "${HEADERS_DIR}" diff --git a/ci/cov_build.sh b/ci/cov_build.sh index eb3d12f6..de5338de 100644 --- a/ci/cov_build.sh +++ b/ci/cov_build.sh @@ -28,8 +28,8 @@ ls -la ${GITHUB_WORKSPACE} echo "building control (ctrlm-main)" XRSDK_REAL_HEADERS="$GITHUB_WORKSPACE/ci/headers/xr-voice-sdk" -CTRL_STUBS="$GITHUB_WORKSPACE/ci/mocks/control" -MOCK_DIR="$GITHUB_WORKSPACE/ci/mocks" +CTRL_STUBS="$GITHUB_WORKSPACE/entservices-testframework/Tests/mocks/control" +MOCK_DIR="$GITHUB_WORKSPACE/entservices-testframework/Tests/mocks" HEADERS_DIR="$GITHUB_WORKSPACE/ci/headers" EMPTY_JSON="$GITHUB_WORKSPACE/install/usr/include/ctrlm_config_empty.json" diff --git a/ci/mocks/Iarm.h b/ci/mocks/Iarm.h deleted file mode 100644 index ad4a5480..00000000 --- a/ci/mocks/Iarm.h +++ /dev/null @@ -1,923 +0,0 @@ -/** -* If not stated otherwise in this file or this component's LICENSE -* file the following copyright and licenses apply: -* -* Copyright 2026 RDK Management -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -**/ - -#pragma once - -#include -#include - -#include "mfrTypes.h" - -typedef int IARM_EventId_t; - -typedef enum _IARM_Result_t { - IARM_RESULT_SUCCESS, - IARM_RESULT_INVALID_PARAM, - IARM_RESULT_INVALID_STATE, - IARM_RESULT_IPCCORE_FAIL, - IARM_RESULT_OOM, -} IARM_Result_t; - -#define IARM_BUS_DAEMON_NAME "Daemon" - -typedef IARM_Result_t (*IARM_BusCall_t)(void* arg); -typedef void (*IARM_EventHandler_t)(const char* owner, IARM_EventId_t eventId, void* data, size_t len); - -class IarmBusImpl { -public: - virtual ~IarmBusImpl() = default; - - virtual IARM_Result_t IARM_Bus_Init(const char* name) = 0; - virtual IARM_Result_t IARM_Bus_Connect() = 0; - virtual IARM_Result_t IARM_Bus_Disconnect() = 0; - virtual IARM_Result_t IARM_Bus_Term() = 0; - virtual IARM_Result_t IARM_Bus_IsConnected(const char* memberName, int* isRegistered) = 0; - virtual IARM_Result_t IARM_Bus_RegisterEventHandler(const char* ownerName, IARM_EventId_t eventId, IARM_EventHandler_t handler) = 0; - virtual IARM_Result_t IARM_Bus_UnRegisterEventHandler(const char* ownerName, IARM_EventId_t eventId) = 0; - virtual IARM_Result_t IARM_Bus_RemoveEventHandler(const char* ownerName, IARM_EventId_t eventId, IARM_EventHandler_t handler) = 0; - virtual IARM_Result_t IARM_Bus_Call(const char* ownerName, const char* methodName, void* arg, size_t argLen) = 0; - virtual IARM_Result_t IARM_Bus_BroadcastEvent(const char *ownerName, IARM_EventId_t eventId, void *arg, size_t argLen) = 0; - virtual IARM_Result_t IARM_Bus_RegisterCall(const char* methodName, IARM_BusCall_t handler) = 0; - virtual IARM_Result_t IARM_Bus_Call_with_IPCTimeout(const char *ownerName, const char *methodName, void *arg, size_t argLen, int timeout) = 0; -}; - -class IarmBus { -protected: - static IarmBusImpl* impl; -public: - IarmBus(); - IarmBus(const IarmBus &obj) = delete; // deleted copy constructor so that copy of the instance cannot be created. - static void setImpl(IarmBusImpl* newImpl); - static IARM_Result_t IARM_Bus_Init(const char* name); - static IARM_Result_t IARM_Bus_Connect(); - static IARM_Result_t IARM_Bus_Disconnect(); - static IARM_Result_t IARM_Bus_Term(); - static IARM_Result_t IARM_Bus_IsConnected(const char* memberName, int* isRegistered); - static IARM_Result_t IARM_Bus_RegisterEventHandler(const char* ownerName, IARM_EventId_t eventId, IARM_EventHandler_t handler); - static IARM_Result_t IARM_Bus_UnRegisterEventHandler(const char* ownerName, IARM_EventId_t eventId); - static IARM_Result_t IARM_Bus_RemoveEventHandler(const char* ownerName, IARM_EventId_t eventId, IARM_EventHandler_t handler); - static IARM_Result_t IARM_Bus_Call(const char* ownerName, const char* methodName, void* arg, size_t argLen); - static IARM_Result_t IARM_Bus_BroadcastEvent(const char *ownerName, IARM_EventId_t eventId, void *arg, size_t argLen) ; - static IARM_Result_t IARM_Bus_RegisterCall(const char* methodName, IARM_BusCall_t handler); - static IARM_Result_t IARM_Bus_Call_with_IPCTimeout(const char *ownerName, const char *methodName, void *arg, size_t argLen, int timeout); -}; - -extern IARM_Result_t (*IARM_Bus_Init)(const char*); -extern IARM_Result_t (*IARM_Bus_Connect)(); -extern IARM_Result_t (*IARM_Bus_Disconnect)(); -extern IARM_Result_t (*IARM_Bus_Term)(); -extern IARM_Result_t (*IARM_Bus_IsConnected)(const char*,int*); -extern IARM_Result_t (*IARM_Bus_RegisterEventHandler)(const char*,IARM_EventId_t,IARM_EventHandler_t); -extern IARM_Result_t (*IARM_Bus_UnRegisterEventHandler)(const char*,IARM_EventId_t); -extern IARM_Result_t (*IARM_Bus_RemoveEventHandler)(const char*,IARM_EventId_t,IARM_EventHandler_t); -extern IARM_Result_t (*IARM_Bus_Call)(const char*,const char*,void*,size_t); -extern IARM_Result_t (*IARM_Bus_BroadcastEvent)(const char *,IARM_EventId_t,void *,size_t); -extern IARM_Result_t (*IARM_Bus_RegisterCall)(const char*,IARM_BusCall_t); -extern IARM_Result_t (*IARM_Bus_Call_with_IPCTimeout)(const char*,const char*,void*,size_t,int); -/* ctrlm-main uses IARM_Bus_RegisterEvent as a plain function (defined in stubs_iarm.cpp) */ -extern IARM_Result_t IARM_Bus_RegisterEvent(IARM_EventId_t maxEventId); - -#define IARM_BUS_COMMON_API_SysModeChange "SysModeChange" - -typedef enum _IARM_Bus_Daemon_PowerState_t { - IARM_BUS_PWRMGR_POWERSTATE_OFF, - IARM_BUS_PWRMGR_POWERSTATE_STANDBY, - IARM_BUS_PWRMGR_POWERSTATE_ON, - IARM_BUS_PWRMGR_POWERSTATE_STANDBY_LIGHT_SLEEP, - IARM_BUS_PWRMGR_POWERSTATE_STANDBY_DEEP_SLEEP -} IARM_Bus_PowerState_t; - -typedef IARM_Bus_PowerState_t IARM_Bus_PWRMgr_PowerState_t; - -typedef enum _IARM_Bus_Daemon_SysMode_t { - IARM_BUS_SYS_MODE_NORMAL, - IARM_BUS_SYS_MODE_EAS, - IARM_BUS_SYS_MODE_WAREHOUSE -} IARM_Bus_Daemon_SysMode_t; - -#define IARMBUS_AUDIOCAPTUREMGR_NAME "audiocapturemgr" -#define IARMBUS_AUDIOCAPTUREMGR_REQUEST_SAMPLE "requestSample" - -#define IARMBUS_AUDIOCAPTUREMGR_OPEN "open" -#define IARMBUS_AUDIOCAPTUREMGR_CLOSE "close" -#define IARMBUS_AUDIOCAPTUREMGR_START "start" -#define IARMBUS_AUDIOCAPTUREMGR_STOP "stop" -#define IARMBUS_AUDIOCAPTUREMGR_GET_DEFAULT_AUDIO_PROPS "getDefaultAudioProperties" -#define IARMBUS_AUDIOCAPTUREMGR_GET_AUDIO_PROPS "getAudioProperties" -#define IARMBUS_AUDIOCAPTUREMGR_GET_OUTPUT_PROPS "getOutputProperties" -#define IARMBUS_AUDIOCAPTUREMGR_SET_AUDIO_PROPERTIES "setAudioProperties" -#define IARMBUS_AUDIOCAPTUREMGR_SET_OUTPUT_PROPERTIES "setOutputProperties" - -#define AUDIOCAPTUREMGR_FILENAME_PREFIX "audio_sample" -#define AUDIOCAPTUREMGR_FILE_PATH "/opt/" - -#define DATA_CAPTURE_IARM_EVENT_AUDIO_CLIP_READY 100 - -#define ACM_RESULT_GENERAL_FAILURE 0 -#define ACM_RESULT_PRECAPTURE_NOT_SUPPORTED 1 -#define ACM_RESULT_STREAM_UNAVAILABLE 2 -#define ACM_RESULT_DURATION_OUT_OF_BOUNDS 3 -#define BUFFERED_FILE_OUTPUT "" - -enum Format { - acmFormate16BitStereo, - acmFormate16BitMonoLeft, - acmFormate16BitMonoRight, - acmFormate16BitMono, - acmFormate24BitStereo, - acmFormate24Bit5_1 -}; - -enum Sampling_frequency { - acmFreqe48000, - acmFreqe44100, - acmFreqe32000, - acmFreqe24000, - acmFreqe16000 -}; - -namespace audiocapturemgr { -using session_id_t = int; - -struct audio_properties_ifce_t { - Format format; - Sampling_frequency sampling_frequency; -}; -} - -struct iarmbus_notification_payload_t { - char dataLocator[64]; -}; - -struct iarmbus_acm_arg_t { - struct iarmbus_open_args { - int source; - std::string output_type; - }; - - struct iarmbus_request_payload_t { - float duration; - bool is_precapture; - }; - - struct output_t { - unsigned int buffer_duration; - unsigned int max_buffer_duration; - }; - - struct arg_output_props_t { - output_t output; - }; - - struct Details { - iarmbus_open_args arg_open; - audiocapturemgr::audio_properties_ifce_t arg_audio_properties; - iarmbus_request_payload_t arg_sample_request; - arg_output_props_t arg_output_props; - }; - - int session_id; - int result; - Details details; -}; - -#define IARM_BUS_CECMGR_NAME "CECMgr" -#define IARM_BUS_CECMGR_MAX_DATA_LENGTH 62 -#define IARM_BUS_CECMGR_API_Send "Send" - -typedef struct _IARM_Bus_CECMgr_Send_Param_t { - uint8_t length; - uint8_t data[IARM_BUS_CECMGR_MAX_DATA_LENGTH + 1]; - uint8_t retVal; -} IARM_Bus_CECMgr_Send_Param_t; - -#define IARM_BUS_DEEPSLEEPMGR_NAME "DEEPSLEEPMgr" - -#define IARM_BUS_DEEPSLEEPMGR_API_GetLastWakeupReason "GetLastWakeupReason" -#define IARM_BUS_DEEPSLEEPMGR_API_GetLastWakeupKeyCode "GetLastWakeupKeycode" - -typedef enum _DeepSleep_WakeupReason_t { - DEEPSLEEP_WAKEUPREASON_IR = 0, - DEEPSLEEP_WAKEUPREASON_RCU_BT, - DEEPSLEEP_WAKEUPREASON_RCU_RF4CE, - DEEPSLEEP_WAKEUPREASON_GPIO, - DEEPSLEEP_WAKEUPREASON_LAN, - DEEPSLEEP_WAKEUPREASON_WLAN, - DEEPSLEEP_WAKEUPREASON_TIMER, - DEEPSLEEP_WAKEUPREASON_FRONT_PANEL, - DEEPSLEEP_WAKEUPREASON_WATCHDOG, - DEEPSLEEP_WAKEUPREASON_SOFTWARE_RESET, - DEEPSLEEP_WAKEUPREASON_THERMAL_RESET, - DEEPSLEEP_WAKEUPREASON_WARM_RESET, - DEEPSLEEP_WAKEUPREASON_COLDBOOT, - DEEPSLEEP_WAKEUPREASON_STR_AUTH_FAILURE, - DEEPSLEEP_WAKEUPREASON_CEC, - DEEPSLEEP_WAKEUPREASON_PRESENCE, - DEEPSLEEP_WAKEUPREASON_VOICE, - DEEPSLEEP_WAKEUPREASON_UNKNOWN -} DeepSleep_WakeupReason_t; - -typedef struct _DeepSleepMgr_WakeupKeyCode_Param_t { - unsigned int keyCode; -} DeepSleepMgr_WakeupKeyCode_Param_t; - -#define IARM_BUS_MFRLIB_NAME "MFRLib" -#define IARM_BUS_MFRLIB_API_SetBootLoaderPattern "mfrSetBootloaderPattern" -#define IARM_BUS_MFRLIB_API_SetBlSplashScreen "mfrSetBlSplashScreen" -#define IARM_BUS_MFRLIB_API_GetSerializedData "mfrGetManufacturerData" -#define IARM_BUS_MFRLIB_API_SetFsrFlag "mfrSetFSRflag" -#define IARM_BUS_MFRLIB_API_GetFsrFlag "mfrGetFSRflag" -#define IARM_BUS_MFRLIB_API_GetTemperature "mfrGetTemperature" /*!< Gets the thermal temperature for the device*/ -#define IARM_BUS_MFRLIB_API_SetTemperatureThresholds "mfrSetTempThresholds" /*!< Sets the thermal threshold for the device*/ -#define IARM_BUS_MFRLIB_API_GetTemperatureThresholds "mfrGetTempThresholds" /*!< Gets the thermal threshold for the device*/ - -typedef struct _IARM_Bus_MFRLib_SetBLPattern_Param_t { - mfrBlPattern_t pattern; -} IARM_Bus_MFRLib_SetBLPattern_Param_t; - -typedef struct _IARM_Bus_MFRLib_GetSerializedData_Param_t { - mfrSerializedType_t type; - char buffer[1280]; - int bufLen; -} IARM_Bus_MFRLib_GetSerializedData_Param_t; - -#define PWRMGR_MAX_REBOOT_REASON_LENGTH 100 - -#define MAX_PWR_STATE_BEF_REBOOR_STR_LEN (32) -#define IARM_BUS_PWRMGR_API_GetPowerStateBeforeReboot "GetPowerStateBeforeReboot" -#define IARM_BUS_PWRMGR_API_SetStandbyVideoState "SetStandbyVideoState" -#define IARM_BUS_PWRMGR_API_GetStandbyVideoState "GetStandbyVideoState" -#define IARM_BUS_PWRMGR_API_SetNetworkStandbyMode "SetNetworkStandbyMode" -#define IARM_BUS_PWRMGR_API_GetNetworkStandbyMode "GetNetworkStandbyMode" -#define IARM_BUS_PWRMGR_API_Reboot "performReboot" -#define IARM_BUS_PWRMGR_API_WareHouseClear "WarehouseClear" /*!< */ -#define IARM_BUS_PWRMGR_API_ColdFactoryReset "ColdFactoryReset" /*!< Reset the box to cold factory state*/ -#define IARM_BUS_PWRMGR_API_FactoryReset "FactoryReset" /*!< Reset the box to factory state*/ -#define IARM_BUS_PWRMGR_API_UserFactoryReset "UserFactoryReset" /*!< Reset the box to user factory state*/ -#define IARM_BUS_PWRMGR_API_WareHouseReset "WareHouseReset" /*!< Reset the box to warehouse state*/ - -typedef struct _IARM_Bus_PWRMgr_NetworkStandbyMode_Param_t { - bool bStandbyMode; -} IARM_Bus_PWRMgr_NetworkStandbyMode_Param_t; - -typedef struct _IARM_Bus_PWRMgr_GetPowerStateBeforeReboot_Param_t { - char powerStateBeforeReboot[MAX_PWR_STATE_BEF_REBOOR_STR_LEN]; -} IARM_Bus_PWRMgr_GetPowerStateBeforeReboot_Param_t; - -typedef struct _IARM_Bus_PWRMgr_SetDeepSleepTimeOut_Param_t { - unsigned int timeout; -} IARM_Bus_PWRMgr_SetDeepSleepTimeOut_Param_t; - -typedef enum _IARM_Bus_PWRMgr_ThermalState_t { - IARM_BUS_PWRMGR_TEMPERATURE_NORMAL = 0, - IARM_BUS_PWRMGR_TEMPERATURE_HIGH, - IARM_BUS_PWRMGR_TEMPERATURE_CRITICAL -} IARM_Bus_PWRMgr_ThermalState_t; - -typedef enum _WakeupSrcType_t { - WAKEUPSRC_VOICE = 0, - WAKEUPSRC_PRESENCE_DETECTION, - WAKEUPSRC_BLUETOOTH, - WAKEUPSRC_WIFI, - WAKEUPSRC_IR, - WAKEUPSRC_POWER_KEY, - WAKEUPSRC_TIMER, - WAKEUPSRC_CEC, - WAKEUPSRC_LAN, - WAKEUPSRC_MAX -} WakeupSrcType_t; - -typedef struct _PWRMgr_EventData_t { - union { - struct _MODE_DATA { - IARM_Bus_PWRMgr_PowerState_t curState; - IARM_Bus_PWRMgr_PowerState_t newState; - uint32_t deep_sleep_timeout; - bool nwStandbyMode; - } state; - struct _THERM_DATA { - IARM_Bus_PWRMgr_ThermalState_t curLevel; - IARM_Bus_PWRMgr_ThermalState_t newLevel; - float curTemperature; - } therm; - bool bNetworkStandbyMode; - int32_t reset_sequence_progress; - } data; -} IARM_Bus_PWRMgr_EventData_t; - -typedef struct _IARM_Bus_PWRMgr_GetThermalState_Param_t { - IARM_Bus_PWRMgr_ThermalState_t curLevel; - float curTemperature; -} IARM_Bus_PWRMgr_GetThermalState_Param_t; - -typedef struct _IARM_Bus_PWRMgr_GetTempThresholds_Param_t { - float tempHigh; - float tempCritical; -} IARM_Bus_PWRMgr_GetTempThresholds_Param_t; - -typedef struct _IARM_Bus_PWRMgr_SetTempThresholds_Param_t { - float tempHigh; - float tempCritical; -} IARM_Bus_PWRMgr_SetTempThresholds_Param_t; - -typedef struct _IARM_Bus_PWRMgr_GetOvertempGraceInterval_Param_t { - int graceInterval; -} IARM_Bus_PWRMgr_GetOvertempGraceInterval_Param_t; - -typedef struct _IARM_Bus_PWRMgr_SetOvertempGraceInterval_Param_t { - int graceInterval; -} IARM_Bus_PWRMgr_SetOvertempGraceInterval_Param_t; - -typedef struct _IARM_Bus_CommonAPI_SysModeChange_Param_t { - IARM_Bus_Daemon_SysMode_t oldMode; - IARM_Bus_Daemon_SysMode_t newMode; -} IARM_Bus_CommonAPI_SysModeChange_Param_t; - -typedef enum _PWRMgr_EventId_t { - IARM_BUS_PWRMGR_EVENT_MODECHANGED = 0, - IARM_BUS_PWRMGR_EVENT_DEEPSLEEP_TIMEOUT, - IARM_BUS_PWRMGR_EVENT_RESET_SEQUENCE, - IARM_BUS_PWRMGR_EVENT_REBOOTING, - IARM_BUS_PWRMGR_EVENT_THERMAL_MODECHANGED, - IARM_BUS_PWRMGR_EVENT_WAREHOUSEOPS_STATUSCHANGED, - IARM_BUS_PWRMGR_EVENT_NETWORK_STANDBYMODECHANGED, - IARM_BUS_PWRMGR_EVENT_MAX, - IARM_BUS_DSMGR_EVENT_ATMOS_CAPS_CHANGED, -} IARM_Bus_PWRMgr_EventId_t; - -typedef struct _IARM_Bus_PWRMgr_RebootParam_t { - char reboot_reason_custom[PWRMGR_MAX_REBOOT_REASON_LENGTH]; - char reboot_reason_other[PWRMGR_MAX_REBOOT_REASON_LENGTH]; - char requestor[PWRMGR_MAX_REBOOT_REASON_LENGTH]; -} IARM_Bus_PWRMgr_RebootParam_t; - -#define IARM_BUS_PWRMGR_NAME "PWRMgr" -#define IARM_BUS_PWRMGR_API_SetPowerState "SetPowerState" -#define IARM_BUS_PWRMGR_API_GetPowerState "GetPowerState" - -typedef struct _IARM_Bus_PWRMgr_SetPowerState_Param_t { - IARM_Bus_PWRMgr_PowerState_t newState; - int keyCode; -} IARM_Bus_PWRMgr_SetPowerState_Param_t; - -typedef struct _IARM_Bus_PWRMgr_GetPowerState_Param_t { - IARM_Bus_PWRMgr_PowerState_t curState; - IARM_Bus_PowerState_t prevState; -} IARM_Bus_PWRMgr_GetPowerState_Param_t; - -typedef struct _IARM_BUS_PWRMgr_DeepSleepTimeout_EventData_t { - unsigned int timeout; /*!< Timeout for deep sleep in seconds*/ -} IARM_BUS_PWRMgr_DeepSleepTimeout_EventData_t; - -#define IARM_BUS_PWRMGR_API_GetThermalState "GetThermalState" -#define IARM_BUS_PWRMGR_API_GetTemperatureThresholds "GetTemperatureThresholds" -#define IARM_BUS_PWRMGR_API_SetTemperatureThresholds "SetTemperatureThresholds" -#define IARM_BUS_PWRMGR_API_GetOvertempGraceInterval "GetOvertempGraceInterval" -#define IARM_BUS_PWRMGR_API_SetOvertempGraceInterval "SetOvertempGraceInterval" -#define IARM_BUS_PWRMGR_API_GetLastWakeupReason "GetLastWakeupReason" -#define IARM_BUS_PWRMGR_API_GetLastWakeupKeyCode "GetLastWakeupKeyCode" - -/** - * @brief Structure which holds the wakeup source type and the value to be set and the power state. - */ -typedef struct _IARM_Bus_PWRMgr_WakeupSrcConfig_Param_t{ - uint32_t pwrMode; - uint32_t srcType; - uint32_t config; -} IARM_Bus_PWRMgr_WakeupSrcConfig_Param_t; -/** - * @brief Structure which holds the ware house reset time. - */ -typedef struct _IARM_Bus_PWRMgr_WareHouseReset_Param_t { - bool suppressReboot; /*!< STB should not be rebooted */ -} IARM_Bus_PWRMgr_WareHouseReset_Param_t; - -/** - * @brief Enumerator which represents the possible warehouse ops - */ -typedef enum _IARM_Bus_PWRMgr_WareHouseOpsStatus_t{ - IARM_BUS_PWRMGR_WAREHOUSE_COMPLETED = 0, /* warehouse operation completed sucessfully */ - IARM_BUS_PWRMGR_WAREHOUSE_INPROGRESS, /* warehouse operation in progress*/ - IARM_BUS_PWRMGR_WAREHOUSE_FAILED, /* warehouse operation failed.*/ -} IARM_Bus_PWRMgr_WareHouseOpsStatus_t; - -/** - * @brief Enumerator which represents the possible warehouse ops - */ -typedef enum _IARM_Bus_PWRMgr_WareHouseOps_t{ - IARM_BUS_PWRMGR_WAREHOUSE_RESET = 0, /* warehouse reset */ - IARM_BUS_PWRMGR_WAREHOUSE_CLEAR, /* warehouse clear*/ -} IARM_Bus_PWRMgr_WareHouseOps_t; - -/** - * @brief Structure which holds warehouse opn status value. - */ -typedef struct _IARM_BUS_PWRMgr_WareHouseOpn_EventData_t { - IARM_Bus_PWRMgr_WareHouseOps_t wareHouseOpn; /*!< WareHouse operation*/ - IARM_Bus_PWRMgr_WareHouseOpsStatus_t status; /*!< WareHouse operation status*/ -} IARM_BUS_PWRMgr_WareHouseOpn_EventData_t; - -#define IARM_BUS_PWRMGR_API_SetWakeupSrcConfig "setWakeupSrcConfig" -#define IARM_BUS_PWRMGR_API_GetWakeupSrcConfig "getWakeupSrcConfig" /*!< gets wakup configuration*/ - -#define IARM_BUS_SYSMGR_NAME "SYSMgr" -#define IARM_BUS_SYSMGR_API_GetSystemStates "GetSystemStates" - -/** - * @brief Structure which holds RFC device management update information. - */ -typedef struct _IARM_BUS_SYSMGR_DeviceMgtUpdateInfo_Param_t -{ - char source[10]; /*!< Device Management Update source. Ex: rfc */ - char type[10]; /*!< Device Management Update type. Ex: initial */ - bool status; /*!< Device Management Update status. true/false */ -} IARM_BUS_SYSMGR_DeviceMgtUpdateInfo_Param_t; - -typedef enum _SYSMgr_EventId_t { - IARM_BUS_SYSMGR_EVENT_SYSTEMSTATE, - IARM_BUS_SYSMGR_EVENT_XUPNP_DATA_REQUEST, /*!< Xupnp data request frm Receiver to UPNP*/ - IARM_BUS_SYSMGR_EVENT_XUPNP_DATA_UPDATE, /*!< Xupnp data frm UPNP to Receiver*/ - IARM_BUS_SYSMGR_EVENT_IMAGE_DNLD, /*Image download status to Receiver */ - IARM_BUS_SYSMGR_EVENT_CARD_FWDNLD, /*!< CARD FW download event to Receiver - Valid on some product's CA*/ - IARM_BUS_SYSMGR_EVENT_HDCP_PROFILE_UPDATE, /*!< HDCP Profile Update */ - IARM_BUS_SYSMGR_EVENT_INTRUSION, /*!< Intrusion Detection */ - IARM_BUS_SYSMGR_EVENT_EISS_FILTER_STATUS, /*!< EISS Filter status event */ - IARM_BUS_SYSMGR_EVENT_EISS_APP_ID_UPDATE, /*!< EISS App ID update */ - IARM_BUS_SYSMGR_EVENT_KEYCODE_LOGGING_CHANGED, /*!< Key Code logging status update */ - IARM_BUS_SYSMGR_EVENT_USB_MOUNT_CHANGED, /*!< Fires when USB mounts change */ - IARM_BUS_SYSMGR_EVENT_APP_RELEASE_FOCUS, /*!< Application fires event to release focus*/ - IARM_BUS_SYSMGR_EVENT_DEVICE_UPDATE_RECEIVED, /*!< Received Device Management update information */ - IARM_BUS_SYSMGR_EVENT_MAX /*!< Max Event Id */ -} IARM_Bus_SYSMgr_EventId_t; - -typedef struct _IARM_BUS_SYSMGR_KEYCodeLoggingInfo_Param_t { - int logStatus; /*!< HDCP Profile Data */ -} IARM_BUS_SYSMGR_KEYCodeLoggingInfo_Param_t; - -#define IARM_BUS_SYSMGR_API_GetKeyCodeLoggingPref "GetKeyCodeLoggingPref" -#define IARM_BUS_SYSMGR_API_SetKeyCodeLoggingPref "SetKeyCodeLoggingPref" - -typedef enum _SYSMgr_SystemState_t { - IARM_BUS_SYSMGR_SYSSTATE_CHANNELMAP, //0 - IARM_BUS_SYSMGR_SYSSTATE_DISCONNECTMGR, //1 - IARM_BUS_SYSMGR_SYSSTATE_TUNEREADY, //2 - IARM_BUS_SYSMGR_SYSSTATE_EXIT_OK, //3 - IARM_BUS_SYSMGR_SYSSTATE_CMAC, //4 - IARM_BUS_SYSMGR_SYSSTATE_MOTO_ENTITLEMENT, //5 - IARM_BUS_SYSMGR_SYSSTATE_MOTO_HRV_RX, //6 - IARM_BUS_SYSMGR_SYSSTATE_CARD_CISCO_STATUS, //7 - IARM_BUS_SYSMGR_SYSSTATE_VIDEO_PRESENTING, //8 - IARM_BUS_SYSMGR_SYSSTATE_HDMI_OUT, //9 - IARM_BUS_SYSMGR_SYSSTATE_HDCP_ENABLED, //10 - IARM_BUS_SYSMGR_SYSSTATE_HDMI_EDID_READ, //11 - IARM_BUS_SYSMGR_SYSSTATE_FIRMWARE_DWNLD, //12 - IARM_BUS_SYSMGR_SYSSTATE_TIME_SOURCE, //13 - IARM_BUS_SYSMGR_SYSSTATE_TIME_ZONE, //14 - IARM_BUS_SYSMGR_SYSSTATE_CA_SYSTEM, //15 - IARM_BUS_SYSMGR_SYSSTATE_ESTB_IP, //16 - IARM_BUS_SYSMGR_SYSSTATE_ECM_IP, //17 - IARM_BUS_SYSMGR_SYSSTATE_LAN_IP, //18 - IARM_BUS_SYSMGR_SYSSTATE_MOCA, //19 - IARM_BUS_SYSMGR_SYSSTATE_DOCSIS, //20 - IARM_BUS_SYSMGR_SYSSTATE_DSG_BROADCAST_CHANNEL, //21 - IARM_BUS_SYSMGR_SYSSTATE_DSG_CA_TUNNEL, //22 - IARM_BUS_SYSMGR_SYSSTATE_CABLE_CARD, //23 - IARM_BUS_SYSMGR_SYSSTATE_CABLE_CARD_DWNLD, //24 - IARM_BUS_SYSMGR_SYSSTATE_CVR_SUBSYSTEM, //25 - IARM_BUS_SYSMGR_SYSSTATE_DOWNLOAD, //26 - IARM_BUS_SYSMGR_SYSSTATE_VOD_AD, //27 - IARM_BUS_SYSMGR_SYSSTATE_DAC_INIT_TIMESTAMP, //28 - IARM_BUS_SYSMGR_SYSSTATE_CABLE_CARD_SERIAL_NO, //29 - IARM_BUS_SYSMGR_SYSSTATE_ECM_MAC, //30 - IARM_BUS_SYSMGR_SYSSTATE_DAC_ID, //31 - IARM_BUS_SYSMGR_SYSSTATE_PLANT_ID, //32 - IARM_BUS_SYSMGR_SYSSTATE_STB_SERIAL_NO, //33 - IARM_BUS_SYSMGR_SYSSTATE_BOOTUP, //34 - IARM_BUS_SYSMGR_SYSSTATE_GATEWAY_CONNECTION, //35 - IARM_BUS_SYSMGR_SYSSTATE_DST_OFFSET, //36 - IARM_BUS_SYSMGR_SYSSTATE_RF_CONNECTED, //37 - IARM_BUS_SYSMGR_SYSSTATE_PARTNERID_CHANGE, //38 - IARM_BUS_SYSMGR_SYSSTATE_IP_MODE, //39 - IARM_BUS_SYSMGR_SYSSTATE_LP_CONNECTION_RESET, //40 - IARM_BUS_SYSMGR_SYSSTATE_RWS_CONNECTION_RESET, //41 - IARM_BUS_SYSMGR_SYSSTATE_QAM_READY, //42 - IARM_BUS_SYSMGR_SYSSTATE_FIRMWARE_UPDATE_STATE, //43, Added as part of RDK-19978, As the IARM - IARM_BUS_SYSMGR_SYSSTATE_USB_DETECTED, //44 - IARM_BUS_SYSMGR_SYSSTATE_LOG_UPLOAD, //45 -} IARM_Bus_SYSMgr_SystemState_t; - -typedef enum _SYSMgr_FirmwareUpdateState_t { - IARM_BUS_SYSMGR_FIRMWARE_UPDATE_STATE_UNINITIALIZED = 0, - IARM_BUS_SYSMGR_FIRMWARE_UPDATE_STATE_REQUESTING = 1, - IARM_BUS_SYSMGR_FIRMWARE_UPDATE_STATE_DOWNLOADING = 2, - IARM_BUS_SYSMGR_FIRMWARE_UPDATE_STATE_FAILED = 3, - IARM_BUS_SYSMGR_FIRMWARE_UPDATE_STATE_DOWNLOAD_COMPLETE = 4, - IARM_BUS_SYSMGR_FIRMWARE_UPDATE_STATE_VALIDATION_COMPLETE = 5, - IARM_BUS_SYSMGR_FIRMWARE_UPDATE_STATE_PREPARING_TO_REBOOT = 6, - IARM_BUS_SYSMGR_FIRMWARE_UPDATE_STATE_ONHOLD_FOR_OPTOUT = 7, /* On Hold for opt-out */ - IARM_BUS_SYSMGR_FIRMWARE_UPDATE_STATE_CRITICAL_REBOOT = 8, - IARM_BUS_SYSMGR_FIRMWARE_UPDATE_STATE_NO_UPGRADE_REQUIRED = 9 -} IARM_Bus_SYSMGR_FirmwareUpdateState_t; - -typedef enum _SYSMgr_LogUpload_t -{ - IARM_BUS_SYSMGR_LOG_UPLOAD_SUCCESS = 0, - IARM_BUS_SYSMGR_LOG_UPLOAD_FAILED = 1, - IARM_BUS_SYSMGR_LOG_UPLOAD_ABORTED = 2, -} IARM_Bus_SYSMGR_SYSMgr_LogUpload_t; - -typedef struct _IARM_BUS_SYSMgr_EventData_t { - union { - struct _CARD_FWDNLD_DATA { - char eventType; - char status; - } cardFWDNLD; - struct _IMAGE_FWDNLD_DATA { - char status; - } imageFWDNLD; - struct _XUPNP_DATA { - unsigned long deviceInfoLength; - } xupnpData; - struct _HDCP_PROFILE { - unsigned int hdcpProfile; - } hdcpProfileData; - struct _SystemStates { - IARM_Bus_SYSMgr_SystemState_t stateId; - int state; - int error; - char payload[128]; - } systemStates; - struct _EISS_STATUS { - int filterStatus; - } eissEventData; - struct _EISS_APP_ID { - unsigned char idList[4][6]; - int count; - } eissAppIDList; - struct _KEY_CODE_LOG { - int logStatus; - } keyCodeLogData; - struct _USB_MOUNT { - int mounted; - char device[128]; - char dir[256]; - } usbMountData; - - } data; -} IARM_Bus_SYSMgr_EventData_t; - -typedef struct _propertyValue { - int state; - int error; - char payload[128]; -} state_property; - -typedef struct _IARM_Bus_SYSMgr_GetSystemStates_Param_t { - state_property channel_map; - state_property disconnect_mgr_state; - state_property TuneReadyStatus; - state_property exit_ok_key_sequence; - state_property cmac; - state_property card_moto_entitlements; - state_property card_moto_hrv_rx; - state_property dac_init_timestamp; - state_property card_cisco_status; - state_property video_presenting; - state_property hdmi_out; - state_property hdcp_enabled; - state_property hdmi_edid_read; - state_property firmware_download; - state_property time_source; - state_property time_zone_available; - state_property ca_system; - state_property estb_ip; - state_property ecm_ip; - state_property lan_ip; - state_property moca; - state_property docsis; - state_property dsg_broadcast_tunnel; - state_property dsg_ca_tunnel; - state_property cable_card; - state_property cable_card_download; - state_property cvr_subsystem; - state_property download; - state_property vod_ad; - state_property card_serial_no; - state_property ecm_mac; - state_property dac_id; - state_property plant_id; - state_property stb_serial_no; - state_property bootup; - state_property dst_offset; - state_property rf_connected; - state_property ip_mode; - state_property qam_ready_status; - state_property firmware_update_state; -} IARM_Bus_SYSMgr_GetSystemStates_Param_t; - -#define IARM_BUS_DSMGR_NAME "DSMgr" - -/*! Events published from DS Mananger */ -typedef enum _DSMgr_EventId_t { - IARM_BUS_DSMGR_EVENT_RES_PRECHANGE = 0, /*!< Resolution Pre Change Event */ - IARM_BUS_DSMGR_EVENT_RES_POSTCHANGE, /*!< Resolution Post Change Event */ - IARM_BUS_DSMGR_EVENT_ZOOM_SETTINGS, /*!< Zoom Settings Events */ - IARM_BUS_DSMGR_EVENT_HDMI_HOTPLUG, /*!< HDMI HPD DETECT Change Event */ - IARM_BUS_DSMGR_EVENT_AUDIO_MODE, /*!< HDMI HPD DETECT Change Event */ - IARM_BUS_DSMGR_EVENT_HDCP_STATUS, /*!< HDMI HDCP status */ - IARM_BUS_DSMGR_EVENT_RX_SENSE, /*!< HDMI Rx Sense status */ - IARM_BUS_DSMGR_EVENT_HDMI_IN_HOTPLUG, /*!< HDMI IN HPD change event */ - IARM_BUS_DSMGR_EVENT_HDMI_IN_SIGNAL_STATUS, /*!< HDMI IN signal status change event */ - IARM_BUS_DSMGR_EVENT_HDMI_IN_STATUS, /*!< HDMI IN status change event */ - IARM_BUS_DSMGR_EVENT_HDMI_IN_AV_LATENCY, /*!< HDMI IN AV Latency Event */ - IARM_BUS_DSMGR_EVENT_HDMI_IN_VIDEO_MODE_UPDATE, /*!< HDMI IN video mode update event */ - IARM_BUS_DSMGR_EVENT_HDMI_IN_ALLM_STATUS, /*!< HDMI IN ALLM mode update event */ - IARM_BUS_DSMGR_EVENT_HDMI_IN_VRR_STATUS, /*!< HDMI IN VRR mode update event */ - IARM_BUS_DSMGR_EVENT_COMPOSITE_IN_HOTPLUG, /*!< COMPOSITE IN HPD change event */ - IARM_BUS_DSMGR_EVENT_COMPOSITE_IN_SIGNAL_STATUS, /*!< COMPOSITE IN signal status change event */ - IARM_BUS_DSMGR_EVENT_COMPOSITE_IN_STATUS, /*!< COMPOSITE IN status change event */ - IARM_BUS_DSMGR_EVENT_COMPOSITE_IN_VIDEO_MODE_UPDATE, /*!< COMPOSITE IN Video Mode change event */ - IARM_BUS_DSMGR_EVENT_TIME_FORMAT_CHANGE, /*!< Clock Time Format Change Event*/ - IARM_BUS_DSMGR_EVENT_AUDIO_LEVEL_CHANGED, /*!< Audio Level Change Event*/ - IARM_BUS_DSMGR_EVENT_AUDIO_OUT_HOTPLUG, /*!< AUDIO OUT HPD change event */ - IARM_BUS_DSMGR_EVENT_AUDIO_FORMAT_UPDATE, /*!< Audio Format change event */ - IARM_BUS_DSMGR_EVENT_AUDIO_PRIMARY_LANGUAGE_CHANGED, /*!< Audio Primary Language change event */ - IARM_BUS_DSMGR_EVENT_AUDIO_SECONDARY_LANGUAGE_CHANGED, /*!< Audio Secondary Language change event */ - IARM_BUS_DSMGR_EVENT_AUDIO_FADER_CONTROL_CHANGED, /*!< Audio Fader Control change event */ - IARM_BUS_DSMGR_EVENT_AUDIO_ASSOCIATED_AUDIO_MIXING_CHANGED, /*!< Audio Associated Audio Mixing change event */ - IARM_BUS_DSMGR_EVENT_VIDEO_FORMAT_UPDATE, /*!< Video Format change event */ - IARM_BUS_DSMGR_EVENT_DISPLAY_FRAMRATE_PRECHANGE, /*!< Frame rate pre change */ - IARM_BUS_DSMGR_EVENT_DISPLAY_FRAMRATE_POSTCHANGE, /*!< Frame rate post change */ - IARM_BUS_DSMGR_EVENT_AUDIO_PORT_STATE, /*!< Audio Port Init State */ - IARM_BUS_DSMGR_EVENT_SLEEP_MODE_CHANGED, /*!< Sleep Mode Change Event*/ - IARM_BUS_DSMGR_EVENT_HDMI_IN_AVI_CONTENT_TYPE, /*Register(__VA_ARGS__) -#endif - -/* Netsrvmgr Based Macros & Structures */ -typedef struct _IARM_BUS_NetSrvMgr_Iface_EventData_t { - union { - char activeIface[INTERFACE_SIZE]; - char allNetworkInterfaces[INTERFACE_LIST]; - char setInterface[INTERFACE_SIZE]; - char activeIfaceIpaddr[MAX_IP_ADDRESS_LEN]; - }; - char interfaceCount; - bool isInterfaceEnabled; - bool persist; - char ipfamily[MAX_IP_FAMILY_SIZE]; -} IARM_BUS_NetSrvMgr_Iface_EventData_t; - -#define IARM_BUS_SYSMGR_API_RunScript "RunScript" -/*! Parameter for RunScript call*/ -typedef struct _IARM_Bus_SYSMgr_RunScript_t{ - char script_path [256]; //[in] Null terminated path name of the script. - int return_value; //[out] Returns the ret value of system. -} IARM_Bus_SYSMgr_RunScript_t; - -typedef enum _CECMgr_EventId_t { - IARM_BUS_CECMGR_EVENT_SEND, - IARM_BUS_CECMGR_EVENT_RECV, - IARM_BUS_CECMGR_EVENT_ENABLE, - IARM_BUS_CECMGR_EVENT_DAEMON_INITIALIZED, - IARM_BUS_CECMGR_EVENT_MAX, - IARM_BUS_CECMGR_EVENT_STATUS_UPDATED -} IARM_Bus_CECMgr_EventId_t; - -typedef enum _IARM_Bus_MFRLib_ThermalState_t{ - IARM_BUS_TEMPERATURE_NORMAL = 0, /* Temp is within normal operating range */ - IARM_BUS_TEMPERATURE_HIGH, /* Temp is high, but just a warning as device can still operate */ - IARM_BUS_TEMPERATURE_CRITICAL /* Temp is critical, should trigger a thermal reset */ -} IARM_Bus_MFRLib_CurThermalState_t; - -typedef struct _IARM_Bus_CECMgr_Status_Updated_Param_t -{ - int logicalAddress; -}IARM_Bus_CECMgr_Status_Updated_Param_t; - -typedef struct _IARM_Bus_MFRLib_SetBLSplashScreen_Param{ - char path[255]; -} IARM_Bus_MFRLib_SetBLSplashScreen_Param_t; - -typedef struct _IARM_Bus_MFRLib_ThermalSoCTemp_Param_t{ - IARM_Bus_MFRLib_CurThermalState_t curState; /* !< Current Thermal level */ - int curSoCTemperature; /* !< Current SoC temperature value */ - int curWiFiTemperature; /* !< Current WiFi temperature value */ - int highTemp; /* !< New threshold at which TEMPERATURE_HIGH will be reported */ - int criticalTemp; /* !< New threshold at which TEMPERATURE_CRITICAL will be reported */ -} IARM_Bus_MFRLib_ThermalSoCTemp_Param_t; - -typedef bool IARM_Bus_MFRLib_FsrFlag_Param_t; // true or false - -#define IARM_BUS_CECMGR_API_isAvailable "isAvailable" -#define IARM_BUS_DSMGR_API_dsHdmiInGetNumberOfInputs "dsHdmiInGetNumberOfInputs" -#define IARM_BUS_DSMGR_API_dsHdmiInGetStatus "dsHdmiInGetStatus" -#define IARM_BUS_DSMGR_API_dsGetHDMIARCPortId "dsGetHDMIARCPortId" -#define IARM_BUS_DSMGR_API_SetStandbyVideoState "dsSetStandbyVideoState" -#define IARM_BUS_DSMGR_API_GetStandbyVideoState "dsGetStandbyVideoState" diff --git a/ci/mocks/Rfc.h b/ci/mocks/Rfc.h deleted file mode 100644 index 2354f194..00000000 --- a/ci/mocks/Rfc.h +++ /dev/null @@ -1,114 +0,0 @@ -/** -* If not stated otherwise in this file or this component's LICENSE -* file the following copyright and licenses apply: -* -* Copyright 2026 RDK Management -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -**/ - -#pragma once - -typedef enum { - WDMP_SUCCESS = 0, /**< Success. */ - WDMP_FAILURE, /**< General Failure */ - WDMP_ERR_TIMEOUT, - WDMP_ERR_NOT_EXIST, - WDMP_ERR_INVALID_PARAMETER_NAME, - WDMP_ERR_INVALID_PARAMETER_TYPE, - WDMP_ERR_INVALID_PARAMETER_VALUE, - WDMP_ERR_NOT_WRITABLE, - WDMP_ERR_SETATTRIBUTE_REJECTED, - WDMP_ERR_REQUEST_REJECTED, - WDMP_ERR_NAMESPACE_OVERLAP, - WDMP_ERR_UNKNOWN_COMPONENT, - WDMP_ERR_NAMESPACE_MISMATCH, - WDMP_ERR_UNSUPPORTED_NAMESPACE, - WDMP_ERR_DP_COMPONENT_VERSION_MISMATCH, - WDMP_ERR_INVALID_PARAM, - WDMP_ERR_UNSUPPORTED_DATATYPE, - WDMP_STATUS_RESOURCES, - WDMP_ERR_WIFI_BUSY, - WDMP_ERR_INVALID_ATTRIBUTES, - WDMP_ERR_WILDCARD_NOT_SUPPORTED, - WDMP_ERR_SET_OF_CMC_OR_CID_NOT_SUPPORTED, - WDMP_ERR_VALUE_IS_EMPTY, - WDMP_ERR_VALUE_IS_NULL, - WDMP_ERR_DATATYPE_IS_NULL, - WDMP_ERR_CMC_TEST_FAILED, - WDMP_ERR_NEW_CID_IS_MISSING, - WDMP_ERR_CID_TEST_FAILED, - WDMP_ERR_SETTING_CMC_OR_CID, - WDMP_ERR_INVALID_INPUT_PARAMETER, - WDMP_ERR_ATTRIBUTES_IS_NULL, - WDMP_ERR_NOTIFY_IS_NULL, - WDMP_ERR_INVALID_WIFI_INDEX, - WDMP_ERR_INVALID_RADIO_INDEX, - WDMP_ERR_ATOMIC_GET_SET_FAILED, - WDMP_ERR_METHOD_NOT_SUPPORTED, - WDMP_ERR_SESSION_IN_PROGRESS, - WDMP_ERR_INTERNAL_ERROR, - WDMP_ERR_DEFAULT_VALUE -} WDMP_STATUS; - -typedef enum { - WDMP_STRING = 0, - WDMP_INT, - WDMP_UINT, - WDMP_BOOLEAN, - WDMP_DATETIME, - WDMP_BASE64, - WDMP_LONG, - WDMP_ULONG, - WDMP_FLOAT, - WDMP_DOUBLE, - WDMP_BYTE, - WDMP_NONE, - WDMP_BLOB -} DATA_TYPE; - -#define MAX_PARAM_LEN (2 * 1024) - -typedef struct _RFC_Param_t { - char name[MAX_PARAM_LEN]; - char value[MAX_PARAM_LEN]; - DATA_TYPE type; -} RFC_ParamData_t; - -class RfcApiImpl { -public: - virtual ~RfcApiImpl() = default; - - virtual WDMP_STATUS getRFCParameter(char* pcCallerID, const char* pcParameterName, RFC_ParamData_t* pstParamData) = 0; - virtual WDMP_STATUS setRFCParameter(char* pcCallerID, const char* pcParameterName, const char* pcParameterValue, DATA_TYPE eDataType) = 0; - virtual const char* getRFCErrorString(WDMP_STATUS code) = 0; -}; - -class RfcApi { - -protected: - static RfcApiImpl* impl; - -public: - RfcApi(); - RfcApi(const RfcApi &obj) = delete; // deleted copy constructor so that copy of the instance cannot be created. - static void setImpl(RfcApiImpl* newImpl); - static WDMP_STATUS getRFCParameter(char* pcCallerID, const char* pcParameterName, RFC_ParamData_t* pstParamData); - static WDMP_STATUS setRFCParameter(char* pcCallerID, const char* pcParameterName, const char* pcParameterValue, DATA_TYPE eDataType); - static const char* getRFCErrorString(WDMP_STATUS code); -}; - -extern WDMP_STATUS (*getRFCParameter)(char*,const char*,RFC_ParamData_t*); -extern WDMP_STATUS (*setRFCParameter)(char*,const char*,const char*,DATA_TYPE); -extern const char* (*getRFCErrorString)(WDMP_STATUS); - diff --git a/ci/mocks/Telemetry.h b/ci/mocks/Telemetry.h deleted file mode 100644 index f5c26c71..00000000 --- a/ci/mocks/Telemetry.h +++ /dev/null @@ -1,61 +0,0 @@ -/** -* If not stated otherwise in this file or this component's LICENSE -* file the following copyright and licenses apply: -* -* Copyright 2026 RDK Management -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -**/ - -#pragma once - -typedef enum { - T2ERROR_SUCCESS, - T2ERROR_FAILURE, - T2ERROR_INVALID_PROFILE, - T2ERROR_PROFILE_NOT_FOUND, - T2ERROR_PROFILE_NOT_SET, - T2ERROR_MAX_PROFILES_REACHED, - T2ERROR_MEMALLOC_FAILED, - T2ERROR_INVALID_ARGS, - T2ERROR_INTERNAL_ERROR -} T2ERROR; - -class TelemetryApiImpl { -public: - virtual ~TelemetryApiImpl() = default; - - virtual void t2_init(char* component) = 0; - virtual void t2_uninit(void) = 0; - virtual T2ERROR t2_event_s(const char* marker, const char* value) = 0; - virtual T2ERROR t2_event_d(const char* marker, int value) = 0; -}; - -class TelemetryApi { -protected: - static TelemetryApiImpl* impl; -public: - TelemetryApi(); - TelemetryApi(const TelemetryApi &obj) = delete; - static void setImpl(TelemetryApiImpl* newImpl); - static void t2_init(char* component); - static void t2_uninit(void); - static T2ERROR t2_event_s(const char* marker, const char* value); - static T2ERROR t2_event_d(const char* marker, int value); -}; - -extern void (*t2_init)(char*); -extern void (*t2_uninit)(void); -extern T2ERROR (*t2_event_s)(const char*,const char*); -extern T2ERROR (*t2_event_d)(const char*,int); - diff --git a/ci/mocks/control/comcastIrKeyCodes.h b/ci/mocks/control/comcastIrKeyCodes.h deleted file mode 100644 index d0028cee..00000000 --- a/ci/mocks/control/comcastIrKeyCodes.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Stub for comcastIrKeyCodes.h - * - * Copyright 2026 RDK Management - * Licensed under the Apache License, Version 2.0 - */ -#ifndef _COMCAST_IR_KEY_CODES_H_ -#define _COMCAST_IR_KEY_CODES_H_ - -/* Key event types */ -#define KET_KEYDOWN 0x00000008 -#define KET_KEYUP 0x00000100 -#define KET_KEYREPEAT 0x00000200 - -/* Key codes */ -#define KED_POWER 0x00000001 -#define KED_TVPOWER 0x00000002 -#define KED_RF_POWER 0x00000003 -#define KED_DISCRETE_POWER_ON 0x00000004 -#define KED_DISCRETE_POWER_STANDBY 0x00000005 -#define KED_VOLUMEUP 0x00000010 -#define KED_VOLUMEDOWN 0x00000011 -#define KED_MUTE 0x00000012 -#define KED_INPUTKEY 0x00000013 -#define KED_SETUP 0x00000020 -#define KED_PUSH_TO_TALK 0x00000030 -#define KED_RF_PAIR_GHOST 0x00000040 -#define KED_SCREEN_BIND_NOTIFY 0x00000050 -#define KED_XR2V3 0x00000060 -#define KED_XR5V2 0x00000061 -#define KED_XR11V1 0x00000062 -#define KED_XR11V2 0x00000063 -#define KED_XR11_NOTIFY 0x00000064 -#define KED_XR15V1_NOTIFY 0x00000065 -#define KED_XR16V1_NOTIFY 0x00000066 -#define KED_UNDEFINEDKEY 0x000000FF - -/* XMP tags */ -#define XMP_TAG_COMCAST 0x0001 -#define XMP_TAG_PLATCO 0x0002 -#define XMP_TAG_XR11V2 0x0003 -#define XMP_TAG_XR15V1 0x0004 -#define XMP_TAG_XR15V2 0x0005 -#define XMP_TAG_XR16V1 0x0006 -#define XMP_TAG_XRAV1 0x0007 -#define XMP_TAG_XR20V1 0x0008 -#define XMP_TAG_UNDEFINED 0x00FF - -#endif /* _COMCAST_IR_KEY_CODES_H_ */ diff --git a/ci/mocks/control/irMgr.h b/ci/mocks/control/irMgr.h deleted file mode 100644 index 1d3cebb9..00000000 --- a/ci/mocks/control/irMgr.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Stub for irMgr.h - IR Manager types - * - * Copyright 2026 RDK Management - * Licensed under the Apache License, Version 2.0 - */ -#ifndef _IR_MGR_H_ -#define _IR_MGR_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#define IARM_BUS_IRMGR_NAME "IRMgr" - -typedef enum { - IARM_BUS_IRMGR_EVENT_IRKEY = 0, - IARM_BUS_IRMGR_EVENT_CONTROL = 1, - IARM_BUS_IRMGR_EVENT_MAX = 2 -} IARM_Bus_IRMgr_EventId_t; - -#define IARM_BUS_IRMGR_KEYSRC_IR 0 -#define IARM_BUS_IRMGR_KEYSRC_FP 1 -#define IARM_BUS_IRMGR_KEYSRC_RF 2 - -typedef struct { - union { - struct { - int keyType; - int keyCode; - int keySrc; - int keyTag; - int keySourceId; - } irkey; - } data; -} IARM_Bus_IRMgr_EventData_t; - -#ifdef __cplusplus -} -#endif - -#endif /* _IR_MGR_H_ */ diff --git a/ci/mocks/control/rdkversion.h b/ci/mocks/control/rdkversion.h deleted file mode 100644 index fd27f7e3..00000000 --- a/ci/mocks/control/rdkversion.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Stub for rdkversion.h - * - * Copyright 2026 RDK Management - * Licensed under the Apache License, Version 2.0 - */ -#ifndef _RDKVERSION_H_ -#define _RDKVERSION_H_ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct { - char *image_name; - char *stb_name; - char *branch_name; - char *version_name; - char *image_build_time; - bool production_build; - char *parse_error; -} rdk_version_info_t; - -int rdk_version_parse_version(rdk_version_info_t *info); -void rdk_version_object_free(rdk_version_info_t *info); - -#ifdef __cplusplus -} -#endif - -#endif /* _RDKVERSION_H_ */ diff --git a/ci/mocks/control/rdkx_logger.h b/ci/mocks/control/rdkx_logger.h deleted file mode 100644 index 4ea58c39..00000000 --- a/ci/mocks/control/rdkx_logger.h +++ /dev/null @@ -1,204 +0,0 @@ -/* - * If not stated otherwise in this file or this component's license file the - * following copyright and licenses apply: - * - * Copyright 2026 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 _RDKX_LOGGER_H_ -#define _RDKX_LOGGER_H_ - -#ifdef __cplusplus -#include -#include -#include -/* The real rdkx_logger.h pulls in std:: namespace indirectly; replicate only the needed names here */ -// ctrlm expects these to be in the global namespace, so we need to pull them in here -using std::get; -using std::map; -using std::string; -using std::tuple; -#endif - -/* Log option flags */ -#define XLOG_OPTS_DATE (1 << 0) -#define XLOG_OPTS_TIME (1 << 1) -#define XLOG_OPTS_LF (1 << 2) -#define XLOG_OPTS_MOD_NAME (1 << 3) -#define XLOG_OPTS_LEVEL (1 << 4) -#define XLOG_OPTS_COLOR (1 << 5) - -/* Module IDs */ -#define XLOG_MODULE_ID_CTRLM 0 -#define XLOG_MODULE_ID_VSDK 1 -#define XLOG_MODULE_ID_XRAUDIO 2 - -#ifndef XLOG_MODULE_ID -#define XLOG_MODULE_ID XLOG_MODULE_ID_CTRLM -#endif - -/* Stub types and functions used by xlog_fprintf */ -#ifndef XLOG_OPTS_DEFAULT -#define XLOG_OPTS_DEFAULT 0 -#endif - -#ifndef XLOG_COLOR_NONE -#define XLOG_COLOR_NONE 0 -#endif - -#ifndef XLOG_COLOR_BLU -#define XLOG_COLOR_BLU 0 -#endif - -#ifndef XLOG_COLOR_GRN -#define XLOG_COLOR_GRN 0 -#endif - -#ifndef XLOG_LINE_NONE -#define XLOG_LINE_NONE 0 -#endif - -typedef int xlog_level_t; - -#ifndef XLOG_LEVEL_DEBUG -#define XLOG_LEVEL_DEBUG 0 -#endif - -#ifndef XLOG_LEVEL_INFO -#define XLOG_LEVEL_INFO 1 -#endif - -#ifndef XLOG_LEVEL_WARN -#define XLOG_LEVEL_WARN 2 -#endif - -#ifndef XLOG_LEVEL_ERROR -#define XLOG_LEVEL_ERROR 3 -#endif - -#ifndef XLOG_LEVEL_FATAL -#define XLOG_LEVEL_FATAL 4 -#endif - -#ifndef XLOG_LEVEL_TELEMETRY -#define XLOG_LEVEL_TELEMETRY 5 -#endif - -#ifndef XLOG_BUF_SIZE_DEFAULT -#define XLOG_BUF_SIZE_DEFAULT 0 -#endif - -typedef struct { - int options; - int color; - const char *function; - int line; - int level; - int id; - int size_max; -} xlog_args_t; - -#ifndef xlog_fprintf -#define xlog_fprintf(args, output, fmt, ...) do { (void)(args); (void)(output); (void)sizeof(fmt); } while(0) -#endif - -#ifndef xlog_printf -#define xlog_printf(args, fmt, ...) do { (void)(args); (void)sizeof(fmt); } while(0) -#endif - -#ifndef xlog_init -#define xlog_init(id, path, options, console, syslog) (0) -#endif - -#ifndef xlog_level_set_all -#define xlog_level_set_all(level) do { (void)(level); } while(0) -#endif - -#ifndef xlog_level_get -#define xlog_level_get(id) (XLOG_LEVEL_INFO) -#endif - -#ifndef xlog_term -#define xlog_term() do { } while(0) -#endif - -/* Logging macros - silently discard in stub builds (avoids -Werror=format-zero-length) */ -#ifndef XLOGD -#define XLOGD(level, opts, color, size, fmt, ...) do { (void)(level); (void)(opts); (void)(color); (void)(size); (void)sizeof(fmt); } while(0) -#endif -#ifndef XLOGD_INFO -#define XLOGD_INFO(fmt, ...) do { (void)sizeof(fmt); } while(0) -#endif -#ifndef XLOGD_DEBUG -#define XLOGD_DEBUG(fmt, ...) do { (void)sizeof(fmt); } while(0) -#endif -#ifndef XLOGD_ERROR -#define XLOGD_ERROR(fmt, ...) do { (void)sizeof(fmt); } while(0) -#endif -#ifndef XLOGD_WARN -#define XLOGD_WARN(fmt, ...) do { (void)sizeof(fmt); } while(0) -#endif -#ifndef XLOGD_FATAL -#define XLOGD_FATAL(fmt, ...) do { (void)sizeof(fmt); } while(0) -#endif -#ifndef XLOGD_TELEMETRY -#define XLOGD_TELEMETRY(fmt, ...) do { (void)sizeof(fmt); } while(0) -#endif -#ifndef XLOGD_INFO_OPTS -#define XLOGD_INFO_OPTS(opts, fmt, ...) do { (void)(opts); (void)sizeof(fmt); } while(0) -#endif -#ifndef XLOGD_NO_LF -#define XLOGD_NO_LF(level, fmt, ...) do { (void)(level); (void)sizeof(fmt); } while(0) -#endif -/* XLOGD_OUTPUT is used as an output-handle VALUE (second arg to xlog_fprintf), not a logging macro */ -#ifndef XLOGD_OUTPUT -#define XLOGD_OUTPUT NULL -#endif - -#ifndef XLOGD_AUTOMATION_INFO -#define XLOGD_AUTOMATION_INFO(fmt, ...) do { (void)sizeof(fmt); } while(0) -#endif -#ifndef XLOGD_AUTOMATION_DEBUG -#define XLOGD_AUTOMATION_DEBUG(fmt, ...) do { (void)sizeof(fmt); } while(0) -#endif -#ifndef XLOGD_AUTOMATION_ERROR -#define XLOGD_AUTOMATION_ERROR(fmt, ...) do { (void)sizeof(fmt); } while(0) -#endif -#ifndef XLOGD_AUTOMATION_WARN -#define XLOGD_AUTOMATION_WARN(fmt, ...) do { (void)sizeof(fmt); } while(0) -#endif -#ifndef XLOGD_AUTOMATION_TELEMETRY -#define XLOGD_AUTOMATION_TELEMETRY(fmt, ...) do { (void)sizeof(fmt); } while(0) -#endif - -#ifndef XLOG_INFO -#define XLOG_INFO(fmt, ...) do { (void)sizeof(fmt); } while(0) -#endif -#ifndef XLOG_DEBUG -#define XLOG_DEBUG(fmt, ...) do { (void)sizeof(fmt); } while(0) -#endif -#ifndef XLOG_ERROR -#define XLOG_ERROR(fmt, ...) do { (void)sizeof(fmt); } while(0) -#endif -#ifndef XLOG_WARN -#define XLOG_WARN(fmt, ...) do { (void)sizeof(fmt); } while(0) -#endif -#ifndef XLOG_RAW -#define XLOG_RAW(fmt, ...) do { (void)sizeof(fmt); } while(0) -#endif -#ifndef XLOG_FLUSH -#define XLOG_FLUSH() do { } while(0) -#endif - -#endif /* _RDKX_LOGGER_H_ */ diff --git a/ci/mocks/control/xr_timestamp.h b/ci/mocks/control/xr_timestamp.h deleted file mode 100644 index efa2d9f6..00000000 --- a/ci/mocks/control/xr_timestamp.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * If not stated otherwise in this file or this component's license file the - * following copyright and licenses apply: - * - * Copyright 2026 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 _XR_TIMESTAMP_H_ -#define _XR_TIMESTAMP_H_ - -#include -#include - -/* Use timespec-compatible layout so ctrlm can assign directly between types. */ -typedef struct timespec rdkx_timestamp_t; - -#ifdef __cplusplus -extern "C" { -#endif - -void rdkx_timestamp_get(rdkx_timestamp_t *timestamp); -void rdkx_timestamp_get_realtime(rdkx_timestamp_t *timestamp); -double rdkx_timestamp_subtract(const rdkx_timestamp_t *a, const rdkx_timestamp_t *b); -signed long long rdkx_timestamp_subtract_us(rdkx_timestamp_t a, rdkx_timestamp_t b); -signed long long rdkx_timestamp_subtract_ms(rdkx_timestamp_t a, rdkx_timestamp_t b); -void rdkx_timestamp_add_ms(rdkx_timestamp_t *timestamp, unsigned long milliseconds); -int rdkx_timestamp_cmp(const rdkx_timestamp_t *a, const rdkx_timestamp_t *b); - -#ifdef __cplusplus -} -#endif - -#endif /* _XR_TIMESTAMP_H_ */ diff --git a/ci/mocks/control/xr_voice_sdk.h b/ci/mocks/control/xr_voice_sdk.h deleted file mode 100644 index d150e4f5..00000000 --- a/ci/mocks/control/xr_voice_sdk.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Stub for xr_voice_sdk.h - * - * Copyright 2026 RDK Management - * Licensed under the Apache License, Version 2.0 - */ -#ifndef _XR_VOICE_SDK_H_ -#define _XR_VOICE_SDK_H_ - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* xr_voice_sdk API */ -int xr_voice_sdk_init(void); -int xr_voice_sdk_term(void); - -/* vsdk API used by ctrlm-main */ -#define VSDK_VERSION_QTY_MAX (16) - -typedef struct { - const char *name; - const char *version; - const char *branch; - const char *commit_id; -} vsdk_version_info_t; - -typedef void (*vsdk_thread_poll_response_t)(void *data); - -void vsdk_version(vsdk_version_info_t *info, uint32_t *qty); -bool vsdk_init(bool console, const char *filename, uint32_t file_size_max); -void vsdk_term(void); -void vsdk_thread_poll(vsdk_thread_poll_response_t response, void *data); - -#ifdef __cplusplus -} -#endif - -#endif /* _XR_VOICE_SDK_H_ */ diff --git a/ci/mocks/control/xraudio.h b/ci/mocks/control/xraudio.h deleted file mode 100644 index 0738c738..00000000 --- a/ci/mocks/control/xraudio.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Stub for xraudio.h - Audio types - * - * Copyright 2026 RDK Management - * Licensed under the Apache License, Version 2.0 - */ -#ifndef _XRAUDIO_H_ -#define _XRAUDIO_H_ - -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef enum { - XRAUDIO_ENCODING_PCM = 0, - XRAUDIO_ENCODING_ADPCM = 1, - XRAUDIO_ENCODING_OPUS = 2, - XRAUDIO_ENCODING_INVALID = 3 -} xraudio_encoding_t; - -typedef struct { - xraudio_encoding_t type; -} xraudio_encoding_info_t; - -typedef struct { - xraudio_encoding_info_t encoding; - uint16_t sample_rate; - uint8_t sample_size; - uint8_t channel_qty; -} xraudio_output_format_t; - -typedef enum { - XRAUDIO_RESULT_OK = 0, - XRAUDIO_RESULT_ERROR = 1 -} xraudio_result_t; - -int32_t xraudio_container_header_parse_wave(int audio_fd, const uint8_t *header, size_t size, xraudio_output_format_t *format, uint32_t *data_length); - -#ifdef __cplusplus -} -#endif - -#endif /* _XRAUDIO_H_ */ diff --git a/ci/mocks/devicesettings.h b/ci/mocks/devicesettings.h deleted file mode 100644 index 3a13f946..00000000 --- a/ci/mocks/devicesettings.h +++ /dev/null @@ -1,2297 +0,0 @@ -/** -* If not stated otherwise in this file or this component's LICENSE -* file the following copyright and licenses apply: -* -* Copyright 2026 RDK Management -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* -**/ - -#pragma once - -#include -#include -#include -#include -#include -#include - -/* -* Copyright (c) 2007 Dave Airlie -* Copyright (c) 2007 Jakob Bornecrantz -* Copyright (c) 2008 Red Hat Inc. -* Copyright (c) 2007-2008 Tungsten Graphics, Inc., Cedar Park, TX., USA -* Copyright (c) 2007-2008 Intel Corporation -* Licensed under the MIT License -*/ -#define DRM_DISPLAY_MODE_LEN 32 -#define DRM_PROP_NAME_LEN 32 - -#define DRM_MODE_PROP_RANGE (1<<1) -#define DRM_MODE_PROP_ENUM (1<<3) /* enumerated type with text strings */ -#define DRM_MODE_PROP_BLOB (1<<4) -#define DRM_MODE_PROP_BITMASK (1<<5) /* bitmask of enumerated types */ - -#define DRM_MODE_PROP_LEGACY_TYPE ( \ - DRM_MODE_PROP_RANGE | \ - DRM_MODE_PROP_ENUM | \ - DRM_MODE_PROP_BLOB | \ - DRM_MODE_PROP_BITMASK) - -#define DRM_MODE_PROP_EXTENDED_TYPE 0x0000ffc0 - -typedef unsigned int drm_context_t; -typedef unsigned int drm_magic_t; -typedef unsigned int drm_handle_t; -typedef unsigned int drm_drawable_t; - - -#include -#include -#include -#include - -typedef enum _dsAudioPortType_t { - dsAUDIOPORT_TYPE_ID_LR, /**< RCA audio output. */ - dsAUDIOPORT_TYPE_HDMI, /**< HDMI audio output. */ - dsAUDIOPORT_TYPE_SPDIF, /**< S/PDIF audio output. */ - dsAUDIOPORT_TYPE_SPEAKER, /**< SPEAKER audio output. */ - dsAUDIOPORT_TYPE_HDMI_ARC, /** < HDMI ARC/EARC audio output. */ - dsAUDIOPORT_TYPE_HEADPHONE, /**< 3.5mm headphone jack. */ - dsAUDIOPORT_TYPE_MAX /**< Maximum index for audio port type. */ -} dsAudioPortType_t; - -typedef enum _dsAudioDuckingAction_t { - dsAUDIO_DUCKINGACTION_START = 0, - dsAUDIO_DUCKINGACTION_STOP = 1 -} dsAudioDuckingAction_t; - -typedef enum _dsAudioDuckingType_t { - dsAUDIO_DUCKINGTYPE_ABSOLUTE = 0, - dsAUDIO_DUCKINGTYPE_RELATIVE = 1 -} dsAudioDuckingType_t; - -typedef enum _dsVideoPortType_t { - dsVIDEOPORT_TYPE_RF = 0, ///< RF modulator (channel 3/4) video output - dsVIDEOPORT_TYPE_BB, ///< Baseband (composite, RCA) video output - dsVIDEOPORT_TYPE_SVIDEO, ///< S-Video video output - dsVIDEOPORT_TYPE_1394, ///< IEEE 1394 (Firewire) video output - dsVIDEOPORT_TYPE_DVI, ///< DVI (Panel-Link, HDCP) video output - dsVIDEOPORT_TYPE_COMPONENT, ///< Component video output - dsVIDEOPORT_TYPE_HDMI, ///< HDMI video output - dsVIDEOPORT_TYPE_HDMI_INPUT, ///< HDMI video input - dsVIDEOPORT_TYPE_INTERNAL, ///< Internal (integrated/internal display) video output - dsVIDEOPORT_TYPE_MAX ///< Out of range -} dsVideoPortType_t; - -typedef enum _dsAudioFormat_t { - dsAUDIO_FORMAT_NONE, - dsAUDIO_FORMAT_PCM, - dsAUDIO_FORMAT_DOLBY_AC3, - dsAUDIO_FORMAT_DOLBY_EAC3, - dsAUDIO_FORMAT_DOLBY_AC4, - dsAUDIO_FORMAT_DOLBY_MAT, - dsAUDIO_FORMAT_DOLBY_TRUEHD, - dsAUDIO_FORMAT_DOLBY_EAC3_ATMOS, - dsAUDIO_FORMAT_DOLBY_TRUEHD_ATMOS, - dsAUDIO_FORMAT_DOLBY_MAT_ATMOS, - dsAUDIO_FORMAT_DOLBY_AC4_ATMOS, - dsAUDIO_FORMAT_AAC, - dsAUDIO_FORMAT_VORBIS, - dsAUDIO_FORMAT_WMA, - dsAUDIO_FORMAT_UNKNOWN, - dsAUDIO_FORMAT_MAX /**< Maximum . */ -} dsAudioFormat_t; - -typedef enum _dsAudioCapabilities_t { - dsAUDIOSUPPORT_NONE = 0x0, - dsAUDIOSUPPORT_ATMOS = 0x01, - dsAUDIOSUPPORT_DD = 0x02, - dsAUDIOSUPPORT_DDPLUS = 0x04, - dsAUDIOSUPPORT_DAD = 0x08, - dsAUDIOSUPPORT_DAPv2 = 0x10, - dsAUDIOSUPPORT_MS12 = 0x20, - dsAUDIOSUPPORT_MS12V2 = 0x40, - dsAUDIOSUPPORT_Invalid = 0x80, -} dsAudioCapabilities_t; - -typedef enum _dsAudioARCTypes_t { - dsAUDIOARCSUPPORT_NONE = 0x0, - dsAUDIOARCSUPPORT_ARC = 0x01, - dsAUDIOARCSUPPORT_eARC = 0x02, -} dsAudioARCTypes_t; - -typedef enum _dsMS12Capabilities_t { - dsMS12SUPPORT_NONE = 0x0, - dsMS12SUPPORT_DolbyVolume = 0x01, - dsMS12SUPPORT_InteligentEqualizer = 0x02, - dsMS12SUPPORT_DialogueEnhancer = 0x04, - dsMS12SUPPORT_Invalid = 0x80, -} dsMS12Capabilities_t; - -typedef struct _dsVolumeLeveller_t { - int mode; // 0 = off, 1= on, 2= auto - int level; -} dsVolumeLeveller_t; - -typedef struct _dsSurroundVirtualizer_t { - int mode; // 0 = off, 1= on, 2= auto - int boost; -} dsSurroundVirtualizer_t; - -typedef enum StereoMode { - dsAUDIO_STEREO_UNKNOWN, /**< Unknown mode. */ - dsAUDIO_STEREO_MONO = 1, /**< Mono mode. */ - dsAUDIO_STEREO_STEREO, /**< Normal stereo mode (L+R). */ - dsAUDIO_STEREO_SURROUND, /**< Surround mode. */ - dsAUDIO_STEREO_PASSTHRU, /**< Passthrough mode. */ - dsAUDIO_STEREO_DD, /**< Dolby Digital. */ - dsAUDIO_STEREO_DDPLUS, /**< Dolby Digital Plus. */ - dsAUDIO_STEREO_MAX /**< Maximum index for audio stereo types. */ -} dsAudioStereoMode_t; - -typedef enum _dsATMOSCapability_t { - dsAUDIO_ATMOS_NOTSUPPORTED = 0, /**< ATMOS audio not supported */ - dsAUDIO_ATMOS_DDPLUSSTREAM, /**< can handle dd plus stream which is only way to pass ATMOS metadata */ - dsAUDIO_ATMOS_ATMOSMETADATA, /**< capable of parsing ATMOS metadata */ -} dsATMOSCapability_t; - -typedef enum _dsAudioInput_t -{ - dsAUDIO_INPUT_PRIMARY = 0, /**< Primary Audio Input is main audio input provided to audio mixer */ - dsAUDIO_INPUT_SYSTEM, /**< System Audio Input to audio mixer , e.g Beep Sounds */ - dsAUDIO_INPUT_MAX /**< Out of range */ -} dsAudioInput_t; - -typedef enum _dsHdcpProtocolVersion_t { - dsHDCP_VERSION_1X = 0, /**< HDCP Protocol version 1.x */ - dsHDCP_VERSION_2X, /**< HDCP Protocol version 2.x */ - dsHDCP_VERSION_MAX /**< Maximum index for HDCP protocol. */ -} dsHdcpProtocolVersion_t; - -typedef enum _dsHdcpStatus_t { - dsHDCP_STATUS_UNPOWERED = 0, /**< Connected Sink Device does not support HDCP */ - dsHDCP_STATUS_UNAUTHENTICATED, /**< HDCP Authentication Process is not initiated */ - dsHDCP_STATUS_AUTHENTICATED, /**< HDCP Authentication Process is initiated and Passed */ - dsHDCP_STATUS_AUTHENTICATIONFAILURE, /**< HDCP Authentication Failure or Link Integroty Failure */ - dsHDCP_STATUS_INPROGRESS, /**< HDCP Authentication in Progress */ - dsHDCP_STATUS_PORTDISABLED, /**< HDMI output port disabled */ - dsHDCP_STATUS_MAX /**< Maximum index for HDCP status. */ -} dsHdcpStatus_t; - -typedef enum _dsVideoResolution_t { - dsVIDEO_PIXELRES_720x480, /**< 720x480 Resolution. */ - dsVIDEO_PIXELRES_720x576, /**< 720x576 Resolution. */ - dsVIDEO_PIXELRES_1280x720, /**< 1280x720 Resolution. */ - dsVIDEO_PIXELRES_1920x1080, /**< 1920x1080 Resolution. */ - dsVIDEO_PIXELRES_3840x2160, /**< 3840x2160 Resolution. */ - dsVIDEO_PIXELRES_4096x2160, /**< 3840x2160 Resolution. */ - dsVIDEO_PIXELRES_MAX /**< Maximum index for Video ouptut resolutions. */ -} dsVideoResolution_t; - -// typedef enum _dsTVResolution_t { -// dsTV_RESOLUTION_480i = 0x0001, /**< 480i Resolution. */ -// dsTV_RESOLUTION_480p = 0x0002, /**< 480p Resolution. */ -// dsTV_RESOLUTION_576i = 0x0004, /**< 576p Resolution. */ -// dsTV_RESOLUTION_576p = 0x0008, /**< 576p Resolution. */ -// dsTV_RESOLUTION_720p = 0x0010, /**< 720p Resolution. */ -// dsTV_RESOLUTION_1080i = 0x0020, /**< 1080i Resolution. */ -// dsTV_RESOLUTION_1080p = 0x0040, /**< 1080p Resolution. */ -// dsTV_RESOLUTION_2160p30 = 0x0080, /**< 2160p30 Resolution. */ -// dsTV_RESOLUTION_2160p60 = 0x0100, /**< 2160p60 Resolution. */ -// } dsTVResolution_t; - -typedef enum _dsTVResolution_t { - dsTV_RESOLUTION_480i = 0x0001, - dsTV_RESOLUTION_480p = 0x0002, - dsTV_RESOLUTION_576i = 0x0004, - dsTV_RESOLUTION_576p = 0x0008, - dsTV_RESOLUTION_576p50 = 0x0010, - dsTV_RESOLUTION_720p = 0x0020, - dsTV_RESOLUTION_720p50 = 0x0040, - dsTV_RESOLUTION_1080i = 0x0080, - dsTV_RESOLUTION_1080p = 0x0100, - dsTV_RESOLUTION_1080p24 = 0x0200, - dsTV_RESOLUTION_1080p25 = 0x0400, - dsTV_RESOLUTION_1080i25 = 0x0800, - dsTV_RESOLUTION_1080p30 = 0x1000, - dsTV_RESOLUTION_1080i50 = 0x2000, - dsTV_RESOLUTION_1080p50 = 0x4000, - dsTV_RESOLUTION_1080p60 = 0x8000, - dsTV_RESOLUTION_2160p24 = 0x10000, - dsTV_RESOLUTION_2160p25 = 0x20000, - dsTV_RESOLUTION_2160p30 = 0x40000, - dsTV_RESOLUTION_2160p50 = 0x80000, - dsTV_RESOLUTION_2160p60 = 0x100000, -} dsTVResolution_t; - -typedef enum _dsVideoFrameRate_t { - dsVIDEO_FRAMERATE_UNKNOWN, /**< Unknown frame rate. */ - dsVIDEO_FRAMERATE_24, /**< Played at 24 frames per second. */ - dsVIDEO_FRAMERATE_25, /**< Played at 25 frames per second. */ - dsVIDEO_FRAMERATE_30, /**< Played at 30 frames per second. */ - dsVIDEO_FRAMERATE_60, /**< Played at 60 frames per second. */ - dsVIDEO_FRAMERATE_23dot98, /**< Played at 23.98 frames per second. */ - dsVIDEO_FRAMERATE_29dot97, /**< Played at 29.97 frames per second. */ - dsVIDEO_FRAMERATE_50, /**< Played at 50 frames per second. */ - dsVIDEO_FRAMERATE_59dot94, /**< Played at 59.94 frames per second. */ - dsVIDEO_FRAMERATE_100, /**< Played at 100 frames per second. */ - dsVIDEO_FRAMERATE_119dot88, /**< Played at 119.88 frames per second. */ - dsVIDEO_FRAMERATE_120, /**< Played at 120 frames per second. */ - dsVIDEO_FRAMERATE_200, /**< Played at 200 frames per second. */ - dsVIDEO_FRAMERATE_239dot76, /**< Played at 23.76 frames per second. */ - dsVIDEO_FRAMERATE_240, /**< Played at 240 frames per second. */ - dsVIDEO_FRAMERATE_MAX /**< Maximum index for video frame rates. */ -} dsVideoFrameRate_t; - -typedef enum _dsVideoZoom_t { - dsVIDEO_ZOOM_UNKNOWN = -1, /**< Unknown mode. */ - dsVIDEO_ZOOM_NONE = 0, /**< Decoder format conversion is inactive. */ - dsVIDEO_ZOOM_FULL, /**< Full screen (16:9 video is streched to fit 4:3 frame). */ - dsVIDEO_ZOOM_LB_16_9, /**< 16:9 Letterbox (16:9 video is placed in a 4:3 frame with a full letterbox effect). */ - dsVIDEO_ZOOM_LB_14_9, /**< 14:9 Letterbox (16:9 video is transferred into a 4:3 frame with 14:9 letterbox effect). */ - dsVIDEO_ZOOM_CCO, /**< Center Cut-out (16:9 video is cut to fill 4:3 frame with its center part). */ - dsVIDEO_ZOOM_PAN_SCAN, /**< Pan & Scan (16:9 is cut and panned to fille 4:3 frame, following MPEG pan & scan vectors). */ - dsVIDEO_ZOOM_LB_2_21_1_ON_4_3, /**< 2.21:1 Letterbox on 4:3 (video is transferred into 4:3 frame with a 2.21:1 letterbox effect). */ - dsVIDEO_ZOOM_LB_2_21_1_ON_16_9, /**< 2.21:1 Letterbox on 16:9 (video is transferred into 16:9 frame with a 2.21:1 letterbox effect). */ - dsVIDEO_ZOOM_PLATFORM, /**< Control over the decoder format conversions is managed by the platform. */ - dsVIDEO_ZOOM_16_9_ZOOM, /**< 16:9 Zoom (4:3 video is zoomed to fill 16:9 frame). */ - dsVIDEO_ZOOM_PILLARBOX_4_3, /**< Pillarbox 4:3 (4:3 video is placed in a 16:9 frame with a pillarbox effect) */ - dsVIDEO_ZOOM_WIDE_4_3, /**< Wide 4:3 (4:3 video is stretched to fill 16:9 frame). */ - dsVIDEO_ZOOM_MAX /**< Maximum index for screen zoom modes. */ -} dsVideoZoom_t; - -typedef enum _dsVideoAspectRatio_t { - dsVIDEO_ASPECT_RATIO_4x3, /**< 4:3 aspect ratio. */ - dsVIDEO_ASPECT_RATIO_16x9, /**< 16:9 aspect ratio. */ - dsVIDEO_ASPECT_RATIO_MAX /**< Maximum index for video aspect ratios. */ -} dsVideoAspectRatio_t; - -typedef enum _dsVideoStereoScopicMode_t { - dsVIDEO_SSMODE_UNKNOWN = 0, /**< Unknown mode. */ - dsVIDEO_SSMODE_2D, /**< 2D mode. */ - dsVIDEO_SSMODE_3D_SIDE_BY_SIDE, /**< 3D side by side (L/R) stereo mode. */ - dsVIDEO_SSMODE_3D_TOP_AND_BOTTOM, /**< 3D top & bottom stereo mode. */ - dsVIDEO_SSMODE_MAX /**< Maximum index for video stereoscopic modes. */ -} dsVideoStereoScopicMode_t; - -typedef struct _dsVideoPortResolution_t { - char name[32]; /**< Name the resolution (e.g. 480i, 480p, 1080p24). */ - dsVideoResolution_t pixelResolution; /**< The resolution associated with the name. */ - dsVideoAspectRatio_t aspectRatio; /**< The associated aspect ratio. */ - dsVideoStereoScopicMode_t stereoScopicMode; /**< The associated stereoscopic mode. */ - dsVideoFrameRate_t frameRate; /**< The associated frame rate. */ - bool interlaced; /**< The associated scan mode(@a true if interlaced, @a false if progressive). */ -} dsVideoPortResolution_t; - -typedef enum _dsHDRStandard_t { - dsHDRSTANDARD_NONE = 0x0, - dsHDRSTANDARD_HDR10 = 0x01, - dsHDRSTANDARD_HLG = 0x02, - dsHDRSTANDARD_DolbyVision = 0x04, - dsHDRSTANDARD_TechnicolorPrime = 0x08, - dsHDRSTANDARD_HDR10PLUS = 0x10, - dsHDRSTANDARD_SDR = 0x20, - dsHDRSTANDARD_Invalid = 0x80, -} dsHDRStandard_t; - -typedef enum _dsSURROUNDMode_t { - dsSURROUNDMODE_NONE = 0x0, - dsSURROUNDMODE_DD = 0x1, - dsSURROUNDMODE_DDPLUS = 0x2, -} dsSURROUNDMode_t; - -typedef enum _dsDisplayColorDepth_t { - dsDISPLAY_COLORDEPTH_UNKNOWN = 0x0, /* Unknown color depth */ - dsDISPLAY_COLORDEPTH_8BIT = 0x01, /* 8 bit color depth */ - dsDISPLAY_COLORDEPTH_10BIT = 0x02, /* 10 bit color depth */ - dsDISPLAY_COLORDEPTH_12BIT = 0x04, /* 12 bit color depth */ - dsDISPLAY_COLORDEPTH_AUTO = 0x08 /* Automatic color depth */ -} dsDisplayColorDepth_t; - -typedef enum _dsHdmiInPort_t { - dsHDMI_IN_PORT_NONE = -1, - dsHDMI_IN_PORT_0, - dsHDMI_IN_PORT_1, - dsHDMI_IN_PORT_2, - dsHDMI_IN_PORT_MAX -} dsHdmiInPort_t; - -typedef enum _dsHdmiInSignalStatus_t { - dsHDMI_IN_SIGNAL_STATUS_NONE = -1, - dsHDMI_IN_SIGNAL_STATUS_NOSIGNAL, - dsHDMI_IN_SIGNAL_STATUS_UNSTABLE, - dsHDMI_IN_SIGNAL_STATUS_NOTSUPPORTED, - dsHDMI_IN_SIGNAL_STATUS_STABLE, - dsHDMI_IN_SIGNAL_STATUS_MAX -} dsHdmiInSignalStatus_t; - -typedef enum dsAviContentType { - dsAVICONTENT_TYPE_GRAPHICS, /*!< Content type Graphics. - ITC=1, CN1=0, CN0=0 */ - dsAVICONTENT_TYPE_PHOTO, /*!< Content type Photo - ITC=1, CN1=0, CN0=1 */ - dsAVICONTENT_TYPE_CINEMA, /*!< Content type Cinema - ITC=1, CN1=1, CN0=0 */ - dsAVICONTENT_TYPE_GAME, /*!< Content type Game - ITC=1, CN1=1, CN0=1 */ - dsAVICONTENT_TYPE_NOT_SIGNALLED,/*!< Content type no data - ITC=0, CN1=0, CN0=0 */ - dsAVICONTENT_TYPE_MAX, /*!< Out of range */ -}dsAviContentType_t; - -struct dsSpd_infoframe_st { - uint8_t pkttype; - uint8_t version; - uint8_t length; /*length=25*/ - uint8_t rsd; - uint8_t checksum; - /*Vendor Name Character*/ - uint8_t vendor_name[8]; - /*Product Description Character*/ - uint8_t product_des[16]; - /*byte 25*/ - uint8_t source_info; -}; - -typedef enum tv_hdmi_edid_version_e { - HDMI_EDID_VER_14 = 0, - HDMI_EDID_VER_20, - HDMI_EDID_VER_MAX, -} tv_hdmi_edid_version_t; - -typedef enum _dsAudioPortState { - dsAUDIOPORT_STATE_UNINITIALIZED, - dsAUDIOPORT_STATE_INITIALIZED, - dsAUDIOPORT_STATE_MAX -} dsAudioPortState_t; - -typedef enum { - dsERR_NONE = 0, ///< Input output operation is successful - dsERR_GENERAL = 1, ///< Operation general error. - dsERR_INVALID_PARAM, ///< Invalid parameter is passed to the module - dsERR_INVALID_STATE, ///< Module is in an invalid state - dsERR_ALREADY_INITIALIZED, ///< Module is already initialised - dsERR_NOT_INITIALIZED, ///< Module is not initialised - dsERR_OPERATION_NOT_SUPPORTED, ///< Operation not supported - dsERR_RESOURCE_NOT_AVAILABLE, ///< Resources have failed to allocate - dsERR_OPERATION_FAILED, ///< The attempted operation has failed. Used when a SoC call has a failure - dsErr_MAX -} dsError_t; - -#define MAX_LANGUAGE_LEN 10 -#define DSMGR_MAX_VIDEO_PORT_NAME_LENGTH 128 - -typedef struct { - bool isEnabled; - bool result; - char port[DSMGR_MAX_VIDEO_PORT_NAME_LENGTH]; - } dsMgrStandbyVideoStateParam_t; - -typedef struct { - bool result; - bool isEnabled; - char port[DSMGR_MAX_VIDEO_PORT_NAME_LENGTH]; - } IARM_Bus_PWRMgr_StandbyVideoState_Param_t; - -typedef enum _dsSleepMode_t { - dsHOST_SLEEP_MODE_LIGHT, /**< Light sleep mode. */ - dsHOST_SLEEP_MODE_DEEP, /**< Deep sleep mode. */ - dsHOST_SLEEP_MODE_MAX, /**< Maximum index for sleep modes */ -} dsSleepMode_t; - -typedef enum __dsFPDTimeFormat_t { - dsFPD_TIME_12_HOUR, /**< 12 hour time format. */ - dsFPD_TIME_24_HOUR, /**< 24 hour time format. */ - dsFPD_TIME_STRING /**< Text string. */ -} dsFPDTimeFormat_t; - -typedef enum _dsCompInSignalStatus_t { - dsCOMP_IN_SIGNAL_STATUS_NONE = -1, - dsCOMP_IN_SIGNAL_STATUS_NOSIGNAL, - dsCOMP_IN_SIGNAL_STATUS_UNSTABLE, - dsCOMP_IN_SIGNAL_STATUS_NOTSUPPORTED, - dsCOMP_IN_SIGNAL_STATUS_STABLE, - dsCOMP_IN_SIGNAL_STATUS_MAX -} dsCompInSignalStatus_t; - -typedef enum _dsCompositeInPort_t { - dsCOMPOSITE_IN_PORT_NONE = -1, - dsCOMPOSITE_IN_PORT_0, - dsCOMPOSITE_IN_PORT_1, - dsCOMPOSITE_IN_PORT_MAX -} dsCompositeInPort_t; - -typedef enum dsHdmiMaxCapabilityVersion{ - HDMI_COMPATIBILITY_VERSION_14 = 0, /*!< Hdmi Compatibility Version 1.4 */ - HDMI_COMPATIBILITY_VERSION_20, /*!< Hdmi Compatibility Version 2.0 */ - HDMI_COMPATIBILITY_VERSION_21, /*!< Hdmi Compatibility Version 2.1 */ - HDMI_COMPATIBILITY_VERSION_MAX /*!< Out of bounds */ - }dsHdmiMaxCapabilityVersion_t; - -typedef enum dsVRRType { - dsVRR_NONE, - dsVRR_HDMI_VRR, - dsVRR_AMD_FREESYNC, - dsVRR_AMD_FREESYNC_PREMIUM, - dsVRR_AMD_FREESYNC_PREMIUM_PRO -} dsVRRType_t; - -typedef enum _dsAVIScanInformation_t { - dsAVI_SCAN_TYPE_NO_DATA = 0, ///< No data signalling - S1=0, S0=0 - dsAVI_SCAN_TYPE_OVERSCAN = 1, ///< Overscan signalling - S1=0, S0=1 - dsAVI_SCAN_TYPE_UNDERSCAN = 2, ///< Underscan signalling - S1=1, S0=0 - dsAVI_SCAN_TYPE_MAX ///< Out of range -} dsAVIScanInformation_t; - -typedef struct _dsHdmiInVrrStatus_t -{ - dsVRRType_t vrrType; /*! Type of VRR */ - double vrrAmdfreesyncFramerate_Hz; /*! Display VRR FrameRate in Hz */ -} dsHdmiInVrrStatus_t; - -/*! DS Manager Event Data */ -typedef struct _DSMgr_EventData_t { - union { - struct _RESOLUTION_DATA { - /* Declare Event Data structure for Video resolution Event */ - int width; /*!< Resolution Width */ - int height; /*!< Key code */ - } resn; /*Reolution data*/ - struct _DFC_DATA { - /* Declare Event Data structure for Zoom settings Event */ - int zoomsettings; - } dfc; /*zoom data*/ - - struct _AUDIOMODE_DATA { - /* Declare Event Data structure for Video resolution Event */ - int type; /*!< device type */ - int mode; /*!< device mode */ - } Audioport; /*Audio mode data*/ - - struct _ATMOS_CAPS_CHANGE { - dsATMOSCapability_t caps; - bool status; - } AtmosCapsChange; - - struct _HDMI_HPD_DATA { - /* Declare HDMI HPD Data */ - int event; - } hdmi_hpd; /*HDMI Hot Plug detect*/ - - struct _HDMI_HDCP_DATA { - /* Declare HDMI DCP Data */ - int hdcpStatus; - } hdmi_hdcp; /*HDMI HDCP Hot Plug detect*/ - - struct _HDMI_RXSENSE_DATA { - /* Declare HDMI Rx Sense status */ - int status; - } hdmi_rxsense; /*HDMI Rx Sense Data*/ - - struct _HDMI_IN_CONNECT_DATA { - dsHdmiInPort_t port; - bool isPortConnected; - } hdmi_in_connect; - - struct _HDMI_IN_STATUS_DATA { - /* Declare HDMI Input status*/ - dsHdmiInPort_t port; - bool isPresented; - } hdmi_in_status; /*HDMI in status change detect*/ - - struct _HDMI_IN_SIG_STATUS_DATA { - /* Declare HDMI In signal status*/ - dsHdmiInPort_t port; - dsHdmiInSignalStatus_t status; - } hdmi_in_sig_status; /*HDMI in signal change detect*/ - - struct _HDMI_IN_VIDEO_MODE_DATA { - /* Declare HDMI In signal status*/ - dsHdmiInPort_t port; - dsVideoPortResolution_t resolution; - } hdmi_in_video_mode; /*HDMI in video mode update*/ - - struct _COMPOSITE_IN_CONNECT_DATA { - dsCompositeInPort_t port; - bool isPortConnected; - } composite_in_connect; - - struct _COMPOSITE_IN_STATUS_DATA { - /* Declare Composite Input status*/ - dsCompositeInPort_t port; - bool isPresented; - } composite_in_status; /*Composite in status change detect*/ - - struct _COMPOSITE_IN_SIG_STATUS_DATA { - /* Declare Composite In signal status*/ - dsCompositeInPort_t port; - dsCompInSignalStatus_t status; - } composite_in_sig_status; /*Composite in signal change detect*/ - - struct _COMPOSITE_IN_VIDEO_MODE_DATA{ - /* Declare COMPOSITE In Video Mode*/ - dsCompositeInPort_t port; - dsVideoPortResolution_t resolution; - }composite_in_video_mode; /*Composite in video mode update*/ - - struct _FPD_TIME_FORMAT { - dsFPDTimeFormat_t eTimeFormat; - } FPDTimeFormat; - - struct _HDCP_PROTOCOL_DATA { - dsHdcpProtocolVersion_t protocolVersion; - } HDCPProtocolVersion; - struct _SLEEP_MODE_DATA { - dsSleepMode_t sleepMode; - } sleepModeInfo; - - struct _AUDIO_LEVEL_DATA { - int level; - } AudioLevelInfo; - - struct _AUDIO_OUT_CONNECT_DATA { - dsAudioPortType_t portType; - unsigned int uiPortNo; - bool isPortConnected; - } audio_out_connect; - - struct _AUDIO_FORMAT_DATA { - dsAudioFormat_t audioFormat; - } AudioFormatInfo; - - struct _LANGUAGE_DATA { - char audioLanguage[MAX_LANGUAGE_LEN]; - } AudioLanguageInfo; - - struct _FADER_CONTROL_DATA { - int mixerbalance; - } FaderControlInfo; - - struct _ASSOCIATED_AUDIO_MIXING_DATA { - bool mixing; - } AssociatedAudioMixingInfo; - - struct _VIDEO_FORMAT_DATA { - dsHDRStandard_t videoFormat; - } VideoFormatInfo; - - struct _AUDIO_PORTSTATE_DATA { - dsAudioPortState_t audioPortState; - } AudioPortStateInfo; - - struct _HDMI_IN_ALLM_MODE_DATA { - /* Declare HDMI In ALLM Mode*/ - dsHdmiInPort_t port; - bool allm_mode; - } hdmi_in_allm_mode; /*HDMI in ALLM Mode change*/ - - struct _HDMI_IN_VRR_MODE_DATA{ - /* Declare HDMI In VRR Mode*/ - dsHdmiInPort_t port; - dsVRRType_t vrr_type; - }hdmi_in_vrr_mode; /*HDMI in VRR Mode change*/ - - struct _HDMI_IN_CONTENT_TYPE_DATA{ - dsHdmiInPort_t port; - dsAviContentType_t aviContentType; - }hdmi_in_content_type; - struct _HDMI_IN_AV_LATENCY{ - int audio_output_delay; - int video_latency; - }hdmi_in_av_latency; /*HDMI in AVLatency change*/ - struct _DISPLAY_FRAMERATE_CHANGE { - char framerate[20]; - }DisplayFrameRateChange; - } data; -} IARM_Bus_DSMgr_EventData_t; - -typedef enum _dsDisplayEvent_t { - dsDISPLAY_EVENT_CONNECTED = 0, //!< Display connected event. - dsDISPLAY_EVENT_DISCONNECTED, //!< Display disconnected event. - dsDISPLAY_RXSENSE_ON, //!< Rx Sense ON event - dsDISPLAY_RXSENSE_OFF, //!< Rx Sense OFF event - dsDISPLAY_HDCPPROTOCOL_CHANGE, //!< HDCP Protocol Version Change event - dsDISPLAY_EVENT_MAX -} dsDisplayEvent_t; - -typedef enum _dsDisplayColorSpace_t -{ - dsDISPLAY_COLORSPACE_UNKNOWN = 0, ///< Unknown color space - dsDISPLAY_COLORSPACE_RGB = 1, ///< RGB color space - dsDISPLAY_COLORSPACE_YCbCr422 = 2, ///< YCbCr4.2.2 color space - dsDISPLAY_COLORSPACE_YCbCr444 = 3, ///< YCbCr4.4.4 color space - dsDISPLAY_COLORSPACE_YCbCr420 = 4, ///< YCbCr4.2.0 color space - dsDISPLAY_COLORSPACE_AUTO = 5, ///< Automatic color space - dsDISPLAY_COLORSPACE_MAX ///< Out of range -} dsDisplayColorSpace_t; - -typedef enum _dsDisplayQuantizationRange_t -{ - dsDISPLAY_QUANTIZATIONRANGE_UNKNOWN = 0, ///< Unknown quantization range - dsDISPLAY_QUANTIZATIONRANGE_LIMITED = 1, ///< Limited quantization range - dsDISPLAY_QUANTIZATIONRANGE_FULL = 2, ///< Full quantization range - dsDISPLAY_QUANTIZATIONRANGE_MAX ///< Out of range -} dsDisplayQuantizationRange_t; - -typedef uint32_t dsFPDColor_t; -#define dsFPDColor_Make(R8,G8,B8) (((R8)<< 8)|((G8)<<8)|((B8) )) -#define dsFPD_COLOR_WHITE dsFPDColor_Make(0xFF, 0xFF, 0xFF) - -typedef struct _dsFPDColorConfig_t{ - int id; - dsFPDColor_t color; -}dsFPDColorConfig_t; - -namespace device { - -template -using List = std::vector; - -} - -namespace device { - -class Exception : public std::exception { - int _err; - std::string _msg; - -public: - Exception(const char* msg = "No Message for this exception") throw() - : _msg(msg) - { - } - - Exception(int err, const char* msg = "No Message for this Exception") throw() - : _err(err) - , _msg(msg){}; - - virtual const std::string& getMessage() const - { - return _msg; - } - - virtual int getCode() const - { - return _err; - } - - virtual const char* what() const throw() - { - return _msg.c_str(); - } - - virtual ~Exception() throw(){}; -}; - -} - -namespace device { -class AudioStereoModeImpl { -public: - virtual ~AudioStereoModeImpl() = default; - virtual const std::string& getName() const = 0; - - virtual std::string toString() = 0; - -}; - -class AudioStereoMode { -protected: - static AudioStereoModeImpl* impl; - int audioMode; - -public: - AudioStereoMode(); - static void setImpl(AudioStereoModeImpl* newImpl); - const std::string& getName() const; - - static const int kMono; //!< Indicates audio mode of type mono. - static const int kStereo; //!< Indicates audio mode of type stereo. - static const int kSurround; //!< Indicates audio mode of type surround. - static const int kPassThru; //!< Indicates audio mode of type pass through. - static const int kDD; //!< Indicates audio mode of type dolby digital. - static const int kDDPlus; //!< Indicates audio mode of type dolby digital plus. - static const int kMax; //!< Indicates maximum number of audio modes supported. - - bool operator==(const AudioStereoMode& other) const { - return audioMode == other.audioMode; - } - AudioStereoMode& operator=(int mode) { - audioMode = mode; - return *this; -} - - std::string toString(); - AudioStereoMode(int id); -}; - -} - -namespace device { - -class AudioOutputPortTypeImpl { -public: - virtual ~AudioOutputPortTypeImpl() = default; - - virtual int getId() const = 0; -}; - -class AudioOutputPortType { -protected: - static AudioOutputPortTypeImpl* impl; - -public: - AudioOutputPortType(); - static void setImpl(AudioOutputPortTypeImpl* newImpl); - - static const int kHDMI; - static const int kARC; - static const int kSPDIF; - static const int kSPEAKER; - static const int kHEADPHONE; - int getId() const; - - -}; - -} -namespace device { - -class AudioOutputPortImpl { -public: - virtual ~AudioOutputPortImpl() = default; - - virtual const AudioOutputPortType& getType() const = 0; - - virtual const std::string& getName() const = 0; - virtual std::vector getMS12AudioProfileList() const = 0; - virtual void getAudioCapabilities(int* capabilities) = 0; - virtual void getMS12Capabilities(int* capabilities) = 0; - virtual bool isAudioMSDecode() const = 0; - - virtual bool getEnablePersist() = 0; - virtual void getHdmiArcPortId(int *portId) = 0; - virtual bool isConnected() = 0; - virtual void setDRCMode(int DRCMode) = 0; - virtual void setCompression (int compresionLevel) = 0; - virtual int getCompression() = 0; - virtual void setDolbyVolumeMode(bool dolbyVolumeMode) = 0; - virtual void setDialogEnhancement(int enhancerlevel) = 0; - virtual int getDialogEnhancement() = 0; - virtual void resetDialogEnhancement() = 0; - virtual void setIntelligentEqualizerMode (int intelligentEqualizerMode) = 0; - virtual int getIntelligentEqualizerMode() = 0; - virtual void setGraphicEqualizerMode (int graphicEqualizerMode) = 0; - virtual int getGraphicEqualizerMode() = 0; - virtual void setMS12AudioProfile(std::string audioProfileName) = 0; - virtual void resetVolumeLeveller() = 0; - virtual void resetSurroundVirtualizer() = 0; - virtual void resetBassEnhancer() = 0; - virtual void getSupportedARCTypes(int *types) = 0; - virtual void setEnablePersist(bool pEnable) = 0; - virtual dsError_t setEnablePort(bool pEnable) = 0; - virtual bool isMuted() = 0; - virtual void setAudioAtmosOutputMode (int enable) = 0; - virtual bool getSinkDeviceAtmosCapability(dsATMOSCapability_t& atmosCapability) = 0; - virtual void setAudioDelayOffset(int audioDelayOffsetMs) = 0; - virtual void setAudioDelay(int audioDelayMs) = 0; - virtual void getAudioDelay(uint32_t audioDelayMs) = 0; - virtual void getSecondaryLanguage(std::string secondaryLanguage) = 0; - virtual void setSecondaryLanguage(std::string secondaryLanguage) = 0; - virtual void setPrimaryLanguage(std::string primaryLanguage) = 0; - virtual void getPrimaryLanguage(std::string primaryLanguage) = 0; - virtual void getFaderControl(int *mixerBalance) = 0; - virtual void setFaderControl(int mixerBalance) = 0; - virtual void setAssociatedAudioMixing(bool mixing) = 0; - virtual void setGain(float newGain) = 0; - virtual void setMISteering(bool MISteering) = 0; - virtual void setSurroundVirtualizer(dsSurroundVirtualizer_t surroundVirtualizer) = 0; - virtual void setBassEnhancer(int bassBoost) = 0; - virtual void enableSurroundDecoder(bool enableSurroundDecoder) = 0; - virtual void setVolumeLeveller(dsVolumeLeveller_t volumeLeveller) = 0; - virtual bool getMISteering() = 0; - virtual dsSurroundVirtualizer_t getSurroundVirtualizer() = 0; - virtual int getDRCMode() = 0; - virtual float getLevel() = 0; - virtual float getGain() = 0; - virtual bool isSurroundDecoderEnabled() = 0; - virtual int getBassEnhancer() = 0; - virtual dsVolumeLeveller_t getVolumeLeveller() = 0; - virtual bool getStereoAuto() = 0; - virtual void setStereoAuto(bool stereoAuto, bool persist) = 0; - virtual std::string getMS12AudioProfile() = 0; - virtual void setMS12AudioProfileSetttingsOverride(std::string audioProfileState,std::string audioProfileName,std::string audioProfileSettingsName, std::string audioProfileSettingValue) = 0; - virtual void setLevel(float level) = 0; - virtual void setMuted(bool muted) = 0; - virtual void getAssociatedAudioMixing(bool *mixing) = 0; - virtual bool isEnabled() = 0; - virtual void setSAD(std::vector sad_list) = 0; - virtual void reInitializeAudioOutputPort() = 0; - virtual void getAudioDelayOffset (uint32_t audioDelayOffsetMs) = 0; - // virtual const List getSupportedStereoModes() const = 0; - virtual std::vector getSupportedStereoModes() const = 0; - - - - - virtual AudioStereoMode getStereoMode(const bool toPersist) const= 0; - - virtual AudioStereoMode getStereoMode() const= 0; - - - virtual void enableARC(dsAudioARCTypes_t type, bool enable) = 0; - - virtual uint32_t getDolbyVolumeMode() const = 0; - - virtual void setStereoMode(const std::string &mode, bool persist) = 0; - - -}; - -class AudioOutputPort { -protected: - static AudioOutputPortImpl* impl; - -public: - AudioOutputPort(); - static void setImpl(AudioOutputPortImpl* newImpl); - static AudioOutputPort& getInstance(); - - const AudioOutputPortType& getType() const; - - // dsATMOSCapability_t atmosCapability=dsATMOSCapability_t::dsAUDIO_ATMOS_ATMOSMETADATA; - const std::string& getName() const; - std::vector getMS12AudioProfileList() const; - void getAudioCapabilities(int* capabilities); - void getMS12Capabilities(int* capabilities); - bool isAudioMSDecode(); - void reInitializeAudioOutputPort(); - bool getEnablePersist(); - void getHdmiArcPortId(int *portId); - bool isConnected(); - - int getDRCMode(); - void setDRCMode(int DRCMode); - void setCompression (int compresionLevel); - int getCompression(); - void setDolbyVolumeMode(bool dolbyVolumeMode); - - void setDialogEnhancement(int enhancerlevel); - int getDialogEnhancement(); - void setIntelligentEqualizerMode (int intelligentEqualizerMode); - int getIntelligentEqualizerMode(); - void setGraphicEqualizerMode (int graphicEqualizerMode); - int getGraphicEqualizerMode(); - void setMS12AudioProfile(std::string audioProfileName); - void resetVolumeLeveller(); - void resetSurroundVirtualizer(); - void resetBassEnhancer(); - void resetDialogEnhancement(); - void getSupportedARCTypes(int *types); - void setEnablePersist(bool pEnable); - dsError_t setEnablePort(bool pEnable); - bool isMuted(); - void setAudioAtmosOutputMode (int enable); - bool getSinkDeviceAtmosCapability(dsATMOSCapability_t& atmosCapability); - void setAudioDelayOffset(int audioDelayOffsetMs); - void setAudioDelay(int audioDelayMs); - void getAudioDelay(uint32_t audioDelayMs); - void getSecondaryLanguage(std::string secondaryLanguage); - void setSecondaryLanguage(std::string secondaryLanguage); - void setPrimaryLanguage(std::string primaryLanguage); - void getPrimaryLanguage(std::string primaryLanguage); - void getFaderControl(int *mixerBalance); - void setFaderControl(int mixerBalance); - void setAssociatedAudioMixing(bool mixing); - void setGain(float newGain); - void setMISteering(bool MISteering); - void setSurroundVirtualizer(dsSurroundVirtualizer_t surroundVirtualizer); - void setBassEnhancer(int bassBoost); - void enableSurroundDecoder(bool enableSurroundDecoder); - void setVolumeLeveller(dsVolumeLeveller_t volumeLeveller); - bool getMISteering(); - dsSurroundVirtualizer_t getSurroundVirtualizer(); - float getLevel(); - float getGain(); - bool isSurroundDecoderEnabled(); - int getBassEnhancer(); - dsVolumeLeveller_t getVolumeLeveller(); - bool getStereoAuto(); - void setStereoAuto(bool stereoAuto, bool persist); - std::string getMS12AudioProfile(); - void setMS12AudioProfileSetttingsOverride(std::string audioProfileState,std::string audioProfileName,std::string audioProfileSettingsName, std::string audioProfileSettingValue); - void setLevel(float level); - void setMuted(bool muted); - void getAssociatedAudioMixing(bool *mixing); - bool isEnabled(); - void setSAD(std::vector sad_list); - void getAudioDelayOffset (uint32_t audioDelayOffsetMs); - - // const List getSupportedStereoModes() const; - const std::vector getSupportedStereoModes() const; - - AudioStereoMode getStereoMode(const bool toPersist) const; - - AudioStereoMode getStereoMode() const; - - void enableARC(dsAudioARCTypes_t type, bool enable); - uint32_t getDolbyVolumeMode() const; - void setStereoMode(const std::string &mode, bool persist); - void setAudioDucking(dsAudioDuckingAction_t action, dsAudioDuckingType_t type, float level) { - (void)action; - (void)type; - (void)level; - } - - - - -}; - -} - -namespace device { -class CompositeInputImpl { -public: - virtual ~CompositeInputImpl() = default; - virtual uint8_t getNumberOfInputs() const = 0; - virtual bool isPortConnected(int8_t Port) const = 0; - virtual void selectPort(int8_t Port) const = 0; - virtual void scaleVideo(int32_t x, int32_t y, int32_t width, int32_t height) const = 0; -}; - -class CompositeInput { -protected: - static CompositeInputImpl* impl; - -public: - CompositeInput(); - static void setImpl(CompositeInputImpl* newImpl); - static CompositeInput& getInstance(); - - uint8_t getNumberOfInputs() const; - bool isPortConnected(int8_t port) const; - void selectPort(int8_t port) const; - void scaleVideo(int32_t x, int32_t y, int32_t width, int32_t height) const; -}; - -} - -namespace device { - -class HdmiInputImpl { -public: - virtual ~HdmiInputImpl() = default; - - virtual uint8_t getNumberOfInputs() const = 0; - virtual bool isPortConnected(int8_t Port) const = 0; - virtual std::string getCurrentVideoMode() const = 0; - virtual void selectPort(int8_t Port,bool audioMix = false, int videoPlane = 0,bool topMost = false) const = 0; - virtual void scaleVideo(int32_t x, int32_t y, int32_t width, int32_t height) const = 0; - // virtual void setAudioMixerLevels(dsAudioInput_t gain, int volume) const = 0; - virtual void getEDIDBytesInfo(int iHdmiPort, std::vector& edid) const = 0; - virtual void getHDMISPDInfo(int iHdmiPort, std::vector& data) const = 0; - virtual void setEdidVersion(int iHdmiPort, int iEdidVersion) const = 0; - virtual void getEdidVersion(int iHdmiPort, int* iEdidVersion) const = 0; - virtual void getHdmiALLMStatus(int iHdmiPort, bool* allmStatus) const = 0; - virtual void getVRRStatus(int iHdmiPort, dsHdmiInVrrStatus_t *vrrStatus) const = 0; - virtual void getSupportedGameFeatures(std::vector& featureList) const = 0; - virtual void getAVLatency(int *audio_output_delay, int *video_latency) const = 0; - virtual void setEdid2AllmSupport(int iHdmiPort, bool allmsupport) const = 0; - virtual void getEdid2AllmSupport(int iHdmiPort, bool *allmsupport) const = 0; - virtual void setVRRSupport(int iHdmiPort, bool vrrsupport) const = 0; - virtual void getVRRSupport(int iHdmiPort, bool *vrrsupport) const = 0; - virtual void getCurrentVideoModeObj (dsVideoPortResolution_t &resolution) const = 0; - virtual void getHdmiVersion (int iHdmiPort, dsHdmiMaxCapabilityVersion_t *capversion) const = 0; - virtual dsError_t getHDMIARCPortId(int &portId) const = 0; -}; - -class HdmiInput { -protected: - static HdmiInputImpl* impl; - -public: - HdmiInput(); - static void setImpl(HdmiInputImpl* newImpl); - static HdmiInput& getInstance(); // Changed return type - - uint8_t getNumberOfInputs() const; - bool isPortConnected(int8_t port) const; - std::string getCurrentVideoMode() const; - void selectPort(int8_t Port,bool audioMix = false, int videoPlane = 0,bool topMost = false) const; - void scaleVideo(int32_t x, int32_t y, int32_t width, int32_t height) const; - void getEDIDBytesInfo(int iHdmiPort, std::vector& edid) const; - void getHDMISPDInfo(int iHdmiPort, std::vector& data) const; - void setEdidVersion(int iHdmiPort, int iEdidVersion) const; - void getEdidVersion(int iHdmiPort, int* iEdidVersion) const; - - void getHdmiALLMStatus(int iHdmiPort, bool* allmStatus) const; - void getVRRStatus(int iHdmiPort, dsHdmiInVrrStatus_t *vrrStatus) const; - void getSupportedGameFeatures(std::vector& featureList) const; - void getAVLatency(int *audio_output_delay, int *video_latency)const; - void setEdid2AllmSupport(int iport, bool allmSupport) const; - void getEdid2AllmSupport(int iport, bool *allmSupport) const; - void setVRRSupport(int iHdmiPort, bool vrrsupport) const; - void getVRRSupport(int iHdmiPort, bool *vrrsupport) const; - void getCurrentVideoModeObj (dsVideoPortResolution_t &resolution) const; - void getHdmiVersion (int iHdmiPort, dsHdmiMaxCapabilityVersion_t *capversion) const; - dsError_t getHDMIARCPortId(int &portId) const; -}; - -} - -namespace device { -class SleepMode; -class SleepModeImpl { -public: - virtual ~SleepModeImpl() = default; - virtual SleepMode & getInstanceById(int id) = 0; - virtual SleepMode & getInstanceByName(const std::string &name) = 0; - virtual List getSleepModes() = 0; - virtual const std::string& toString() const = 0; -}; - -class SleepMode { -protected: - static SleepModeImpl* impl; - -public: - SleepMode(); - static void setImpl(SleepModeImpl* newImpl); - - static SleepMode& getInstance(); - static SleepMode& getInstance(int id); - static SleepMode& getInstance(const std::string &name); - - List getSleepModes(); - const std::string& toString() const; -}; -} - - -namespace device { - -class VideoDFCImpl { -public: - virtual ~VideoDFCImpl() = default; - virtual const std::string& getName() const = 0; - -}; - -class VideoDFC { -protected: - static VideoDFCImpl* impl; - -public: - VideoDFC(); - static void setImpl(VideoDFCImpl* newImpl); - const std::string& getName() const; - -}; - -} - -namespace device { - -class VideoDeviceImpl { -public: - virtual ~VideoDeviceImpl() = default; - - virtual int getFRFMode(int* frfmode) const = 0; - virtual int setFRFMode(int frfmode) const = 0; - virtual int getCurrentDisframerate(char* framerate) const = 0; - virtual int setDisplayframerate(const char* framerate) const = 0; - virtual void setDFC(std::string zoomSetting) = 0; - virtual const VideoDFC& getDFC() = 0; - virtual void getHDRCapabilities(int* capabilities) = 0; - virtual void getSettopSupportedResolutions(std::list& resolutions) = 0; -}; - -class VideoDevice { -protected: - static VideoDeviceImpl* impl; - -public: - VideoDevice(); - - static void setImpl(VideoDeviceImpl* newImpl); - static VideoDevice& getInstance(); - - int getFRFMode(int* frfmode) const; - int setFRFMode(int frfmode) const; - int getCurrentDisframerate(char* framerate) const; - int setDisplayframerate(const char* framerate) const; - - const VideoDFC& getDFC(); - void setDFC(std::string zoomSetting); - void getHDRCapabilities(int* capabilities); - void getSettopSupportedResolutions(std::list& resolutions); - -}; - -} - -namespace device { - -class DSConstant { -private: - bool enabled; - -protected: - int _id; - std::string _name; - - -public: - - DSConstant() : enabled(false), _id(0), _name("_UNASSIGNED NAME_"){}; - - DSConstant(const int id, const std::string &name) : enabled(false), _id(id), _name(name){}; - - virtual ~DSConstant() {}; - - virtual bool operator==(int id) const { - return id == _id; - } - -}; - -} - -namespace device { - class PixelResolution : public DSConstant{ - public: - static const int k720x480; //!< Indicates 720x480 video resolution. - static const int k720x576; //!< Indicates 720x576 video resolution. - static const int k1280x720; //!< Indicates 1280x720 video resolution. - static const int k1366x768; //!< Indicates 1366x768 video resolution. - static const int k1920x1080; //!< Indicates 1920x1080 video resolution. - - static const int k3840x2160; //!< Indicates 3840x2160 video resolution. - static const int k4096x2160; //!< Indicates 4096x2160 video resolution. - - static const int kMax; //!< Indicates the maximum number of video resolutions supported. - - PixelResolution(int id); - PixelResolution() = default; - virtual ~PixelResolution() = default; - }; -} - -namespace device { - - class FrameRate : public DSConstant { - float _value; //!< Indicates the supported frame rate value in fps. - public: - static const int kUnknown; //!< Indicates video frame rate of unknown type. - static const int k24; //!< Indicates video frame rate of 24 fps. - static const int k25; //!< Indicates video frame rate of 25 fps. - static const int k30; //!< Indicates video frame rate of 30 fps. - static const int k60; //!< Indicates video frame rate of 60 fps. - static const int k23dot98; //!< Indicates video frame rate of 23.98 fps. - static const int k29dot97; //!< Indicates video frame rate of 29.97 fps. - static const int k50; //!< Indicates video frame rate of 50 fps. - static const int k59dot94; //!< Indicates video frame rate of 59.94 fps. - static const int kMax; //!< Indicates maximum number of frame rates supported. - - virtual ~FrameRate() = default; - - FrameRate(int id); - FrameRate(float value); - }; - -} - -namespace device { - -class VideoResolutionImpl { -public: - virtual ~VideoResolutionImpl() = default; - - virtual const std::string& getName() const = 0; - virtual const PixelResolution& getPixelResolution() const = 0; - virtual const FrameRate& getFrameRate() const = 0; -}; - -class VideoResolution { -protected: - static VideoResolutionImpl* impl; - -public: - static void setImpl(VideoResolutionImpl* newImpl); - const std::string& getName() const; - const PixelResolution & getPixelResolution() const; - const FrameRate & getFrameRate() const; -}; - -} - -namespace device { - -class VideoOutputPortTypeImpl { -public: - virtual ~VideoOutputPortTypeImpl() = default; - - virtual int getId() const = 0; - virtual const List getSupportedResolutions() const = 0; -}; - -class VideoOutputPortType : public DSConstant{ -protected: - static VideoOutputPortTypeImpl* impl; - -public: - VideoOutputPortType(); - VideoOutputPortType(int type){ - _id = type; - } - - static void setImpl(VideoOutputPortTypeImpl* newImpl); - - int getId() const; - const List getSupportedResolutions() const; - - static const int kRF; - static const int kBaseband; - static const int kSVideo; - static const int k1394; - static const int kDVI; - static const int kComponent; - static const int kHDMI; - static const int kInternal; - static const int kScart; - static const int kMax; -}; - -} - -namespace device{ - class DisplayImpl{ - public: - virtual ~DisplayImpl() = default; - - virtual void getEDIDBytes(std::vector &edid) const = 0; - virtual bool isConnectedDeviceRepeater() = 0; - virtual int getSurroundMode() = 0; - virtual void setAllmEnabled(bool enable) = 0; - virtual void setAVIContentType(int contentType) = 0; - virtual void setAVIScanInformation(int scanInfo) = 0; - }; - class Display { - protected: - static DisplayImpl* impl; - - public: - static void setImpl(DisplayImpl* newImpl); - static Display& getInstance(); - - void getEDIDBytes(std::vector& edid); - int getSurroundMode(); - bool isConnectedDeviceRepeater(); - void setAllmEnabled(bool enable); - void setAVIContentType(int contentType); - void setAVIScanInformation(int scanInfo); - -}; - -} - -namespace device { - -class VideoOutputPortImpl { -public: - virtual ~VideoOutputPortImpl() = default; - - virtual const VideoOutputPortType& getType() const = 0; - virtual const std::string& getName() const = 0; - virtual const VideoResolution& getDefaultResolution() const = 0; - virtual int getHDCPProtocol() = 0; - virtual int getHDCPReceiverProtocol() = 0; - virtual int getHDCPCurrentProtocol() = 0; - virtual int getHDCPStatus() = 0; - virtual AudioOutputPort& getAudioOutputPort() const = 0; - virtual bool isDisplayConnected() = 0; - virtual bool isContentProtected() = 0; - virtual Display& getDisplay() = 0; - virtual bool setScartParameter(std::string sScartParameter, std::string sScartParameterData) = 0; - - virtual void getTVHDRCapabilities(int* capabilities) = 0; - virtual bool setForceHDRMode (dsHDRStandard_t mode) = 0; - virtual int getPreferredColorDepth(bool persist) = 0; - virtual void getColorDepthCapabilities(unsigned int *capabilities) = 0; - virtual void setPreferredColorDepth(dsDisplayColorDepth_t colorDepth, bool persist) = 0; - virtual bool getCurrentOutputSettings(int& videoEOTF, int& matrixCoefficients, int& colorSpace, int& colorDepth, int& quantizationRange) = 0; - virtual bool isConnected() const = 0; - virtual void setResolution(std::string resolution, bool persist, bool isIgnoreEdid) = 0; - - virtual const VideoResolution& getResolution() const =0; - - virtual void getSupportedTvResolutions(int *tvResolutions) = 0; - virtual int getVideoEOTF() = 0; - virtual bool isActive() = 0; - virtual void setAllmEnabled(bool enable) = 0; - - virtual int GetHdmiPreference() = 0; - virtual bool SetHdmiPreference(dsHdcpProtocolVersion_t hdcpProtocol) = 0; - virtual int getColorSpace() const = 0; - virtual int getColorDepth() const = 0; - virtual int getQuantizationRange() const = 0; - virtual bool IsOutputHDR() = 0; - - -}; - -class VideoOutputPort { -protected: - static VideoOutputPortImpl* impl; - -public: - VideoOutputPort(); - - static void setImpl(VideoOutputPortImpl* newImpl); - static VideoOutputPort& getInstance(); - - const VideoOutputPortType& getType() const; - const std::string& getName() const; - const VideoResolution& getDefaultResolution() const; - int getHDCPProtocol(); - int getHDCPReceiverProtocol(); - int getHDCPCurrentProtocol(); - int getHDCPStatus(); - AudioOutputPort& getAudioOutputPort(); - bool isDisplayConnected(); - bool isContentProtected(); - Display& getDisplay(); - void getSupportedTvResolutions(int *tvResolutions); - const VideoResolution& getResolution() const; - - void setResolution(std::string resolution, bool persist, bool isIgnoreEdid); - bool getCurrentOutputSettings(int& videoEOTF, int& matrixCoefficients, int& colorSpace, int& colorDepth, int& quantizationRange); - - void setPreferredColorDepth(dsDisplayColorDepth_t colorDepth, bool persist); - void getColorDepthCapabilities(unsigned int *capabilities); - int getPreferredColorDepth(bool persist); - bool setForceHDRMode (dsHDRStandard_t mode); - void getTVHDRCapabilities(int* capabilities); - bool setScartParameter(std::string sScartParameter, std::string sScartParameterData); - int getVideoEOTF(); - bool isActive(); - void setAllmEnabled(bool enable); - int GetHdmiPreference(); - bool SetHdmiPreference(dsHdcpProtocolVersion_t hdcpProtocol); - int getColorSpace() const; - int getColorDepth() const; - int getQuantizationRange() const; - bool IsOutputHDR(); - -}; - -} - -namespace device { - -class VideoOutputPortConfigImpl { -public: - virtual ~VideoOutputPortConfigImpl() = default; - - virtual VideoOutputPortType& getPortType(int id) = 0; - virtual VideoOutputPort& getPort(const std::string& name) = 0; -}; - -class VideoOutputPortConfig { -protected: - static VideoOutputPortConfigImpl* impl; - -public: - VideoOutputPortConfig(); - - static void setImpl(VideoOutputPortConfigImpl* newImpl); - static VideoOutputPortConfig& getInstance(); - - VideoOutputPortType& getPortType(int id); - VideoOutputPort& getPort(const std::string& name); -}; - -} - -class ManagerImpl { -public: - virtual ~ManagerImpl() = default; - - virtual void Initialize() = 0; - virtual void DeInitialize() = 0; -}; - -namespace device { -class Manager { -protected: - static ManagerImpl* impl; - -public: - Manager(); - - static void setImpl(ManagerImpl* newImpl); - static Manager& getInstance(); - - inline static bool IsInitialized = false; - static void Initialize(); - static void DeInitialize(); -}; -} - -namespace device { - -class HostImpl; -class IDisplayEventsImpl; -class IAudioOutputPortEventsImpl; -class IDisplayDeviceEventsImpl; -class IHdmiInEventsImpl; -class IVideoDeviceEventsImpl; -class IVideoOutputPortEventsImpl; -class ICompositeInEventsImpl; - -class Host { -protected: - static HostImpl* impl; - -public: - static void setImpl(HostImpl* newImpl); - static Host& getInstance(); - - SleepMode getPreferredSleepMode(); - int setPreferredSleepMode(const SleepMode mode); - List getAvailableSleepModes(); - List getVideoOutputPorts(); - List getAudioOutputPorts(); - List getVideoDevices(); - VideoOutputPort& getVideoOutputPort(const std::string& name); - AudioOutputPort& getAudioOutputPort(const std::string& name); - void getHostEDID(std::vector& edid) const; - std::string getDefaultVideoPortName(); - std::string getDefaultAudioPortName(); - - void getMS12ConfigDetails(std::string type); - bool isHDMIOutPortPresent(); - void getSecondaryLanguage(std::string secondaryLanguage); - void setSecondaryLanguage(std::string secondaryLanguage); - void getSinkDeviceAtmosCapability(dsATMOSCapability_t atmosCapability); - void getFaderControl(int *mixerBalance); - void setFaderControl(int mixerBalance); - void setPrimaryLanguage(std::string primaryLanguage); - void getPrimaryLanguage(std::string primaryLanguage); - void setAudioAtmosOutputMode (int enable); - void setAssociatedAudioMixing(bool mixing); - void getCurrentAudioFormat(dsAudioFormat_t audioFormat); - void getAssociatedAudioMixing(bool *mixing); - void setAudioMixerLevels(dsAudioInput_t gain, int volume) ; - -class IDisplayEvents { - protected: - static IDisplayEventsImpl* impl; - - public: - static void setImpl(IDisplayEventsImpl* newImpl); - static IDisplayEvents& getInstance(); - virtual void OnDisplayRxSense(dsDisplayEvent_t displayEvent); -}; - -class IAudioOutputPortEvents { - protected: - static IAudioOutputPortEventsImpl* impl; - - public: - static void setImpl(IAudioOutputPortEventsImpl* newImpl); - static IAudioOutputPortEvents& getInstance(); - virtual void OnAudioOutHotPlug(dsAudioPortType_t portType, uint32_t uiPortNumber, bool isPortConnected); - virtual void OnAudioFormatUpdate(dsAudioFormat_t audioFormat); - virtual void OnDolbyAtmosCapabilitiesChanged(dsATMOSCapability_t atmosCapability, bool status); - virtual void OnAudioPortStateChanged(dsAudioPortState_t audioPortState); - virtual void OnAssociatedAudioMixingChanged(bool mixing); - virtual void OnAudioFaderControlChanged(int mixerBalance); - virtual void OnAudioPrimaryLanguageChanged(const std::string& primaryLanguage); - virtual void OnAudioSecondaryLanguageChanged(const std::string& secondaryLanguage); - virtual void OnAudioModeEvent(dsAudioPortType_t audioPortType, dsAudioStereoMode_t audioStereoMode); - virtual void OnAudioLevelChangedEvent(int audioLevel); -}; - -class IDisplayDeviceEvents { - protected: - static IDisplayDeviceEventsImpl* impl; - public: - static void setImpl(IDisplayDeviceEventsImpl* newImpl); - static IDisplayDeviceEvents& getInstance(); - - virtual void OnDisplayHDMIHotPlug(dsDisplayEvent_t displayEvent); -}; - -class IHdmiInEvents { - protected: - static IHdmiInEventsImpl* impl; - - public: - static void setImpl(IHdmiInEventsImpl* newImpl); - static IHdmiInEvents& getInstance(); - - virtual void OnHdmiInEventHotPlug(dsHdmiInPort_t port, bool isConnected); - virtual void OnHdmiInEventSignalStatus(dsHdmiInPort_t port, dsHdmiInSignalStatus_t signalStatus); - virtual void OnHdmiInEventStatus(dsHdmiInPort_t activePort, bool isPresented); - virtual void OnHdmiInVideoModeUpdate(dsHdmiInPort_t port, const dsVideoPortResolution_t& videoPortResolution); - virtual void OnHdmiInAllmStatus(dsHdmiInPort_t port, bool allmStatus); - virtual void OnHdmiInAVIContentType(dsHdmiInPort_t port, dsAviContentType_t aviContentType); - virtual void OnHdmiInVRRStatus(dsHdmiInPort_t port, dsVRRType_t vrrType); - virtual void OnHdmiInAVLatency(int audioDelay, int videoDelay); -}; - -class ICompositeInEvents { - protected: - static ICompositeInEventsImpl* impl; - - public: - static void setImpl(ICompositeInEventsImpl* newImpl); - static ICompositeInEvents& getInstance(); - - virtual void OnCompositeInHotPlug(dsCompositeInPort_t port, bool isConnected); - virtual void OnCompositeInSignalStatus(dsCompositeInPort_t port, dsCompInSignalStatus_t signalStatus); - virtual void OnCompositeInStatus(dsCompositeInPort_t activePort, bool isPresented); - virtual void OnCompositeInVideoModeUpdate(dsCompositeInPort_t activePort, dsVideoPortResolution_t videoResolution); - }; - -class IVideoDeviceEvents { - protected: - static IVideoDeviceEventsImpl* impl; - - public: - static void setImpl(IVideoDeviceEventsImpl* newImpl); - static IVideoDeviceEvents& getInstance(); - - virtual void OnZoomSettingsChanged(dsVideoZoom_t zoomSetting); - virtual void OnDisplayFrameratePreChange(const std::string& frameRate); - virtual void OnDisplayFrameratePostChange(const std::string& frameRate); -}; - -class IVideoOutputPortEvents { - protected: - static IVideoOutputPortEventsImpl* impl; - - public: - static void setImpl(IVideoOutputPortEventsImpl* newImpl); - static IVideoOutputPortEvents& getInstance(); - - virtual void OnResolutionPreChange(const int width, const int height); - virtual void OnResolutionPostChange(const int width, const int height); - virtual void OnVideoFormatUpdate(dsHDRStandard_t videoFormatHDR); - virtual void OnHDCPStatusChange(dsHdcpStatus_t hdcpStatus); -}; - -virtual dsError_t Register(IVideoDeviceEvents* listener, const std::string& clientName = ""); -virtual dsError_t UnRegister(IVideoDeviceEvents* listener); -virtual dsError_t Register(IDisplayEvents* listener, const std::string& clientName = ""); -virtual dsError_t UnRegister(IDisplayEvents* listener); -virtual dsError_t Register(IAudioOutputPortEvents* listener, const std::string& clientName = ""); -virtual dsError_t UnRegister(IAudioOutputPortEvents* listener); -virtual dsError_t Register(IDisplayDeviceEvents* listener, const std::string& clientName = ""); -virtual dsError_t UnRegister(IDisplayDeviceEvents* listener); -virtual dsError_t Register(IHdmiInEvents* listener, const std::string& clientName = ""); -virtual dsError_t UnRegister(IHdmiInEvents* listener); -virtual dsError_t Register(IVideoOutputPortEvents* listener, const std::string& clientName = ""); -virtual dsError_t UnRegister(IVideoOutputPortEvents* listener); -virtual dsError_t Register(ICompositeInEvents* listener, const std::string& clientName = ""); -virtual dsError_t UnRegister(ICompositeInEvents* listener); -}; - -class HostImpl { -public: - virtual ~HostImpl() = default; - virtual SleepMode getPreferredSleepMode() = 0; - virtual int setPreferredSleepMode(const SleepMode mode) = 0; - virtual List getAvailableSleepModes() = 0; - virtual List getVideoOutputPorts() = 0; - virtual List getAudioOutputPorts() = 0; - virtual List getVideoDevices() = 0; - virtual VideoOutputPort& getVideoOutputPort(const std::string& name) = 0; - virtual AudioOutputPort& getAudioOutputPort(const std::string& name) = 0; - virtual void getHostEDID(std::vector& edid) const = 0; - virtual std::string getDefaultVideoPortName() = 0; - virtual std::string getDefaultAudioPortName() = 0; - - virtual void getMS12ConfigDetails(std::string type)=0; - virtual bool isHDMIOutPortPresent() = 0; - virtual void getSecondaryLanguage(std::string secondaryLanguage) = 0; - virtual void setSecondaryLanguage(std::string secondaryLanguage) = 0; - virtual void getSinkDeviceAtmosCapability(dsATMOSCapability_t atmosCapability) = 0; - virtual void getFaderControl(int *mixerBalance) = 0; - virtual void setFaderControl(int mixerBalance) = 0; - virtual void setPrimaryLanguage(std::string primaryLanguage) = 0; - virtual void getPrimaryLanguage(std::string primaryLanguage) = 0; - virtual void setAudioAtmosOutputMode (int enable) = 0; - virtual void setAssociatedAudioMixing(bool mixing) = 0; - virtual void getCurrentAudioFormat(dsAudioFormat_t audioFormat) = 0; - virtual void getAssociatedAudioMixing(bool *mixing) = 0; - virtual void setAudioMixerLevels(dsAudioInput_t inputType, int volumeLevel) = 0; - - virtual dsError_t Register(Host::IDisplayEvents* listener) = 0; - virtual dsError_t UnRegister(Host::IDisplayEvents* listener) = 0; - virtual dsError_t Register(Host::IAudioOutputPortEvents* listener) = 0; - virtual dsError_t UnRegister(Host::IAudioOutputPortEvents* listener) = 0; - virtual dsError_t Register(Host::IDisplayDeviceEvents* listener) = 0; - virtual dsError_t UnRegister(Host::IDisplayDeviceEvents* listener) = 0; - virtual dsError_t Register(Host::IHdmiInEvents* listener) = 0; - virtual dsError_t UnRegister(Host::IHdmiInEvents* listener) = 0; - virtual dsError_t Register(Host::IVideoDeviceEvents* listener) = 0; - virtual dsError_t UnRegister(Host::IVideoDeviceEvents* listener) = 0; - virtual dsError_t Register(Host::IVideoOutputPortEvents* listener) = 0; - virtual dsError_t UnRegister(Host::IVideoOutputPortEvents* listener) = 0; - virtual dsError_t Register(Host::ICompositeInEvents* listener) = 0; - virtual dsError_t UnRegister(Host::ICompositeInEvents* listener) = 0; -}; - - -class IDisplayEventsImpl { -public: - virtual ~IDisplayEventsImpl() = default; - virtual void OnDisplayRxSense(dsDisplayEvent_t displayEvent) = 0; -}; - -class IAudioOutputPortEventsImpl { -public: - virtual ~IAudioOutputPortEventsImpl() = default; - - virtual void OnAudioOutHotPlug(dsAudioPortType_t portType, uint32_t uiPortNumber, bool isPortConnected) = 0; - virtual void OnAudioFormatUpdate(dsAudioFormat_t audioFormat) = 0; - virtual void OnDolbyAtmosCapabilitiesChanged(dsATMOSCapability_t atmosCapability, bool status) = 0; - virtual void OnAudioPortStateChanged(dsAudioPortState_t audioPortState) = 0; - virtual void OnAssociatedAudioMixingChanged(bool mixing) = 0; - virtual void OnAudioFaderControlChanged(int mixerBalance) = 0; - virtual void OnAudioPrimaryLanguageChanged(const std::string& primaryLanguage) = 0; - virtual void OnAudioSecondaryLanguageChanged(const std::string& secondaryLanguage) = 0; - virtual void OnAudioModeEvent(dsAudioPortType_t audioPortType, dsAudioStereoMode_t audioStereoMode) = 0; - virtual void OnAudioLevelChangedEvent(int audioLevel) = 0; - -}; - -class IDisplayDeviceEventsImpl { -public: - virtual ~IDisplayDeviceEventsImpl() = default; - - virtual void OnDisplayHDMIHotPlug(dsDisplayEvent_t displayEvent) = 0; -}; - -class IHdmiInEventsImpl { -public: - virtual ~IHdmiInEventsImpl() = default; - - virtual void OnHdmiInEventHotPlug(dsHdmiInPort_t port, bool isConnected) = 0; - virtual void OnHdmiInEventSignalStatus(dsHdmiInPort_t port, dsHdmiInSignalStatus_t signalStatus) = 0; - virtual void OnHdmiInEventStatus(dsHdmiInPort_t activePort, bool isPresented) = 0; - virtual void OnHdmiInVideoModeUpdate(dsHdmiInPort_t port, const dsVideoPortResolution_t& videoPortResolution) = 0; - virtual void OnHdmiInAllmStatus(dsHdmiInPort_t port, bool allmStatus) = 0; - virtual void OnHdmiInAVIContentType(dsHdmiInPort_t port, dsAviContentType_t aviContentType) = 0; - virtual void OnHdmiInVRRStatus(dsHdmiInPort_t port, dsVRRType_t vrrType) = 0; - virtual void OnHdmiInAVLatency(int audioDelay, int videoDelay) = 0; - -}; - - class ICompositeInEventsImpl { - public: - virtual ~ICompositeInEventsImpl() = default; - virtual void OnCompositeInHotPlug(dsCompositeInPort_t port, bool isConnected) = 0; - virtual void OnCompositeInSignalStatus(dsCompositeInPort_t port, dsCompInSignalStatus_t signalStatus) = 0; - virtual void OnCompositeInStatus(dsCompositeInPort_t activePort, bool isPresented) = 0; - virtual void OnCompositeInVideoModeUpdate(dsCompositeInPort_t activePort, dsVideoPortResolution_t videoResolution) = 0; - }; - -class IVideoDeviceEventsImpl { -public: - virtual ~IVideoDeviceEventsImpl() = default; - - virtual void OnZoomSettingsChanged(dsVideoZoom_t zoomSetting) = 0; - virtual void OnDisplayFrameratePreChange(const std::string& frameRate) = 0; - virtual void OnDisplayFrameratePostChange(const std::string& frameRate) = 0; - -}; - -class IVideoOutputPortEventsImpl { -public: - virtual ~IVideoOutputPortEventsImpl() = default; - - virtual void OnResolutionPreChange(const int width, const int height) = 0; - virtual void OnResolutionPostChange(const int width, const int height) = 0; - virtual void OnVideoFormatUpdate(dsHDRStandard_t videoFormatHDR) = 0; - virtual void OnHDCPStatusChange(dsHdcpStatus_t hdcpStatus) = 0; - -}; - -} - -namespace device { -class FrontPanelIndicator { -public: - class Color; - class ColorImpl { - public: - virtual ~ColorImpl() = default; - virtual const Color& getInstanceById(int id) = 0; - virtual const Color& getInstanceByName(const std::string& name) = 0; - virtual std::string getName() const = 0; - }; - - class Color { -protected: - static ColorImpl* impl; - -public: - Color(); - - static void setImpl(ColorImpl* newImpl); - static Color& getInstance(); - static const Color& getInstance(int id); - static const Color& getInstance(const std::string& name); - - static const int kWhite; - - std::string getName() const; - virtual ~Color(); - }; - - // static FrontPanelIndicator& getInstance() - // { - // static FrontPanelIndicator instance; - // return instance; - // } - - class FrontPanelIndicatorImpl { - public: - virtual ~FrontPanelIndicatorImpl() = default; - virtual FrontPanelIndicator& getInstanceInt(int id) = 0; - virtual FrontPanelIndicator& getInstanceString(const std::string& name) = 0; - virtual void setState(const bool bState) const = 0; - virtual std::string getName() const = 0; - virtual void setBrightness(const int brightness, const bool toPersist = false) const = 0; - virtual int getBrightness(const bool persist=false) const = 0; - virtual void setColor(const Color &newColor, const bool toPersist) const = 0; - virtual void setColorInt(const uint32_t color, const bool toPersist) const = 0; - virtual void getBrightnessLevels(int &levels,int &min,int &max) const = 0; - virtual int getColorMode() const = 0; - virtual std::string getColorName() const = 0; - virtual List getSupportedColors() const =0; - }; - - // FrontPanelIndicatorImpl* impl; - - public: - static FrontPanelIndicatorImpl* impl; - FrontPanelIndicator(); - - static void setImpl(FrontPanelIndicatorImpl* newImpl); - - static FrontPanelIndicator& getInstance(const std::string& name); - static FrontPanelIndicator& getInstance(int id); - static FrontPanelIndicator& getInstance(); - - void setState(const bool bState) const; - std::string getName() const; - void setBrightness(const int brightness, const bool toPersist = false) const; - int getBrightness(const bool persist = false) const; - void setColor(const Color& newColor, const bool toPersist = false) const; - void setColor(const uint32_t color, const bool toPersist = false) const; - // void setColorInt(const uint32_t color, const bool toPersist) const; - void getBrightnessLevels(int& levels, int& min, int& max) const; - int getColorMode() const; - std::string getColorName() const; - List getSupportedColors() const; - -}; - -class FrontPanelTextDisplay; -class FrontPanelTextDisplayImpl { -public: - virtual ~FrontPanelTextDisplayImpl() = default; - virtual int getCurrentTimeFormat() const = 0; - virtual void setTimeFormat(const int iTimeFormat) const = 0; - virtual void setText(const std::string text) const = 0; - virtual void setMode(int mode) const = 0; - virtual int getTextBrightness() const = 0; - virtual void setTextBrightness(const int brightness) const = 0; - virtual FrontPanelTextDisplay& getInstanceById(int id) = 0; - virtual FrontPanelTextDisplay& getInstanceByName(const std::string& name) = 0; -}; - -class FrontPanelTextDisplay : public FrontPanelIndicator{ -protected: - static FrontPanelTextDisplayImpl* impl; - -public: - FrontPanelTextDisplay(); - - static void setImpl(FrontPanelTextDisplayImpl* newImpl); - - int getCurrentTimeFormat() const; - void setTimeFormat(const int iTimeFormat); - static FrontPanelTextDisplay& getInstance(const std::string& name); - static FrontPanelTextDisplay& getInstance(int id); - static FrontPanelTextDisplay& getInstance(); - static const int kModeClock12Hr; - static const int kModeClock24Hr; - - void setText(const std::string text); - void setMode(int mode); - int getTextBrightness() const; - void setTextBrightness(const int brightness) const; -}; - -class FrontPanelConfig; -class FrontPanelConfigImpl { -public: - virtual ~FrontPanelConfigImpl() = default; - virtual List getIndicators() const = 0; - virtual FrontPanelTextDisplay& getTextDisplay() const = 0; - virtual FrontPanelTextDisplay& getTextDisplay(const std::string &name) const = 0; - virtual List getTextDisplays() const = 0; - virtual FrontPanelTextDisplay& getTextDisplay(int id) const = 0; -}; - -class FrontPanelConfig { -protected: - static FrontPanelConfigImpl* impl; - -public: - FrontPanelConfig(); - - static void setImpl(FrontPanelConfigImpl* newImpl); - static FrontPanelConfig& getInstance(); - - List getIndicators(); - FrontPanelTextDisplay& getTextDisplay(const std::string& name); - List getTextDisplays(); - FrontPanelTextDisplay& getTextDisplay(int id); - FrontPanelTextDisplay& getTextDisplay() const; -}; - -} - - -#define RT_OK 0 -#define RT_ERROR 1 -#define RT_ERROR_QUEUE_EMPTY 1006 - - -typedef uint32_t rtError; -typedef void(*remoteDisconnectCallback)(void *data); - -class rtValue; - -class rtIObject -{ - public: - typedef unsigned long refcount_t; - - virtual ~rtIObject(){ - } -}; - -class rtString{ - public: - std::string mData; - rtString(const char* s){ - mData = s; - } - rtString(const rtString& s){ - mData = s.mData; - } - rtString(){ - mData = ""; - } - const char* cString() const{ - return mData.c_str(); - } - rtString& operator=(const char* s){ - mData = s; - return *this; - } - - rtString& operator=(const rtString& s){ - mData = s.mData; - return *this; - } - -}; -typedef rtError (*rtFunctionCB)(int numArgs, const rtValue* args, rtValue* result, void* context); - -class rtFunctionCallback{ - public: - rtFunctionCallback(rtFunctionCB cb, void* context = NULL){ - - } - ~rtFunctionCallback() = default; - -}; - -/* -Based on pxCore, Copyright 2015-2018 John Robinson -Licensed under the Apache License, Version 2.0 -*/ -template -class rtRef -{ -public: - rtRef(): mRef(NULL) {} - rtRef(const T* p): mRef(NULL) {asn(p); } - rtRef(const rtRef& r): mRef(NULL) {asn(r.getPtr());} - rtRef(rtRef&& r) noexcept: mRef(r.mRef) {r.mRef = nullptr;} - virtual ~rtRef() { - } - - T* operator->() const {return mRef;} - operator T* () const {return mRef;} - T* getPtr() const {return mRef;} - T* ptr() const {return mRef;} - T& operator*() const {return *mRef;} - - bool operator! () const {return mRef == NULL; } - inline rtRef& operator=(const T* p) {asn(p); return *this;} - inline rtRef& operator=(const rtRef& r) {asn(r.mRef); return *this;} - - inline friend bool operator==(const T* lhs,const rtRef& rhs) {return lhs==rhs.mRef;} - inline friend bool operator==(const rtRef& lhs,const T* rhs) {return lhs.mRef==rhs;} - inline friend bool operator==(const rtRef& lhs,const rtRef& rhs) {return lhs.mRef==rhs.mRef;} - - void asn(const T* p) - { - if (mRef != p) - { - if (mRef) - { - delete mRef; - mRef = NULL; - } - mRef = const_cast(p); - - } - } - - T* mRef; -}; - -class rtObjectBaseImpl{ - public: - virtual ~rtObjectBaseImpl() = default; - virtual rtError set(const char* name, const char* value) const = 0; - virtual rtError set(const char* name, bool value) const = 0; - virtual rtError set(const char* name, const rtValue& value) const = 0; - virtual rtString get(const char* name) const = 0; - virtual rtError sendReturns(const char* messageName, rtString& result) const = 0; -}; - -class rtObjectBase{ -protected: - static rtObjectBaseImpl* impl; -public: - - static rtObjectBase& getInstance(); - static void setImpl(rtObjectBaseImpl* newImpl); - - rtError set(const char* name, const char* value); - rtError set(const char* name, bool value); - rtError set(const char* name, const rtValue& value); - - //To avoid linker issues with templated code, the complete definition of this - //templated function is included in this header file instead of separating it to .cpp - template - rtError sendReturns(const char* messageName, T& result) { - return impl->sendReturns(messageName, result); - } - - template - T get(const char* name) { - return impl->get(name); - } - virtual ~rtObjectBase() = default; -}; - -class rtMapObject: public rtObjectBase, public rtIObject{ - public: - virtual ~rtMapObject() = default; - -}; - -class rtObjectRef; -class rtObjectRefImpl{ - public: - virtual rtError send(const char* messageName, const rtValue& arg1) = 0; - virtual rtError send(const char* messageName) = 0; - virtual rtError send(const char* messageName, const char* method, rtFunctionCallback* callback) = 0; - virtual rtError send(const char* messageName, rtObjectRef& base) = 0; - -}; - -class rtObjectRef : public rtRef, public rtObjectBase{ -protected: - static rtObjectRefImpl* impl; -public: - - - static rtObjectRef& getInstance(); - - static void setImpl(rtObjectRefImpl* newImpl); - - rtObjectRef(); - - rtObjectRef(const rtObjectRef&); - - rtObjectRef(const rtMapObject* o); - - rtObjectRef& operator=(rtMapObject* o); - - rtObjectRef& operator=(const rtObjectRef&); - - rtObjectRef& operator=(rtIObject* o); - - rtObjectRef& operator=(rtObjectRef&&); - - rtError send(const char* messageName); - - rtError send(const char* messageName, const char* method, rtFunctionCallback* callback); - - rtError send(const char* messageName, const rtValue& arg1); - - rtError send(const char* messageName, rtObjectRef& base); - virtual ~rtObjectRef(); - -}; - -class rtArrayObject; - -struct rtValue_{ - std::string stringValue; - bool boolValue; -}; - -class rtValueImpl{ - public: - virtual void rtValueConstructor(bool v) const = 0; - virtual void rtValueConstructor(const char* v) const = 0; - virtual void rtValueConstructor(rtArrayObject* v) const = 0; - virtual void rtValueConstructor(const rtString& v) const = 0; -}; - -class rtValue -{ - protected: - static rtValueImpl* impl; - public: - rtValue_ mValue; - - static rtValue& getInstance(); - static void setImpl(rtValueImpl* newImpl); - - rtValue(); - rtValue(bool v); - rtValue(const char* v); - rtValue(const rtString& v); - rtValue(rtIObject* v); - - rtValue(const rtObjectRef& v); - rtValue(const rtValue& v); - ~rtValue(); - rtValue& operator=(bool v); - rtValue& operator=(const char* v); - rtValue& operator=(const rtString& v); - rtValue& operator=(const rtIObject* v); - rtValue& operator=(const rtObjectRef& v); - rtValue& operator=(const rtValue& v); - - rtObjectRef toObject() const; - void setString (const char* v); - void setString (const rtString& v); - -}; - -class rtArrayObjectImpl{ - public: - virtual void pushBack(const char* v) const = 0; - virtual void pushBack(rtValue v) const = 0; -}; - - -class rtArrayObject : public rtObjectBase, public rtIObject{ -protected: - static rtArrayObjectImpl* impl; -public: - static rtArrayObject& getInstance(); - static void setImpl(rtArrayObjectImpl* newImpl); - - void pushBack(const char* v); - void pushBack(rtValue v); - virtual ~rtArrayObject() = default; - -}; - -class rtRemoteEnvironment{ - - -}; - -class floatingRtFunctionsImpl{ - public: - virtual ~floatingRtFunctionsImpl() = default; - virtual rtError rtRemoteLocateObject(rtRemoteEnvironment *env, const char* str, rtObjectRef& obj, int x, remoteDisconnectCallback back, void *cbdata=NULL) = 0; - virtual rtRemoteEnvironment* rtEnvironmentGetGlobal() = 0; - virtual rtError rtRemoteShutdown(rtRemoteEnvironment *env) = 0; - virtual rtError rtRemoteInit(rtRemoteEnvironment *env) = 0; - virtual rtError rtRemoteProcessSingleItem() = 0; - virtual char* rtStrError(rtError err) = 0; - -}; - -class floatingRtFunctions{ -public: - static floatingRtFunctionsImpl* impl; - static floatingRtFunctions& getInstance(); - static void setImpl(floatingRtFunctionsImpl* newImpl); - -}; - - rtError rtRemoteProcessSingleItem(); - rtError rtRemoteLocateObject(rtRemoteEnvironment* env, const char* str, rtObjectRef& obj, int x, remoteDisconnectCallback back, void* cbdata = nullptr); - rtRemoteEnvironment* rtEnvironmentGetGlobal(); - rtError rtRemoteInit(rtRemoteEnvironment* env); - rtError rtRemoteShutdown(rtRemoteEnvironment* env); - char* rtStrError(rtError err); - - -namespace edid_parser { - - enum edid_status_e { - EDID_STATUS_OK, - EDID_STATUS_INVALID_PARAMETER, - EDID_STATUS_NOT_SUPPORTED, - EDID_STATUS_INVALID_HEADER, - EDID_STATUS_INVALID_CHECKSUM - }; - - enum edid_native_e { - EDID_NATIVE, - EDID_NOT_NATIVE - }; - - enum edid_progressive_e { - EDID_PROGRESSIVE, - EDID_INTERLACED - }; - - enum HDR_standard_t { - HDR_standard_NONE = 0x0, - HDR_standard_HDR10 = 0x01, // SMPTE ST 2084 - HDR_standard_HLG = 0x02, // Hybrid Log-Gamma - HDR_standard_DolbyVersion = 0x04, // ? - HDR_standard_SDR = 0x08, // Traditional gamma - SDR Luminance Range - HDR_standard_Traditional_HDR = 0x10 // Traditional gamma - HDR Luminance Range - }; - - struct edid_res_t { - int width; - int height; - int refresh; - edid_progressive_e progressive; - edid_native_e native; - }; - - enum colorimetry_info_t { - COLORIMETRY_INFO_NONE = 0x0, - COLORIMETRY_INFO_XVYCC601 = 0x01, - COLORIMETRY_INFO_XVYCC709 = 0x02, - COLORIMETRY_INFO_SYCC601 = 0x04, - COLORIMETRY_INFO_ADOBEYCC601 = 0x08, - COLORIMETRY_INFO_ADOBERGB = 0x10, - COLORIMETRY_INFO_BT2020CL = 0x20, - COLORIMETRY_INFO_BT2020NCL = 0x40, - COLORIMETRY_INFO_BT2020RGB = 0x80, - COLORIMETRY_INFO_DCI_P3 = 0x100 - }; - - struct edid_data_t { - edid_res_t res; - // bitmask of HDR_standard_t values - uint8_t hdr_capabilities; - char manufacturer_name[4]; /* Manufacturer name of the display device.*/ - int32_t product_code; /* Product code of the display device. */ - int32_t serial_number; /* Serial number of the display device. */ - int32_t manufacture_week; /* Manufacturing week of the display device. */ - int32_t manufacture_year; /* Manufacturing year of the display device. */ - uint8_t edid_version[2]; /* EDID version. */ - uint8_t physical_address_a; /* Physical Address for HDMI node A */ - uint8_t physical_address_b; /* Physical Address for HDMI node B */ - uint8_t physical_address_c; /* Physical Address for HDMI node C */ - uint8_t physical_address_d; /* Physical Address for HDMI node D */ - char monitor_name[14]; /* Connected display monitor name. */ - uint32_t colorimetry_info; /* bitmask of enum colorimetry_info_t */ -}; - - class edidParserImpl{ - public: - static edidParserImpl* impl; - - static void setImpl(edidParserImpl* newImpl); - - virtual edid_status_e EDID_Parse(unsigned char* bytes, size_t count, edid_data_t* data_ptr) = 0; - virtual edid_status_e EDID_Verify(unsigned char* bytes, size_t count) = 0; - - }; - - edid_status_e EDID_Parse(unsigned char* bytes, size_t count, edid_data_t* data_ptr); - edid_status_e EDID_Verify(unsigned char* bytes, size_t count); -} - -class drmImpl{ - public: - virtual ~drmImpl() = default; - static drmImpl* impl; - static void setImpl(drmImpl* newImpl); - - virtual drmModeEncoderPtr drmModeGetEncoder(int fd, uint32_t encoder_id) = 0; - virtual void drmModeFreeEncoder(drmModeEncoderPtr* encoder) = 0; - virtual drmModeConnectorPtr drmModeGetConnector(int fd, uint32_t connectorId) = 0; - virtual drmModeCrtcPtr drmModeGetCrtc(int fd, uint32_t crtcId) = 0; - virtual drmModeResPtr drmModeGetResources(int fd) = 0; - virtual void drmModeFreeConnector( drmModeConnectorPtr ptr ) = 0; - virtual void drmModeFreeCrtc( drmModeCrtcPtr ptr ) = 0; - virtual void drmModeFreeResources( drmModeResPtr ptr ) = 0; - virtual drmModePropertyPtr drmModeGetProperty(int fd, uint32_t propertyId) = 0; - virtual void drmModeFreeProperty(drmModePropertyPtr ptr) = 0; - virtual drmModePlaneResPtr drmModeGetPlaneResources(int fd) = 0; - virtual drmModePlanePtr drmModeGetPlane(int fd, uint32_t plane_id) = 0; - virtual drmModeObjectPropertiesPtr drmModeObjectGetProperties(int fd,uint32_t object_id, uint32_t object_type) = 0; - virtual void drmModeFreeObjectProperties(drmModeObjectPropertiesPtr ptr) = 0; - virtual void drmModeFreePlane( drmModePlanePtr ptr ) = 0; - virtual void drmModeFreePlaneResources(drmModePlaneResPtr ptr) = 0; - virtual void drmModeFreeFB(drmModeFBPtr ptr) = 0; - virtual drmModeFBPtr drmModeGetFB(int fd, uint32_t bufferId) = 0; - virtual void drmModeFreeEncoder( drmModeEncoderPtr ptr ) = 0; - virtual int drmSetClientCap(int fd, uint64_t capability, uint64_t value) = 0; - -}; - -//drmModeEncoderPtr drmModeGetEncoder(int fd, uint32_t encoder_id); -//void drmModeFreeEncoder(drmModeEncoderPtr* encoder); -//drmModeConnectorPtr drmModeGetConnector(int fd, uint32_t connectorId); -//drmModeCrtcPtr drmModeGetCrtc(int fd, uint32_t crtcId); -//drmModeResPtr drmModeGetResources(int fd); -//void drmModeFreeConnector( drmModeConnectorPtr ptr ); -//void drmModeFreeCrtc( drmModeCrtcPtr ptr ); -//void drmModeFreeResources( drmModeResPtr ptr ); -//drmModePropertyPtr drmModeGetProperty(int fd, uint32_t propertyId); -//void drmModeFreeProperty(drmModePropertyPtr ptr); -//drmModePlaneResPtrResPtr drmModeGetPlaneResources(int fd); -//drmModePlaneResPtr drmModeGetPlane(int fd, uint32_t plane_id); -//drmModeObjectPropertiesPtr drmModeObjectGetProperties(int fd,uint32_t object_id, uint32_t object_type); -//void drmModeFreeObjectProperties(drmModeObjectPropertiesPtr ptr); -//void drmModeFreePlane( drmModePlaneResPtr ptr ); -//void drmModeFreePlaneResources(drmModePlaneResPtrResPtr ptr); - diff --git a/ci/mocks/devicesettings/AudioOutputPortMock.h b/ci/mocks/devicesettings/AudioOutputPortMock.h deleted file mode 100644 index 2ce1d9f7..00000000 --- a/ci/mocks/devicesettings/AudioOutputPortMock.h +++ /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 2026 RDK Management -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -**/ - -#pragma once - -#include -#include - -#include "audioOutputPort.hpp" - -class AudioOutputPortMock : public device::AudioOutputPortImpl { -public: - virtual ~AudioOutputPortMock() = default; - - MOCK_METHOD(const std::string&, getName, (), (const, override)); - MOCK_METHOD(std::vector, getMS12AudioProfileList, (), (const, override)); - MOCK_METHOD(void, getAudioCapabilities, (int* capabilities), (override)); - MOCK_METHOD(void, getMS12Capabilities, (int* capabilities), (override)); - MOCK_METHOD(bool, isAudioMSDecode, (), (const,override)); - - MOCK_METHOD(bool, getEnablePersist, (), (override)); - MOCK_METHOD(void, getHdmiArcPortId, (int *portId), (override)); - MOCK_METHOD(bool, isConnected, (), (override)); - MOCK_METHOD(void, setDRCMode, (int DRCMode), (override)); - MOCK_METHOD(void, setCompression, (int compressionLevel), (override)); - MOCK_METHOD(int, getCompression, (), (override)); - MOCK_METHOD(void, setDolbyVolumeMode, (bool dolbyVolumeMode), (override)); - MOCK_METHOD(void, setDialogEnhancement, (int enhancerlevel), (override)); - MOCK_METHOD(int, getDialogEnhancement, (), (override)); - MOCK_METHOD(void, setIntelligentEqualizerMode, (int intelligentEqualizerMode), (override)); - MOCK_METHOD(int, getIntelligentEqualizerMode, (), (override)); - MOCK_METHOD(void, setGraphicEqualizerMode, (int graphicEqualizerMode), (override)); - MOCK_METHOD(int, getGraphicEqualizerMode, (), (override)); - MOCK_METHOD(void, setMS12AudioProfile, (std::string audioProfileName), (override)); - MOCK_METHOD(void, resetVolumeLeveller, (), (override)); - MOCK_METHOD(void, resetSurroundVirtualizer, (), (override)); - MOCK_METHOD(void, resetBassEnhancer, (), (override)); - MOCK_METHOD(void, resetDialogEnhancement, (), (override)); - MOCK_METHOD(void, getSupportedARCTypes, (int *types), (override)); - MOCK_METHOD(void, setEnablePersist, (bool pEnable), (override)); - MOCK_METHOD(dsError_t, setEnablePort, (bool pEnable), (override)); - MOCK_METHOD(bool, isMuted, (), (override)); - MOCK_METHOD(void, setAudioAtmosOutputMode, (int enable), (override)); - MOCK_METHOD(bool, getSinkDeviceAtmosCapability, (dsATMOSCapability_t& atmosCapability), (override)); - MOCK_METHOD(void, setAudioDelayOffset, (int audioDelayOffsetMs), (override)); - MOCK_METHOD(void, setAudioDelay, (int audioDelayMs), (override)); - MOCK_METHOD(void, getAudioDelay, (uint32_t audioDelayMs), (override)); - MOCK_METHOD(void, getAudioDelayOffset, (uint32_t audioDelayOffsetMs), (override)); - MOCK_METHOD(void, getSecondaryLanguage, (std::string secondaryLanguage), (override)); - MOCK_METHOD(void,setSecondaryLanguage, (std::string secondaryLanguage), (override)); - MOCK_METHOD(void, setPrimaryLanguage, (std::string primaryLanguage), (override)); - MOCK_METHOD(void, getPrimaryLanguage, (std::string primaryLanguage), (override)); - MOCK_METHOD(void, getFaderControl, (int *mixerBalance), (override)); - MOCK_METHOD(void, setFaderControl, (int mixerBalance), (override)); - MOCK_METHOD(void, setAssociatedAudioMixing, (bool mixing), (override)); - MOCK_METHOD(void, setGain, (float newGain), (override)); - MOCK_METHOD(void, setMISteering, (bool MISteering), (override)); - MOCK_METHOD(void, setSurroundVirtualizer, (dsSurroundVirtualizer_t surroundVirtualizer), (override)); - MOCK_METHOD(void, setBassEnhancer, (int bassBoost), (override)); - MOCK_METHOD(void, enableSurroundDecoder, (bool enableSurroundDecoder), (override)); - MOCK_METHOD(void, setVolumeLeveller, (dsVolumeLeveller_t volumeLeveller), (override)); - MOCK_METHOD(bool, getMISteering, (), (override)); - MOCK_METHOD(dsSurroundVirtualizer_t, getSurroundVirtualizer, (), (override)); - MOCK_METHOD(int, getDRCMode, (), (override)); - MOCK_METHOD(float, getLevel, (), (override)); - MOCK_METHOD(float, getGain, (), (override)); - MOCK_METHOD(bool, isSurroundDecoderEnabled, (), (override)); - MOCK_METHOD(int, getBassEnhancer, (), (override)); - MOCK_METHOD(dsVolumeLeveller_t, getVolumeLeveller, (), (override)); - MOCK_METHOD(bool, getStereoAuto, (), (override)); - - MOCK_METHOD(std::string, getMS12AudioProfile, (), (override)); - MOCK_METHOD(void, setMS12AudioProfileSetttingsOverride, (std::string audioProfileState,std::string audioProfileName,std::string audioProfileSettingsName, std::string audioProfileSettingValue), (override)); - - MOCK_METHOD(void, setLevel, (float level), (override)); - MOCK_METHOD(void, setMuted, (bool muted), (override)); - MOCK_METHOD(void, getAssociatedAudioMixing, (bool *mixing), (override)); - MOCK_METHOD(bool, isEnabled, (), (override)); - MOCK_METHOD(void, setSAD, (std::vector sad_list), (override)); - MOCK_METHOD(void, setStereoAuto, (bool stereoAuto, bool persist), (override)); - MOCK_METHOD(void, reInitializeAudioOutputPort, (), (override)); - - MOCK_METHOD(std::vector, getSupportedStereoModes, (), (const, override)); - - MOCK_METHOD(void, enableARC, (dsAudioARCTypes_t type, bool enable), (override)); - - MOCK_METHOD(void, setStereoMode, (const std::string &mode, bool persist), (override)); - - MOCK_METHOD(device::AudioStereoMode, getStereoMode, (const bool toPersist), (const, override)); - - - MOCK_METHOD(device::AudioStereoMode, getStereoMode, (), (const, override)); - - MOCK_METHOD(uint32_t, getDolbyVolumeMode, (), (const, override)); - - MOCK_METHOD(const device::AudioOutputPortType&, getType, (), (const, override)); - - - - -}; diff --git a/ci/mocks/devicesettings/AudioOutputPortTypeMock.h b/ci/mocks/devicesettings/AudioOutputPortTypeMock.h deleted file mode 100644 index 7a35182b..00000000 --- a/ci/mocks/devicesettings/AudioOutputPortTypeMock.h +++ /dev/null @@ -1,32 +0,0 @@ -/* -* If not stated otherwise in this file or this component's LICENSE file the -* following copyright and licenses apply: -* -* Copyright 2026 RDK Management -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#pragma once - -#include - -#include "audioOutputPortType.hpp" - -class AudioOutputPortTypeMock : public device::AudioOutputPortTypeImpl { -public: - virtual ~AudioOutputPortTypeMock() = default; - - MOCK_METHOD(int, getId, (), (const, override)); - // MOCK_METHOD(const device::List, getSupportedResolutions, (), (const, override)); -}; diff --git a/ci/mocks/devicesettings/AudioStereoModeMock.h b/ci/mocks/devicesettings/AudioStereoModeMock.h deleted file mode 100644 index 34161c15..00000000 --- a/ci/mocks/devicesettings/AudioStereoModeMock.h +++ /dev/null @@ -1,35 +0,0 @@ -/* -* If not stated otherwise in this file or this component's LICENSE file the -* following copyright and licenses apply: -* -* Copyright 2026 RDK Management -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#pragma once - -#include - -#include "AudioStereoMode.hpp" - -class AudioStereoModeMock : public device::AudioStereoModeImpl { -public: - virtual ~AudioStereoModeMock() = default; - - - MOCK_METHOD(const std::string&, getName, (), (const, override)); - MOCK_METHOD( std::string, toString, (), (override)); - - -}; diff --git a/ci/mocks/devicesettings/ColorMock.h b/ci/mocks/devicesettings/ColorMock.h deleted file mode 100644 index f51f8aab..00000000 --- a/ci/mocks/devicesettings/ColorMock.h +++ /dev/null @@ -1,32 +0,0 @@ -/** -* If not stated otherwise in this file or this component's LICENSE -* file the following copyright and licenses apply: -* -* Copyright 2026 RDK Management -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -**/ - -#pragma once - -#include - -class ColorMock : public device::FrontPanelIndicator::ColorImpl { -public: - virtual ~ColorMock() = default; - - MOCK_METHOD(const device::FrontPanelIndicator::Color&, getInstanceById, (int id), (override)); - MOCK_METHOD(const device::FrontPanelIndicator::Color&, getInstanceByName, (const std::string& name), (override)); - MOCK_METHOD(std::string,getName, (), (const, override)); - -}; diff --git a/ci/mocks/devicesettings/CompositeInputMock.h b/ci/mocks/devicesettings/CompositeInputMock.h deleted file mode 100644 index d105e238..00000000 --- a/ci/mocks/devicesettings/CompositeInputMock.h +++ /dev/null @@ -1,35 +0,0 @@ -/** -* If not stated otherwise in this file or this component's LICENSE -* file the following copyright and licenses apply: -* -* Copyright 2026 RDK Management -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -**/ - -#pragma once - -#include - -#include "compositeIn.hpp" - -class CompositeInputImplMock : public device::CompositeInputImpl { -public: - virtual ~CompositeInputImplMock() = default; - - MOCK_METHOD(uint8_t, getNumberOfInputs, (), (const, override)); - MOCK_METHOD(bool, isPortConnected, (int8_t Port), (const, override)); - MOCK_METHOD(void, selectPort, (int8_t Port), (const, override)); - MOCK_METHOD(void, scaleVideo, (int32_t x, int32_t y, int32_t width, int32_t height), (const, override)); - -}; diff --git a/ci/mocks/devicesettings/DisplayMock.h b/ci/mocks/devicesettings/DisplayMock.h deleted file mode 100644 index 34aeaa82..00000000 --- a/ci/mocks/devicesettings/DisplayMock.h +++ /dev/null @@ -1,36 +0,0 @@ -/** -* If not stated otherwise in this file or this component's LICENSE -* file the following copyright and licenses apply: -* -* Copyright 2026 RDK Management -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -**/ - -#pragma once - -#include - -#include "devicesettings.h" - -class DisplayMock : public device::DisplayImpl { -public: - virtual ~DisplayMock() = default; - - MOCK_METHOD(void, getEDIDBytes, (std::vector &edid), (const, override)); - MOCK_METHOD(bool, isConnectedDeviceRepeater, (), (override)); - MOCK_METHOD(int, getSurroundMode, (), (override)); - MOCK_METHOD(void, setAllmEnabled, (bool enable), (override)); - MOCK_METHOD(void, setAVIContentType, (int contentType), (override)); - MOCK_METHOD(void, setAVIScanInformation, (int scanInfo), (override)); -}; diff --git a/ci/mocks/devicesettings/DrmMock.h b/ci/mocks/devicesettings/DrmMock.h deleted file mode 100644 index 51b13432..00000000 --- a/ci/mocks/devicesettings/DrmMock.h +++ /dev/null @@ -1,50 +0,0 @@ -/** -* If not stated otherwise in this file or this component's LICENSE -* file the following copyright and licenses apply: -* -* Copyright 2026 RDK Management -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -**/ - -#pragma once - -#include -#include - -class DRMMock : public drmImpl { -public: - virtual ~DRMMock() = default; - - MOCK_METHOD(drmModeEncoderPtr, drmModeGetEncoder, (int fd, uint32_t encoder_id), (override)); - MOCK_METHOD(void, drmModeFreeEncoder, (drmModeEncoderPtr* encoder), (override)); - MOCK_METHOD(drmModeConnectorPtr, drmModeGetConnector, (int fd, uint32_t connectorId), (override)); - MOCK_METHOD(drmModeCrtcPtr, drmModeGetCrtc, (int fd, uint32_t crtcId), (override)); - MOCK_METHOD(drmModeResPtr, drmModeGetResources, (int fd), (override)); - MOCK_METHOD(void, drmModeFreeConnector, (drmModeConnectorPtr ptr), (override)); - MOCK_METHOD(void, drmModeFreeCrtc, (drmModeCrtcPtr ptr), (override)); - MOCK_METHOD(void, drmModeFreeResources, (drmModeResPtr ptr), (override)); - MOCK_METHOD(drmModePropertyPtr, drmModeGetProperty, (int fd, uint32_t propertyId), (override)); - MOCK_METHOD(void, drmModeFreeProperty, (drmModePropertyPtr ptr), (override)); - MOCK_METHOD(drmModePlaneResPtr, drmModeGetPlaneResources, (int fd), (override)); - MOCK_METHOD(drmModePlanePtr, drmModeGetPlane, (int fd, uint32_t plane_id), (override)); - MOCK_METHOD(drmModeObjectPropertiesPtr, drmModeObjectGetProperties, (int fd, uint32_t object_id, uint32_t object_type), (override)); - MOCK_METHOD(void, drmModeFreeObjectProperties, (drmModeObjectPropertiesPtr ptr), (override)); - MOCK_METHOD(void, drmModeFreePlane, (drmModePlanePtr ptr), (override)); - MOCK_METHOD(void, drmModeFreePlaneResources, (drmModePlaneResPtr ptr), (override)); - MOCK_METHOD(int, drmSetClientCap, (int fd, uint64_t capability, uint64_t value), (override)); - MOCK_METHOD(void, drmModeFreeFB, (drmModeFBPtr ptr), (override)); - MOCK_METHOD(drmModeFBPtr, drmModeGetFB, (int fd, uint32_t bufferId), (override)); - MOCK_METHOD(void, drmModeFreeEncoder, (drmModeEncoderPtr ptr), (override)); - -}; diff --git a/ci/mocks/devicesettings/EdidParserMock.h b/ci/mocks/devicesettings/EdidParserMock.h deleted file mode 100644 index d1643328..00000000 --- a/ci/mocks/devicesettings/EdidParserMock.h +++ /dev/null @@ -1,30 +0,0 @@ -/** -* If not stated otherwise in this file or this component's LICENSE -* file the following copyright and licenses apply: -* -* Copyright 2026 RDK Management -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -**/ - -#pragma once - -#include - -#include "devicesettings.h" -class EdidParserMock : public edid_parser::edidParserImpl { -public: - virtual ~EdidParserMock() = default; - MOCK_METHOD(edid_parser::edid_status_e, EDID_Parse, (unsigned char* bytes, size_t count, edid_parser::edid_data_t* data_ptr), (override)); - MOCK_METHOD(edid_parser::edid_status_e, EDID_Verify, (unsigned char* bytes, size_t count), (override)); -}; diff --git a/ci/mocks/devicesettings/FloatingRtFunctionsMock.h b/ci/mocks/devicesettings/FloatingRtFunctionsMock.h deleted file mode 100644 index 04c82e1f..00000000 --- a/ci/mocks/devicesettings/FloatingRtFunctionsMock.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * If not stated otherwise in this file or this component's LICENSE file the - * following copyright and licenses apply: - * - * Copyright 2026 RDK Management - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#pragma once - -#include - -class floatingRtFunctionsMock : public floatingRtFunctionsImpl { -public: - virtual ~floatingRtFunctionsMock() = default; - - MOCK_METHOD(rtError, rtRemoteLocateObject, (rtRemoteEnvironment *env, const char* str, rtObjectRef& obj, int x, remoteDisconnectCallback back, void *cbdata), (override)); - MOCK_METHOD(rtRemoteEnvironment*, rtEnvironmentGetGlobal, (), (override)); - MOCK_METHOD(rtError,rtRemoteShutdown, (rtRemoteEnvironment *env), (override)); - MOCK_METHOD(rtError,rtRemoteInit, (rtRemoteEnvironment *env), (override)); - MOCK_METHOD(rtError,rtRemoteProcessSingleItem, (), (override)); - MOCK_METHOD(char*, rtStrError, (rtError err), (override)); - - -}; diff --git a/ci/mocks/devicesettings/FrontPanelConfigMock.h b/ci/mocks/devicesettings/FrontPanelConfigMock.h deleted file mode 100644 index dd511667..00000000 --- a/ci/mocks/devicesettings/FrontPanelConfigMock.h +++ /dev/null @@ -1,33 +0,0 @@ -/** -* If not stated otherwise in this file or this component's LICENSE -* file the following copyright and licenses apply: -* -* Copyright 2026 RDK Management -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -**/ - -#pragma once - -#include - -class FrontPanelConfigMock : public device::FrontPanelConfigImpl { -public: - virtual ~FrontPanelConfigMock() = default; - - MOCK_METHOD(device::List,getIndicators, (), (const, override)); - MOCK_METHOD(device::FrontPanelTextDisplay&,getTextDisplay, (const std::string &name), (const, override)); - MOCK_METHOD(device::FrontPanelTextDisplay&,getTextDisplay, (int id), (const, override)); - MOCK_METHOD(device::FrontPanelTextDisplay&,getTextDisplay, (), (const, override)); - MOCK_METHOD(device::List,getTextDisplays, (), (const, override)); -}; diff --git a/ci/mocks/devicesettings/FrontPanelIndicatorMock.h b/ci/mocks/devicesettings/FrontPanelIndicatorMock.h deleted file mode 100644 index daa5ad29..00000000 --- a/ci/mocks/devicesettings/FrontPanelIndicatorMock.h +++ /dev/null @@ -1,40 +0,0 @@ -/** -* If not stated otherwise in this file or this component's LICENSE -* file the following copyright and licenses apply: -* -* Copyright 2026 RDK Management -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -**/ - -#pragma once - -#include - -class FrontPanelIndicatorMock : public device::FrontPanelIndicator::FrontPanelIndicatorImpl { -public: - virtual ~FrontPanelIndicatorMock() = default; - - MOCK_METHOD(device::FrontPanelIndicator&, getInstanceString, (const std::string& name), (override)); - MOCK_METHOD(device::FrontPanelIndicator&, getInstanceInt, (int id), (override)); - MOCK_METHOD(void,setState, (const bool bState), (const, override)); - MOCK_METHOD(std::string,getName, (), (const, override)); - MOCK_METHOD(void,setBrightness, (const int brightness, const bool toPersist), (const, override)); - MOCK_METHOD(int,getBrightness, (const bool persist), (const, override)); - MOCK_METHOD(void,setColor, (const device::FrontPanelIndicator::Color &newColor, const bool toPersist), (const, override)); - MOCK_METHOD(void,setColorInt, (const uint32_t color, const bool toPersist), (const, override)); - MOCK_METHOD(void,getBrightnessLevels, (int &levels,int &min,int &max), (const, override)); - MOCK_METHOD(int,getColorMode, (), (const, override)); - MOCK_METHOD(std::string,getColorName, (), (const, override)); - MOCK_METHOD(device::List,getSupportedColors, (), (const, override)); -}; diff --git a/ci/mocks/devicesettings/FrontPanelTextDisplayMock.h b/ci/mocks/devicesettings/FrontPanelTextDisplayMock.h deleted file mode 100644 index 2f07c3f3..00000000 --- a/ci/mocks/devicesettings/FrontPanelTextDisplayMock.h +++ /dev/null @@ -1,35 +0,0 @@ -/** -* If not stated otherwise in this file or this component's LICENSE -* file the following copyright and licenses apply: -* -* Copyright 2026 RDK Management -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -**/ - -#pragma once - -#include - -class FrontPanelTextDisplayMock : public device::FrontPanelTextDisplayImpl { -public: - virtual ~FrontPanelTextDisplayMock() = default; - MOCK_METHOD(device::FrontPanelTextDisplay&, getInstanceByName, (const std::string& name), (override)); - MOCK_METHOD(device::FrontPanelTextDisplay&, getInstanceById, (int id), (override)); - MOCK_METHOD(int,getCurrentTimeFormat, (), (const, override)); - MOCK_METHOD(void,setTimeFormat, (const int iTimeFormat), (const, override)); - MOCK_METHOD(int,getTextBrightness, (), (const, override)); - MOCK_METHOD(void,setTextBrightness, (const int brightness), (const, override)); - MOCK_METHOD(void,setText, (const std::string text), (const, override)); - MOCK_METHOD(void,setMode, (const int mode), (const, override)); -}; diff --git a/ci/mocks/devicesettings/HdmiCecMock.h b/ci/mocks/devicesettings/HdmiCecMock.h deleted file mode 100644 index 95840cbb..00000000 --- a/ci/mocks/devicesettings/HdmiCecMock.h +++ /dev/null @@ -1,107 +0,0 @@ -/** -* If not stated otherwise in this file or this component's LICENSE -* file the following copyright and licenses apply: -* -* Copyright 2026 RDK Management -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -**/ - -#pragma once -#include -#include "HdmiCec.h" - -class LibCCECImplMock : public LibCCECImpl { -public: - virtual ~LibCCECImplMock() = default; - - MOCK_METHOD(void, init, (const char *name), (const, override)); - MOCK_METHOD(void, init, (), (const, override)); - MOCK_METHOD(void, term, (), (const, override)); - MOCK_METHOD(void, getPhysicalAddress, (unsigned int *physicalAddress), (const, override)); - MOCK_METHOD(int, addLogicalAddress, (const LogicalAddress &source), (const, override)); - MOCK_METHOD(int, getLogicalAddress, (int devType), (const, override)); -}; - -class SystemAudioStatusImplMock : public SystemAudioStatusImpl { -public: - virtual ~SystemAudioStatusImplMock() = default; - - MOCK_METHOD(int, toInt, (), (const, override)); -}; - -class AudioStatusImplMock : public AudioStatusImpl { -public: - virtual ~AudioStatusImplMock() = default; - - MOCK_METHOD(int, getAudioMuteStatus, (), (const, override)); - MOCK_METHOD(int, getAudioVolume, (), (const, override)); -}; - -class PowerStatusImplMock : public PowerStatusImpl { -public: - virtual ~PowerStatusImplMock() = default; - - MOCK_METHOD(int, toInt, (), (const, override)); -}; - -class AbortReasonImplMock : public AbortReasonImpl { -public: - virtual ~AbortReasonImplMock() = default; - - MOCK_METHOD(int, toInt, (), (const, override)); -}; - -class ShortAudioDescriptorImplMock : public ShortAudioDescriptorImpl { -public: - virtual ~ShortAudioDescriptorImplMock() = default; - - MOCK_METHOD(uint32_t, getAudiodescriptor, (), (const, override)); -}; - -class ConnectionImplMock : public ConnectionImpl { -public: - virtual ~ConnectionImplMock() = default; - - MOCK_METHOD(void, open, (), (const, override)); - MOCK_METHOD(void, close, (), (const, override)); - MOCK_METHOD(void, addFrameListener, (FrameListener *listener), (const, override)); - MOCK_METHOD(void, ping, (const LogicalAddress &from, const LogicalAddress &to, const Throw_e &doThrow), (const, override)); - MOCK_METHOD(void, sendToAsync, (const LogicalAddress &to, const CECFrame &frame), (const, override)); - MOCK_METHOD(void, sendTo, (const LogicalAddress &to, const CECFrame &frame), (const, override)); - MOCK_METHOD(void, sendTo, (const LogicalAddress &to, const CECFrame &frame, int timeout), (const, override)); - MOCK_METHOD(void, poll, (const LogicalAddress &from, const Throw_e &doThrow), (const, override)); - MOCK_METHOD(void, sendAsync, (const CECFrame &frame), (const, override)); -}; - -class LogicalAddressImplMock : public LogicalAddressImpl { -public: - virtual ~LogicalAddressImplMock() = default; - - MOCK_METHOD(int, getType, (), (const, override)); -}; - -class MessageEncoderMock : public MessageEncoderImpl{ -public: - virtual ~MessageEncoderMock() = default; - - MOCK_METHOD(CECFrame&, encode, (const DataBlock &m), (const, override)); - MOCK_METHOD(CECFrame&, encode, (const UserControlPressed &m), (const, override)); -}; - -class MessageDecoderMock : public MessageDecoderImpl{ -public: - virtual ~MessageDecoderMock() = default; - - MOCK_METHOD(void, decode, (const CECFrame& in), (const, override)); -}; diff --git a/ci/mocks/devicesettings/HdmiInputMock.h b/ci/mocks/devicesettings/HdmiInputMock.h deleted file mode 100644 index 2849703a..00000000 --- a/ci/mocks/devicesettings/HdmiInputMock.h +++ /dev/null @@ -1,51 +0,0 @@ -/** -* If not stated otherwise in this file or this component's LICENSE -* file the following copyright and licenses apply: -* -* Copyright 2026 RDK Management -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -**/ - -#pragma once - -#include - -#include "hdmiIn.hpp" - -class HdmiInputImplMock : public device::HdmiInputImpl { -public: - virtual ~HdmiInputImplMock() = default; - - MOCK_METHOD(uint8_t, getNumberOfInputs, (), (const, override)); - MOCK_METHOD(bool, isPortConnected, (int8_t Port), (const, override)); - MOCK_METHOD(std::string, getCurrentVideoMode, (), (const, override)); - MOCK_METHOD(void, selectPort, (int8_t Port,bool audioMix, int videoPlane,bool topMost), (const, override)); - MOCK_METHOD(void, scaleVideo, (int32_t x, int32_t y, int32_t width, int32_t height), (const, override)); - MOCK_METHOD(void, getEDIDBytesInfo, (int iHdmiPort, std::vector &edid), (const, override)); - MOCK_METHOD(void, getHDMISPDInfo, (int iHdmiPort, std::vector &data), (const, override)); - MOCK_METHOD(void, setEdidVersion, (int iHdmiPort, int iEdidVersion), (const, override)); - MOCK_METHOD(void, getEdidVersion, (int iHdmiPort, int *iEdidVersion), (const, override)); - MOCK_METHOD(void, setEdid2AllmSupport, (int iHdmiPort, bool allmSupport), (const, override)); - MOCK_METHOD(void, getEdid2AllmSupport, (int iHdmiPort, bool *allmSupport), (const, override)); - MOCK_METHOD(void, setVRRSupport, (int iHdmiPort, bool vrrsupport), (const, override)); - MOCK_METHOD(void, getVRRSupport, (int iHdmiPort, bool *vrrsupport), (const, override)); - // MOCK_METHOD(void, setAudioMixerLevels, (dsAudioInput_t gain, int volume), (const, override)); - MOCK_METHOD(void, getHdmiALLMStatus, (int iHdmiPort, bool *allmStatus), (const, override)); - MOCK_METHOD(void, getVRRStatus, (int iHdmiPort, dsHdmiInVrrStatus_t *vrrStatus), (const, override)); - MOCK_METHOD(void, getSupportedGameFeatures, (std::vector &featureList), (const, override)); - MOCK_METHOD(void, getAVLatency, (int *audio_output_delay,int *video_latency), (const, override)); - MOCK_METHOD(void, getCurrentVideoModeObj, (dsVideoPortResolution_t& resolution), (const, override)); - MOCK_METHOD(void, getHdmiVersion, (int iHdmiPort, dsHdmiMaxCapabilityVersion_t *capVersion), (const, override)); - MOCK_METHOD(dsError_t, getHDMIARCPortId, (int &portId), (const, override)); -}; diff --git a/ci/mocks/devicesettings/HostMock.h b/ci/mocks/devicesettings/HostMock.h deleted file mode 100644 index 0a28c127..00000000 --- a/ci/mocks/devicesettings/HostMock.h +++ /dev/null @@ -1,148 +0,0 @@ -/** -* If not stated otherwise in this file or this component's LICENSE -* file the following copyright and licenses apply: -* -* Copyright 2026 RDK Management -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -**/ - -#pragma once - -#include - -#include "host.hpp" - -class HostImplMock : public device::HostImpl { -public: - virtual ~HostImplMock() = default; - - MOCK_METHOD(device::SleepMode, getPreferredSleepMode, (), (override)); - MOCK_METHOD(int, setPreferredSleepMode, (const device::SleepMode), (override)); - MOCK_METHOD(device::List, getAvailableSleepModes, (), (override)); - MOCK_METHOD(device::List, getVideoOutputPorts, (), (override)); - MOCK_METHOD(device::List, getAudioOutputPorts, (), (override)); - MOCK_METHOD(device::List, getVideoDevices, (), (override)); - MOCK_METHOD(device::VideoOutputPort&, getVideoOutputPort, (const std::string& name), (override)); - MOCK_METHOD(device::AudioOutputPort&, getAudioOutputPort, (const std::string& name), (override)); - MOCK_METHOD(void, getHostEDID, (std::vector & edid), (const, override)); - MOCK_METHOD(std::string, getDefaultVideoPortName, (), (override)); - //MOCK_METHOD(void, setAudioMixerLevels, (dsAudioInput_t aInput, int volume), (override)); - MOCK_METHOD(std::string, getDefaultAudioPortName, (), (override)); - - MOCK_METHOD(void, getMS12ConfigDetails, (std::string type), (override)); - MOCK_METHOD(bool, isHDMIOutPortPresent, (), (override)); - MOCK_METHOD(void, getSinkDeviceAtmosCapability, (dsATMOSCapability_t atmosCapability), (override)); - MOCK_METHOD(void, getSecondaryLanguage, (std::string secondaryLanguage), (override)); - MOCK_METHOD(void,setSecondaryLanguage, (std::string secondaryLanguage), (override)); - MOCK_METHOD(void, getFaderControl, (int *mixerBalance), (override)); - MOCK_METHOD(void, setFaderControl, (int mixerBalance), (override)); - MOCK_METHOD(void, setPrimaryLanguage, (std::string primaryLanguage), (override)); - MOCK_METHOD(void, getPrimaryLanguage, (std::string primaryLanguage), (override)); - MOCK_METHOD(void, setAudioAtmosOutputMode, (int enable), (override)); - MOCK_METHOD(void, setAssociatedAudioMixing, (bool mixing), (override)); - MOCK_METHOD(void, getCurrentAudioFormat, (dsAudioFormat_t audioFormat), (override)); - MOCK_METHOD(void, getAssociatedAudioMixing, (bool *mixing), (override)); - MOCK_METHOD(void, setAudioMixerLevels, (dsAudioInput_t gain, int volume), (override)); - - MOCK_METHOD(dsError_t, Register, (device::Host::IDisplayEvents* listener), (override)); - MOCK_METHOD(dsError_t, UnRegister, (device::Host::IDisplayEvents* listener), (override)); - MOCK_METHOD(dsError_t, Register, (device::Host::IAudioOutputPortEvents* listener), (override)); - MOCK_METHOD(dsError_t, UnRegister, (device::Host::IAudioOutputPortEvents* listener), (override)); - MOCK_METHOD(dsError_t, Register, (device::Host::IDisplayDeviceEvents* listener), (override)); - MOCK_METHOD(dsError_t, UnRegister, (device::Host::IDisplayDeviceEvents* listener), (override)); - MOCK_METHOD(dsError_t, Register, (device::Host::IHdmiInEvents* listener), (override)); - MOCK_METHOD(dsError_t, UnRegister, (device::Host::IHdmiInEvents* listener), (override)); - MOCK_METHOD(dsError_t, Register, (device::Host::IVideoDeviceEvents* listener), (override)); - MOCK_METHOD(dsError_t, UnRegister, (device::Host::IVideoDeviceEvents* listener), (override)); - MOCK_METHOD(dsError_t, Register, (device::Host::IVideoOutputPortEvents* listener), (override)); - MOCK_METHOD(dsError_t, UnRegister, (device::Host::IVideoOutputPortEvents* listener), (override)); - MOCK_METHOD(dsError_t, Register, (device::Host::ICompositeInEvents* listener), (override)); - MOCK_METHOD(dsError_t, UnRegister, (device::Host::ICompositeInEvents* listener), (override)); -}; - -class IDisplayEventsImplMock : public device::IDisplayEventsImpl { -public: - virtual ~IDisplayEventsImplMock() = default; - - MOCK_METHOD(void, OnDisplayRxSense, (dsDisplayEvent_t displayEvent), (override)); -}; - -class IAudioOutputPortEventsImplMock : public device::IAudioOutputPortEventsImpl { -public: - virtual ~IAudioOutputPortEventsImplMock() = default; - - MOCK_METHOD(void, OnAudioOutHotPlug, (dsAudioPortType_t portType, uint32_t uiPortNumber, bool isPortConnected), (override)); - MOCK_METHOD(void, OnAudioFormatUpdate, (dsAudioFormat_t audioFormat), (override)); - MOCK_METHOD(void, OnDolbyAtmosCapabilitiesChanged, (dsATMOSCapability_t atmosCapability, bool status), (override)); - MOCK_METHOD(void, OnAudioPortStateChanged, (dsAudioPortState_t audioPortState), (override)); - MOCK_METHOD(void, OnAssociatedAudioMixingChanged, (bool mixing), (override)); - MOCK_METHOD(void, OnAudioFaderControlChanged, (int mixerBalance), (override)); - MOCK_METHOD(void, OnAudioPrimaryLanguageChanged, (const std::string& primaryLanguage), (override)); - MOCK_METHOD(void, OnAudioSecondaryLanguageChanged, (const std::string& secondaryLanguage), (override)); - MOCK_METHOD(void, OnAudioModeEvent, (dsAudioPortType_t audioPortType, dsAudioStereoMode_t audioStereoMode), (override)); - MOCK_METHOD(void, OnAudioLevelChangedEvent, (int audioLevel), (override)); -}; - -class IDisplayDeviceEventsImplMock : public device::IDisplayDeviceEventsImpl { -public: - virtual ~IDisplayDeviceEventsImplMock() = default; - - MOCK_METHOD(void, OnDisplayHDMIHotPlug, (dsDisplayEvent_t displayEvent), (override)); -}; - -class IHdmiInEventsImplMock : public device::IHdmiInEventsImpl { -public: - virtual ~IHdmiInEventsImplMock() = default; - - MOCK_METHOD(void, OnHdmiInEventHotPlug, (dsHdmiInPort_t port, bool isConnected), (override)); - MOCK_METHOD(void, OnHdmiInEventSignalStatus, (dsHdmiInPort_t port, dsHdmiInSignalStatus_t signalStatus), (override)); - MOCK_METHOD(void, OnHdmiInEventStatus, (dsHdmiInPort_t activePort, bool isPresented), (override)); - MOCK_METHOD(void, OnHdmiInVideoModeUpdate, (dsHdmiInPort_t port, const dsVideoPortResolution_t& videoPortResolution), (override)); - MOCK_METHOD(void, OnHdmiInAllmStatus, (dsHdmiInPort_t port, bool allmStatus), (override)); - MOCK_METHOD(void, OnHdmiInAVIContentType, (dsHdmiInPort_t port, dsAviContentType_t aviContentType), (override)); - MOCK_METHOD(void, OnHdmiInVRRStatus, (dsHdmiInPort_t port, dsVRRType_t vrrType), (override)); - MOCK_METHOD(void, OnHdmiInAVLatency, (int audioDelay, int videoDelay), (override)); - -}; - -class ICompositeInEventsImplMock : public device::ICompositeInEventsImpl { -public: - virtual ~ICompositeInEventsImplMock() = default; - - MOCK_METHOD(void, OnCompositeInHotPlug, (dsCompositeInPort_t port, bool isConnected), (override)); - MOCK_METHOD(void, OnCompositeInSignalStatus, (dsCompositeInPort_t port, dsCompInSignalStatus_t signalStatus), (override)); - MOCK_METHOD(void, OnCompositeInStatus, (dsCompositeInPort_t activePort, bool isPresented), (override)); - MOCK_METHOD(void, OnCompositeInVideoModeUpdate, (dsCompositeInPort_t activePort, dsVideoPortResolution_t videoResolution), (override)); -}; - -class IVideoDeviceEventsImplMock : public device::IVideoDeviceEventsImpl { -public: - virtual ~IVideoDeviceEventsImplMock() = default; - - MOCK_METHOD(void, OnZoomSettingsChanged, (dsVideoZoom_t zoomSetting), (override)); - MOCK_METHOD(void, OnDisplayFrameratePreChange, (const std::string& frameRate), (override)); - MOCK_METHOD(void, OnDisplayFrameratePostChange, (const std::string& frameRate), (override)); - -}; - -class IVideoOutputPortEventsImplMock : public device::IVideoOutputPortEventsImpl { -public: - virtual ~IVideoOutputPortEventsImplMock() = default; - - MOCK_METHOD(void, OnResolutionPreChange, (const int width, const int height), (override)); - MOCK_METHOD(void, OnResolutionPostChange, (const int width, const int height), (override)); - MOCK_METHOD(void, OnVideoFormatUpdate,(dsHDRStandard_t videoFormatHDR),(override)); - MOCK_METHOD(void, OnHDCPStatusChange,(dsHdcpStatus_t hdcpStatus),(override)); - -}; diff --git a/ci/mocks/devicesettings/ManagerMock.h b/ci/mocks/devicesettings/ManagerMock.h deleted file mode 100644 index cb2a0049..00000000 --- a/ci/mocks/devicesettings/ManagerMock.h +++ /dev/null @@ -1,32 +0,0 @@ -/** -* If not stated otherwise in this file or this component's LICENSE -* file the following copyright and licenses apply: -* -* Copyright 2026 RDK Management -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -**/ - -#pragma once - -#include - -#include "manager.hpp" - -class ManagerImplMock : public ManagerImpl { -public: - virtual ~ManagerImplMock() = default; - - MOCK_METHOD(void, Initialize, (), (override)); - MOCK_METHOD(void, DeInitialize, (), (override)); -}; diff --git a/ci/mocks/devicesettings/MotionDetectionMock.h b/ci/mocks/devicesettings/MotionDetectionMock.h deleted file mode 100644 index 52633841..00000000 --- a/ci/mocks/devicesettings/MotionDetectionMock.h +++ /dev/null @@ -1,53 +0,0 @@ -/** -* If not stated otherwise in this file or this component's LICENSE -* file the following copyright and licenses apply: -* -* Copyright 2026 RDK Management -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -**/ - -#pragma once - -#include - - -class MotionDetectionImplMock : public MotionDetectionImpl { -public: - - MotionDetectionImplMock():MotionDetectionImpl() - { - ON_CALL(*this, MOTION_DETECTION_Platform_Init()) - .WillByDefault(::testing::Return(MOTION_DETECTION_RESULT_SUCCESS)); - - ON_CALL(*this, MOTION_DETECTION_Platform_Term()) - .WillByDefault(::testing::Return(MOTION_DETECTION_RESULT_SUCCESS)); - } - - virtual ~MotionDetectionImplMock() = default; - - MOCK_METHOD(MOTION_DETECTION_Result_t, MOTION_DETECTION_Platform_Init, (), (override)); - MOCK_METHOD(MOTION_DETECTION_Result_t, MOTION_DETECTION_Platform_Term, (), (override)); - MOCK_METHOD(MOTION_DETECTION_Result_t, MOTION_DETECTION_RegisterEventCallback, (MOTION_DETECTION_OnMotionEventCallback motionEvent), (override)); - - MOCK_METHOD(MOTION_DETECTION_Result_t, MOTION_DETECTION_GetMotionDetectors, (MOTION_DETECTION_CurrentSensorSettings_t* motionDetectors), (override)); - MOCK_METHOD(MOTION_DETECTION_Result_t, MOTION_DETECTION_ArmMotionDetector, (MOTION_DETECTION_Mode_t mode, std::string index), (override)); - MOCK_METHOD(MOTION_DETECTION_Result_t, MOTION_DETECTION_DisarmMotionDetector, (std::string index), (override)); - MOCK_METHOD(MOTION_DETECTION_Result_t, MOTION_DETECTION_IsMotionDetectorArmed, (std::string index, bool* armState), (override)); - MOCK_METHOD(MOTION_DETECTION_Result_t, MOTION_DETECTION_SetNoMotionPeriod, (std::string index, int period), (override)); - MOCK_METHOD(MOTION_DETECTION_Result_t, MOTION_DETECTION_GetNoMotionPeriod, (std::string index, unsigned int* period), (override)); - MOCK_METHOD(MOTION_DETECTION_Result_t, MOTION_DETECTION_SetSensitivity, (std::string index, std::string sensitivity, int inferredMode), (override)); - MOCK_METHOD(MOTION_DETECTION_Result_t, MOTION_DETECTION_GetSensitivity, (std::string index, char** sensitivity, int* currentMode), (override)); - MOCK_METHOD(MOTION_DETECTION_Result_t, MOTION_DETECTION_SetActivePeriod, (std::string index, MOTION_DETECTION_TimeRange_t timeSet), (override)); - MOCK_METHOD(MOTION_DETECTION_Result_t, MOTION_DETECTION_GetActivePeriod, (MOTION_DETECTION_TimeRange_t* timeSet), (override)); -}; diff --git a/ci/mocks/devicesettings/RtArrayObjectMock.h b/ci/mocks/devicesettings/RtArrayObjectMock.h deleted file mode 100644 index e3f14e30..00000000 --- a/ci/mocks/devicesettings/RtArrayObjectMock.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * If not stated otherwise in this file or this component's LICENSE file the - * following copyright and licenses apply: - * - * Copyright 2026 RDK Management - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#pragma once - -#include - -class rtArrayObjectMock : public rtArrayObjectImpl { -public: - virtual ~rtArrayObjectMock() = default; - - MOCK_METHOD(void, pushBack, (const char* v), (const, override)); - MOCK_METHOD(void, pushBack, (rtValue v), (const, override)); - - -}; diff --git a/ci/mocks/devicesettings/RtObjectBaseMock.h b/ci/mocks/devicesettings/RtObjectBaseMock.h deleted file mode 100644 index f1ae10d7..00000000 --- a/ci/mocks/devicesettings/RtObjectBaseMock.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * If not stated otherwise in this file or this component's LICENSE file the - * following copyright and licenses apply: - * - * Copyright 2026 RDK Management - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#pragma once - -#include - -class rtObjectBaseMock : public rtObjectBaseImpl { -public: - virtual ~rtObjectBaseMock() = default; - - MOCK_METHOD(rtError, set, (const char* name, const char* value), (const, override)); - MOCK_METHOD(rtError, set, (const char* name, const rtValue& value), (const, override)); - MOCK_METHOD(rtError, set, (const char* name, bool value), (const, override)); - MOCK_METHOD(rtString, get, (const char* name), (const, override)); - MOCK_METHOD(rtError, sendReturns, (const char* messageName, rtString& result), (const, override)); - - -}; diff --git a/ci/mocks/devicesettings/RtObjectRefMock.h b/ci/mocks/devicesettings/RtObjectRefMock.h deleted file mode 100644 index ab03d45c..00000000 --- a/ci/mocks/devicesettings/RtObjectRefMock.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * If not stated otherwise in this file or this component's LICENSE file the - * following copyright and licenses apply: - * - * Copyright 2026 RDK Management - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#pragma once - -#include - -class rtObjectRefMock : public rtObjectRefImpl { -public: - virtual ~rtObjectRefMock() = default; - - MOCK_METHOD(rtError, send, (const char* messageName), (override)); - MOCK_METHOD(rtError, send, (const char* messageName, const char* method, rtFunctionCallback* callback), (override)); - MOCK_METHOD(rtError, send, (const char* messageName, const rtValue& arg1), (override)); - MOCK_METHOD(rtError, send, (const char* messageName, rtObjectRef& base), (override)); - - -}; diff --git a/ci/mocks/devicesettings/SleepModeMock.h b/ci/mocks/devicesettings/SleepModeMock.h deleted file mode 100644 index 56f99475..00000000 --- a/ci/mocks/devicesettings/SleepModeMock.h +++ /dev/null @@ -1,32 +0,0 @@ -/** -* If not stated otherwise in this file or this component's LICENSE -* file the following copyright and licenses apply: -* -* Copyright 2026 RDK Management -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -**/ - -#pragma once - -#include - -class SleepModeMock : public device::SleepModeImpl { -public: - virtual ~SleepModeMock() = default; - - MOCK_METHOD(device::SleepMode&, getInstanceById, (int id), (override)); - MOCK_METHOD(device::SleepMode&, getInstanceByName, (const std::string &name), (override)); - MOCK_METHOD(device::List, getSleepModes, (), (override)); - MOCK_METHOD(const std::string&, toString, (), (const, override)); -}; diff --git a/ci/mocks/devicesettings/VideoDFCMock.h b/ci/mocks/devicesettings/VideoDFCMock.h deleted file mode 100644 index 736d0a1f..00000000 --- a/ci/mocks/devicesettings/VideoDFCMock.h +++ /dev/null @@ -1,32 +0,0 @@ -/* -* If not stated otherwise in this file or this component's LICENSE file the -* following copyright and licenses apply: -* -* Copyright 2026 RDK Management -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#pragma once - -#include - -#include "VideoDFC.hpp" - -class VideoDFCMock : public device::VideoDFCImpl { -public: - virtual ~VideoDFCMock() = default; - - - MOCK_METHOD(const std::string&, getName, (), (const, override)); -}; diff --git a/ci/mocks/devicesettings/VideoDeviceMock.h b/ci/mocks/devicesettings/VideoDeviceMock.h deleted file mode 100644 index 05ddd966..00000000 --- a/ci/mocks/devicesettings/VideoDeviceMock.h +++ /dev/null @@ -1,39 +0,0 @@ -/** -* If not stated otherwise in this file or this component's LICENSE -* file the following copyright and licenses apply: -* -* Copyright 2026 RDK Management -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -**/ - -#pragma once - -#include - -#include "host.hpp" - -class VideoDeviceMock : public device::VideoDeviceImpl { -public: - virtual ~VideoDeviceMock() = default; - - MOCK_METHOD(int, getFRFMode, (int* frfmode), (const, override)); - MOCK_METHOD(int, setFRFMode, (int frfmode), (const, override)); - MOCK_METHOD(int, getCurrentDisframerate, (char* framerate), (const, override)); - MOCK_METHOD(int, setDisplayframerate, (const char* framerate), (const, override)); - MOCK_METHOD(void, getHDRCapabilities, (int* capabilities), (override)); - MOCK_METHOD(void, getSettopSupportedResolutions, (std::list& resolutions), (override)); - MOCK_METHOD(void, setDFC, (std::string zoomSetting), (override)); - // MOCK_METHOD(const VideoDFC&, getDFC, (), (const, override)); - MOCK_METHOD(const device::VideoDFC&, getDFC, (), (override)); -}; diff --git a/ci/mocks/devicesettings/VideoOutputPortConfigMock.h b/ci/mocks/devicesettings/VideoOutputPortConfigMock.h deleted file mode 100644 index 3f3fb095..00000000 --- a/ci/mocks/devicesettings/VideoOutputPortConfigMock.h +++ /dev/null @@ -1,32 +0,0 @@ -/** -* If not stated otherwise in this file or this component's LICENSE -* file the following copyright and licenses apply: -* -* Copyright 2026 RDK Management -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -**/ - -#pragma once - -#include - -#include "videoOutputPortConfig.hpp" - -class VideoOutputPortConfigImplMock : public device::VideoOutputPortConfigImpl { -public: - virtual ~VideoOutputPortConfigImplMock() = default; - - MOCK_METHOD(device::VideoOutputPortType&, getPortType, (int id), (override)); - MOCK_METHOD(device::VideoOutputPort&, getPort, (const std::string& name), (override)); -}; diff --git a/ci/mocks/devicesettings/VideoOutputPortMock.h b/ci/mocks/devicesettings/VideoOutputPortMock.h deleted file mode 100644 index 3ea471d1..00000000 --- a/ci/mocks/devicesettings/VideoOutputPortMock.h +++ /dev/null @@ -1,61 +0,0 @@ -/** -* If not stated otherwise in this file or this component's LICENSE -* file the following copyright and licenses apply: -* -* Copyright 2026 RDK Management -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -**/ - -#pragma once - -#include - -#include "videoOutputPort.hpp" - -class VideoOutputPortMock : public device::VideoOutputPortImpl { -public: - virtual ~VideoOutputPortMock() = default; - - MOCK_METHOD(const device::VideoOutputPortType&, getType, (), (const, override)); - MOCK_METHOD(const std::string&, getName, (), (const, override)); - MOCK_METHOD(const device::VideoResolution&, getDefaultResolution, (), (const, override)); - MOCK_METHOD(int, getHDCPProtocol, (), (override)); - MOCK_METHOD(int, getHDCPReceiverProtocol, (), (override)); - MOCK_METHOD(int, getHDCPCurrentProtocol, (), (override)); - MOCK_METHOD(device::AudioOutputPort&, getAudioOutputPort, (), (const, override)); - MOCK_METHOD(bool, isDisplayConnected, (), (override)); - MOCK_METHOD(int, getHDCPStatus, (), (override)); - MOCK_METHOD(bool, isContentProtected, (), (override)); - MOCK_METHOD(device::Display&, getDisplay, (), (override)); - MOCK_METHOD(bool, setScartParameter, (std::string sScartParameter, std::string sScartParameterData), (override)); - MOCK_METHOD(void, getTVHDRCapabilities, (int* capabilities), (override)); - MOCK_METHOD(bool, setForceHDRMode, (dsHDRStandard_t mode), (override)); - MOCK_METHOD(int, getPreferredColorDepth, (bool persist), (override)); - MOCK_METHOD(void, getColorDepthCapabilities, (unsigned int* capabilities), (override)); - MOCK_METHOD(void, setPreferredColorDepth, (dsDisplayColorDepth_t colorDepth, bool persist), (override)); - MOCK_METHOD(bool, getCurrentOutputSettings, (int& videoEOTF, int& matrixCoefficients, int& colorSpace, int& colorDepth, int& quantizationRange), (override)); - MOCK_METHOD(bool, isConnected, (), (const, override)); - MOCK_METHOD(void, setResolution, (std::string resolution, bool persist, bool isIgnoreEdid), (override)); - MOCK_METHOD(const device::VideoResolution&, getResolution, (), (const, override)); - MOCK_METHOD(void, getSupportedTvResolutions, (int* tvResolutions), (override)); - MOCK_METHOD(int, getVideoEOTF, (), (override)); - MOCK_METHOD(bool, isActive, (), (override)); - MOCK_METHOD(void, setAllmEnabled, (bool enable), (override)); - MOCK_METHOD(int, GetHdmiPreference, (), (override)); - MOCK_METHOD(bool, SetHdmiPreference, (dsHdcpProtocolVersion_t hdcpProtocol), (override)); - MOCK_METHOD(int, getColorSpace, (), (const, override)); - MOCK_METHOD(int, getColorDepth, (), (const, override)); - MOCK_METHOD(int, getQuantizationRange, (), (const, override)); - MOCK_METHOD(bool, IsOutputHDR, (), (override)); -}; diff --git a/ci/mocks/devicesettings/VideoOutputPortTypeMock.h b/ci/mocks/devicesettings/VideoOutputPortTypeMock.h deleted file mode 100644 index 8975bd56..00000000 --- a/ci/mocks/devicesettings/VideoOutputPortTypeMock.h +++ /dev/null @@ -1,32 +0,0 @@ -/** -* If not stated otherwise in this file or this component's LICENSE -* file the following copyright and licenses apply: -* -* Copyright 2026 RDK Management -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -**/ - -#pragma once - -#include - -#include "videoOutputPortType.hpp" - -class VideoOutputPortTypeMock : public device::VideoOutputPortTypeImpl { -public: - virtual ~VideoOutputPortTypeMock() = default; - - MOCK_METHOD(int, getId, (), (const, override)); - MOCK_METHOD(const device::List, getSupportedResolutions, (), (const, override)); -}; diff --git a/ci/mocks/devicesettings/VideoResolutionMock.h b/ci/mocks/devicesettings/VideoResolutionMock.h deleted file mode 100644 index a5c0aeb1..00000000 --- a/ci/mocks/devicesettings/VideoResolutionMock.h +++ /dev/null @@ -1,34 +0,0 @@ -/** -* If not stated otherwise in this file or this component's LICENSE -* file the following copyright and licenses apply: -* -* Copyright 2026 RDK Management -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -**/ - -#pragma once - -#include - -#include "videoResolution.hpp" -#include "pixelResolution.hpp" - -class VideoResolutionMock : public device::VideoResolutionImpl { -public: - virtual ~VideoResolutionMock() = default; - - MOCK_METHOD(const std::string&, getName, (), (const, override)); - MOCK_METHOD(const device::PixelResolution&, getPixelResolution, (), (const, override)); - MOCK_METHOD(const device::FrameRate&, getFrameRate, (), (const, override)); -}; diff --git a/ci/mocks/mfrTypes.h b/ci/mocks/mfrTypes.h deleted file mode 100644 index 8fba1467..00000000 --- a/ci/mocks/mfrTypes.h +++ /dev/null @@ -1,651 +0,0 @@ -/* - * If not stated otherwise in this file or this component's LICENSE file the - * following copyright and licenses apply: - * - * Copyright 2026 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. -*/ - -/** - * @addtogroup HPK Hardware Porting Kit - * @{ - * @par The Hardware Porting Kit - * HPK is the next evolution of the well-defined Hardware Abstraction Layer - * (HAL), but augmented with more comprehensive documentation and test suites - * that OEM or SOC vendors can use to self-certify their ports before taking - * them to RDKM for validation or to an operator for final integration and - * deployment. The Hardware Porting Kit effectively enables an OEM and/or SOC - * vendor to self-certify their own Video Accelerator devices, with minimal RDKM - * assistance - * - */ -/** @defgroup MFR MFR Module - * @{ - */ -/** @defgroup MFR_HAL MFR HAL - * @{ - * @par Application API Specification - * MFR HAL provides an interface for reading and writing device serialization information and doing image flashing operations - */ - -/** @defgroup PLAT_MFR_DATA PLAT MFR DATA - * @{ - */ - -/** - * @file mfrTypes.h - * - * @brief MFR HAL header - * - * This file defines APIs, datatypes and error codes used by the MFR HAL - * - * @par Document - * Document reference. - * - * @par Open Issues (in no particular order) - * -# None - * - * @par Assumptions - * -# None - * - * @par Abbreviations - * - MFR: Manufacturer library - * - HDMI: High-Definition multimedia Interface - * - HDCP: High-Bandwidth digital content protection - * - MOCA: Multimedia over coax alliance - * - auth: Authentication - * - DTCP: Digital transmission content protection - * - CDL: Code download - * - RCDL: Remote code download - * - CA: Certificate authority - * - DVR: Digital video recording - * - SVN: Software version number - * - CRC: Cyclic redundancy check - * - oui: Organizationally unique identifier - * - DRI: Disaster recovery image - * - PDRI: Peripheral disaster recovery image - * - WIFI: Wireless fidelity - * - MAC: Media access control address - * - RF4CE: Radio frequency for consumer electronics - * - DTB: Device tree binary - * - PMI: Product manufacturer information - * - SOC: System on chip - * - TV: Television - * - BDRI: Backup disaster recovery image - * - CPD: Critical panel data - * - WB: White balancing - * - ALS: Ambient light sensor - * - LUX: Unit of luminance or illumination of a one metre square area - * - PCI: Peripheral component interconnect - * - AV: Audio video - * - TPV: TPV technology limited - * - FTA: Factory test app - * - WPS: Wi-Fi protected setup - */ - - -#ifndef _MFR_TYPES_H -#define _MFR_TYPES_H - -#include -#include -#include - - -/** - * @brief MFR status codes. - * - */ -typedef enum _mfrError_t -{ - mfrERR_NONE = 0, ///< Input output operation is successful - mfrERR_GENERAL = 0x1000, ///< Operation general error. This enum is deprecated - mfrERR_INVALID_PARAM, ///< Invalid argument is passed to the module - mfrERR_NOT_INITIALIZED, ///< Module is not initialised - mfrERR_OPERATION_NOT_SUPPORTED, ///< Not suppoted operation is performed - mfrERR_UNKNOWN, ///< Unknown error. This enum is deprecated - /* Please add Error Code here */ - mfrERR_MEMORY_EXHAUSTED, ///< Memory exhausted - mfrERR_SRC_FILE_ERROR, ///< File related errors - mfrERR_WRITE_FLASH_FAILED, ///< Flash write failed - mfrERR_UPDATE_BOOT_PARAMS_FAILED, ///< Boot params update failed - mfrERR_FAILED_CRC_CHECK, ///< CRC check failed - mfrERR_BAD_IMAGE_HEADER, ///< Bad image header error. Invalid Image(Not a valid image to flash in the partition) - mfrERR_IMPROPER_SIGNATURE, ///< Improper signature error. Invalidate section data available in the image - mfrERR_IMAGE_TOO_BIG, ///< Image too big error - mfrERR_FAILED_INVALID_SIGNING_TIME, ///< Invalid image signing time value - mfrERR_FAILED_INVALID_SVN, ///< Invalid SVN error - mfrERR_FAILED_IMAGE_SIGNING_TIME_OLDER, ///< Image signing time is older than expected. By comparing the signing time available in flash data with current image timing. return mfrERR_FAILED_IMAGE_SIGNING_TIME_OLDER flash signing image time is older - mfrERR_FAILED_IMAGE_SVN_OLDER, ///< SVN is older - mfrERR_FAILED_SAME_DRI_CODE_VERSION, ///< Same DRI trying to write again. Current DRI image is requested to flash again. If curren image is corrupted this operation will corrupt the alternate bank also - mfrERR_FAILED_SAME_PCI_CODE_VERSION, ///< Same PCI trying to write again. Current PCI image is requested to flash again. If curren image is corrupted this operation will corrupt the alternate bank also - mfrERR_IMAGE_FILE_OPEN_FAILED, ///< Not able to open image file - mfrERR_GET_FLASHED_IMAGE_DETAILS_FAILED, ///< Not able to retrieve the flashed image details - mfrERR_FLASH_VERIFY_FAILED, ///< Not able to verify the flash - mfrERR_ALREADY_INITIALIZED, ///< Module already initialised - mfrERR_FLASH_READ_FAILED, ///< Flash read failed - mfrERR_FLASH_SOFT_LOCK_FAILED, ///< Flash soft lock failed - mfrERR_TEMP_READ_FAILED, ///< Temperature read failed - mfrERR_MAX ///< Out of range - required to be the last item of the enum -} mfrError_t; - -/** - * @brief Serialization data - * - */ -typedef struct _mfrSerializedData_t -{ - char * buf; ///< Buffer containing the data - size_t bufLen; ///< Length of the data buffer - void (* freeBuf) (char *buf); ///< Function used to free the buffer. If NULL, the user does not need to free the buffer -} mfrSerializedData_t; - -/** - * @brief Serialization data types. All values are platform specific - * - * - * White balancing calibration for TV sources involves applying calibration to the linear playback streams. - * White balancing calibration for AV involves applying calibration specifically to the composite source - * - */ -typedef enum _mfrSerializedType_t -{ - mfrSERIALIZED_TYPE_MANUFACTURER = 0, ///< manufacture field. ASCII string - mfrSERIALIZED_TYPE_MANUFACTUREROUI, ///< manufacture oui field. HEX string value - mfrSERIALIZED_TYPE_MODELNAME, ///< model name field. ASCII string - mfrSERIALIZED_TYPE_DESCRIPTION, ///< description field. ASCII string - mfrSERIALIZED_TYPE_PRODUCTCLASS, ///< product class field. ASCII string - mfrSERIALIZED_TYPE_SERIALNUMBER, ///< serial number field. Alphanumerical string value - mfrSERIALIZED_TYPE_HARDWAREVERSION, ///< Hardware version field. String value - mfrSERIALIZED_TYPE_SOFTWAREVERSION, ///< software field. Decimal stirng value - mfrSERIALIZED_TYPE_PROVISIONINGCODE, ///< provisioning code field. String value - mfrSERIALIZED_TYPE_FIRSTUSEDATE, ///< first use date field. String value - mfrSERIALIZED_TYPE_DEVICEMAC, ///< device mac field. HEX string MAC value separated with colon - mfrSERIALIZED_TYPE_MOCAMAC, ///< MOCA mac field. HEX string MAC value separated with colon - mfrSERIALIZED_TYPE_HDMIHDCP, ///< HDMI HDCP field. String value - - mfrSERIALIZED_TYPE_PDRIVERSION, ///< PDRI version field. It provide the primary Disaster Recovery Image version information - mfrSERIALIZED_TYPE_WIFIMAC, ///< wifi mac field. HEX string MAC value separated with colon - mfrSERIALIZED_TYPE_BLUETOOTHMAC, ///< bluetooth MAC field. HEX string MAC value separated with colon - mfrSERIALIZED_TYPE_WPSPIN, ///< WPS PIN filed. Decimal string - mfrSERIALIZED_TYPE_MANUFACTURING_SERIALNUMBER, ///< manufacturing serial number field. Alphanumerical string value - mfrSERIALIZED_TYPE_ETHERNETMAC, ///< ethernet MAC field. HEX string MAC value separated with colon - mfrSERIALIZED_TYPE_ESTBMAC, ///< estb mac field. HEX string MAC value separated with colon. Device MAC is same as the ethernet (mfrSERIALIZED_TYPE_ETHERNETMAC) mac - mfrSERIALIZED_TYPE_RF4CEMAC, ///< RF4CE MAC field. HEX string MAC value separated with colon - - mfrSERIALIZED_TYPE_PROVISIONED_MODELNAME, ///< provisioned model name field - mfrSERIALIZED_TYPE_PMI, ///< PMI field. Alphanumerical string value of the model - mfrSERIALIZED_TYPE_HWID, ///< hardware ID field. HEX sting value of hardware id - mfrSERIALIZED_TYPE_MODELNUMBER, ///< Model number field. HEX sting value of model number - /* boot data */ - mfrSERIALIZED_TYPE_SOC_ID, ///< SOC id field. String value - mfrSERIALIZED_TYPE_IMAGENAME, ///< image name field. Alphanumerical name of the monolitic image flashed - mfrSERIALIZED_TYPE_IMAGETYPE, ///< image type field. Alphanumerical type name of the image. Eg: PC1 - mfrSERIALIZED_TYPE_BLVERSION, ///< boot loader version field. Boot loader version value separated with dots. Eg: 6.9.7 - /* provisional data */ - mfrSERIALIZED_TYPE_REGION, ///< region field. String value - /* other data */ - mfrSERIALIZED_TYPE_BDRIVERSION, ///< BDRI version field. It provide the Backup DRI version information - - /* led data */ - mfrSERIALIZED_TYPE_LED_WHITE_LEVEL, ///< led white level field. String value - mfrSERIALIZED_TYPE_LED_PATTERN, ///< led pattern field. String value - mfrSERIALIZED_TYPE_MAX, ///< Out of range - required to be the last item of the enum -#ifdef PANEL_SERIALIZATION_TYPES - //As MFR HAL is a precompiled binary across all existing platforms, a distinct region is allocated for panel-based enums, beginning at 0x51. - //This approach allows us to utilize the same type field for corresponding APIs. - mfrSERIALIZED_TYPE_COREBOARD_SERIALNUMBER=0x51, ///< core board serial number field - mfrSERIALIZED_TYPE_FACTORYBOOT, ///< factory boot field. String value - mfrSERIALIZED_TYPE_COUNTRYCODE, ///< country code field. To configure country code - mfrSERIALIZED_TYPE_LANGUAGECODE, ///< language code field.To configure language code - mfrSERIALIZED_TYPE_MANUFACTURERDATA, ///< manufacture data field. To configure HDCP filename, PCBA serial number, project id, logo, device lock information - mfrSERIALIZED_TYPE_CPD_SIZE, ///< CPD size field. It represent the Size of the Critical panel data - mfrSERIALIZED_TYPE_PANEL_ID, ///< panel id field. It is unique ID to represent the each unique version(ex: 43", 55" inches etc) of panel - mfrSERIALIZED_TYPE_PANEL_TYPE, ///< panel type field. Its unique id mapped with each panel ID - mfrSERIALIZED_TYPE_PANEL_HDMI_WB_DATA_NORMAL, ///< HDMI WB data normal field. Standard colour temperature in HDMI source, to adjust r,g,b gain equally to achieve accurate color reproduction. - mfrSERIALIZED_TYPE_PANEL_HDMI_WB_DATA_COLD, ///< HDMI WB data cold field. COLD colour temperature in HDMI source, to adjust the blue gain alone to achieve blueish color pattern - mfrSERIALIZED_TYPE_PANEL_HDMI_WB_DATA_WARM, ///< HDMI WB data warm field. WARM colour temperature in HDMI source, to adjust the red gain alone to achieve reddish colour pattern - mfrSERIALIZED_TYPE_PANEL_HDMI_WB_DATA_USER, ///< HDMI WB data user field. User can change the picture modes as per their requirement in USER colour temperature mode - mfrSERIALIZED_TYPE_PANEL_TV_WB_DATA_NORMAL, ///< panel TV WB data normal field Standard colour temperature in TV source, to adjust r,g,b gain equally to achieve accurate color reproduction. Applicable for linear playback streams - mfrSERIALIZED_TYPE_PANEL_TV_WB_DATA_COLD, ///< panel TV WB data cold field. COLD colour temperature in TV source, to adjust the blue gain alone to to achieve blueish color pattern. Applicable for linear playback streams - mfrSERIALIZED_TYPE_PANEL_TV_WB_DATA_WARM, ///< panel TV WB data warm field. WARM colour temperature in TV source, to adjust the red gain alone to to achieve reddish colour pattern. Applicable for linear playback streams - mfrSERIALIZED_TYPE_PANEL_TV_WB_DATA_USER, ///< panel TV WB data user field. User can change the picture modes as per their requirement in USER colour temperature mode. Applicable for linear playback streams - mfrSERIALIZED_TYPE_PANEL_AV_WB_DATA_NORMAL, ///< panel AV WB data normal field what is the difference between TV and AV white balance here. TV targets for Linear playback source and For AV target composite source. Applicable for composite source - mfrSERIALIZED_TYPE_PANEL_AV_WB_DATA_COLD, ///< panel AV WB data cold field. COLD colour temperature in AV source, to adjust the blue gain alone to to achieve blueish color pattern. Applicable for composite source - mfrSERIALIZED_TYPE_PANEL_AV_WB_DATA_WARM, ///< panel AV WB data warm field. WARM colour temperature in AV source, to adjust the red gain alone to to achieve reddish colour pattern. Applicable for composite source - mfrSERIALIZED_TYPE_PANEL_AV_WB_DATA_USER, ///< panel AV WB data user field. User can change the picture modes as per their requirement in USER colour temperature mode. Applicable for composite source - mfrSERIALIZED_TYPE_PANEL_DTB_VERSION, ///< Version of the device tree binary(DTB) - mfrSERIALIZED_TYPE_PANEL_DTB_DATA_SIZE, ///< Size of the device tree binary(DTB) - mfrSERIALIZED_TYPE_PANEL_DTB_DATA, ///< panel DTB data. The DTB file contains a binary-formatted flattened device tree data - - /* panel data*/ - mfrSERIALIZED_TYPE_PANEL_DATA_FUNCTION_STATUS, - mfrSERIALIZED_TYPE_PANEL_DATA_AGEING_TIME, - mfrSERIALIZED_TYPE_PANEL_DATA_POWER_ON_TIME, - mfrSERIALIZED_TYPE_PANEL_DATA_BACKLIGHT_TIME, - mfrSERIALIZED_TYPE_PANEL_DATA_VALID, - mfrSERIALIZED_TYPE_PANEL_DATA_TPV_APP_VERSION, - mfrSERIALIZED_TYPE_PANEL_ALS_CALIBRATION_INDEX0, - mfrSERIALIZED_TYPE_PANEL_ALS_CALIBRATION_INDEX1, - /*Gamma data*/ - mfrSERIALIZED_TYPE_PANEL_GAMMA_CALIBRATED_NORMAL, - mfrSERIALIZED_TYPE_PANEL_GAMMA_CALIBRATED_COLD, - mfrSERIALIZED_TYPE_PANEL_GAMMA_CALIBRATED_WARM, - mfrSERIALIZED_TYPE_PANEL_GAMMA_CALIBRATED_BOOST_NORMAL, - mfrSERIALIZED_TYPE_PANEL_GAMMA_CALIBRATED_BOOST_COLD, - mfrSERIALIZED_TYPE_PANEL_GAMMA_CALIBRATED_BOOST_WARM, - /*WB data boost*/ - mfrSERIALIZED_TYPE_PANEL_HDMI_WB_DATA_BOOST_NORMAL, - mfrSERIALIZED_TYPE_PANEL_HDMI_WB_DATA_BOOST_COLD, - mfrSERIALIZED_TYPE_PANEL_HDMI_WB_DATA_BOOST_WARM, - /*Tmax*/ - mfrSERIALIZED_TYPE_PANEL_PEAK_BRIGHTNESS_NONBOOST, - mfrSERIALIZED_TYPE_PANEL_PEAK_BRIGHTNESS_BOOST, - mfrSERIALIZED_TYPE_PANEL_PEAK_BRIGHTNESS_BURST, - mfrSERIALIZED_TYPE_PANEL_HDMI_WB_DATA_SUPERCOLD, - mfrSERIALIZED_TYPE_PANEL_HDMI_WB_DATA_BOOST_SUPERCOLD, - mfrSERIALIZED_TYPE_PANEL_GAMMA_CALIBRATED_SUPERCOLD, - mfrSERIALIZED_TYPE_PANEL_GAMMA_CALIBRATED_BOOST_SUPERCOLD, - mfrSERIALIZED_TYPE_PANEL_MAX, -#endif - mfrSERIALIZED_TYPE_SKYMODELNAME = 8000, //Sky specific MFRLib flags - mfrSERIALIZED_TYPE_DE_SERIAL_PREFIX, //Sky specific MFRLib flags -} mfrSerializedType_t; - - -/** - * @brief MFR image types - * - */ -typedef enum _mfrImageType_t -{ - mfrIMAGE_TYPE_CDL, ///< CDL image type - mfrIMAGE_TYPE_RCDL, ///< RCDL image type. - mfrUPGRADE_IMAGE_MONOLITHIC, ///< Monolithic image type - mfrUPGRADE_IMAGE_PACKAGEHEADER, ///< Package header image type - mfrIMAGE_TYPE_MAX, ///< Out of range - required to be the last item of the enum -} mfrImageType_t; - - -/** - * @brief MFR image write progress status - * - */ - typedef enum _mfrUpgradeProgress_t - { - mfrUPGRADE_PROGRESS_NOT_STARTED = 0, ///< not started - mfrUPGRADE_PROGRESS_STARTED, ///< in progress - mfrUPGRADE_PROGRESS_ABORTED, ///< failed - mfrUPGRADE_PROGRESS_VERIFYING, ///< Verifying - mfrUPGRADE_PROGRESS_FLASHING, ///< Flashing - mfrUPGRADE_PROGRESS_REBOOTING, ///< Rebooting - mfrUPGRADE_PROGRESS_COMPLETED, ///< success - mfrUPGRADE_PROGRESS_MAX ///< Out of range - required to be the last item of the enum - } mfrUpgradeProgress_t; - - -/** - * @brief MFR boot loader patterns - * - */ -typedef enum _mfrBlPattern_t -{ - mfrBL_PATTERN_NORMAL = 0, ///< normal boot loader pattern. This Boot pattern enable both LOGO as well LED ON during boot up - mfrBL_PATTERN_SILENT, ///< silent boot loader pattern. Keep the led off - mfrBL_PATTERN_SILENT_LED_ON, ///< silent LED on pattern. This Boot pattern enable only LED and disable LOGO during this boot up - mfrBL_PATTERN_LOGO_DISABLED, ///< Logo is disabled - mfrBL_PATTERN_MAX, ///< Out of range - required to be the last item of the enum -} mfrBlPattern_t; - -/** - * @brief MFR image upgrade status - * - */ -typedef struct _mfrUpgradeStatus_t -{ - mfrUpgradeProgress_t progress; ///< MFR upgrade progress status. @see mfrUpgradeProgress_t - mfrError_t error; ///< Error @see mfrError_t - char error_string[32]; ///< Error string - int percentage; ///< MFR upgrade percentage -} mfrUpgradeStatus_t; - -/** - * @brief MFR image upgrade status notify stucture - * - */ -typedef struct _mfrUpgradeStatusNotify_t -{ - void * cbData; ///< Upgrade status notify call back data - void (*cb) (mfrUpgradeStatus_t * status); ///< Upgrade status notify call back - int interval; ///< number of seconds between two callbacks. 0 means invoking callback only once to report final upgrade result -} mfrUpgradeStatusNotify_t; - -/** - * @brief Initializes the MFR library - * - * This function will initialize all the respective internal components responsible for MFR functionalities. - * This API need to be called before any other APIs in this module@n - * - * @return mfrError_t - Status - * @retval mfrERR_NONE - Success - * @retval mfrERR_ALREADY_INITIALIZED - Module is already initialised - * @retval mfrERR_MEMORY_EXHAUSTED - memory allocation failure - * - * @warning This API is Not thread safe - * - */ -mfrError_t mfr_init( void ); - -/** - * @brief Initialize the mfr partition. - * - * mfr_init invokes this mfr_partition_init. - * This function should be call once before accessing serialized data. - * - * @return mfrError_t - Status - * @retval mfrERR_NONE - Success - * @retval mfrERR_ALREADY_INITIALIZED - Module is already initialised - * @retval mfrERR_NOT_INITIALIZED - Module is not initialised - * - * - * @pre mfr_init() should be called before calling this API. If this precondition is not met, the API will return mfrERR_NOT_INITIALIZED. -*/ -mfrError_t mfr_partition_init(void); - -/** - * @brief Uninitializes the MFR library - * - * This function will uninitialize all the respective internal components responsible for MFR functionalities. - * - * @return mfrError_t - Status - * @retval mfrERR_NONE - Success - * @retval mfrERR_NOT_INITIALIZED - Module is not initialised - * - * @warning This API is Not thread safe - * - */ -mfrError_t mfr_term( void ); - -/** - * @brief Retrieves serialized Read-Only data from device - * - * - * @param [in] type : specifies the serialized data type to be read. @see mfrSerializedType_t - * @param [in] data : serialized data for the specific type requested. (buffer location, length, and func to free the buffer). @see mfrSerializedData_t - * - * @return mfrError_t - Status - * @retval mfrERR_NONE - Success - * @retval mfrERR_NOT_INITIALIZED - Module is not initialised - * @retval mfrERR_INVALID_PARAM - Parameter passed to this function is invalid - * @retval mfrERR_MEMORY_EXHAUSTED - memory allocation failure - * @retval mfrERR_FAILED_CRC_CHECK - CRC check failed - * @retval mfrERR_FLASH_READ_FAILED - Flash read failed - * - * @note The serialized data is returned as a byte stream. It is upto the application to deserialize and make sense of the data returned. - * Even if the serialized data returned is "string", the buffer is not required to contain the null-terminator - * - * @pre mfr_init() should be called before calling this API. If this precondition is not met, the API will return mfrERR_NOT_INITIALIZED. - * @warning This API is Not thread safe - * - */ -mfrError_t mfrGetSerializedData( mfrSerializedType_t type, mfrSerializedData_t *data ); - -/** - * @brief Sets the read write Serialization data on device - * - * @param [in] type : specifies the serialized data type to write. @see mfrSerializedType_t - * @param [in] data : serialized data to set for the specific type requested. (buffer location, length, and func to free the buffer). @see mfrSerializedData_t - * - * @return mfrError_t - Status - * @retval mfrERR_NONE - Success - * @retval mfrERR_NOT_INITIALIZED - Module is not initialised - * @retval mfrERR_INVALID_PARAM - Parameter passed to this function is invalid - * @retval mfrERR_MEMORY_EXHAUSTED - memory allocation failure - * @retval mfrERR_FAILED_CRC_CHECK - CRC check failed - * @retval mfrERR_WRITE_FLASH_FAILED - Flash write failed - * @retval mfrERR_FLASH_READ_FAILED - Flash read failed - * @retval mfrERR_FLASH_VERIFY_FAILED - Flash verification failed - * - * @pre mfr_init() should be called before calling this API. If this precondition is not met, the API will return mfrERR_NOT_INITIALIZED. - * @warning This API is Not thread safe - * - */ -mfrError_t mfrSetSerializedData( mfrSerializedType_t type, mfrSerializedData_t *data); - -/** - * @brief Writes the image into flash - * - * The process should follow these major steps: - * 1) Verify the validity of the image and flash - * 2) Update boot params and switch banks to prepare for a reboot event - * 3) All upgrades should be done in the alternate bank. The current bank should not be disturbed - * - * State Transition: - * 0) Before the API is invoked, the Upgrade process should be in PROGRESS_NOT_STARTED state - * 1) After the API returns with success, the Upgrade process moves to PROGRESS_STARTED state - * 2) After the API returns with error, the Upgrade process stays in PROGRESS_NOT_STARTED state. Notify function will not be invoked - * 3) The notify function is called at regular interval with process = PROGRESS_STARTED - * 4) The last invocation of notify function should have either progress = PROGRESS_COMPLETED or progress = PROGRESS_ABORTED with error code set - * - * @note mfrWriteImage() should work without any issue when device transition to DEEPSLEEP state and Wakeup. During DEEPSLEEP state processor will - * cache all the pc and stack state and will enter to low power state. On wakeup system will use the saved pc and stack and resume from the same point. - * - * @param [in] name : the filename of the image file - * @param [in] path : the path of the image file in the file system - * @param [in] type : the type (format, signature type) of the image. This can dictate the handling of the image within the MFR library. @see mfrImageType_t - * @param[in] notify: function to provide status of the image flashing process. @see mfrUpgradeStatusNotify_t - * - * - * @return mfrError_t - Status - * - * @retval mfrERR_NONE - Success - * @retval mfrERR_NOT_INITIALIZED - Module is not initialised - * @retval mfrERR_INVALID_PARAM - Parameter passed to this function is invalid - * @retval mfrERR_MEMORY_EXHAUSTED - memory allocation failure - * @retval mfrERR_FAILED_CRC_CHECK - CRC is failed - * @retval mfrERR_WRITE_FLASH_FAILED - Flash write failed - * @retval mfrERR_FLASH_VERIFY_FAILED - Flash verification failed - * @retval mfrERR_BAD_IMAGE_HEADER - Image header is corrupted - * @retval mfrERR_IMPROPER_SIGNATURE - Image signature is invalid - * @retval mfrERR_IMAGE_TOO_BIG - Image size is more than allocated maximum - * @retval mfrERR_FAILED_INVALID_SIGNING_TIME - Image signing time invalid - * @retval mfrERR_FAILED_IMAGE_SVN_OLDER - software version number is older than existing image - * @retval mfrERR_FAILED_SAME_DRI_CODE_VERSION - DRI code version is same - * @retval mfrERR_FAILED_SAME_PCI_CODE_VERSION - PCI code version is same - * @retval mfrERR_IMAGE_FILE_OPEN_FAILED - Not able to open the input image file - * @retval mfrERR_GET_FLASHED_IMAGE_DETAILS_FAILED - Not able to get the current image version details - * - * - * @pre mfr_init() should be called before calling this API. If this precondition is not met, the API will return mfrERR_NOT_INITIALIZED. . - * @warning This API is Not thread safe - * - */ -mfrError_t mfrWriteImage(const char *name, const char *path, mfrImageType_t type, mfrUpgradeStatusNotify_t notify); - -/** - * @brief Deletes the PDRI image if it is present - * - * @return mfrError_t - Status - * @retval mfrERR_NONE - Success - * @retval mfrERR_NOT_INITIALIZED - Module is not initialised - * @retval mfrERR_WRITE_FLASH_FAILED - Flash write failed - * @retval mfrERR_FLASH_VERIFY_FAILED - Flash verification failed - * - * @pre mfr_init() should be called before calling this API. If this precondition is not met, the API will return mfrERR_NOT_INITIALIZED. - * @warning This API is Not thread safe - * - */ -mfrError_t mfrDeletePDRI(void); - -/** - * @brief Deletes the platform images. Deletes the main image from primary and secondary bank - * - * @return mfrError_t - Status - * @retval mfrERR_NONE - Success - * @retval mfrERR_NOT_INITIALIZED - Module is not initialised - * @retval mfrERR_WRITE_FLASH_FAILED - Flash write failed - * @retval mfrERR_FLASH_VERIFY_FAILED - Flash verification failed - * - * @pre mfr_init() should be called before calling this API. If this precondition is not met, the API will return mfrERR_NOT_INITIALIZED. - * @warning This API is Not thread safe - * - */ -mfrError_t mfrScrubAllBanks(void); - -/** - * @brief Sets bootloader LED pattern - * - * This function stores the bootup pattern in the persistance storage for bootloader to read - * and control the front panel LED and/or TV backlight sequence on bootup - * - * @param [in] pattern : options are defined by enum mfrBlPattern_t. @see mfrBlPattern_t - * - * @return mfrError_t - Status - * @retval mfrERR_NONE - Success - * @retval mfrERR_NOT_INITIALIZED - Module is not initialised - * @retval mfrERR_INVALID_PARAM - Parameter passed to this function is invalid - * @retval mfrERR_WRITE_FLASH_FAILED - Flash write failed - * @retval mfrERR_FLASH_VERIFY_FAILED - Flash verification failed - * - * @pre mfr_init() should be called before calling this API. If this precondition is not met, the API will return mfrERR_NOT_INITIALIZED. - * @warning This API is Not thread safe - * - */ -mfrError_t mfrSetBootloaderPattern(mfrBlPattern_t pattern); - -/** - * @brief API to update Primary Splash screen Image and to override the default the Splash screen image - * - * @param [in] path : char pointer which holds the path of input bootloader OSD image. - * - * @return mfrError_t - Status - * @retval mfrERR_NONE - Success - * @retval mfrERR_NOT_INITIALIZED - Module is not initialised - * @retval mfrERR_INVALID_PARAM - Parameter passed to this function is invalid - * @retval mfrERR_IMAGE_FILE_OPEN_FAILED - Failed to open the downloaded splash screen file - * @retval mfrERR_MEMORY_EXHAUSTED - memory allocation failure - * - * @pre mfr_init() should be called before calling this API. If this precondition is not met, the API will return mfrERR_NOT_INITIALIZED. - * @warning This API is Not thread safe - * - */ -mfrError_t mfrSetBlSplashScreen(const char *path); - -/** - * @brief API to clear the primary Splash screen Image and to make - * use of default Splash screen image - * - * @return mfrError_t - Status - * @retval mfrERR_NONE - Success - * @retval mfrERR_NOT_INITIALIZED - Module is not initialised - * @retval mfrERR_IMAGE_FILE_OPEN_FAILED - Failed to open the downloaded splash screen file - * @retval mfrERR_MEMORY_EXHAUSTED - memory allocation failure - * - * @pre mfr_init() should be called before calling this API. If this precondition is not met, the API will return mfrERR_NOT_INITIALIZED. - * @warning This API is Not thread safe - * - */ -mfrError_t mfrClearBlSplashScreen(void); - -/** -* @brief API to retrive the secure time from TEE -* -* @param [in] params : unit32 timeptr to get the UTC time in seconds -* -* @return Error Code: Return mfrERR_NONE if operation is successful, mfrERR_GENERAL if it fails -*/ -mfrError_t mfrGetSecureTime(uint32_t *timeptr); - -/** -* @brief API to set the secure time from TEE -* -* @param [in] params : unit32 timeptr to set the UTC time in seconds -* -* @return Error Code: Return mfrERR_NONE if operation is successful, mfrERR_GENERAL if it fails -*/ -mfrError_t mfrSetSecureTime(uint32_t *timeptr); - - -/** - * @brief API to set the fsr flag into the emmc raw area - * - * @param [in] params : uint16_t fsrflag to set the FSR flag - * - * @return mfrError_t - Status - * @retval mfrERR_NONE - Success - * @retval mfrERR_NOT_INITIALIZED - Module is not initialised - * @retval mfrERR_INVALID_PARAM - Parameter passed to this function is invalid - * @return Error Code: Return mfrERR_NONE if operation is successful, mfrERR_GENERAL if it fails - * - **/ -mfrError_t mfrSetFSRflag(uint16_t *newFsrFlag); - -/** - * @brief API to get the fsr flag from emmc - * - * @param [in] params : uint16_t fsrflag to get the FSR flag - * - * @return mfrError_t - Status - * @retval mfrERR_NONE - Success - * @retval mfrERR_INVALID_PARAM - Parameter passed to this function is invalid - * @retval mfrERR_NOT_INITIALIZED - Module is not initialised - * @return Error Code: Return mfrERR_NONE if operation is successful, mfrERR_GENERAL if it fails - * - **/ -mfrError_t mfrGetFSRflag(uint16_t *newFsrFlag); - -/** -* @brief API to retrive the secure time from TEE -* -* @param [in] params : unit32 timeptr to get the UTC time in seconds -* -* @return Error Code: Return mfrERR_NONE if operation is successful, mfrERR_GENERAL if it fails -*/ -mfrError_t mfrGetSecureTime(uint32_t *timeptr); - -/** -* @brief API to set the secure time from TEE -* -* @param [in] params : unit32 timeptr to set the UTC time in seconds -* -* @return Error Code: Return mfrERR_NONE if operation is successful, mfrERR_GENERAL if it fails -*/ -mfrError_t mfrSetSecureTime(uint32_t *timeptr); - - -/** -* @brief API to set the fsr flag into the emmc raw area -* -* @param [in] params : unit32 fsrflag to set the FSR flag -* -* @return Error Code: Return mfrERR_NONE if operation is successful, mfrERR_GENERAL if it fails -*/ -mfrError_t mfrSetFSRflag(uint16_t *newFsrFlag); - - -/** -* @brief API to get the fsr flag from emmc -* -* @param [in] params : unit32 fsrflag to get the FSR flag -* -* @return Error Code: Return mfrERR_NONE if operation is successful, mfrERR_GENERAL if it fails -*/ -mfrError_t mfrGetFSRflag(uint16_t *newFsrFlag); - -#endif - -/** @} */ // End of PLAT_MFR_DATA -/** @} */ // End of MFR_HAL -/** @} */ // End of MFR Module -/** @} */ // End of HPK diff --git a/ci/mocks/secure_wrappermock.h b/ci/mocks/secure_wrappermock.h deleted file mode 100755 index 04122b99..00000000 --- a/ci/mocks/secure_wrappermock.h +++ /dev/null @@ -1,37 +0,0 @@ -/** -* If not stated otherwise in this file or this component's LICENSE -* file the following copyright and licenses apply: -* -* Copyright 2026 RDK Management -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -**/ - -#pragma once -#include -#include - -# ifdef __cplusplus -extern "C" { -# endif - - -FILE *v_secure_popen(const char *direction, const char *command, ...); - -int v_secure_pclose(FILE *); - -int v_secure_system(const char *command, ...); - -# ifdef __cplusplus -} -# endif diff --git a/ci/mocks/thunder/COMLinkMock.h b/ci/mocks/thunder/COMLinkMock.h deleted file mode 100644 index 8907e70a..00000000 --- a/ci/mocks/thunder/COMLinkMock.h +++ /dev/null @@ -1,50 +0,0 @@ -/** -* If not stated otherwise in this file or this component's LICENSE -* file the following copyright and licenses apply: -* -* Copyright 2026 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 RDKSERVICES_TESTS_MOCKS_COMLINKMOCK_H_ -#define RDKSERVICES_TESTS_MOCKS_COMLINKMOCK_H_ - -#include - -#include "Module.h" - -#ifndef USE_THUNDER_R4 -class COMLinkMock : public WPEFramework::PluginHost::IShell::ICOMLink { -public: - virtual ~COMLinkMock() = default; - - MOCK_METHOD(void, Register, (WPEFramework::RPC::IRemoteConnection::INotification*), (override)); - MOCK_METHOD(void, Unregister, (WPEFramework::RPC::IRemoteConnection::INotification*), (override)); - MOCK_METHOD(WPEFramework::RPC::IRemoteConnection*, RemoteConnection, (const uint32_t), (override)); - MOCK_METHOD(void*, Instantiate, (const WPEFramework::RPC::Object&, const uint32_t, uint32_t&, const string&, const string&), (override)); -}; -#else -class COMLinkMock : public WPEFramework::PluginHost::IShell::ICOMLink { -public: - virtual ~COMLinkMock() = default; - - MOCK_METHOD(void, Register, (WPEFramework::RPC::IRemoteConnection::INotification*), (override)); - MOCK_METHOD(void, Unregister, (const WPEFramework::RPC::IRemoteConnection::INotification*), (override)); - MOCK_METHOD(void, Register, (INotification*), (override)); - MOCK_METHOD(void, Unregister, (INotification*), (override)); - MOCK_METHOD(WPEFramework::RPC::IRemoteConnection*, RemoteConnection, (const uint32_t), (override)); - MOCK_METHOD(void*, Instantiate, (const WPEFramework::RPC::Object&, const uint32_t, uint32_t&), (override)); -}; -#endif /* ! USE_THUNDER_R4 */ -#endif //RDKSERVICES_TESTS_MOCKS_COMLINKMOCK_H_ diff --git a/ci/mocks/thunder/Communicator.cpp b/ci/mocks/thunder/Communicator.cpp deleted file mode 100755 index 5de37d50..00000000 --- a/ci/mocks/thunder/Communicator.cpp +++ /dev/null @@ -1,30 +0,0 @@ -/* -* If not stated otherwise in this file or this component's LICENSE file the -* following copyright and licenses apply: -* -* Copyright 2026 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. -*/ - -#include "Communicator.h" -#include - -ICommunicatorClient* WPEFramework::RPC::CommunicatorClient::impl = nullptr; - -void WPEFramework::RPC::CommunicatorClient::setImpl(ICommunicatorClient* newImpl) -{ - // Handles both resetting 'impl' to nullptr and assigning a new value to 'impl' - EXPECT_TRUE ((nullptr == impl) || (nullptr == newImpl)); - impl = newImpl; -} diff --git a/ci/mocks/thunder/Communicator.h b/ci/mocks/thunder/Communicator.h deleted file mode 100755 index 4af3a850..00000000 --- a/ci/mocks/thunder/Communicator.h +++ /dev/null @@ -1,286 +0,0 @@ -/* -* If not stated otherwise in this file or this component's LICENSE file the -* following copyright and licenses apply: -* -* Copyright 2026 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 __COM_PROCESSLAUNCH_H -#define __COM_PROCESSLAUNCH_H - -#include -#include "Proxy.h" -#include "NodeId.h" -#include "IPCConnector.h" - -using std::string; -const uint32_t CommunicationTimeOut = 3000; - -class ICommunicatorClient { -public: - virtual ~ICommunicatorClient() = default; - virtual uint32_t Open(const uint32_t waitTime) = 0; - virtual void* Open(const std::string& className, const uint32_t version, const uint32_t waitTime) = 0; - virtual void* Acquire(const uint32_t waitTime, const std::string& className, const uint32_t versionId) = 0; - virtual uint32_t Offer(void* offer, const uint32_t version, const uint32_t waitTime) = 0; - virtual uint32_t Revoke(void* offer, const uint32_t version, const uint32_t waitTime) = 0; - virtual uint32_t Close(const uint32_t waitTime) = 0; - virtual void* Acquire(const std::string& className, const uint32_t interfaceId, const uint32_t versionId) = 0; -}; - -namespace WPEFramework { -namespace RPC { - class Object { - public: - enum class HostType { - LOCAL, - DISTRIBUTED, - CONTAINER - }; - - Object() - : _locator() - , _className() - , _callsign() - , _interface(~0) - , _version(~0) - , _user() - , _group() - , _threads() - , _priority() - , _type(HostType::LOCAL) - , _systemRootPath() - , _remoteAddress() - , _configuration() - { - } - Object(const Object& copy) - : _locator(copy._locator) - , _className(copy._className) - , _callsign(copy._callsign) - , _interface(copy._interface) - , _version(copy._version) - , _user(copy._user) - , _group(copy._group) - , _threads(copy._threads) - , _priority(copy._priority) - , _type(copy._type) - , _systemRootPath(copy._systemRootPath) - , _remoteAddress(copy._remoteAddress) - , _configuration(copy._configuration) - { - } - Object(const string& locator, - const string& className, - const string& callsign, - const uint32_t interface, - const uint32_t version, - const string& user, - const string& group, - const uint8_t threads, - const int8_t priority, - const HostType type, - const string& systemRootPath, - const string& remoteAddress, - const string& configuration) - : _locator(locator) - , _className(className) - , _callsign(callsign) - , _interface(interface) - , _version(version) - , _user(user) - , _group(group) - , _threads(threads) - , _priority(priority) - , _type(type) - , _systemRootPath(systemRootPath) - , _remoteAddress(remoteAddress) - , _configuration(configuration) - { - } - ~Object() - { - } - - Object& operator=(const Object& RHS) - { - _locator = RHS._locator; - _className = RHS._className; - _callsign = RHS._callsign; - _interface = RHS._interface; - _version = RHS._version; - _user = RHS._user; - _group = RHS._group; - _threads = RHS._threads; - _priority = RHS._priority; - _systemRootPath = RHS._systemRootPath; - _type = RHS._type; - _remoteAddress = RHS._remoteAddress; - _configuration = RHS._configuration; - - return (*this); - } - - public: - inline const string& Locator() const - { - return (_locator); - } - inline const string& ClassName() const - { - return (_className); - } - inline const string& Callsign() const - { - return (_callsign); - } - inline uint32_t Interface() const - { - return (_interface); - } - inline uint32_t Version() const - { - return (_version); - } - inline const string& User() const - { - return (_user); - } - inline const string& Group() const - { - return (_group); - } - inline uint8_t Threads() const - { - return (_threads); - } - inline int8_t Priority() const - { - return (_priority); - } - inline HostType Type() const - { - return (_type); - } - inline const string& SystemRootPath() const - { - return (_systemRootPath); - } - inline const Core::NodeId RemoteAddress() const - { - return (Core::NodeId(_remoteAddress.c_str())); - } - inline const string& Configuration() const - { - return (_configuration); - } - - private: - string _locator; - string _className; - string _callsign; - uint32_t _interface; - uint32_t _version; - string _user; - string _group; - uint8_t _threads; - int8_t _priority; - HostType _type; - string _systemRootPath; - string _remoteAddress; - string _configuration; - }; - - class CommunicatorClient{ - protected: - static ICommunicatorClient* impl; - - public: - class Source { - bool IsOpen() const - { - return true; - } - }; - CommunicatorClient() = delete; - CommunicatorClient(CommunicatorClient&&) = delete; - CommunicatorClient(const CommunicatorClient&) = delete; - CommunicatorClient& operator=(CommunicatorClient&&) = delete; - CommunicatorClient& operator=(const CommunicatorClient&) = delete; - - static void setImpl(ICommunicatorClient* newImpl); - - CommunicatorClient(const Core::NodeId& remoteNode) { - //Mock CommunicatorClient constructor. - } - - CommunicatorClient(const Core::NodeId& remoteNode, const Core::ProxyType& handler) { - //Mock CommunicatorClient constructor. - } - - ~CommunicatorClient() { - } - - public: - inline uint32_t ConnectionId() const { - return _connectionId; - } - - // Open a communication channel with this process, no need for an initial exchange - uint32_t Open(const uint32_t waitTime) - { - return impl->Open(waitTime); - } - template - INTERFACE* Open(const std::string& className, const uint32_t version = static_cast(~0), const uint32_t waitTime = CommunicationTimeOut) - { - return static_cast(impl->Open(className, version, waitTime)); - } - template - INTERFACE* Acquire(const uint32_t waitTime, const std::string& className, const uint32_t versionId) - { - return static_cast(impl->Acquire(waitTime, className, versionId)); - } - template - uint32_t Offer(INTERFACE* offer, const uint32_t version = static_cast(~0), const uint32_t waitTime = CommunicationTimeOut) - { - return static_cast(impl->Offer(static_cast(offer), version, CommunicationTimeOut)); - } - template - uint32_t Revoke(INTERFACE* offer, const uint32_t version = static_cast(~0), const uint32_t waitTime = CommunicationTimeOut) - { - return static_cast(impl->Revoke(static_cast(offer), version, CommunicationTimeOut)); - } - uint32_t Close(const uint32_t waitTime) - { - if (impl) - return impl->Close(waitTime); - return Core::ERROR_GENERAL; - } - virtual void* Acquire(const std::string& className, const uint32_t interfaceId, const uint32_t versionId) - { - return impl->Acquire(className, interfaceId, versionId); - } - protected: - void StateChange() { - //Mock CommunicatorClient StateChange is calling. - } - private: - uint32_t _connectionId; - }; -} -} -#endif // __COM_PROCESSLAUNCH_H - diff --git a/ci/mocks/thunder/CommunicatorMock.h b/ci/mocks/thunder/CommunicatorMock.h deleted file mode 100755 index 522d5cf0..00000000 --- a/ci/mocks/thunder/CommunicatorMock.h +++ /dev/null @@ -1,53 +0,0 @@ -/* -* If not stated otherwise in this file or this component's LICENSE file the -* following copyright and licenses apply: -* -* Copyright 2026 RDK Management -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#pragma once - -#include -#include "Communicator.h" - -#if 0 -class CommunicatorClientMock : public ICommunicatorClient -{ -public: - virtual ~CommunicatorClientMock() = default; - - MOCK_METHOD(uint32_t, Open, (const uint32_t waitTime), (override)); - MOCK_METHOD(INTERFACE*, Open, (const std::string& className, const uint32_t version, const uint32_t waitTime), (override)); - MOCK_METHOD(INTERFACE*, Acquire, (const uint32_t waitTime, const std::string& className, const uint32_t versionId), (override)); - MOCK_METHOD(uint32_t, Offer, (INTERFACE* offer, const uint32_t version, const uint32_t waitTime), (override)); - MOCK_METHOD(uint32_t, Revoke, (INTERFACE* offer, const uint32_t version, const uint32_t waitTime), (override)); - MOCK_METHOD(uint32_t, Close, (const uint32_t waitTime), (override)); -}; -#else -class CommunicatorClientMock : public ICommunicatorClient { -public: - virtual ~CommunicatorClientMock() = default; - MOCK_METHOD(void, AddRef, (), (const)); - MOCK_METHOD(uint32_t, Release, (), (const)); - MOCK_METHOD(uint32_t, Open, (const uint32_t waitTime), (override)); - MOCK_METHOD(void*, Open, (const std::string& className, const uint32_t version, const uint32_t waitTime), (override)); - MOCK_METHOD(void*, Acquire, (const uint32_t waitTime, const std::string& className, const uint32_t versionId), (override)); - MOCK_METHOD(uint32_t, Offer, (void* offer, const uint32_t version, const uint32_t waitTime), (override)); - MOCK_METHOD(uint32_t, Revoke, (void* offer, const uint32_t version, const uint32_t waitTime), (override)); - MOCK_METHOD(uint32_t, Close, (const uint32_t waitTime), (override)); - MOCK_METHOD(void*, Acquire, (const std::string& className, const uint32_t interfaceId, const uint32_t versionId), (override)); -}; - -#endif diff --git a/ci/mocks/thunder/DispatcherMock.h b/ci/mocks/thunder/DispatcherMock.h deleted file mode 100644 index c26986a8..00000000 --- a/ci/mocks/thunder/DispatcherMock.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * If not stated otherwise in this file or this component's LICENSE file the - * following copyright and licenses apply: - * - * Copyright 2026 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 DISPATCHERMOCK_H -#define DISPATCHERMOCK_H - -#include - -#include "Module.h" - -#ifndef USE_THUNDER_R4 - class DispatcherMock: public WPEFramework::PluginHost::IDispatcher{ - public: - virtual ~DispatcherMock() = default; - MOCK_METHOD(void, AddRef, (), (const, override)); - MOCK_METHOD(uint32_t, Release, (), (const, override)); - MOCK_METHOD(void*, QueryInterface, (const uint32_t interfaceNummer), (override)); - MOCK_METHOD(void, Activate, (WPEFramework::PluginHost::IShell* service)); - MOCK_METHOD(void, Deactivate, ()); - MOCK_METHOD(WPEFramework::Core::ProxyType, Invoke, (const string&, uint32_t, const WPEFramework::Core::JSONRPC::Message&), (override)); -}; -#else - class DispatcherMock: public WPEFramework::PluginHost::ILocalDispatcher{ - public: - virtual ~DispatcherMock() = default; - MOCK_METHOD(void, AddRef, (), (const, override)); - MOCK_METHOD(uint32_t, Release, (), (const, override)); - MOCK_METHOD(void*, QueryInterface, (const uint32_t interfaceNummer), (override)); - MOCK_METHOD(void, Activate, (WPEFramework::PluginHost::IShell* service)); - MOCK_METHOD(void, Deactivate, ()); - MOCK_METHOD(void, Dropped, (const uint32_t)); - MOCK_METHOD(uint32_t, Invoke, (const uint32_t channelId, const uint32_t id, const string& token, const string& method, const string& parameters, string& response), (override)); - MOCK_METHOD(WPEFramework::Core::hresult, Invoke, (WPEFramework::PluginHost::IDispatcher::ICallback* callback, const uint32_t channelId, const uint32_t id, const string& token, const string& method, const string& parameters /* @restrict:(4M-1) */, string& response /* @restrict:(4M-1) @out */), (override)); - MOCK_METHOD(WPEFramework::Core::hresult, Revoke, (WPEFramework::PluginHost::IDispatcher::ICallback* callback), (override)); - MOCK_METHOD(WPEFramework::Core::hresult, Validate, (const string& token, const string& method, const string& paramaters /* @restrict:(4M-1) */), (const, override)); - MOCK_METHOD(WPEFramework::PluginHost::ILocalDispatcher*, Local, (), (override)); -}; -#endif /* ! USE_THUNDER_R4 */ -#endif //DISPATCHERMOCK_H diff --git a/ci/mocks/thunder/FactoriesImplementation.h b/ci/mocks/thunder/FactoriesImplementation.h deleted file mode 100644 index da57617a..00000000 --- a/ci/mocks/thunder/FactoriesImplementation.h +++ /dev/null @@ -1,66 +0,0 @@ -/** -* If not stated otherwise in this file or this component's LICENSE -* file the following copyright and licenses apply: -* -* Copyright 2026 RDK Management -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -**/ - -#pragma once - -#include - -#include "Module.h" - -class FactoriesImplementation : public WPEFramework::PluginHost::IFactories { -public: - FactoriesImplementation(const FactoriesImplementation&) = delete; - FactoriesImplementation& operator=(const FactoriesImplementation&) = delete; - - FactoriesImplementation() - : _requestFactory(5) - , _responseFactory(5) - , _fileBodyFactory(5) - , _jsonRPCFactory(5) - { - // Defaults: - ON_CALL(*this, Request()) - .WillByDefault(::testing::Invoke( - [&]() { return (_requestFactory.Element()); })); - ON_CALL(*this, Response()) - .WillByDefault(::testing::Invoke( - [&]() { return (_responseFactory.Element()); })); - ON_CALL(*this, FileBody()) - .WillByDefault(::testing::Invoke( - [&]() { return (_fileBodyFactory.Element()); })); - ON_CALL(*this, JSONRPC()) - .WillByDefault(::testing::Invoke( - [&]() { - return (WPEFramework::Core::ProxyType>(_jsonRPCFactory.Element())); - })); - } - - virtual ~FactoriesImplementation() = default; - - MOCK_METHOD(WPEFramework::Core::ProxyType, Request, (), (override)); - MOCK_METHOD(WPEFramework::Core::ProxyType, Response, (), (override)); - MOCK_METHOD(WPEFramework::Core::ProxyType, FileBody, (), (override)); - MOCK_METHOD(WPEFramework::Core::ProxyType>, JSONRPC, (), (override)); - -private: - WPEFramework::Core::ProxyPoolType _requestFactory; - WPEFramework::Core::ProxyPoolType _responseFactory; - WPEFramework::Core::ProxyPoolType _fileBodyFactory; - WPEFramework::Core::ProxyPoolType _jsonRPCFactory; -}; diff --git a/ci/mocks/thunder/Module.cpp b/ci/mocks/thunder/Module.cpp deleted file mode 100644 index 9fe0ab6e..00000000 --- a/ci/mocks/thunder/Module.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/** -* If not stated otherwise in this file or this component's LICENSE -* file the following copyright and licenses apply: -* -* Copyright 2026 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. -**/ - -#include "Module.h" - -MODULE_NAME_DECLARATION(BUILD_REFERENCE) diff --git a/ci/mocks/thunder/Module.h b/ci/mocks/thunder/Module.h deleted file mode 100644 index 1f49ab64..00000000 --- a/ci/mocks/thunder/Module.h +++ /dev/null @@ -1,27 +0,0 @@ -/** -* If not stated otherwise in this file or this component's LICENSE -* file the following copyright and licenses apply: -* -* Copyright 2026 RDK Management -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -**/ - -#pragma once - -#ifndef MODULE_NAME -#define MODULE_NAME RdkServicesL1Test -#endif - -#include -#include diff --git a/ci/mocks/thunder/ServiceMock.h b/ci/mocks/thunder/ServiceMock.h deleted file mode 100644 index a5dc9d2e..00000000 --- a/ci/mocks/thunder/ServiceMock.h +++ /dev/null @@ -1,92 +0,0 @@ -/* - * If not stated otherwise in this file or this component's LICENSE file the - * following copyright and licenses apply: - * - * Copyright 2026 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 SERVICEMOCK_H -#define SERVICEMOCK_H - -#include - -#include "Module.h" - -class ServiceMock : public WPEFramework::PluginHost::IShell { -public: - virtual ~ServiceMock() = default; - - MOCK_METHOD(void, AddRef, (), (const, override)); - MOCK_METHOD(uint32_t, Release, (), (const, override)); - MOCK_METHOD(string, Versions, (), (const, override)); - MOCK_METHOD(string, Locator, (), (const, override)); - MOCK_METHOD(string, ClassName, (), (const, override)); - MOCK_METHOD(string, Callsign, (), (const, override)); - MOCK_METHOD(string, WebPrefix, (), (const, override)); - MOCK_METHOD(string, ConfigLine, (), (const, override)); - MOCK_METHOD(string, PersistentPath, (), (const, override)); - MOCK_METHOD(string, VolatilePath, (), (const, override)); - MOCK_METHOD(string, DataPath, (), (const, override)); - MOCK_METHOD(state, State, (), (const, override)); -#ifdef USE_THUNDER_R4 - MOCK_METHOD(WPEFramework::Core::hresult, Activate, (const reason), (override)); - MOCK_METHOD(WPEFramework::Core::hresult, Deactivate, (const reason), (override)); - MOCK_METHOD(WPEFramework::Core::hresult, Unavailable, (const reason), (override)); - MOCK_METHOD(WPEFramework::Core::hresult, ConfigLine, (const string& config), (override)); - MOCK_METHOD(WPEFramework::Core::hresult, SystemRootPath, (const string& systemRootPath), (override)); - MOCK_METHOD(WPEFramework::Core::hresult, Hibernate, (const uint32_t timeout), (override)); - MOCK_METHOD(string, SystemPath, (), (const, override)); - MOCK_METHOD(string, PluginPath, (), (const, override)); - MOCK_METHOD(WPEFramework::PluginHost::IShell::startup, Startup, (), (const, override)); - MOCK_METHOD(WPEFramework::Core::hresult, Startup, (const startup value), (override)); - MOCK_METHOD(WPEFramework::Core::hresult, Resumed, (const bool value), (override)); - MOCK_METHOD(WPEFramework::Core::hresult, Metadata, (string& info), (const, override)); -#else - MOCK_METHOD(bool, AutoStart, (), (const, override)); - MOCK_METHOD(string, Version, (), (const, override)); - MOCK_METHOD(uint32_t, Activate, (const reason), (override)); - MOCK_METHOD(uint32_t, Deactivate, (const reason), (override)); - MOCK_METHOD(uint32_t, Unavailable, (const reason), (override)); - MOCK_METHOD(uint8_t, Major, (), (const, override)); - MOCK_METHOD(uint8_t, Minor, (), (const, override)); - MOCK_METHOD(uint8_t, Patch, (), (const, override)); - MOCK_METHOD(uint32_t, ConfigLine, (const string& config), (override)); - MOCK_METHOD(uint32_t, SystemRootPath, (const string& systemRootPath), (override)); - MOCK_METHOD(uint32_t, Hibernate, (const string &processSequence, const uint32_t timeout), (override)); - MOCK_METHOD(uint32_t, Wakeup, (const string &processSequence, const uint32_t timeout), (override)); -#endif - MOCK_METHOD(bool, Resumed, (), (const, override)); - MOCK_METHOD(bool, IsSupported, (const uint8_t), (const, override)); - MOCK_METHOD(void, EnableWebServer, (const string&, const string&), (override)); - MOCK_METHOD(void, DisableWebServer, (), (override)); - MOCK_METHOD(WPEFramework::PluginHost::ISubSystem*, SubSystems, (), (override)); - MOCK_METHOD(uint32_t, Submit, (const uint32_t, const WPEFramework::Core::ProxyType&), (override)); - MOCK_METHOD(void, Notify, (const string&), (override)); - MOCK_METHOD(void*, QueryInterface, (const uint32_t), (override)); - MOCK_METHOD(void*, QueryInterfaceByCallsign, (const uint32_t, const string&), (override)); - MOCK_METHOD(void, Register, (WPEFramework::PluginHost::IPlugin::INotification*), (override)); - MOCK_METHOD(void, Unregister, (WPEFramework::PluginHost::IPlugin::INotification*), (override)); - MOCK_METHOD(string, Model, (), (const, override)); - MOCK_METHOD(bool, Background, (), (const, override)); - MOCK_METHOD(string, Accessor, (), (const, override)); - MOCK_METHOD(string, ProxyStubPath, (), (const, override)); - MOCK_METHOD(string, HashKey, (), (const, override)); - MOCK_METHOD(string, Substitute, (const string&), (const, override)); - MOCK_METHOD(WPEFramework::PluginHost::IShell::ICOMLink*, COMLink, (), (override)); - MOCK_METHOD(reason, Reason, (), (const, override)); - MOCK_METHOD(string, SystemRootPath, (), (const, override)); -}; - -#endif //SERVICEMOCK_H diff --git a/ci/mocks/thunder/SystemInfo.h b/ci/mocks/thunder/SystemInfo.h deleted file mode 100644 index baaab5bb..00000000 --- a/ci/mocks/thunder/SystemInfo.h +++ /dev/null @@ -1,85 +0,0 @@ -/** -* If not stated otherwise in this file or this component's LICENSE -* file the following copyright and licenses apply: -* -* Copyright 2026 RDK Management -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -**/ - -#pragma once - -#include - -#include "Module.h" - -class SystemInfo : public WPEFramework::PluginHost::ISubSystem { -private: - SystemInfo(const SystemInfo&) = delete; - SystemInfo& operator=(const SystemInfo&) = delete; - -public: - SystemInfo() - : _flags(0) - { - // Defaults: - ON_CALL(*this, Set(::testing::_, ::testing::_)) - .WillByDefault(::testing::Invoke( - [&](const subsystem type, WPEFramework::Core::IUnknown* information) { - _subsystems.emplace(type, information); - - if (type >= NEGATIVE_START) { - _flags &= ~(1 << (type - NEGATIVE_START)); - } else { - _flags |= (1 << type); - } - })); - ON_CALL(*this, Get(::testing::_)) - .WillByDefault(::testing::Invoke( - [&](const subsystem type) -> const WPEFramework::Core::IUnknown* { - const WPEFramework::Core::IUnknown* result(nullptr); - - auto it = _subsystems.find(type); - if (it != _subsystems.end()) { - result = it->second; - } - - return result; - })); - ON_CALL(*this, IsActive(::testing::_)) - .WillByDefault(::testing::Invoke( - [&](const subsystem type) -> bool { - return ((type < END_LIST) && ((_flags & (1 << type)) != 0)); - })); - } - virtual ~SystemInfo() = default; - -public: - MOCK_METHOD(void, Register, (WPEFramework::PluginHost::ISubSystem::INotification * notification), (override)); - MOCK_METHOD(void, Unregister, (WPEFramework::PluginHost::ISubSystem::INotification * notification), (override)); - MOCK_METHOD(string, BuildTreeHash, (), (const, override)); - MOCK_METHOD(void, Set, (const subsystem type, WPEFramework::Core::IUnknown* information), (override)); - MOCK_METHOD(const WPEFramework::Core::IUnknown*, Get, (const subsystem type), (const, override)); - MOCK_METHOD(bool, IsActive, (const subsystem type), (const, override)); -#ifdef USE_THUNDER_R4 - MOCK_METHOD(string, Version, (), (const, override)); -#endif /*USE_THUNDER_R4 */ - - BEGIN_INTERFACE_MAP(SystemInfo) - INTERFACE_ENTRY(WPEFramework::PluginHost::ISubSystem) - END_INTERFACE_MAP - -private: - std::map _subsystems; - uint32_t _flags; -}; diff --git a/ci/mocks/thunder/ThunderPortability.h b/ci/mocks/thunder/ThunderPortability.h deleted file mode 100755 index 392e1883..00000000 --- a/ci/mocks/thunder/ThunderPortability.h +++ /dev/null @@ -1,52 +0,0 @@ -/** -* If not stated otherwise in this file or this component's LICENSE -* file the following copyright and licenses apply: -* -* Copyright 2026 RDK Management -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -**/ - -#pragma once - -#include -#include - -#ifdef USE_THUNDER_R4 -#define EVENT_SUBSCRIBE(__A__, __B__, __C__, __D__) \ - { \ - auto ret = plugin->Subscribe(__A__, __B__, __C__); \ - EXPECT_EQ(Core::ERROR_NONE, ret); \ - (void)__D__; \ - } - -#define EVENT_UNSUBSCRIBE(__A__, __B__, __C__, __D__) \ - { \ - auto ret = plugin->Unsubscribe(__A__, __B__, __C__); \ - EXPECT_EQ(Core::ERROR_NONE, ret); \ - (void)__D__; \ - } - -#define DECL_CORE_JSONRPC_CONX Core::JSONRPC::Context -#define INIT_CONX(__X__, __Y__) connection(__X__, __Y__, "") -#define PLUGINHOST_DISPATCHER PluginHost::ILocalDispatcher -#define PLUGINHOST_DISPATCHER_ID PluginHost::ILocalDispatcher::ID -#else -#define EVENT_SUBSCRIBE(__A__, __B__, __C__, __D__) { handler.Subscribe(__A__, __B__, __C__, __D__); } -#define EVENT_UNSUBSCRIBE(__A__, __B__, __C__, __D__) { handler.Unsubscribe(__A__, __B__, __C__, __D__); } - -#define DECL_CORE_JSONRPC_CONX Core::JSONRPC::Connection -#define INIT_CONX(__X__, __Y__) connection(__X__, __Y__) -#define PLUGINHOST_DISPATCHER PluginHost::IDispatcher -#define PLUGINHOST_DISPATCHER_ID PluginHost::IDispatcher::ID -#endif diff --git a/ci/mocks/thunder/WorkerPoolImplementation.h b/ci/mocks/thunder/WorkerPoolImplementation.h deleted file mode 100644 index f0e8ee86..00000000 --- a/ci/mocks/thunder/WorkerPoolImplementation.h +++ /dev/null @@ -1,63 +0,0 @@ -/** -* If not stated otherwise in this file or this component's LICENSE -* file the following copyright and licenses apply: -* -* Copyright 2026 RDK Management -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -**/ - -#pragma once - -#include - -#include "Module.h" - -class WorkerPoolImplementation : public WPEFramework::Core::WorkerPool { -private: - class Dispatcher : public WPEFramework::Core::ThreadPool::IDispatcher { - public: - Dispatcher(const Dispatcher&) = delete; - Dispatcher& operator=(const Dispatcher&) = delete; - - Dispatcher() = default; - ~Dispatcher() override = default; - - private: - void Initialize() override {} - void Deinitialize() override {} - void Dispatch(WPEFramework::Core::IDispatch* job) override - { - job->Dispatch(); - } - }; - -public: - WorkerPoolImplementation() = delete; - WorkerPoolImplementation(const WorkerPoolImplementation&) = delete; - WorkerPoolImplementation& operator=(const WorkerPoolImplementation&) = delete; - - WorkerPoolImplementation(const uint8_t threads, const uint32_t stackSize, const uint32_t queueSize) - : WPEFramework::Core::WorkerPool(threads - 1, stackSize, queueSize, &_dispatcher) - , _dispatcher() - { - } - - virtual ~WorkerPoolImplementation() - { - WPEFramework::Core::WorkerPool::Stop(); - } - -private: - Dispatcher _dispatcher; -}; diff --git a/ci/mocks/thunder/mockauthservices.h b/ci/mocks/thunder/mockauthservices.h deleted file mode 100644 index cc56c400..00000000 --- a/ci/mocks/thunder/mockauthservices.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - * If not stated otherwise in this file or this component's LICENSE file the - * following copyright and licenses apply: - * - * Copyright 2026 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 MOCKAUTHSERVICES_H -#define MOCKAUTHSERVICES_H - -#include - -#include "Module.h" - -class MockAuthService : public WPEFramework::Exchange::IAuthService { -public: - virtual ~MockAuthService() = default; - MOCK_METHOD(uint32_t, GetActivationStatus, (ActivationStatusResult&), (override)); - MOCK_METHOD(uint32_t, SetActivationStatus, (const std::string&, SuccessMsgResult&), (override)); - MOCK_METHOD(uint32_t, ClearAuthToken, (SuccessMsgResult&), (override)); - MOCK_METHOD(uint32_t, ClearSessionToken, (SuccessMsgResult&), (override)); - MOCK_METHOD(uint32_t, ClearServiceAccessToken, (SuccessMsgResult&), (override)); - MOCK_METHOD(uint32_t, ClearLostAndFoundAccessToken, (SuccessMsgResult&), (override)); - MOCK_METHOD(uint32_t, ClearServiceAccountId, (SuccessMsgResult&), (override)); - MOCK_METHOD(uint32_t, ClearCustomProperties, (SuccessMsgResult&), (override)); - MOCK_METHOD(uint32_t, GetCustomProperties, (std::string&, bool&), (override)); - MOCK_METHOD(uint32_t, SetCustomProperties, (const std::string&, bool&), (override)); - MOCK_METHOD(uint32_t, GetAlternateIds, (std::string&, std::string&, bool&), (override)); - MOCK_METHOD(uint32_t, SetAlternateIds, (const std::string&, std::string&, bool&), (override)); - MOCK_METHOD(uint32_t, GetTransitionData, (std::string&, std::string&, bool&), (override)); - MOCK_METHOD(void, AddRef, (), (const, override)); - MOCK_METHOD(uint32_t, Release, (), (const, override)); - MOCK_METHOD(void*, QueryInterface, (uint32_t), (override)); - MOCK_METHOD(uint32_t, Register, (IAuthService::INotification*), (override)); - MOCK_METHOD(uint32_t, Unregister, (IAuthService::INotification*), (override)); - MOCK_METHOD(uint32_t, Configure, (), (override)); - MOCK_METHOD(uint32_t, GetInfo, (GetInfoResult&), (override)); - MOCK_METHOD(uint32_t, GetDeviceInfo, (GetDeviceInfoResult&), (override)); - MOCK_METHOD(uint32_t, GetDeviceId, (GetDeviceIdResult&), (override)); - MOCK_METHOD(uint32_t, SetDeviceId, (const std::string&, SuccessMsgResult&), (override)); - MOCK_METHOD(uint32_t, SetPartnerId, (const std::string&, SetPartnerIdResult&), (override)); - MOCK_METHOD(uint32_t, GetAuthToken, (const bool, const bool, GetAuthTokenResult&), (override)); - MOCK_METHOD(uint32_t, GetSessionToken, (GetSessionTokenResult&), (override)); - MOCK_METHOD(uint32_t, SetSessionToken, (const int32_t&, const std::string&, uint32_t, const std::string&, const std::string&, SuccessMsgResult&), (override)); - MOCK_METHOD(uint32_t, GetServiceAccessToken, (GetServiceAccessTokenResult&), (override)); - MOCK_METHOD(uint32_t, SetServiceAccessToken, (const int32_t&, const std::string&, uint32_t, SuccessMsgResult&), (override)); - MOCK_METHOD(uint32_t, GetServiceAccountId, (GetServiceAccountIdResult&), (override)); - MOCK_METHOD(uint32_t, SetServiceAccountId, (const std::string&, SuccessMsgResult&), (override)); - MOCK_METHOD(uint32_t, SetAuthIdToken, (const std::string&, SuccessMsgResult&), (override)); - MOCK_METHOD(uint32_t, Ready, (const std::string&, SuccessMsgResult&), (override)); - MOCK_METHOD(uint32_t, GetBootstrapProperty, (const std::string&, GetBootstrapPropResult&), (override)); - MOCK_METHOD(uint32_t, ActivationStarted, (SuccessResult&), (override)); - MOCK_METHOD(uint32_t, ActivationComplete, (SuccessResult&), (override)); - MOCK_METHOD(uint32_t, GetLostAndFoundAccessToken, (std::string&, std::string&, bool&), (override)); - MOCK_METHOD(uint32_t, SetLostAndFoundAccessToken, (const std::string&, SuccessMsgResult&), (override)); - MOCK_METHOD(uint32_t, GetXDeviceId, (GetXDeviceIdResult&), (override)); - MOCK_METHOD(uint32_t, SetXDeviceId, (const std::string&, SuccessMsgResult&), (override)); - MOCK_METHOD(uint32_t, GetExperience, (GetExpResult&), (override)); - MOCK_METHOD(uint32_t, SetExperience, (const std::string&, SuccessMsgResult&), (override)); - MOCK_METHOD(uint32_t, GetXifaId, (GetxifaIdResult&), (override)); - MOCK_METHOD(uint32_t, SetXifaId, (const std::string&, SuccessMsgResult&), (override)); - MOCK_METHOD(uint32_t, GetAdvtOptOut, (AdvtOptOutResult&), (override)); - MOCK_METHOD(uint32_t, SetAdvtOptOut, (const bool&, SuccessMsgResult&), (override)); - MOCK_METHOD(WPEFramework::Core::hresult, SetContentAccessToken, (const std::string&, const uint32_t, bool&), (override)); - MOCK_METHOD(WPEFramework::Core::hresult, GetContentAccessToken, (std::string&, uint32_t&), (override)); -}; - -class MockIAuthenticate : public WPEFramework::PluginHost::IAuthenticate { -public: - MOCK_METHOD(void*, QueryInterfaceByCallsign, (const uint32_t, const string&)); - MOCK_METHOD(uint32_t, CreateToken, (uint16_t, const uint8_t*, std::string&)); - MOCK_METHOD(uint32_t, Release, (), (const, override)); - MOCK_METHOD(void*, QueryInterface, (uint32_t), (override)); - MOCK_METHOD(void, AddRef, (), (const, override)); - MOCK_METHOD(WPEFramework::PluginHost::ISecurity*, Officer, (const std::string& token), (override)); -}; -#endif From 918cad523ecd8cffecaf330ce3f6214c942ecf16 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Wed, 15 Apr 2026 15:13:19 +0000 Subject: [PATCH 19/72] More testing --- .github/copilot-instructions.md | 3 +- ci/cov_build.sh | 2 +- ci/mocks/control/comcastIrKeyCodes.h | 49 +++++++ ci/mocks/control/irMgr.h | 42 ++++++ ci/mocks/control/rdkversion.h | 33 +++++ ci/mocks/control/rdkx_logger.h | 204 +++++++++++++++++++++++++++ ci/mocks/control/xr_voice_sdk.h | 42 ++++++ ci/mocks/control/xraudio.h | 47 ++++++ 8 files changed, 420 insertions(+), 2 deletions(-) create mode 100644 ci/mocks/control/comcastIrKeyCodes.h create mode 100644 ci/mocks/control/irMgr.h create mode 100644 ci/mocks/control/rdkversion.h create mode 100644 ci/mocks/control/rdkx_logger.h create mode 100644 ci/mocks/control/xr_voice_sdk.h create mode 100644 ci/mocks/control/xraudio.h diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index b0634934..efeb1d9f 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -7,9 +7,10 @@ This is the **ctrlm-main** (Control Manager) plugin — a Thunder/WPEFramework p The `ci/` directory contains **native CI build support files only**. It is not part of the application. - `ci/build_dependencies.sh` / `ci/cov_build.sh` — scripts that build the plugin in a CI container without a full RDK target image +- `ci/mocks/control/` — control-specific stub headers (rdkx_logger, xraudio, xr_voice_sdk, irMgr, comcastIrKeyCodes, rdkversion) that are not available upstream - `ci/patches/` — temporary patches applied to Thunder/ThunderTools during CI builds only - `ci/headers/` — empty stub headers and real xr-voice-sdk headers generated/copied at CI build time; not committed to source -Mock/stub headers for platform libraries (IARM, DeviceSettings, RFC, Telemetry, etc.) are sourced from `entservices-testframework/Tests/mocks/` at CI build time, not stored in this repo. Real xr-voice-sdk headers are copied into `ci/headers/xr-voice-sdk/` and placed first on the include path to override those mocks. +Mock/stub headers for platform libraries (IARM, DeviceSettings, RFC, Telemetry, Thunder, etc.) are sourced from `entservices-testframework/Tests/mocks/` at CI build time. Control-specific mocks remain in `ci/mocks/control/`. Real xr-voice-sdk headers are copied into `ci/headers/xr-voice-sdk/` and placed first on the include path to override testframework mocks where the real API matches. When suggesting code or answering questions, treat CI mocks as scaffolding, not as authoritative API definitions. For real API shapes refer to the installed headers under `install/usr/include/` or the upstream repositories (Thunder, entservices-apis, xr-voice-sdk). diff --git a/ci/cov_build.sh b/ci/cov_build.sh index de5338de..6c015f75 100644 --- a/ci/cov_build.sh +++ b/ci/cov_build.sh @@ -28,7 +28,7 @@ ls -la ${GITHUB_WORKSPACE} echo "building control (ctrlm-main)" XRSDK_REAL_HEADERS="$GITHUB_WORKSPACE/ci/headers/xr-voice-sdk" -CTRL_STUBS="$GITHUB_WORKSPACE/entservices-testframework/Tests/mocks/control" +CTRL_STUBS="$GITHUB_WORKSPACE/ci/mocks/control" MOCK_DIR="$GITHUB_WORKSPACE/entservices-testframework/Tests/mocks" HEADERS_DIR="$GITHUB_WORKSPACE/ci/headers" EMPTY_JSON="$GITHUB_WORKSPACE/install/usr/include/ctrlm_config_empty.json" diff --git a/ci/mocks/control/comcastIrKeyCodes.h b/ci/mocks/control/comcastIrKeyCodes.h new file mode 100644 index 00000000..d0028cee --- /dev/null +++ b/ci/mocks/control/comcastIrKeyCodes.h @@ -0,0 +1,49 @@ +/* + * Stub for comcastIrKeyCodes.h + * + * Copyright 2026 RDK Management + * Licensed under the Apache License, Version 2.0 + */ +#ifndef _COMCAST_IR_KEY_CODES_H_ +#define _COMCAST_IR_KEY_CODES_H_ + +/* Key event types */ +#define KET_KEYDOWN 0x00000008 +#define KET_KEYUP 0x00000100 +#define KET_KEYREPEAT 0x00000200 + +/* Key codes */ +#define KED_POWER 0x00000001 +#define KED_TVPOWER 0x00000002 +#define KED_RF_POWER 0x00000003 +#define KED_DISCRETE_POWER_ON 0x00000004 +#define KED_DISCRETE_POWER_STANDBY 0x00000005 +#define KED_VOLUMEUP 0x00000010 +#define KED_VOLUMEDOWN 0x00000011 +#define KED_MUTE 0x00000012 +#define KED_INPUTKEY 0x00000013 +#define KED_SETUP 0x00000020 +#define KED_PUSH_TO_TALK 0x00000030 +#define KED_RF_PAIR_GHOST 0x00000040 +#define KED_SCREEN_BIND_NOTIFY 0x00000050 +#define KED_XR2V3 0x00000060 +#define KED_XR5V2 0x00000061 +#define KED_XR11V1 0x00000062 +#define KED_XR11V2 0x00000063 +#define KED_XR11_NOTIFY 0x00000064 +#define KED_XR15V1_NOTIFY 0x00000065 +#define KED_XR16V1_NOTIFY 0x00000066 +#define KED_UNDEFINEDKEY 0x000000FF + +/* XMP tags */ +#define XMP_TAG_COMCAST 0x0001 +#define XMP_TAG_PLATCO 0x0002 +#define XMP_TAG_XR11V2 0x0003 +#define XMP_TAG_XR15V1 0x0004 +#define XMP_TAG_XR15V2 0x0005 +#define XMP_TAG_XR16V1 0x0006 +#define XMP_TAG_XRAV1 0x0007 +#define XMP_TAG_XR20V1 0x0008 +#define XMP_TAG_UNDEFINED 0x00FF + +#endif /* _COMCAST_IR_KEY_CODES_H_ */ diff --git a/ci/mocks/control/irMgr.h b/ci/mocks/control/irMgr.h new file mode 100644 index 00000000..1d3cebb9 --- /dev/null +++ b/ci/mocks/control/irMgr.h @@ -0,0 +1,42 @@ +/* + * Stub for irMgr.h - IR Manager types + * + * Copyright 2026 RDK Management + * Licensed under the Apache License, Version 2.0 + */ +#ifndef _IR_MGR_H_ +#define _IR_MGR_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#define IARM_BUS_IRMGR_NAME "IRMgr" + +typedef enum { + IARM_BUS_IRMGR_EVENT_IRKEY = 0, + IARM_BUS_IRMGR_EVENT_CONTROL = 1, + IARM_BUS_IRMGR_EVENT_MAX = 2 +} IARM_Bus_IRMgr_EventId_t; + +#define IARM_BUS_IRMGR_KEYSRC_IR 0 +#define IARM_BUS_IRMGR_KEYSRC_FP 1 +#define IARM_BUS_IRMGR_KEYSRC_RF 2 + +typedef struct { + union { + struct { + int keyType; + int keyCode; + int keySrc; + int keyTag; + int keySourceId; + } irkey; + } data; +} IARM_Bus_IRMgr_EventData_t; + +#ifdef __cplusplus +} +#endif + +#endif /* _IR_MGR_H_ */ diff --git a/ci/mocks/control/rdkversion.h b/ci/mocks/control/rdkversion.h new file mode 100644 index 00000000..fd27f7e3 --- /dev/null +++ b/ci/mocks/control/rdkversion.h @@ -0,0 +1,33 @@ +/* + * Stub for rdkversion.h + * + * Copyright 2026 RDK Management + * Licensed under the Apache License, Version 2.0 + */ +#ifndef _RDKVERSION_H_ +#define _RDKVERSION_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct { + char *image_name; + char *stb_name; + char *branch_name; + char *version_name; + char *image_build_time; + bool production_build; + char *parse_error; +} rdk_version_info_t; + +int rdk_version_parse_version(rdk_version_info_t *info); +void rdk_version_object_free(rdk_version_info_t *info); + +#ifdef __cplusplus +} +#endif + +#endif /* _RDKVERSION_H_ */ diff --git a/ci/mocks/control/rdkx_logger.h b/ci/mocks/control/rdkx_logger.h new file mode 100644 index 00000000..4ea58c39 --- /dev/null +++ b/ci/mocks/control/rdkx_logger.h @@ -0,0 +1,204 @@ +/* + * If not stated otherwise in this file or this component's license file the + * following copyright and licenses apply: + * + * Copyright 2026 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 _RDKX_LOGGER_H_ +#define _RDKX_LOGGER_H_ + +#ifdef __cplusplus +#include +#include +#include +/* The real rdkx_logger.h pulls in std:: namespace indirectly; replicate only the needed names here */ +// ctrlm expects these to be in the global namespace, so we need to pull them in here +using std::get; +using std::map; +using std::string; +using std::tuple; +#endif + +/* Log option flags */ +#define XLOG_OPTS_DATE (1 << 0) +#define XLOG_OPTS_TIME (1 << 1) +#define XLOG_OPTS_LF (1 << 2) +#define XLOG_OPTS_MOD_NAME (1 << 3) +#define XLOG_OPTS_LEVEL (1 << 4) +#define XLOG_OPTS_COLOR (1 << 5) + +/* Module IDs */ +#define XLOG_MODULE_ID_CTRLM 0 +#define XLOG_MODULE_ID_VSDK 1 +#define XLOG_MODULE_ID_XRAUDIO 2 + +#ifndef XLOG_MODULE_ID +#define XLOG_MODULE_ID XLOG_MODULE_ID_CTRLM +#endif + +/* Stub types and functions used by xlog_fprintf */ +#ifndef XLOG_OPTS_DEFAULT +#define XLOG_OPTS_DEFAULT 0 +#endif + +#ifndef XLOG_COLOR_NONE +#define XLOG_COLOR_NONE 0 +#endif + +#ifndef XLOG_COLOR_BLU +#define XLOG_COLOR_BLU 0 +#endif + +#ifndef XLOG_COLOR_GRN +#define XLOG_COLOR_GRN 0 +#endif + +#ifndef XLOG_LINE_NONE +#define XLOG_LINE_NONE 0 +#endif + +typedef int xlog_level_t; + +#ifndef XLOG_LEVEL_DEBUG +#define XLOG_LEVEL_DEBUG 0 +#endif + +#ifndef XLOG_LEVEL_INFO +#define XLOG_LEVEL_INFO 1 +#endif + +#ifndef XLOG_LEVEL_WARN +#define XLOG_LEVEL_WARN 2 +#endif + +#ifndef XLOG_LEVEL_ERROR +#define XLOG_LEVEL_ERROR 3 +#endif + +#ifndef XLOG_LEVEL_FATAL +#define XLOG_LEVEL_FATAL 4 +#endif + +#ifndef XLOG_LEVEL_TELEMETRY +#define XLOG_LEVEL_TELEMETRY 5 +#endif + +#ifndef XLOG_BUF_SIZE_DEFAULT +#define XLOG_BUF_SIZE_DEFAULT 0 +#endif + +typedef struct { + int options; + int color; + const char *function; + int line; + int level; + int id; + int size_max; +} xlog_args_t; + +#ifndef xlog_fprintf +#define xlog_fprintf(args, output, fmt, ...) do { (void)(args); (void)(output); (void)sizeof(fmt); } while(0) +#endif + +#ifndef xlog_printf +#define xlog_printf(args, fmt, ...) do { (void)(args); (void)sizeof(fmt); } while(0) +#endif + +#ifndef xlog_init +#define xlog_init(id, path, options, console, syslog) (0) +#endif + +#ifndef xlog_level_set_all +#define xlog_level_set_all(level) do { (void)(level); } while(0) +#endif + +#ifndef xlog_level_get +#define xlog_level_get(id) (XLOG_LEVEL_INFO) +#endif + +#ifndef xlog_term +#define xlog_term() do { } while(0) +#endif + +/* Logging macros - silently discard in stub builds (avoids -Werror=format-zero-length) */ +#ifndef XLOGD +#define XLOGD(level, opts, color, size, fmt, ...) do { (void)(level); (void)(opts); (void)(color); (void)(size); (void)sizeof(fmt); } while(0) +#endif +#ifndef XLOGD_INFO +#define XLOGD_INFO(fmt, ...) do { (void)sizeof(fmt); } while(0) +#endif +#ifndef XLOGD_DEBUG +#define XLOGD_DEBUG(fmt, ...) do { (void)sizeof(fmt); } while(0) +#endif +#ifndef XLOGD_ERROR +#define XLOGD_ERROR(fmt, ...) do { (void)sizeof(fmt); } while(0) +#endif +#ifndef XLOGD_WARN +#define XLOGD_WARN(fmt, ...) do { (void)sizeof(fmt); } while(0) +#endif +#ifndef XLOGD_FATAL +#define XLOGD_FATAL(fmt, ...) do { (void)sizeof(fmt); } while(0) +#endif +#ifndef XLOGD_TELEMETRY +#define XLOGD_TELEMETRY(fmt, ...) do { (void)sizeof(fmt); } while(0) +#endif +#ifndef XLOGD_INFO_OPTS +#define XLOGD_INFO_OPTS(opts, fmt, ...) do { (void)(opts); (void)sizeof(fmt); } while(0) +#endif +#ifndef XLOGD_NO_LF +#define XLOGD_NO_LF(level, fmt, ...) do { (void)(level); (void)sizeof(fmt); } while(0) +#endif +/* XLOGD_OUTPUT is used as an output-handle VALUE (second arg to xlog_fprintf), not a logging macro */ +#ifndef XLOGD_OUTPUT +#define XLOGD_OUTPUT NULL +#endif + +#ifndef XLOGD_AUTOMATION_INFO +#define XLOGD_AUTOMATION_INFO(fmt, ...) do { (void)sizeof(fmt); } while(0) +#endif +#ifndef XLOGD_AUTOMATION_DEBUG +#define XLOGD_AUTOMATION_DEBUG(fmt, ...) do { (void)sizeof(fmt); } while(0) +#endif +#ifndef XLOGD_AUTOMATION_ERROR +#define XLOGD_AUTOMATION_ERROR(fmt, ...) do { (void)sizeof(fmt); } while(0) +#endif +#ifndef XLOGD_AUTOMATION_WARN +#define XLOGD_AUTOMATION_WARN(fmt, ...) do { (void)sizeof(fmt); } while(0) +#endif +#ifndef XLOGD_AUTOMATION_TELEMETRY +#define XLOGD_AUTOMATION_TELEMETRY(fmt, ...) do { (void)sizeof(fmt); } while(0) +#endif + +#ifndef XLOG_INFO +#define XLOG_INFO(fmt, ...) do { (void)sizeof(fmt); } while(0) +#endif +#ifndef XLOG_DEBUG +#define XLOG_DEBUG(fmt, ...) do { (void)sizeof(fmt); } while(0) +#endif +#ifndef XLOG_ERROR +#define XLOG_ERROR(fmt, ...) do { (void)sizeof(fmt); } while(0) +#endif +#ifndef XLOG_WARN +#define XLOG_WARN(fmt, ...) do { (void)sizeof(fmt); } while(0) +#endif +#ifndef XLOG_RAW +#define XLOG_RAW(fmt, ...) do { (void)sizeof(fmt); } while(0) +#endif +#ifndef XLOG_FLUSH +#define XLOG_FLUSH() do { } while(0) +#endif + +#endif /* _RDKX_LOGGER_H_ */ diff --git a/ci/mocks/control/xr_voice_sdk.h b/ci/mocks/control/xr_voice_sdk.h new file mode 100644 index 00000000..d150e4f5 --- /dev/null +++ b/ci/mocks/control/xr_voice_sdk.h @@ -0,0 +1,42 @@ +/* + * Stub for xr_voice_sdk.h + * + * Copyright 2026 RDK Management + * Licensed under the Apache License, Version 2.0 + */ +#ifndef _XR_VOICE_SDK_H_ +#define _XR_VOICE_SDK_H_ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* xr_voice_sdk API */ +int xr_voice_sdk_init(void); +int xr_voice_sdk_term(void); + +/* vsdk API used by ctrlm-main */ +#define VSDK_VERSION_QTY_MAX (16) + +typedef struct { + const char *name; + const char *version; + const char *branch; + const char *commit_id; +} vsdk_version_info_t; + +typedef void (*vsdk_thread_poll_response_t)(void *data); + +void vsdk_version(vsdk_version_info_t *info, uint32_t *qty); +bool vsdk_init(bool console, const char *filename, uint32_t file_size_max); +void vsdk_term(void); +void vsdk_thread_poll(vsdk_thread_poll_response_t response, void *data); + +#ifdef __cplusplus +} +#endif + +#endif /* _XR_VOICE_SDK_H_ */ diff --git a/ci/mocks/control/xraudio.h b/ci/mocks/control/xraudio.h new file mode 100644 index 00000000..0738c738 --- /dev/null +++ b/ci/mocks/control/xraudio.h @@ -0,0 +1,47 @@ +/* + * Stub for xraudio.h - Audio types + * + * Copyright 2026 RDK Management + * Licensed under the Apache License, Version 2.0 + */ +#ifndef _XRAUDIO_H_ +#define _XRAUDIO_H_ + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum { + XRAUDIO_ENCODING_PCM = 0, + XRAUDIO_ENCODING_ADPCM = 1, + XRAUDIO_ENCODING_OPUS = 2, + XRAUDIO_ENCODING_INVALID = 3 +} xraudio_encoding_t; + +typedef struct { + xraudio_encoding_t type; +} xraudio_encoding_info_t; + +typedef struct { + xraudio_encoding_info_t encoding; + uint16_t sample_rate; + uint8_t sample_size; + uint8_t channel_qty; +} xraudio_output_format_t; + +typedef enum { + XRAUDIO_RESULT_OK = 0, + XRAUDIO_RESULT_ERROR = 1 +} xraudio_result_t; + +int32_t xraudio_container_header_parse_wave(int audio_fd, const uint8_t *header, size_t size, xraudio_output_format_t *format, uint32_t *data_length); + +#ifdef __cplusplus +} +#endif + +#endif /* _XRAUDIO_H_ */ From d6d9ab20a78c33a7180e5f8d79bd64984b745d23 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Wed, 15 Apr 2026 15:27:13 +0000 Subject: [PATCH 20/72] CHanges --- ci/build_dependencies.sh | 6 ++++++ ci/cov_build.sh | 2 ++ ci/mocks/testframework_overrides.h | 29 +++++++++++++++++++++++++++++ 3 files changed, 37 insertions(+) create mode 100644 ci/mocks/testframework_overrides.h diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh index 46c1439d..09f1f0a1 100644 --- a/ci/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -68,6 +68,12 @@ git -C xr-voice-sdk checkout e55c99a0ec947b0ad3efc308bf8e3de0a42140d5 git clone https://github.com/rdkcentral/entservices-testframework.git git -C entservices-testframework checkout 584e3ec70fd5e044982910b4eb15c465808bb6d1 +# Patch testframework mocks with declarations ctrlm needs that are not yet upstream. +# device::Manager::IsInitialized (static bool member) +# We should remove as it is cleaner to just make changes to entservices-testframework directly +sed -i '/static void Initialize();/i\ inline static bool IsInitialized = false;' \ + entservices-testframework/Tests/mocks/devicesettings.h + ############################ # 3. Build Thunder-Tools echo "======================================================================================" diff --git a/ci/cov_build.sh b/ci/cov_build.sh index 6c015f75..12b0830a 100644 --- a/ci/cov_build.sh +++ b/ci/cov_build.sh @@ -30,6 +30,7 @@ echo "building control (ctrlm-main)" XRSDK_REAL_HEADERS="$GITHUB_WORKSPACE/ci/headers/xr-voice-sdk" CTRL_STUBS="$GITHUB_WORKSPACE/ci/mocks/control" MOCK_DIR="$GITHUB_WORKSPACE/entservices-testframework/Tests/mocks" +MOCK_OVERRIDES="$GITHUB_WORKSPACE/ci/mocks/testframework_overrides.h" HEADERS_DIR="$GITHUB_WORKSPACE/ci/headers" EMPTY_JSON="$GITHUB_WORKSPACE/install/usr/include/ctrlm_config_empty.json" @@ -88,6 +89,7 @@ cmake -G Ninja -S "$GITHUB_WORKSPACE" -B build/control \ -I /usr/lib/x86_64-linux-gnu/glib-2.0/include \ -I /usr/include/libdrm \ -include ${MOCK_DIR}/Iarm.h \ +-include ${MOCK_OVERRIDES} \ -include ${MOCK_DIR}/devicesettings.h \ -include ${MOCK_DIR}/Rfc.h \ -include ${MOCK_DIR}/Telemetry.h \ diff --git a/ci/mocks/testframework_overrides.h b/ci/mocks/testframework_overrides.h new file mode 100644 index 00000000..18e0ddee --- /dev/null +++ b/ci/mocks/testframework_overrides.h @@ -0,0 +1,29 @@ +/* + * If not stated otherwise in this file or this component's license file the + * following copyright and licenses apply: + * + * Copyright 2026 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. + */ +/* + * Supplements the entservices-testframework mocks with declarations ctrlm needs + * that are not (yet) in the upstream testframework develop branch. We can remove this file once the necessary declarations are merged upstream. + */ +#ifndef _CONTROL_TESTFRAMEWORK_OVERRIDES_H_ +#define _CONTROL_TESTFRAMEWORK_OVERRIDES_H_ + +/* ctrlm-main calls IARM_Bus_RegisterEvent as a plain function (defined in stubs_iarm.cpp) */ +extern IARM_Result_t IARM_Bus_RegisterEvent(IARM_EventId_t maxEventId); + +#endif /* _CONTROL_TESTFRAMEWORK_OVERRIDES_H_ */ From 361475c688d08a9feccc6039dd6ac27d09ed185f Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Wed, 15 Apr 2026 15:36:50 +0000 Subject: [PATCH 21/72] More updates --- ci/build_dependencies.sh | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh index 09f1f0a1..0f3ec7fa 100644 --- a/ci/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -69,10 +69,30 @@ git clone https://github.com/rdkcentral/entservices-testframework.git git -C entservices-testframework checkout 584e3ec70fd5e044982910b4eb15c465808bb6d1 # Patch testframework mocks with declarations ctrlm needs that are not yet upstream. -# device::Manager::IsInitialized (static bool member) # We should remove as it is cleaner to just make changes to entservices-testframework directly +# device::Manager::IsInitialized (static bool member) sed -i '/static void Initialize();/i\ inline static bool IsInitialized = false;' \ entservices-testframework/Tests/mocks/devicesettings.h +# dsAudioDucking enums (after dsAudioPortType_t) +sed -i '/^} dsAudioPortType_t;/a\ +typedef enum _dsAudioDuckingAction_t {\ + dsAUDIO_DUCKINGACTION_START = 0,\ + dsAUDIO_DUCKINGACTION_STOP = 1\ +} dsAudioDuckingAction_t;\ +\ +typedef enum _dsAudioDuckingType_t {\ + dsAUDIO_DUCKINGTYPE_ABSOLUTE = 0,\ + dsAUDIO_DUCKINGTYPE_RELATIVE = 1\ +} dsAudioDuckingType_t;' \ + entservices-testframework/Tests/mocks/devicesettings.h +# AudioOutputPort::setAudioDucking (after reInitializeAudioOutputPort) +sed -i '/void reInitializeAudioOutputPort();/a\ + void setAudioDucking(dsAudioDuckingAction_t action, dsAudioDuckingType_t type, float level) {\ + (void)action;\ + (void)type;\ + (void)level;\ + }' \ + entservices-testframework/Tests/mocks/devicesettings.h ############################ # 3. Build Thunder-Tools From 47767297bee960dcd97d7f7bf0afee8675ef3261 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Wed, 15 Apr 2026 11:45:43 -0400 Subject: [PATCH 22/72] Update ci/patches/Use_Legact_Alt_Based_On_ThunderTools_R4.4.3.patch Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- ci/patches/Use_Legact_Alt_Based_On_ThunderTools_R4.4.3.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/patches/Use_Legact_Alt_Based_On_ThunderTools_R4.4.3.patch b/ci/patches/Use_Legact_Alt_Based_On_ThunderTools_R4.4.3.patch index 3e1dea87..365006ba 100755 --- a/ci/patches/Use_Legact_Alt_Based_On_ThunderTools_R4.4.3.patch +++ b/ci/patches/Use_Legact_Alt_Based_On_ThunderTools_R4.4.3.patch @@ -1,7 +1,7 @@ commit 810aae64cb31c907698e468b615797750094b847 Author: Pesala Lakshmi Jwala Priya Date: Thu Aug 29 12:31:30 2024 +0530 -Source: Commit 810aae64cb31c907698e468b615797750094b847 by Pesala Lakshmi Jwala Priya , copied from entservices-testframework/patches/Use_Legact_Alt_Based_On_ThunderTools_R4.4.3.patch +Source: Commit 810aae64cb31c907698e468b615797750094b847 by Pesala Lakshmi Jwala Priya , copied from entservices-testframework/patches/Use_Legacy_Alt_Based_On_ThunderTools_R4.4.3.patch Alt change From 3ab8ebbcf270dae85d94be17032ca66611876396 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Wed, 15 Apr 2026 16:24:41 +0000 Subject: [PATCH 23/72] Fixing typo in patch sourse --- ci/patches/Use_Legact_Alt_Based_On_ThunderTools_R4.4.3.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/patches/Use_Legact_Alt_Based_On_ThunderTools_R4.4.3.patch b/ci/patches/Use_Legact_Alt_Based_On_ThunderTools_R4.4.3.patch index 365006ba..3e1dea87 100755 --- a/ci/patches/Use_Legact_Alt_Based_On_ThunderTools_R4.4.3.patch +++ b/ci/patches/Use_Legact_Alt_Based_On_ThunderTools_R4.4.3.patch @@ -1,7 +1,7 @@ commit 810aae64cb31c907698e468b615797750094b847 Author: Pesala Lakshmi Jwala Priya Date: Thu Aug 29 12:31:30 2024 +0530 -Source: Commit 810aae64cb31c907698e468b615797750094b847 by Pesala Lakshmi Jwala Priya , copied from entservices-testframework/patches/Use_Legacy_Alt_Based_On_ThunderTools_R4.4.3.patch +Source: Commit 810aae64cb31c907698e468b615797750094b847 by Pesala Lakshmi Jwala Priya , copied from entservices-testframework/patches/Use_Legact_Alt_Based_On_ThunderTools_R4.4.3.patch Alt change From 17d174d5069f2832c7594826b1296bcecc084a2b Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Wed, 15 Apr 2026 16:30:18 +0000 Subject: [PATCH 24/72] Using patches from test framework instead of local copies --- .github/copilot-instructions.md | 4 +- ci/build_dependencies.sh | 10 +- ...010-R4.4-Add-support-for-project-dir.patch | 118 ------------------ .../1004-Add-support-for-project-dir.patch | 44 ------- ci/patches/RDKEMW-733-Add-ENTOS-IDS.patch | 22 ---- ...act_Alt_Based_On_ThunderTools_R4.4.3.patch | 21 ---- ci/patches/error_code_R4_4.patch | 66 ---------- 7 files changed, 7 insertions(+), 278 deletions(-) delete mode 100755 ci/patches/00010-R4.4-Add-support-for-project-dir.patch delete mode 100755 ci/patches/1004-Add-support-for-project-dir.patch delete mode 100755 ci/patches/RDKEMW-733-Add-ENTOS-IDS.patch delete mode 100755 ci/patches/Use_Legact_Alt_Based_On_ThunderTools_R4.4.3.patch delete mode 100644 ci/patches/error_code_R4_4.patch diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index efeb1d9f..12ddabcd 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -8,9 +8,9 @@ The `ci/` directory contains **native CI build support files only**. It is not p - `ci/build_dependencies.sh` / `ci/cov_build.sh` — scripts that build the plugin in a CI container without a full RDK target image - `ci/mocks/control/` — control-specific stub headers (rdkx_logger, xraudio, xr_voice_sdk, irMgr, comcastIrKeyCodes, rdkversion) that are not available upstream -- `ci/patches/` — temporary patches applied to Thunder/ThunderTools during CI builds only +- `ci/mocks/testframework_overrides.h` — supplements testframework mocks with declarations ctrlm needs that are not yet upstream - `ci/headers/` — empty stub headers and real xr-voice-sdk headers generated/copied at CI build time; not committed to source -Mock/stub headers for platform libraries (IARM, DeviceSettings, RFC, Telemetry, Thunder, etc.) are sourced from `entservices-testframework/Tests/mocks/` at CI build time. Control-specific mocks remain in `ci/mocks/control/`. Real xr-voice-sdk headers are copied into `ci/headers/xr-voice-sdk/` and placed first on the include path to override testframework mocks where the real API matches. +Mock/stub headers for platform libraries (IARM, DeviceSettings, RFC, Telemetry, Thunder, etc.) and Thunder/ThunderTools patches are sourced from `entservices-testframework/` at CI build time. Control-specific mocks remain in `ci/mocks/control/`. Real xr-voice-sdk headers are copied into `ci/headers/xr-voice-sdk/` and placed first on the include path to override testframework mocks where the real API matches. When suggesting code or answering questions, treat CI mocks as scaffolding, not as authoritative API definitions. For real API shapes refer to the installed headers under `install/usr/include/` or the upstream repositories (Thunder, entservices-apis, xr-voice-sdk). diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh index 0f3ec7fa..46d2d6bd 100644 --- a/ci/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -99,7 +99,7 @@ sed -i '/void reInitializeAudioOutputPort();/a\ echo "======================================================================================" echo "building thunderTools" cd ThunderTools -patch -p1 < $GITHUB_WORKSPACE/ci/patches/00010-R4.4-Add-support-for-project-dir.patch +patch -p1 < $GITHUB_WORKSPACE/entservices-testframework/patches/00010-R4.4-Add-support-for-project-dir.patch cd - cmake -G Ninja -S ThunderTools -B build/ThunderTools \ @@ -116,10 +116,10 @@ echo "========================================================================== echo "building thunder" cd Thunder -patch -p1 < $GITHUB_WORKSPACE/ci/patches/Use_Legact_Alt_Based_On_ThunderTools_R4.4.3.patch -patch -p1 < $GITHUB_WORKSPACE/ci/patches/error_code_R4_4.patch -patch -p1 < $GITHUB_WORKSPACE/ci/patches/1004-Add-support-for-project-dir.patch -patch -p1 < $GITHUB_WORKSPACE/ci/patches/RDKEMW-733-Add-ENTOS-IDS.patch +patch -p1 < $GITHUB_WORKSPACE/entservices-testframework/patches/Use_Legact_Alt_Based_On_ThunderTools_R4.4.3.patch +patch -p1 < $GITHUB_WORKSPACE/entservices-testframework/patches/error_code_R4_4.patch +patch -p1 < $GITHUB_WORKSPACE/entservices-testframework/patches/1004-Add-support-for-project-dir.patch +patch -p1 < $GITHUB_WORKSPACE/entservices-testframework/patches/RDKEMW-733-Add-ENTOS-IDS.patch cd - cmake -G Ninja -S Thunder -B build/Thunder \ diff --git a/ci/patches/00010-R4.4-Add-support-for-project-dir.patch b/ci/patches/00010-R4.4-Add-support-for-project-dir.patch deleted file mode 100755 index 60c0129a..00000000 --- a/ci/patches/00010-R4.4-Add-support-for-project-dir.patch +++ /dev/null @@ -1,118 +0,0 @@ -Source: Copied from entservices-testframework/patches/00010-R4.4-Add-support-for-project-dir.patch - -diff --git a/JsonGenerator/source/class_emitter.py b/JsonGenerator/source/class_emitter.py -index 7f2fb01..67a6469 100644 ---- a/JsonGenerator/source/class_emitter.py -+++ b/JsonGenerator/source/class_emitter.py -@@ -113,7 +113,6 @@ - emit.Line("#include ") - emit.Line() - -- emit.Line("#include \"definitions.h\"") - - if not config.NO_INCLUDES: - if if_file.endswith(".h"): -diff --git a/ProxyStubGenerator/StubGenerator.py b/ProxyStubGenerator/StubGenerator.py -index 6e079b6..d2de681 100755 ---- a/ProxyStubGenerator/StubGenerator.py -+++ b/ProxyStubGenerator/StubGenerator.py -@@ -193,7 +193,7 @@ - - - # Generate interface information in lua --def GenerateLuaData(emit, interfaces_list, enums_list, source_file=None, tree=None, ns=None): -+def GenerateLuaData(emit, interfaces_list, enums_list, project_dir, source_file=None, tree=None, ns=None): - - if not source_file: - assert(tree==None) -@@ -535,7 +535,7 @@ - - return tree - --def GenerateStubs2(output_file, source_file, tree, ns, scan_only=False): -+def GenerateStubs2(output_file, source_file, project_dir, tree, ns, scan_only=False): - log.Info("Scanning '%s' (in %s)..." % (source_file, ns)) - - if not FORCE and (os.path.exists(output_file) and (os.path.getmtime(source_file) < os.path.getmtime(output_file))): -@@ -579,7 +579,7 @@ - emit.Line - emit.Line() - -- if os.path.isfile(os.path.join(os.path.dirname(source_file), "Module.h")): -+ if os.path.isfile(os.path.join(project_dir, "Module.h")): - emit.Line('#include "Module.h"') - - if os.path.isfile(os.path.join(os.path.dirname(source_file), interface_header_name)): -@@ -2085,6 +2085,8 @@ - help="include an additional C++ header file, may be used multiple times (default: include 'Ids.h')") - argparser.add_argument('-I', dest="includePaths", metavar="INCLUDE_DIR", action='append', default=[], type=str, - help='add an include search path, can be used multiple times') -+ argparser.add_argument("--projectdir",dest="project_dir",metavar="DIR",type=str,default="", -+ help="specify the project directory") - - args = argparser.parse_args(sys.argv[1:]) - SHOW_WARNINGS = not args.no_warnings -@@ -2221,7 +2223,10 @@ - - for source_file in interface_files: - try: -- _extra_includes = [ os.path.join("@" + os.path.dirname(source_file), IDS_DEFINITIONS_FILE) ] -+ if args.project_dir is not None: -+ _extra_includes = [ os.path.join("@" + args.project_dir, IDS_DEFINITIONS_FILE) ] -+ else: -+ _extra_includes = [ os.path.join("@" + os.path.dirname(source_file), IDS_DEFINITIONS_FILE) ] - _extra_includes.extend(args.extra_includes) - - tree = Parse(source_file, args.includePaths, -@@ -2242,7 +2247,7 @@ - some_omitted = False - - for ns in INTERFACE_NAMESPACES: -- output, some_omitted = GenerateStubs2(output_file, source_file, tree, ns, scan_only) -+ output, some_omitted = GenerateStubs2(output_file, source_file, args.project_dir, tree, ns, scan_only) - - new_faces += output - -@@ -2265,7 +2270,7 @@ - log.Print("(lua generator) Scanning %s..." % os.path.basename(source_file)) - - for ns in INTERFACE_NAMESPACES: -- GenerateLuaData(Emitter(lua_file, INDENT_SIZE), lua_interfaces, lua_enums, source_file, tree, ns) -+ GenerateLuaData(Emitter(lua_file, INDENT_SIZE), lua_interfaces, lua_enums, args.project_dir, source_file, tree, ns) - - except NotModifiedException as err: - log.Print("skipped file %s, up-to-date" % os.path.basename(output_file)) -@@ -2316,7 +2321,7 @@ - if args.lua_code: - # Epilogue - for ns in INTERFACE_NAMESPACES: -- GenerateLuaData(Emitter(lua_file, INDENT_SIZE), lua_interfaces, lua_enums) -+ GenerateLuaData(Emitter(lua_file, INDENT_SIZE), lua_interfaces, lua_enums,args.project_dir) - log.Print("Created %s (%s interfaces, %s enums)" % (lua_file.name, len(lua_interfaces), len(lua_enums))) - - else: - -diff --git a/cmake/FindProxyStubGenerator.cmake.in b/cmake/FindProxyStubGenerator.cmake.in -index 1344452..a8dbcea 100644 ---- a/cmake/FindProxyStubGenerator.cmake.in -+++ b/cmake/FindProxyStubGenerator.cmake.in. -@@ -31,7 +31,7 @@ function(ProxyStubGenerator) - endif() - - set(optionsArgs SECURE COHERENT TRACES VERBOSE NO_WARNINGS KEEP FORCE_GENERATE) -- set(oneValueArgs OUTDIR) -+ set(oneValueArgs OUTDIR PROJECT_DIR) - set(multiValueArgs INPUT INCLUDE INCLUDE_PATH NAMESPACE) - - cmake_parse_arguments(Argument "${optionsArgs}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} ) -@@ -81,6 +81,10 @@ function(ProxyStubGenerator) - list(APPEND _execute_command "--outdir" "${Argument_OUTDIR}") - endif() - -+ if(Argument_PROJECT_DIR) -+ list(APPEND _execute_command "--projectdir" "${Argument_PROJECT_DIR}") -+ endif() -+ - foreach(_include ${Argument_INCLUDE}) - list(APPEND _execute_command "-I" "${_include}") - endforeach(_include) diff --git a/ci/patches/1004-Add-support-for-project-dir.patch b/ci/patches/1004-Add-support-for-project-dir.patch deleted file mode 100755 index e612bd8a..00000000 --- a/ci/patches/1004-Add-support-for-project-dir.patch +++ /dev/null @@ -1,44 +0,0 @@ -Source: Copied from entservices-testframework/patches/1004-Add-support-for-project-dir.patch - -diff --git a/Source/plugins/CMakeLists.txt b/Source/plugins/CMakeLists.txt -index 4d362d545..9357c647c 100644 ---- a/Source/plugins/CMakeLists.txt -+++ b/Source/plugins/CMakeLists.txt -@@ -20,14 +20,14 @@ - string(TOLOWER ${NAMESPACE} NAMESPACE_LIB) - - option(VIRTUALINPUT_TOOLS "Build VirtualInput tools" OFF) -- --ProxyStubGenerator(NAMESPACE "WPEFramework::PluginHost" INPUT "${CMAKE_CURRENT_SOURCE_DIR}/IPlugin.h" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated") --ProxyStubGenerator(NAMESPACE "WPEFramework::PluginHost" INPUT "${CMAKE_CURRENT_SOURCE_DIR}/IShell.h" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated") --ProxyStubGenerator(NAMESPACE "WPEFramework::Exchange" INPUT "${CMAKE_CURRENT_SOURCE_DIR}/IController.h" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated" INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/..") --ProxyStubGenerator(NAMESPACE "WPEFramework::PluginHost" INPUT "${CMAKE_CURRENT_SOURCE_DIR}/IControllerDeprecated.h" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated" INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/..") --ProxyStubGenerator(NAMESPACE "WPEFramework::PluginHost" INPUT "${CMAKE_CURRENT_SOURCE_DIR}/IStateControl.h" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated") --ProxyStubGenerator(NAMESPACE "WPEFramework::PluginHost" INPUT "${CMAKE_CURRENT_SOURCE_DIR}/ISubSystem.h" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated") --ProxyStubGenerator(NAMESPACE "WPEFramework::PluginHost" INPUT "${CMAKE_CURRENT_SOURCE_DIR}/IDispatcher.h" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated") -+set(PROJECT_DIR "${CMAKE_CURRENT_SOURCE_DIR}") -+ProxyStubGenerator(NAMESPACE "WPEFramework::PluginHost" INPUT "${CMAKE_CURRENT_SOURCE_DIR}/IPlugin.h" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated" PROJECT_DIR ${PROJECT_DIR}) -+ProxyStubGenerator(NAMESPACE "WPEFramework::PluginHost" INPUT "${CMAKE_CURRENT_SOURCE_DIR}/IShell.h" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated" PROJECT_DIR ${PROJECT_DIR}) -+ProxyStubGenerator(NAMESPACE "WPEFramework::Exchange" INPUT "${CMAKE_CURRENT_SOURCE_DIR}/IController.h" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated" INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/.." PROJECT_DIR ${PROJECT_DIR}) -+ProxyStubGenerator(NAMESPACE "WPEFramework::PluginHost" INPUT "${CMAKE_CURRENT_SOURCE_DIR}/IControllerDeprecated.h" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated" INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/.." PROJECT_DIR ${PROJECT_DIR}) -+ProxyStubGenerator(NAMESPACE "WPEFramework::PluginHost" INPUT "${CMAKE_CURRENT_SOURCE_DIR}/IStateControl.h" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated" PROJECT_DIR ${PROJECT_DIR}) -+ProxyStubGenerator(NAMESPACE "WPEFramework::PluginHost" INPUT "${CMAKE_CURRENT_SOURCE_DIR}/ISubSystem.h" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated" PROJECT_DIR ${PROJECT_DIR}) -+ProxyStubGenerator(NAMESPACE "WPEFramework::PluginHost" INPUT "${CMAKE_CURRENT_SOURCE_DIR}/IDispatcher.h" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated" PROJECT_DIR ${PROJECT_DIR}) - - JsonGenerator(CODE NAMESPACE WPEFramework::Exchange::Controller INPUT ${CMAKE_CURRENT_SOURCE_DIR}/IController.h OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/generated/jsonrpc" INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/.." NO_INCLUDES LEGACY_ALT) - -diff --git a/Source/com/CMakeLists.txt b/Source/com/CMakeLists.txt -index 1de9ac176..bcf9489d1 100644 ---- a/Source/com/CMakeLists.txt -+++ b/Source/com/CMakeLists.txt -@@ -16,8 +16,8 @@ - # limitations under the License. - - set(TARGET ${NAMESPACE}COM) -- --ProxyStubGenerator(NAMESPACE "WPEFramework::RPC" INPUT "${CMAKE_CURRENT_SOURCE_DIR}/ICOM.h" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated") -+set(PROJECT_DIR "${CMAKE_CURRENT_SOURCE_DIR}") -+ProxyStubGenerator(NAMESPACE "WPEFramework::RPC" INPUT "${CMAKE_CURRENT_SOURCE_DIR}/ICOM.h" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated" PROJECT_DIR ${PROJECT_DIR}) - - add_library(${TARGET} SHARED - Administrator.cpp diff --git a/ci/patches/RDKEMW-733-Add-ENTOS-IDS.patch b/ci/patches/RDKEMW-733-Add-ENTOS-IDS.patch deleted file mode 100755 index 3f9f9eb7..00000000 --- a/ci/patches/RDKEMW-733-Add-ENTOS-IDS.patch +++ /dev/null @@ -1,22 +0,0 @@ -From: Sitaram, Soundaryaa -Date: 05 Feb 2025 17:24:43 +0000 -Subject: [PATCH] ENTOS IDs offset to be adjusted in rdkservices-apis -Source: Author email patch from Soundaryaa_Sitaram@comcast.com, copied from entservices-testframework/patches/RDKEMW-733-Add-ENTOS-IDS.patch - -Upstream-Status: None -Signed-off-by: ssitar583 ---- -diff --git a/Source/com/Ids.h b/Source/com/Ids.h -index cf2060333..75d235bbd 100644 ---- a/Source/com/Ids.h -+++ b/Source/com/Ids.h -@@ -74,7 +74,8 @@ namespace RPC { - ID_COMREQUEST_NOTIFICATION = (ID_OFFSET_INTERNAL + 0x003D), - ID_SYSTEM_METADATA = (ID_OFFSET_INTERNAL + 0x003E), - -- ID_EXTERNAL_INTERFACE_OFFSET = (ID_OFFSET_INTERNAL + 0x0040) -+ ID_EXTERNAL_INTERFACE_OFFSET = (ID_OFFSET_INTERNAL + 0x0040), -+ ID_EXTERNAL_CC_INTERFACE_OFFSET = (0xCC00) // ends on 0xDFFF - }; - } - } diff --git a/ci/patches/Use_Legact_Alt_Based_On_ThunderTools_R4.4.3.patch b/ci/patches/Use_Legact_Alt_Based_On_ThunderTools_R4.4.3.patch deleted file mode 100755 index 3e1dea87..00000000 --- a/ci/patches/Use_Legact_Alt_Based_On_ThunderTools_R4.4.3.patch +++ /dev/null @@ -1,21 +0,0 @@ -commit 810aae64cb31c907698e468b615797750094b847 -Author: Pesala Lakshmi Jwala Priya -Date: Thu Aug 29 12:31:30 2024 +0530 -Source: Commit 810aae64cb31c907698e468b615797750094b847 by Pesala Lakshmi Jwala Priya , copied from entservices-testframework/patches/Use_Legact_Alt_Based_On_ThunderTools_R4.4.3.patch - - Alt change - -diff --git a/Source/plugins/CMakeLists.txt b/Source/plugins/CMakeLists.txt -index 4d362d54..cdb53cdc 100644 ---- a/Source/plugins/CMakeLists.txt -+++ b/Source/plugins/CMakeLists.txt -@@ -29,7 +29,7 @@ ProxyStubGenerator(NAMESPACE "WPEFramework::PluginHost" INPUT "${CMAKE_CURRENT_S - ProxyStubGenerator(NAMESPACE "WPEFramework::PluginHost" INPUT "${CMAKE_CURRENT_SOURCE_DIR}/ISubSystem.h" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated") - ProxyStubGenerator(NAMESPACE "WPEFramework::PluginHost" INPUT "${CMAKE_CURRENT_SOURCE_DIR}/IDispatcher.h" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated") - --JsonGenerator(CODE NAMESPACE WPEFramework::Exchange::Controller INPUT ${CMAKE_CURRENT_SOURCE_DIR}/IController.h OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/generated/jsonrpc" INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/.." NO_INCLUDES) -+JsonGenerator(CODE NAMESPACE WPEFramework::Exchange::Controller INPUT ${CMAKE_CURRENT_SOURCE_DIR}/IController.h OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/generated/jsonrpc" INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/.." NO_INCLUDES LEGACY_ALT) - - add_library(${TARGET} SHARED - Channel.cpp - diff --git a/ci/patches/error_code_R4_4.patch b/ci/patches/error_code_R4_4.patch deleted file mode 100644 index 47e9cd92..00000000 --- a/ci/patches/error_code_R4_4.patch +++ /dev/null @@ -1,66 +0,0 @@ -Source: Copied from entservices-testframework/patches/error_code_R4_4.patch - -diff --git a/Source/WPEFramework/PluginServer.h b/Source/WPEFramework/PluginServer.h -index e87933d9a..591385222 100644 ---- a/Source/WPEFramework/PluginServer.h -+++ b/Source/WPEFramework/PluginServer.h -@@ -1535,6 +1535,22 @@ namespace PluginHost { - response->Error.SetError(Core::ERROR_ILLEGAL_STATE); - response->Error.Text = _T("The service is in an illegal state!!!."); - break; -+ case Core::ERROR_INVALID_PARAMETER: -+ response->Error.SetError(Core::ERROR_INVALID_SIGNATURE); -+ response->Error.Text = _T("Invalid Parameter"); -+ break; -+ case Core::ERROR_INVALID_DEVICENAME: -+ response->Error.SetError(Core::ERROR_INVALID_DEVICENAME); -+ response->Error.Text = _T("Invalid device name"); -+ break; -+ case Core::ERROR_INVALID_MOUNTPOINT: -+ response->Error.SetError(Core::ERROR_INVALID_MOUNTPOINT); -+ response->Error.Text = _T("Invalid mount path"); -+ break; -+ case Core::ERROR_FIRMWAREUPDATE_INPROGRESS: -+ response->Error.SetError(Core::ERROR_FIRMWAREUPDATE_INPROGRESS); -+ response->Error.Text = _T("Firmware update already in progress"); -+ break; - case static_cast(~0): - response.Release(); - break; -diff --git a/Source/core/JSONRPC.h b/Source/core/JSONRPC.h -index a9c4360fb..5fcef161d 100644 ---- a/Source/core/JSONRPC.h -+++ b/Source/core/JSONRPC.h -@@ -98,6 +98,15 @@ namespace Core { - case Core::ERROR_TIMEDOUT: - Code = -32000; // Server defined, now mapped to Timed out - break; -+ case Core::ERROR_INVALID_DEVICENAME: -+ Code = -32001; // Invalid device name -+ break; -+ case Core::ERROR_INVALID_MOUNTPOINT: -+ Code = -32002; // Invalid mount path -+ break; -+ case Core::ERROR_FIRMWAREUPDATE_INPROGRESS: -+ Code = -32003; // Firmware update inprogress -+ break; - default: - Code = static_cast(frameworkError); - break; -diff --git a/Source/core/Portability.h b/Source/core/Portability.h -index 01e34d398..a5728eebf 100644 ---- a/Source/core/Portability.h -+++ b/Source/core/Portability.h -@@ -874,7 +874,11 @@ namespace Core { - ERROR_CODE(ERROR_HIBERNATED, 46) \ - ERROR_CODE(ERROR_INPROC, 47) \ - ERROR_CODE(ERROR_FAILED_REGISTERED, 48) \ -- ERROR_CODE(ERROR_FAILED_UNREGISTERED, 49) -+ ERROR_CODE(ERROR_FAILED_UNREGISTERED, 49) \ -+ ERROR_CODE(ERROR_INVALID_PARAMETER, 54) \ -+ ERROR_CODE(ERROR_INVALID_DEVICENAME, 59) \ -+ ERROR_CODE(ERROR_INVALID_MOUNTPOINT, 60) \ -+ ERROR_CODE(ERROR_FIRMWAREUPDATE_INPROGRESS,61) - - #define ERROR_CODE(CODE, VALUE) CODE = VALUE, - From 90ad5f1633aa2156fd7dbcb93f0d2f85f2f5a147 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Thu, 16 Apr 2026 16:58:12 +0000 Subject: [PATCH 25/72] Test --- ci/build_dependencies.sh | 139 ++------------------------------------- 1 file changed, 7 insertions(+), 132 deletions(-) diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh index 46d2d6bd..7cc09c17 100644 --- a/ci/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -49,6 +49,7 @@ apt install -y \ meson \ valgrind \ lcov \ + libsafec-dev \ clang pip install jsonref @@ -242,144 +243,18 @@ touch secure_wrapper.h touch edid-parser.hpp touch dsFPD.h -# safec - needs actual dummy API content +# safec compatibility header - maps ctrlm's include name to the real libsafec headers. cat > safec_lib.h << 'SAFEC_EOF' #ifndef _SAFEC_LIB_H_ #define _SAFEC_LIB_H_ -#include -#include -#include -#ifdef SAFEC_DUMMY_API -typedef int errno_t; -#define EOK 0 - -static inline errno_t strcpy_s(char *dest, size_t dmax, const char *src) { - (void)dmax; - if(dest == NULL || src == NULL) { - return -1; - } - strcpy(dest, src); - return EOK; -} - -static inline errno_t strncpy_s(char *dest, size_t dmax, const char *src, size_t count) { - (void)dmax; - if(dest == NULL || src == NULL) { - return -1; - } - strncpy(dest, src, count); - return EOK; -} - -static inline errno_t strcat_s(char *dest, size_t dmax, const char *src) { - (void)dmax; - if(dest == NULL || src == NULL) { - return -1; - } - strcat(dest, src); - return EOK; -} - -static inline errno_t strncat_s(char *dest, size_t dmax, const char *src, size_t count) { - (void)dmax; - if(dest == NULL || src == NULL) { - return -1; - } - strncat(dest, src, count); - return EOK; -} - -static inline errno_t sprintf_s(char *dest, size_t dmax, const char *format, ...) { - va_list args; - int ret; - if(dest == NULL || format == NULL) { - return -1; - } - va_start(args, format); - ret = vsnprintf(dest, dmax, format, args); - va_end(args); - return (ret < 0) ? -1 : EOK; -} - -static inline errno_t snprintf_s(char *dest, size_t dmax, size_t count, const char *format, ...) { - va_list args; - int ret; - size_t max_len = count < dmax ? count : dmax; - if(dest == NULL || format == NULL) { - return -1; - } - va_start(args, format); - ret = vsnprintf(dest, max_len, format, args); - va_end(args); - return (ret < 0) ? -1 : EOK; -} - -static inline errno_t strcmp_s(const char *dest, size_t dmax, const char *src, int *indicator) { - (void)dmax; - if(dest == NULL || src == NULL || indicator == NULL) { - return -1; - } - *indicator = strcmp(dest, src); - return EOK; -} - -static inline errno_t strncmp_s(const char *dest, size_t dmax, const char *src, size_t count, int *indicator) { - (void)dmax; - if(dest == NULL || src == NULL || indicator == NULL) { - return -1; - } - *indicator = strncmp(dest, src, count); - return EOK; -} - -static inline char *strtok_s(char *str, size_t *strmax, const char *delim, char **context) { - char *token; - (void)strmax; - if(delim == NULL || context == NULL) { - return NULL; - } - token = strtok_r(str, delim, context); - return token; -} - -static inline errno_t memcpy_s(void *dest, size_t dmax, const void *src, size_t count) { - (void)dmax; - if(dest == NULL || src == NULL) { - return -1; - } - memcpy(dest, src, count); - return EOK; -} - -static inline errno_t memset_s(void *dest, size_t dmax, int value, size_t count) { - (void)dmax; - if(dest == NULL) { - return -1; - } - memset(dest, value, count); - return EOK; -} - -static inline errno_t memmove_s(void *dest, size_t dmax, const void *src, size_t count) { - (void)dmax; - if(dest == NULL || src == NULL) { - return -1; - } - memmove(dest, src, count); - return EOK; -} - -static inline errno_t memcmp_s(const void *dest, size_t dmax, const void *src, size_t count, int *indicator) { - (void)dmax; - if(dest == NULL || src == NULL || indicator == NULL) { - return -1; - } - *indicator = memcmp(dest, src, count); - return EOK; -} +#include +#include +#include +#ifndef ERR_CHK #define ERR_CHK(rc) do { (void)(rc); } while(0) #endif + #endif SAFEC_EOF From c83469017040085529fe2317d64461b1202b7d3e Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Thu, 16 Apr 2026 17:25:41 +0000 Subject: [PATCH 26/72] Updates --- ci/build_dependencies.sh | 17 +++-------------- ci/mocks/safec_lib.h | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 14 deletions(-) create mode 100644 ci/mocks/safec_lib.h diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh index 7cc09c17..62f5d713 100644 --- a/ci/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -243,20 +243,9 @@ touch secure_wrapper.h touch edid-parser.hpp touch dsFPD.h -# safec compatibility header - maps ctrlm's include name to the real libsafec headers. -cat > safec_lib.h << 'SAFEC_EOF' -#ifndef _SAFEC_LIB_H_ -#define _SAFEC_LIB_H_ -#include -#include -#include - -#ifndef ERR_CHK -#define ERR_CHK(rc) do { (void)(rc); } while(0) -#endif - -#endif -SAFEC_EOF +# safec compatibility header - committed in ci/mocks, copied here so it is +# resolved on the generated-headers include path. +cp "$GITHUB_WORKSPACE/ci/mocks/safec_lib.h" safec_lib.h echo "Stub headers created successfully" diff --git a/ci/mocks/safec_lib.h b/ci/mocks/safec_lib.h new file mode 100644 index 00000000..08edb533 --- /dev/null +++ b/ci/mocks/safec_lib.h @@ -0,0 +1,40 @@ +/* + * If not stated otherwise in this file or this component's license file the + * following copyright and licenses apply: + * + * Copyright 2026 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. + */ + +/* + * Compatibility header: maps ctrlm's local include name to the real libsafec + * package headers (libsafec-dev / safec-common-wrapper in production). + * + * In CI this file is copied from ci/mocks/ into ci/headers/ by + * build_dependencies.sh so it is resolved on the generated-headers include + * path used by cov_build.sh. + */ + +#ifndef _SAFEC_LIB_H_ +#define _SAFEC_LIB_H_ + +#include +#include +#include + +#ifndef ERR_CHK +#define ERR_CHK(rc) do { (void)(rc); } while(0) +#endif + +#endif /* _SAFEC_LIB_H_ */ From 0c6c05fabea8237d912ce708ff2a3b5e2dbf79f6 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Fri, 17 Apr 2026 20:25:13 +0000 Subject: [PATCH 27/72] Reduce mock attempt --- ci/build_dependencies.sh | 91 +--------------------------- ci/cov_build.sh | 21 ++----- ci/mocks/control/comcastIrKeyCodes.h | 49 --------------- ci/mocks/control/irMgr.h | 42 ------------- ci/mocks/control/xraudio.h | 47 -------------- 5 files changed, 7 insertions(+), 243 deletions(-) delete mode 100644 ci/mocks/control/comcastIrKeyCodes.h delete mode 100644 ci/mocks/control/irMgr.h delete mode 100644 ci/mocks/control/xraudio.h diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh index 62f5d713..96d733d5 100644 --- a/ci/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -56,12 +56,6 @@ pip install jsonref ########################################### # 2. Clone the required repositories -git clone --depth 1 --branch R4.4.3 https://github.com/rdkcentral/ThunderTools.git - -git clone --depth 1 --branch R4.4.1 https://github.com/rdkcentral/Thunder.git - -git clone --depth 1 --branch develop https://github.com/rdkcentral/entservices-apis.git - # 1.0.13 git clone https://github.com/rdkcentral/xr-voice-sdk.git git -C xr-voice-sdk checkout e55c99a0ec947b0ad3efc308bf8e3de0a42140d5 @@ -96,62 +90,7 @@ sed -i '/void reInitializeAudioOutputPort();/a\ entservices-testframework/Tests/mocks/devicesettings.h ############################ -# 3. Build Thunder-Tools -echo "======================================================================================" -echo "building thunderTools" -cd ThunderTools -patch -p1 < $GITHUB_WORKSPACE/entservices-testframework/patches/00010-R4.4-Add-support-for-project-dir.patch -cd - - -cmake -G Ninja -S ThunderTools -B build/ThunderTools \ - -DEXCEPTIONS_ENABLE=ON \ - -DCMAKE_INSTALL_PREFIX="$GITHUB_WORKSPACE/install/usr" \ - -DCMAKE_MODULE_PATH="$GITHUB_WORKSPACE/install/tools/cmake" \ - -DGENERIC_CMAKE_MODULE_PATH="$GITHUB_WORKSPACE/install/tools/cmake" - -cmake --build build/ThunderTools --target install - -############################ -# 4. Build Thunder -echo "======================================================================================" -echo "building thunder" - -cd Thunder -patch -p1 < $GITHUB_WORKSPACE/entservices-testframework/patches/Use_Legact_Alt_Based_On_ThunderTools_R4.4.3.patch -patch -p1 < $GITHUB_WORKSPACE/entservices-testframework/patches/error_code_R4_4.patch -patch -p1 < $GITHUB_WORKSPACE/entservices-testframework/patches/1004-Add-support-for-project-dir.patch -patch -p1 < $GITHUB_WORKSPACE/entservices-testframework/patches/RDKEMW-733-Add-ENTOS-IDS.patch -cd - - -cmake -G Ninja -S Thunder -B build/Thunder \ - -DMESSAGING=ON \ - -DCMAKE_INSTALL_PREFIX="$GITHUB_WORKSPACE/install/usr" \ - -DCMAKE_MODULE_PATH="$GITHUB_WORKSPACE/install/tools/cmake" \ - -DGENERIC_CMAKE_MODULE_PATH="$GITHUB_WORKSPACE/install/tools/cmake" \ - -DBUILD_TYPE=Debug \ - -DBINDING=127.0.0.1 \ - -DPORT=55555 \ - -DEXCEPTIONS_ENABLE=ON - -cmake --build build/Thunder --target install - -############################ -# 5. Build entservices-apis -echo "======================================================================================" -echo "building entservices-apis" -cd entservices-apis -rm -rf jsonrpc/DTV.json -cd .. - -cmake -G Ninja -S entservices-apis -B build/entservices-apis \ - -DEXCEPTIONS_ENABLE=ON \ - -DCMAKE_INSTALL_PREFIX="$GITHUB_WORKSPACE/install/usr" \ - -DCMAKE_MODULE_PATH="$GITHUB_WORKSPACE/install/tools/cmake" - -cmake --build build/entservices-apis --target install - -############################ -# 6. Create stub/empty headers for external dependencies +# 3. Create stub/empty headers for external dependencies echo "======================================================================================" echo "Creating stub headers" @@ -164,17 +103,11 @@ mkdir -p "${HEADERS_DIR}/rdk/ds-rpc" mkdir -p "${HEADERS_DIR}/rdk/ds-hal" mkdir -p "${HEADERS_DIR}/rdk/halif/ds-hal" mkdir -p "${HEADERS_DIR}/rdk/iarmmgrs-hal" -mkdir -p "${HEADERS_DIR}/websocket" -mkdir -p "${HEADERS_DIR}/proc" -mkdir -p "${HEADERS_DIR}/audiocapturemgr" -mkdir -p "${HEADERS_DIR}/ccec/drivers" -mkdir -p "${HEADERS_DIR}/network" -mkdir -p "${HEADERS_DIR}/nopoll" mkdir -p "${XRSDK_HEADERS_DIR}" # Copy real xr-voice-sdk headers where control's source matches the real API. # xr_voice_sdk.h is NOT copied: it requires rdkx_logger.h installed types unavailable in source form. -cp "$GITHUB_WORKSPACE/xr-voice-sdk/src/xr-fdc/xr_fdc.h" "${XRSDK_HEADERS_DIR}/" +# xr_fdc.h is NOT copied: only needed when FDC_ENABLED=ON cp "$GITHUB_WORKSPACE/xr-voice-sdk/src/xr-speech-vrex/xrsv.h" "${XRSDK_HEADERS_DIR}/" cp "$GITHUB_WORKSPACE/xr-voice-sdk/src/xr-speech-router/xrsr.h" "${XRSDK_HEADERS_DIR}/" cp "$GITHUB_WORKSPACE/xr-voice-sdk/src/xr-mq/xr_mq.h" "${XRSDK_HEADERS_DIR}/" @@ -191,11 +124,8 @@ touch rdk/iarmbus/libIBusDaemon.h # IARM managers (types provided via -include Iarm.h for sysMgr, or in control stubs) touch rdk/iarmmgrs-hal/sysMgr.h -touch rdk/iarmmgrs-hal/irMgr.h touch rdk/iarmmgrs-hal/deepSleepMgr.h -touch rdk/iarmmgrs-hal/mfrMgr.h touch rdk/iarmmgrs-hal/pwrMgr.h -touch rdk/iarmmgrs-hal/plat_ir.h # Device settings headers (types provided via -include devicesettings.h) touch rdk/ds/audioOutputPort.hpp @@ -222,27 +152,12 @@ touch rdk/ds/frontPanelIndicator.hpp touch rdk/ds/frontPanelConfig.hpp touch rdk/ds/frontPanelTextDisplay.hpp -# Other stubs -touch audiocapturemgr/audiocapturemgr_iarm.h -touch rdk_logger_milestone.h -touch btmgr.h -touch proc/readproc.h -touch nopoll/nopoll.h - # rfcapi.h (types provided via -include Rfc.h) touch rfcapi.h -# telemetry (types provided via -include Telemetry.h) -touch telemetry_busmessage_sender.h -touch telemetry2_0.h - # secure_wrapper (types provided via -include secure_wrappermock.h) touch secure_wrapper.h -# edid / drm -touch edid-parser.hpp -touch dsFPD.h - # safec compatibility header - committed in ci/mocks, copied here so it is # resolved on the generated-headers include path. cp "$GITHUB_WORKSPACE/ci/mocks/safec_lib.h" safec_lib.h @@ -258,7 +173,7 @@ printf '{}\n' > "${GITHUB_WORKSPACE}/install/usr/include/ctrlm_config_empty.json cp -r /usr/include/glib-2.0/* /usr/lib/x86_64-linux-gnu/glib-2.0/include/* "${HEADERS_DIR}/" 2>/dev/null || true ############################ -# 7. Create stub shared libraries for linking +# 4. Create stub shared libraries for linking echo "======================================================================================" echo "Creating stub libraries" diff --git a/ci/cov_build.sh b/ci/cov_build.sh index 12b0830a..a36c4f8d 100644 --- a/ci/cov_build.sh +++ b/ci/cov_build.sh @@ -30,7 +30,6 @@ echo "building control (ctrlm-main)" XRSDK_REAL_HEADERS="$GITHUB_WORKSPACE/ci/headers/xr-voice-sdk" CTRL_STUBS="$GITHUB_WORKSPACE/ci/mocks/control" MOCK_DIR="$GITHUB_WORKSPACE/entservices-testframework/Tests/mocks" -MOCK_OVERRIDES="$GITHUB_WORKSPACE/ci/mocks/testframework_overrides.h" HEADERS_DIR="$GITHUB_WORKSPACE/ci/headers" EMPTY_JSON="$GITHUB_WORKSPACE/install/usr/include/ctrlm_config_empty.json" @@ -40,11 +39,10 @@ cmake -G Ninja -S "$GITHUB_WORKSPACE" -B build/control \ -DCMAKE_MODULE_PATH="${GITHUB_WORKSPACE}/install/tools/cmake" \ -DCMAKE_VERBOSE_MAKEFILE=ON \ -DCMAKE_PROJECT_VERSION="1.0.0" \ --DUSE_THUNDER_R4=ON \ --DTHUNDER=ON \ +-DTHUNDER=OFF \ -DTHUNDER_SECURITY=OFF \ -DBLE_ENABLED=OFF \ --DRF4CE_ENABLED=ON \ +-DRF4CE_ENABLED=OFF \ -DIP_ENABLED=OFF \ -DTELEMETRY_SUPPORT=OFF \ -DAUTH_ENABLED=OFF \ @@ -53,7 +51,7 @@ cmake -G Ninja -S "$GITHUB_WORKSPACE" -B build/control \ -DBUILD_CTRLM_FACTORY=OFF \ -DBUILD_FACTORY_TEST=OFF \ -DUSE_SAFEC=OFF \ --DUSE_IARM_POWER_MANAGER=OFF \ +-DUSE_IARM_POWER_MANAGER=ON \ -DBREAKPAD=OFF \ -DFDC_ENABLED=OFF \ -DENABLE_ASYNC_SRVR_MSG=OFF \ @@ -70,7 +68,6 @@ cmake -G Ninja -S "$GITHUB_WORKSPACE" -B build/control \ -I ${XRSDK_REAL_HEADERS} \ -I ${CTRL_STUBS} \ -I ${MOCK_DIR} \ --I ${MOCK_DIR}/thunder \ -I ${MOCK_DIR}/devicesettings \ -I ${HEADERS_DIR} \ -I ${HEADERS_DIR}/rdk/iarmbus \ @@ -79,25 +76,16 @@ cmake -G Ninja -S "$GITHUB_WORKSPACE" -B build/control \ -I ${HEADERS_DIR}/rdk/ds-hal \ -I ${HEADERS_DIR}/rdk/halif/ds-hal \ -I ${HEADERS_DIR}/rdk/iarmmgrs-hal \ --I ${HEADERS_DIR}/audiocapturemgr \ --I ${HEADERS_DIR}/ccec/drivers \ --I ${HEADERS_DIR}/network \ --I ${HEADERS_DIR}/nopoll \ -I ${GITHUB_WORKSPACE}/install/usr/include \ --I ${GITHUB_WORKSPACE}/install/usr/include/WPEFramework \ -I /usr/include/glib-2.0 \ -I /usr/lib/x86_64-linux-gnu/glib-2.0/include \ -I /usr/include/libdrm \ -include ${MOCK_DIR}/Iarm.h \ --include ${MOCK_OVERRIDES} \ -include ${MOCK_DIR}/devicesettings.h \ -include ${MOCK_DIR}/Rfc.h \ --include ${MOCK_DIR}/Telemetry.h \ --include ${MOCK_DIR}/secure_wrappermock.h \ -Wall -Wno-error \ -DSAFEC_DUMMY_API \ --DDISABLE_SECURITY_TOKEN \ --DUSE_THUNDER_R4=ON -DTHUNDER_VERSION=4 -DTHUNDER_VERSION_MAJOR=4 -DTHUNDER_VERSION_MINOR=4" \ +-DDISABLE_SECURITY_TOKEN" \ -DCMAKE_C_FLAGS=" \ -I ${XRSDK_REAL_HEADERS} \ -I ${CTRL_STUBS} \ @@ -107,7 +95,6 @@ cmake -G Ninja -S "$GITHUB_WORKSPACE" -B build/control \ -I ${HEADERS_DIR}/rdk/ds \ -I ${HEADERS_DIR}/rdk/iarmmgrs-hal \ -I ${GITHUB_WORKSPACE}/install/usr/include \ --I ${GITHUB_WORKSPACE}/install/usr/include/WPEFramework \ -Wall -Wno-error \ -DSAFEC_DUMMY_API \ -DDISABLE_SECURITY_TOKEN" \ diff --git a/ci/mocks/control/comcastIrKeyCodes.h b/ci/mocks/control/comcastIrKeyCodes.h deleted file mode 100644 index d0028cee..00000000 --- a/ci/mocks/control/comcastIrKeyCodes.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Stub for comcastIrKeyCodes.h - * - * Copyright 2026 RDK Management - * Licensed under the Apache License, Version 2.0 - */ -#ifndef _COMCAST_IR_KEY_CODES_H_ -#define _COMCAST_IR_KEY_CODES_H_ - -/* Key event types */ -#define KET_KEYDOWN 0x00000008 -#define KET_KEYUP 0x00000100 -#define KET_KEYREPEAT 0x00000200 - -/* Key codes */ -#define KED_POWER 0x00000001 -#define KED_TVPOWER 0x00000002 -#define KED_RF_POWER 0x00000003 -#define KED_DISCRETE_POWER_ON 0x00000004 -#define KED_DISCRETE_POWER_STANDBY 0x00000005 -#define KED_VOLUMEUP 0x00000010 -#define KED_VOLUMEDOWN 0x00000011 -#define KED_MUTE 0x00000012 -#define KED_INPUTKEY 0x00000013 -#define KED_SETUP 0x00000020 -#define KED_PUSH_TO_TALK 0x00000030 -#define KED_RF_PAIR_GHOST 0x00000040 -#define KED_SCREEN_BIND_NOTIFY 0x00000050 -#define KED_XR2V3 0x00000060 -#define KED_XR5V2 0x00000061 -#define KED_XR11V1 0x00000062 -#define KED_XR11V2 0x00000063 -#define KED_XR11_NOTIFY 0x00000064 -#define KED_XR15V1_NOTIFY 0x00000065 -#define KED_XR16V1_NOTIFY 0x00000066 -#define KED_UNDEFINEDKEY 0x000000FF - -/* XMP tags */ -#define XMP_TAG_COMCAST 0x0001 -#define XMP_TAG_PLATCO 0x0002 -#define XMP_TAG_XR11V2 0x0003 -#define XMP_TAG_XR15V1 0x0004 -#define XMP_TAG_XR15V2 0x0005 -#define XMP_TAG_XR16V1 0x0006 -#define XMP_TAG_XRAV1 0x0007 -#define XMP_TAG_XR20V1 0x0008 -#define XMP_TAG_UNDEFINED 0x00FF - -#endif /* _COMCAST_IR_KEY_CODES_H_ */ diff --git a/ci/mocks/control/irMgr.h b/ci/mocks/control/irMgr.h deleted file mode 100644 index 1d3cebb9..00000000 --- a/ci/mocks/control/irMgr.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Stub for irMgr.h - IR Manager types - * - * Copyright 2026 RDK Management - * Licensed under the Apache License, Version 2.0 - */ -#ifndef _IR_MGR_H_ -#define _IR_MGR_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#define IARM_BUS_IRMGR_NAME "IRMgr" - -typedef enum { - IARM_BUS_IRMGR_EVENT_IRKEY = 0, - IARM_BUS_IRMGR_EVENT_CONTROL = 1, - IARM_BUS_IRMGR_EVENT_MAX = 2 -} IARM_Bus_IRMgr_EventId_t; - -#define IARM_BUS_IRMGR_KEYSRC_IR 0 -#define IARM_BUS_IRMGR_KEYSRC_FP 1 -#define IARM_BUS_IRMGR_KEYSRC_RF 2 - -typedef struct { - union { - struct { - int keyType; - int keyCode; - int keySrc; - int keyTag; - int keySourceId; - } irkey; - } data; -} IARM_Bus_IRMgr_EventData_t; - -#ifdef __cplusplus -} -#endif - -#endif /* _IR_MGR_H_ */ diff --git a/ci/mocks/control/xraudio.h b/ci/mocks/control/xraudio.h deleted file mode 100644 index 0738c738..00000000 --- a/ci/mocks/control/xraudio.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Stub for xraudio.h - Audio types - * - * Copyright 2026 RDK Management - * Licensed under the Apache License, Version 2.0 - */ -#ifndef _XRAUDIO_H_ -#define _XRAUDIO_H_ - -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef enum { - XRAUDIO_ENCODING_PCM = 0, - XRAUDIO_ENCODING_ADPCM = 1, - XRAUDIO_ENCODING_OPUS = 2, - XRAUDIO_ENCODING_INVALID = 3 -} xraudio_encoding_t; - -typedef struct { - xraudio_encoding_t type; -} xraudio_encoding_info_t; - -typedef struct { - xraudio_encoding_info_t encoding; - uint16_t sample_rate; - uint8_t sample_size; - uint8_t channel_qty; -} xraudio_output_format_t; - -typedef enum { - XRAUDIO_RESULT_OK = 0, - XRAUDIO_RESULT_ERROR = 1 -} xraudio_result_t; - -int32_t xraudio_container_header_parse_wave(int audio_fd, const uint8_t *header, size_t size, xraudio_output_format_t *format, uint32_t *data_length); - -#ifdef __cplusplus -} -#endif - -#endif /* _XRAUDIO_H_ */ From 148abd330407f41083acb00b6d3285dd05a8a230 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Mon, 20 Apr 2026 14:58:09 +0000 Subject: [PATCH 28/72] Test --- ci/build_dependencies.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh index 96d733d5..ce352647 100644 --- a/ci/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -63,6 +63,7 @@ git -C xr-voice-sdk checkout e55c99a0ec947b0ad3efc308bf8e3de0a42140d5 git clone https://github.com/rdkcentral/entservices-testframework.git git -C entservices-testframework checkout 584e3ec70fd5e044982910b4eb15c465808bb6d1 +# TODO: Remove this in a future Commit, testing things now that should be fixed in entservices-testframework directly. # Patch testframework mocks with declarations ctrlm needs that are not yet upstream. # We should remove as it is cleaner to just make changes to entservices-testframework directly # device::Manager::IsInitialized (static bool member) @@ -88,6 +89,9 @@ sed -i '/void reInitializeAudioOutputPort();/a\ (void)level;\ }' \ entservices-testframework/Tests/mocks/devicesettings.h +# DEEPSLEEP_WAKEUPREASON_MAX (after DEEPSLEEP_WAKEUPREASON_UNKNOWN) +sed -i 's/DEEPSLEEP_WAKEUPREASON_UNKNOWN$/DEEPSLEEP_WAKEUPREASON_UNKNOWN,\n DEEPSLEEP_WAKEUPREASON_MAX/' \ + entservices-testframework/Tests/mocks/Iarm.h ############################ # 3. Create stub/empty headers for external dependencies @@ -155,7 +159,10 @@ touch rdk/ds/frontPanelTextDisplay.hpp # rfcapi.h (types provided via -include Rfc.h) touch rfcapi.h -# secure_wrapper (types provided via -include secure_wrappermock.h) +# comcastIrKeyCodes.h (unconditionally included by ctrlm_main.cpp) +cp "$GITHUB_WORKSPACE/entservices-testframework/Tests/mocks/control/comcastIrKeyCodes.h" comcastIrKeyCodes.h + +# secure_wrapper (types provided via empty stub — no v_secure_* calls in core) touch secure_wrapper.h # safec compatibility header - committed in ci/mocks, copied here so it is From acd51686881683328b64ef0de531ed23e36c3036 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Mon, 20 Apr 2026 15:27:03 +0000 Subject: [PATCH 29/72] Test again --- ci/build_dependencies.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh index ce352647..8cab987c 100644 --- a/ci/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -63,12 +63,17 @@ git -C xr-voice-sdk checkout e55c99a0ec947b0ad3efc308bf8e3de0a42140d5 git clone https://github.com/rdkcentral/entservices-testframework.git git -C entservices-testframework checkout 584e3ec70fd5e044982910b4eb15c465808bb6d1 +TESTFRAMEWORK_DIR="$GITHUB_WORKSPACE/entservices-testframework" +if [ ! -d "$TESTFRAMEWORK_DIR" ] && [ -d "$(dirname "$GITHUB_WORKSPACE")/entservices-testframework" ]; then + TESTFRAMEWORK_DIR="$(dirname "$GITHUB_WORKSPACE")/entservices-testframework" +fi + # TODO: Remove this in a future Commit, testing things now that should be fixed in entservices-testframework directly. # Patch testframework mocks with declarations ctrlm needs that are not yet upstream. # We should remove as it is cleaner to just make changes to entservices-testframework directly # device::Manager::IsInitialized (static bool member) sed -i '/static void Initialize();/i\ inline static bool IsInitialized = false;' \ - entservices-testframework/Tests/mocks/devicesettings.h + "$TESTFRAMEWORK_DIR/Tests/mocks/devicesettings.h" # dsAudioDucking enums (after dsAudioPortType_t) sed -i '/^} dsAudioPortType_t;/a\ typedef enum _dsAudioDuckingAction_t {\ @@ -80,7 +85,7 @@ typedef enum _dsAudioDuckingType_t {\ dsAUDIO_DUCKINGTYPE_ABSOLUTE = 0,\ dsAUDIO_DUCKINGTYPE_RELATIVE = 1\ } dsAudioDuckingType_t;' \ - entservices-testframework/Tests/mocks/devicesettings.h + "$TESTFRAMEWORK_DIR/Tests/mocks/devicesettings.h" # AudioOutputPort::setAudioDucking (after reInitializeAudioOutputPort) sed -i '/void reInitializeAudioOutputPort();/a\ void setAudioDucking(dsAudioDuckingAction_t action, dsAudioDuckingType_t type, float level) {\ @@ -88,10 +93,10 @@ sed -i '/void reInitializeAudioOutputPort();/a\ (void)type;\ (void)level;\ }' \ - entservices-testframework/Tests/mocks/devicesettings.h + "$TESTFRAMEWORK_DIR/Tests/mocks/devicesettings.h" # DEEPSLEEP_WAKEUPREASON_MAX (after DEEPSLEEP_WAKEUPREASON_UNKNOWN) sed -i 's/DEEPSLEEP_WAKEUPREASON_UNKNOWN$/DEEPSLEEP_WAKEUPREASON_UNKNOWN,\n DEEPSLEEP_WAKEUPREASON_MAX/' \ - entservices-testframework/Tests/mocks/Iarm.h + "$TESTFRAMEWORK_DIR/Tests/mocks/Iarm.h" ############################ # 3. Create stub/empty headers for external dependencies @@ -160,7 +165,7 @@ touch rdk/ds/frontPanelTextDisplay.hpp touch rfcapi.h # comcastIrKeyCodes.h (unconditionally included by ctrlm_main.cpp) -cp "$GITHUB_WORKSPACE/entservices-testframework/Tests/mocks/control/comcastIrKeyCodes.h" comcastIrKeyCodes.h +cp "$TESTFRAMEWORK_DIR/Tests/mocks/control/comcastIrKeyCodes.h" comcastIrKeyCodes.h # secure_wrapper (types provided via empty stub — no v_secure_* calls in core) touch secure_wrapper.h From bac6a8edcdffc2c058e9447295e08bd1540435df Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Mon, 20 Apr 2026 17:41:11 +0000 Subject: [PATCH 30/72] Updates --- ci/build_dependencies.sh | 2 +- ci/mocks/control/comcastIrKeyCodes.h | 49 ++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 ci/mocks/control/comcastIrKeyCodes.h diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh index 8cab987c..58e70e6f 100644 --- a/ci/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -165,7 +165,7 @@ touch rdk/ds/frontPanelTextDisplay.hpp touch rfcapi.h # comcastIrKeyCodes.h (unconditionally included by ctrlm_main.cpp) -cp "$TESTFRAMEWORK_DIR/Tests/mocks/control/comcastIrKeyCodes.h" comcastIrKeyCodes.h +cp "$GITHUB_WORKSPACE/ci/mocks/control/comcastIrKeyCodes.h" comcastIrKeyCodes.h # secure_wrapper (types provided via empty stub — no v_secure_* calls in core) touch secure_wrapper.h diff --git a/ci/mocks/control/comcastIrKeyCodes.h b/ci/mocks/control/comcastIrKeyCodes.h new file mode 100644 index 00000000..123661fa --- /dev/null +++ b/ci/mocks/control/comcastIrKeyCodes.h @@ -0,0 +1,49 @@ +/* + * Stub for comcastIrKeyCodes.h + * + * Copyright 2024 RDK Management + * Licensed under the Apache License, Version 2.0 + */ +#ifndef _COMCAST_IR_KEY_CODES_H_ +#define _COMCAST_IR_KEY_CODES_H_ + +/* Key event types */ +#define KET_KEYDOWN 0x00000008 +#define KET_KEYUP 0x00000100 +#define KET_KEYREPEAT 0x00000200 + +/* Key codes */ +#define KED_POWER 0x00000001 +#define KED_TVPOWER 0x00000002 +#define KED_RF_POWER 0x00000003 +#define KED_DISCRETE_POWER_ON 0x00000004 +#define KED_DISCRETE_POWER_STANDBY 0x00000005 +#define KED_VOLUMEUP 0x00000010 +#define KED_VOLUMEDOWN 0x00000011 +#define KED_MUTE 0x00000012 +#define KED_INPUTKEY 0x00000013 +#define KED_SETUP 0x00000020 +#define KED_PUSH_TO_TALK 0x00000030 +#define KED_RF_PAIR_GHOST 0x00000040 +#define KED_SCREEN_BIND_NOTIFY 0x00000050 +#define KED_XR2V3 0x00000060 +#define KED_XR5V2 0x00000061 +#define KED_XR11V1 0x00000062 +#define KED_XR11V2 0x00000063 +#define KED_XR11_NOTIFY 0x00000064 +#define KED_XR15V1_NOTIFY 0x00000065 +#define KED_XR16V1_NOTIFY 0x00000066 +#define KED_UNDEFINEDKEY 0x000000FF + +/* XMP tags */ +#define XMP_TAG_COMCAST 0x0001 +#define XMP_TAG_PLATCO 0x0002 +#define XMP_TAG_XR11V2 0x0003 +#define XMP_TAG_XR15V1 0x0004 +#define XMP_TAG_XR15V2 0x0005 +#define XMP_TAG_XR16V1 0x0006 +#define XMP_TAG_XRAV1 0x0007 +#define XMP_TAG_XR20V1 0x0008 +#define XMP_TAG_UNDEFINED 0x00FF + +#endif /* _COMCAST_IR_KEY_CODES_H_ */ From 02cb06ede1576ced3db9d97921cb55f92cc359ff Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Mon, 20 Apr 2026 18:24:53 +0000 Subject: [PATCH 31/72] Testing --- ci/cov_build.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ci/cov_build.sh b/ci/cov_build.sh index a36c4f8d..bae1cbc8 100644 --- a/ci/cov_build.sh +++ b/ci/cov_build.sh @@ -30,6 +30,7 @@ echo "building control (ctrlm-main)" XRSDK_REAL_HEADERS="$GITHUB_WORKSPACE/ci/headers/xr-voice-sdk" CTRL_STUBS="$GITHUB_WORKSPACE/ci/mocks/control" MOCK_DIR="$GITHUB_WORKSPACE/entservices-testframework/Tests/mocks" +MOCK_OVERRIDES="$GITHUB_WORKSPACE/ci/mocks/testframework_overrides.h" HEADERS_DIR="$GITHUB_WORKSPACE/ci/headers" EMPTY_JSON="$GITHUB_WORKSPACE/install/usr/include/ctrlm_config_empty.json" @@ -81,6 +82,7 @@ cmake -G Ninja -S "$GITHUB_WORKSPACE" -B build/control \ -I /usr/lib/x86_64-linux-gnu/glib-2.0/include \ -I /usr/include/libdrm \ -include ${MOCK_DIR}/Iarm.h \ +-include ${MOCK_OVERRIDES} \ -include ${MOCK_DIR}/devicesettings.h \ -include ${MOCK_DIR}/Rfc.h \ -Wall -Wno-error \ From 55a312c8ff71c21cfe670cccae79d72d374a5ede Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Mon, 20 Apr 2026 18:28:21 +0000 Subject: [PATCH 32/72] Test --- ci/mocks/testframework_overrides.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ci/mocks/testframework_overrides.h b/ci/mocks/testframework_overrides.h index 18e0ddee..58393137 100644 --- a/ci/mocks/testframework_overrides.h +++ b/ci/mocks/testframework_overrides.h @@ -26,4 +26,9 @@ /* ctrlm-main calls IARM_Bus_RegisterEvent as a plain function (defined in stubs_iarm.cpp) */ extern IARM_Result_t IARM_Bus_RegisterEvent(IARM_EventId_t maxEventId); +/* IARM common API string not present in the pinned testframework mock */ +#ifndef IARM_BUS_COMMON_API_PowerPreChange +#define IARM_BUS_COMMON_API_PowerPreChange "PowerPreChange" +#endif + #endif /* _CONTROL_TESTFRAMEWORK_OVERRIDES_H_ */ From 689fdda55d6da3bb1c8d896b347e0190d48453aa Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Mon, 20 Apr 2026 18:31:53 +0000 Subject: [PATCH 33/72] More test --- ci/mocks/testframework_overrides.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ci/mocks/testframework_overrides.h b/ci/mocks/testframework_overrides.h index 58393137..14c9920a 100644 --- a/ci/mocks/testframework_overrides.h +++ b/ci/mocks/testframework_overrides.h @@ -31,4 +31,13 @@ extern IARM_Result_t IARM_Bus_RegisterEvent(IARM_EventId_t maxEventId); #define IARM_BUS_COMMON_API_PowerPreChange "PowerPreChange" #endif +/* Struct not present in the pinned testframework mock */ +#ifndef IARM_BUS_COMMON_API_PowerPreChange_Param_t +typedef struct { + IARM_Bus_PWRMgr_PowerState_t newState; + IARM_Bus_PWRMgr_PowerState_t curState; +} IARM_Bus_CommonAPI_PowerPreChange_Param_t; +#define IARM_BUS_COMMON_API_PowerPreChange_Param_t IARM_Bus_CommonAPI_PowerPreChange_Param_t +#endif + #endif /* _CONTROL_TESTFRAMEWORK_OVERRIDES_H_ */ From 57f86afafebdbfeebaa82a95858c49a9075b5f1a Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Mon, 20 Apr 2026 19:16:35 +0000 Subject: [PATCH 34/72] Testing --- ci/build_dependencies.sh | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh index 58e70e6f..9ee70643 100644 --- a/ci/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -63,11 +63,16 @@ git -C xr-voice-sdk checkout e55c99a0ec947b0ad3efc308bf8e3de0a42140d5 git clone https://github.com/rdkcentral/entservices-testframework.git git -C entservices-testframework checkout 584e3ec70fd5e044982910b4eb15c465808bb6d1 +git clone --depth 1 --filter=blob:none --sparse --branch develop https://github.com/rdkcentral/iarmmgrs.git +git -C iarmmgrs sparse-checkout set hal sysmgr deepsleepmgr pwrmgr pwrMgr + TESTFRAMEWORK_DIR="$GITHUB_WORKSPACE/entservices-testframework" if [ ! -d "$TESTFRAMEWORK_DIR" ] && [ -d "$(dirname "$GITHUB_WORKSPACE")/entservices-testframework" ]; then TESTFRAMEWORK_DIR="$(dirname "$GITHUB_WORKSPACE")/entservices-testframework" fi +IARMMGRS_DIR="$GITHUB_WORKSPACE/iarmmgrs" + # TODO: Remove this in a future Commit, testing things now that should be fixed in entservices-testframework directly. # Patch testframework mocks with declarations ctrlm needs that are not yet upstream. # We should remove as it is cleaner to just make changes to entservices-testframework directly @@ -131,10 +136,13 @@ touch rdk/iarmbus/libIARM.h touch rdk/iarmbus/libIBus.h touch rdk/iarmbus/libIBusDaemon.h -# IARM managers (types provided via -include Iarm.h for sysMgr, or in control stubs) -touch rdk/iarmmgrs-hal/sysMgr.h -touch rdk/iarmmgrs-hal/deepSleepMgr.h -touch rdk/iarmmgrs-hal/pwrMgr.h +# IARM managers +find "$IARMMGRS_DIR" -name sysMgr.h -print -quit | xargs -r -I{} cp "{}" rdk/iarmmgrs-hal/sysMgr.h +find "$IARMMGRS_DIR" -name deepSleepMgr.h -print -quit | xargs -r -I{} cp "{}" rdk/iarmmgrs-hal/deepSleepMgr.h +find "$IARMMGRS_DIR" -name pwrMgr.h -print -quit | xargs -r -I{} cp "{}" rdk/iarmmgrs-hal/pwrMgr.h +[ -f rdk/iarmmgrs-hal/sysMgr.h ] +[ -f rdk/iarmmgrs-hal/deepSleepMgr.h ] +[ -f rdk/iarmmgrs-hal/pwrMgr.h ] # Device settings headers (types provided via -include devicesettings.h) touch rdk/ds/audioOutputPort.hpp @@ -165,7 +173,8 @@ touch rdk/ds/frontPanelTextDisplay.hpp touch rfcapi.h # comcastIrKeyCodes.h (unconditionally included by ctrlm_main.cpp) -cp "$GITHUB_WORKSPACE/ci/mocks/control/comcastIrKeyCodes.h" comcastIrKeyCodes.h +find "$IARMMGRS_DIR" -name comcastIrKeyCodes.h -print -quit | xargs -r -I{} cp "{}" comcastIrKeyCodes.h +[ -f comcastIrKeyCodes.h ] # secure_wrapper (types provided via empty stub — no v_secure_* calls in core) touch secure_wrapper.h From becfca5f6e232c54e76bfa7a84db66f00a4980a4 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Mon, 20 Apr 2026 19:25:39 +0000 Subject: [PATCH 35/72] Update --- ci/build_dependencies.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh index 9ee70643..99ee58e7 100644 --- a/ci/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -64,7 +64,13 @@ git clone https://github.com/rdkcentral/entservices-testframework.git git -C entservices-testframework checkout 584e3ec70fd5e044982910b4eb15c465808bb6d1 git clone --depth 1 --filter=blob:none --sparse --branch develop https://github.com/rdkcentral/iarmmgrs.git -git -C iarmmgrs sparse-checkout set hal sysmgr deepsleepmgr pwrmgr pwrMgr +git -C iarmmgrs sparse-checkout set hal sysmgr + +git clone --depth 1 --filter=blob:none --sparse https://github.com/rdkcentral/rdk-halif-deepsleep_manager.git +git -C rdk-halif-deepsleep_manager sparse-checkout set include + +git clone --depth 1 --filter=blob:none --sparse https://github.com/rdkcentral/rdk-halif-power_manager.git +git -C rdk-halif-power_manager sparse-checkout set include TESTFRAMEWORK_DIR="$GITHUB_WORKSPACE/entservices-testframework" if [ ! -d "$TESTFRAMEWORK_DIR" ] && [ -d "$(dirname "$GITHUB_WORKSPACE")/entservices-testframework" ]; then @@ -72,6 +78,8 @@ if [ ! -d "$TESTFRAMEWORK_DIR" ] && [ -d "$(dirname "$GITHUB_WORKSPACE")/entserv fi IARMMGRS_DIR="$GITHUB_WORKSPACE/iarmmgrs" +DEEPSLEEP_HAL_DIR="$GITHUB_WORKSPACE/rdk-halif-deepsleep_manager" +POWER_HAL_DIR="$GITHUB_WORKSPACE/rdk-halif-power_manager" # TODO: Remove this in a future Commit, testing things now that should be fixed in entservices-testframework directly. # Patch testframework mocks with declarations ctrlm needs that are not yet upstream. @@ -138,8 +146,8 @@ touch rdk/iarmbus/libIBusDaemon.h # IARM managers find "$IARMMGRS_DIR" -name sysMgr.h -print -quit | xargs -r -I{} cp "{}" rdk/iarmmgrs-hal/sysMgr.h -find "$IARMMGRS_DIR" -name deepSleepMgr.h -print -quit | xargs -r -I{} cp "{}" rdk/iarmmgrs-hal/deepSleepMgr.h -find "$IARMMGRS_DIR" -name pwrMgr.h -print -quit | xargs -r -I{} cp "{}" rdk/iarmmgrs-hal/pwrMgr.h +cp "$DEEPSLEEP_HAL_DIR/include/deepSleepMgr.h" rdk/iarmmgrs-hal/deepSleepMgr.h +cp "$POWER_HAL_DIR/include/plat_power.h" rdk/iarmmgrs-hal/pwrMgr.h [ -f rdk/iarmmgrs-hal/sysMgr.h ] [ -f rdk/iarmmgrs-hal/deepSleepMgr.h ] [ -f rdk/iarmmgrs-hal/pwrMgr.h ] From b0e14130ef1272de74dad7f46a726722d92e39c1 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Mon, 20 Apr 2026 19:33:45 +0000 Subject: [PATCH 36/72] Updates --- ci/build_dependencies.sh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh index 99ee58e7..6a2b5080 100644 --- a/ci/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -64,7 +64,7 @@ git clone https://github.com/rdkcentral/entservices-testframework.git git -C entservices-testframework checkout 584e3ec70fd5e044982910b4eb15c465808bb6d1 git clone --depth 1 --filter=blob:none --sparse --branch develop https://github.com/rdkcentral/iarmmgrs.git -git -C iarmmgrs sparse-checkout set hal sysmgr +git -C iarmmgrs sparse-checkout set hal git clone --depth 1 --filter=blob:none --sparse https://github.com/rdkcentral/rdk-halif-deepsleep_manager.git git -C rdk-halif-deepsleep_manager sparse-checkout set include @@ -144,8 +144,17 @@ touch rdk/iarmbus/libIARM.h touch rdk/iarmbus/libIBus.h touch rdk/iarmbus/libIBusDaemon.h -# IARM managers -find "$IARMMGRS_DIR" -name sysMgr.h -print -quit | xargs -r -I{} cp "{}" rdk/iarmmgrs-hal/sysMgr.h +# IARM manager headers +# sysMgr.h is included by ctrlm, but the required SYSMgr types already come from the forced +# Iarm.h mock. Using the real header here causes duplicate typedefs, so provide a shim only. +cat > rdk/iarmmgrs-hal/sysMgr.h <<'EOF' +#ifndef CTRLM_CI_SYSMGR_SHIM_H +#define CTRLM_CI_SYSMGR_SHIM_H + +/* SYSMgr declarations are provided by the forced Iarm.h mock in CI. */ + +#endif +EOF cp "$DEEPSLEEP_HAL_DIR/include/deepSleepMgr.h" rdk/iarmmgrs-hal/deepSleepMgr.h cp "$POWER_HAL_DIR/include/plat_power.h" rdk/iarmmgrs-hal/pwrMgr.h [ -f rdk/iarmmgrs-hal/sysMgr.h ] From 3fe154de65e5af1ea94a92638d9e8c5b9177d8a5 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Mon, 20 Apr 2026 19:40:31 +0000 Subject: [PATCH 37/72] Updates --- .github/copilot-instructions.md | 2 +- ci/mocks/control/comcastIrKeyCodes.h | 49 ---------------------------- 2 files changed, 1 insertion(+), 50 deletions(-) delete mode 100644 ci/mocks/control/comcastIrKeyCodes.h diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 12ddabcd..c3db5615 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -7,7 +7,7 @@ This is the **ctrlm-main** (Control Manager) plugin — a Thunder/WPEFramework p The `ci/` directory contains **native CI build support files only**. It is not part of the application. - `ci/build_dependencies.sh` / `ci/cov_build.sh` — scripts that build the plugin in a CI container without a full RDK target image -- `ci/mocks/control/` — control-specific stub headers (rdkx_logger, xraudio, xr_voice_sdk, irMgr, comcastIrKeyCodes, rdkversion) that are not available upstream +- `ci/mocks/control/` — control-specific stub headers (rdkx_logger, xr_voice_sdk, rdkversion) that are not available upstream - `ci/mocks/testframework_overrides.h` — supplements testframework mocks with declarations ctrlm needs that are not yet upstream - `ci/headers/` — empty stub headers and real xr-voice-sdk headers generated/copied at CI build time; not committed to source diff --git a/ci/mocks/control/comcastIrKeyCodes.h b/ci/mocks/control/comcastIrKeyCodes.h deleted file mode 100644 index 123661fa..00000000 --- a/ci/mocks/control/comcastIrKeyCodes.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Stub for comcastIrKeyCodes.h - * - * Copyright 2024 RDK Management - * Licensed under the Apache License, Version 2.0 - */ -#ifndef _COMCAST_IR_KEY_CODES_H_ -#define _COMCAST_IR_KEY_CODES_H_ - -/* Key event types */ -#define KET_KEYDOWN 0x00000008 -#define KET_KEYUP 0x00000100 -#define KET_KEYREPEAT 0x00000200 - -/* Key codes */ -#define KED_POWER 0x00000001 -#define KED_TVPOWER 0x00000002 -#define KED_RF_POWER 0x00000003 -#define KED_DISCRETE_POWER_ON 0x00000004 -#define KED_DISCRETE_POWER_STANDBY 0x00000005 -#define KED_VOLUMEUP 0x00000010 -#define KED_VOLUMEDOWN 0x00000011 -#define KED_MUTE 0x00000012 -#define KED_INPUTKEY 0x00000013 -#define KED_SETUP 0x00000020 -#define KED_PUSH_TO_TALK 0x00000030 -#define KED_RF_PAIR_GHOST 0x00000040 -#define KED_SCREEN_BIND_NOTIFY 0x00000050 -#define KED_XR2V3 0x00000060 -#define KED_XR5V2 0x00000061 -#define KED_XR11V1 0x00000062 -#define KED_XR11V2 0x00000063 -#define KED_XR11_NOTIFY 0x00000064 -#define KED_XR15V1_NOTIFY 0x00000065 -#define KED_XR16V1_NOTIFY 0x00000066 -#define KED_UNDEFINEDKEY 0x000000FF - -/* XMP tags */ -#define XMP_TAG_COMCAST 0x0001 -#define XMP_TAG_PLATCO 0x0002 -#define XMP_TAG_XR11V2 0x0003 -#define XMP_TAG_XR15V1 0x0004 -#define XMP_TAG_XR15V2 0x0005 -#define XMP_TAG_XR16V1 0x0006 -#define XMP_TAG_XRAV1 0x0007 -#define XMP_TAG_XR20V1 0x0008 -#define XMP_TAG_UNDEFINED 0x00FF - -#endif /* _COMCAST_IR_KEY_CODES_H_ */ From cdfd057a6cfbf7b1b9cc01b072b3266042db6f0d Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Mon, 20 Apr 2026 19:47:22 +0000 Subject: [PATCH 38/72] Test --- .github/copilot-instructions.md | 1 + ci/build_dependencies.sh | 35 - ci/cov_build.sh | 5 +- ci/mocks/testframework/devicesettings.h | 2297 +++++++++++++++++++++++ ci/mocks/testframework_overrides.h | 5 + 5 files changed, 2307 insertions(+), 36 deletions(-) create mode 100644 ci/mocks/testframework/devicesettings.h diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index c3db5615..3a8cf33c 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -8,6 +8,7 @@ The `ci/` directory contains **native CI build support files only**. It is not p - `ci/build_dependencies.sh` / `ci/cov_build.sh` — scripts that build the plugin in a CI container without a full RDK target image - `ci/mocks/control/` — control-specific stub headers (rdkx_logger, xr_voice_sdk, rdkversion) that are not available upstream +- `ci/mocks/testframework/` — repo-owned replacements for pinned testframework mocks when ctrlm needs local changes without mutating the clone in CI - `ci/mocks/testframework_overrides.h` — supplements testframework mocks with declarations ctrlm needs that are not yet upstream - `ci/headers/` — empty stub headers and real xr-voice-sdk headers generated/copied at CI build time; not committed to source diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh index 6a2b5080..b1d2d705 100644 --- a/ci/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -72,45 +72,10 @@ git -C rdk-halif-deepsleep_manager sparse-checkout set include git clone --depth 1 --filter=blob:none --sparse https://github.com/rdkcentral/rdk-halif-power_manager.git git -C rdk-halif-power_manager sparse-checkout set include -TESTFRAMEWORK_DIR="$GITHUB_WORKSPACE/entservices-testframework" -if [ ! -d "$TESTFRAMEWORK_DIR" ] && [ -d "$(dirname "$GITHUB_WORKSPACE")/entservices-testframework" ]; then - TESTFRAMEWORK_DIR="$(dirname "$GITHUB_WORKSPACE")/entservices-testframework" -fi - IARMMGRS_DIR="$GITHUB_WORKSPACE/iarmmgrs" DEEPSLEEP_HAL_DIR="$GITHUB_WORKSPACE/rdk-halif-deepsleep_manager" POWER_HAL_DIR="$GITHUB_WORKSPACE/rdk-halif-power_manager" -# TODO: Remove this in a future Commit, testing things now that should be fixed in entservices-testframework directly. -# Patch testframework mocks with declarations ctrlm needs that are not yet upstream. -# We should remove as it is cleaner to just make changes to entservices-testframework directly -# device::Manager::IsInitialized (static bool member) -sed -i '/static void Initialize();/i\ inline static bool IsInitialized = false;' \ - "$TESTFRAMEWORK_DIR/Tests/mocks/devicesettings.h" -# dsAudioDucking enums (after dsAudioPortType_t) -sed -i '/^} dsAudioPortType_t;/a\ -typedef enum _dsAudioDuckingAction_t {\ - dsAUDIO_DUCKINGACTION_START = 0,\ - dsAUDIO_DUCKINGACTION_STOP = 1\ -} dsAudioDuckingAction_t;\ -\ -typedef enum _dsAudioDuckingType_t {\ - dsAUDIO_DUCKINGTYPE_ABSOLUTE = 0,\ - dsAUDIO_DUCKINGTYPE_RELATIVE = 1\ -} dsAudioDuckingType_t;' \ - "$TESTFRAMEWORK_DIR/Tests/mocks/devicesettings.h" -# AudioOutputPort::setAudioDucking (after reInitializeAudioOutputPort) -sed -i '/void reInitializeAudioOutputPort();/a\ - void setAudioDucking(dsAudioDuckingAction_t action, dsAudioDuckingType_t type, float level) {\ - (void)action;\ - (void)type;\ - (void)level;\ - }' \ - "$TESTFRAMEWORK_DIR/Tests/mocks/devicesettings.h" -# DEEPSLEEP_WAKEUPREASON_MAX (after DEEPSLEEP_WAKEUPREASON_UNKNOWN) -sed -i 's/DEEPSLEEP_WAKEUPREASON_UNKNOWN$/DEEPSLEEP_WAKEUPREASON_UNKNOWN,\n DEEPSLEEP_WAKEUPREASON_MAX/' \ - "$TESTFRAMEWORK_DIR/Tests/mocks/Iarm.h" - ############################ # 3. Create stub/empty headers for external dependencies echo "======================================================================================" diff --git a/ci/cov_build.sh b/ci/cov_build.sh index bae1cbc8..e7b9c37f 100644 --- a/ci/cov_build.sh +++ b/ci/cov_build.sh @@ -29,6 +29,7 @@ echo "building control (ctrlm-main)" XRSDK_REAL_HEADERS="$GITHUB_WORKSPACE/ci/headers/xr-voice-sdk" CTRL_STUBS="$GITHUB_WORKSPACE/ci/mocks/control" +LOCAL_TESTFRAMEWORK_MOCKS="$GITHUB_WORKSPACE/ci/mocks/testframework" MOCK_DIR="$GITHUB_WORKSPACE/entservices-testframework/Tests/mocks" MOCK_OVERRIDES="$GITHUB_WORKSPACE/ci/mocks/testframework_overrides.h" HEADERS_DIR="$GITHUB_WORKSPACE/ci/headers" @@ -68,6 +69,7 @@ cmake -G Ninja -S "$GITHUB_WORKSPACE" -B build/control \ -DCMAKE_CXX_FLAGS=" \ -I ${XRSDK_REAL_HEADERS} \ -I ${CTRL_STUBS} \ +-I ${LOCAL_TESTFRAMEWORK_MOCKS} \ -I ${MOCK_DIR} \ -I ${MOCK_DIR}/devicesettings \ -I ${HEADERS_DIR} \ @@ -83,7 +85,7 @@ cmake -G Ninja -S "$GITHUB_WORKSPACE" -B build/control \ -I /usr/include/libdrm \ -include ${MOCK_DIR}/Iarm.h \ -include ${MOCK_OVERRIDES} \ --include ${MOCK_DIR}/devicesettings.h \ +-include ${LOCAL_TESTFRAMEWORK_MOCKS}/devicesettings.h \ -include ${MOCK_DIR}/Rfc.h \ -Wall -Wno-error \ -DSAFEC_DUMMY_API \ @@ -91,6 +93,7 @@ cmake -G Ninja -S "$GITHUB_WORKSPACE" -B build/control \ -DCMAKE_C_FLAGS=" \ -I ${XRSDK_REAL_HEADERS} \ -I ${CTRL_STUBS} \ +-I ${LOCAL_TESTFRAMEWORK_MOCKS} \ -I ${MOCK_DIR} \ -I ${HEADERS_DIR} \ -I ${HEADERS_DIR}/rdk/iarmbus \ diff --git a/ci/mocks/testframework/devicesettings.h b/ci/mocks/testframework/devicesettings.h new file mode 100644 index 00000000..28927b64 --- /dev/null +++ b/ci/mocks/testframework/devicesettings.h @@ -0,0 +1,2297 @@ +/** +* If not stated otherwise in this file or this component's LICENSE +* file the following copyright and licenses apply: +* +* Copyright 2024 RDK Management +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* +**/ + +#pragma once + +#include +#include +#include +#include +#include +#include + +/* +* Copyright (c) 2007 Dave Airlie +* Copyright (c) 2007 Jakob Bornecrantz +* Copyright (c) 2008 Red Hat Inc. +* Copyright (c) 2007-2008 Tungsten Graphics, Inc., Cedar Park, TX., USA +* Copyright (c) 2007-2008 Intel Corporation +* Licensed under the MIT License +*/ +#define DRM_DISPLAY_MODE_LEN 32 +#define DRM_PROP_NAME_LEN 32 + +#define DRM_MODE_PROP_RANGE (1<<1) +#define DRM_MODE_PROP_ENUM (1<<3) /* enumerated type with text strings */ +#define DRM_MODE_PROP_BLOB (1<<4) +#define DRM_MODE_PROP_BITMASK (1<<5) /* bitmask of enumerated types */ + +#define DRM_MODE_PROP_LEGACY_TYPE ( \ + DRM_MODE_PROP_RANGE | \ + DRM_MODE_PROP_ENUM | \ + DRM_MODE_PROP_BLOB | \ + DRM_MODE_PROP_BITMASK) + +#define DRM_MODE_PROP_EXTENDED_TYPE 0x0000ffc0 + +typedef unsigned int drm_context_t; +typedef unsigned int drm_magic_t; +typedef unsigned int drm_handle_t; +typedef unsigned int drm_drawable_t; + + +#include +#include +#include +#include + +typedef enum _dsAudioPortType_t { + dsAUDIOPORT_TYPE_ID_LR, /**< RCA audio output. */ + dsAUDIOPORT_TYPE_HDMI, /**< HDMI audio output. */ + dsAUDIOPORT_TYPE_SPDIF, /**< S/PDIF audio output. */ + dsAUDIOPORT_TYPE_SPEAKER, /**< SPEAKER audio output. */ + dsAUDIOPORT_TYPE_HDMI_ARC, /** < HDMI ARC/EARC audio output. */ + dsAUDIOPORT_TYPE_HEADPHONE, /**< 3.5mm headphone jack. */ + dsAUDIOPORT_TYPE_MAX /**< Maximum index for audio port type. */ +} dsAudioPortType_t; + +typedef enum _dsAudioDuckingAction_t { + dsAUDIO_DUCKINGACTION_START = 0, + dsAUDIO_DUCKINGACTION_STOP = 1 +} dsAudioDuckingAction_t; + +typedef enum _dsAudioDuckingType_t { + dsAUDIO_DUCKINGTYPE_ABSOLUTE = 0, + dsAUDIO_DUCKINGTYPE_RELATIVE = 1 +} dsAudioDuckingType_t; + +typedef enum _dsVideoPortType_t { + dsVIDEOPORT_TYPE_RF = 0, ///< RF modulator (channel 3/4) video output + dsVIDEOPORT_TYPE_BB, ///< Baseband (composite, RCA) video output + dsVIDEOPORT_TYPE_SVIDEO, ///< S-Video video output + dsVIDEOPORT_TYPE_1394, ///< IEEE 1394 (Firewire) video output + dsVIDEOPORT_TYPE_DVI, ///< DVI (Panel-Link, HDCP) video output + dsVIDEOPORT_TYPE_COMPONENT, ///< Component video output + dsVIDEOPORT_TYPE_HDMI, ///< HDMI video output + dsVIDEOPORT_TYPE_HDMI_INPUT, ///< HDMI video input + dsVIDEOPORT_TYPE_INTERNAL, ///< Internal (integrated/internal display) video output + dsVIDEOPORT_TYPE_MAX ///< Out of range +} dsVideoPortType_t; + +typedef enum _dsAudioFormat_t { + dsAUDIO_FORMAT_NONE, + dsAUDIO_FORMAT_PCM, + dsAUDIO_FORMAT_DOLBY_AC3, + dsAUDIO_FORMAT_DOLBY_EAC3, + dsAUDIO_FORMAT_DOLBY_AC4, + dsAUDIO_FORMAT_DOLBY_MAT, + dsAUDIO_FORMAT_DOLBY_TRUEHD, + dsAUDIO_FORMAT_DOLBY_EAC3_ATMOS, + dsAUDIO_FORMAT_DOLBY_TRUEHD_ATMOS, + dsAUDIO_FORMAT_DOLBY_MAT_ATMOS, + dsAUDIO_FORMAT_DOLBY_AC4_ATMOS, + dsAUDIO_FORMAT_AAC, + dsAUDIO_FORMAT_VORBIS, + dsAUDIO_FORMAT_WMA, + dsAUDIO_FORMAT_UNKNOWN, + dsAUDIO_FORMAT_MAX /**< Maximum . */ +} dsAudioFormat_t; + +typedef enum _dsAudioCapabilities_t { + dsAUDIOSUPPORT_NONE = 0x0, + dsAUDIOSUPPORT_ATMOS = 0x01, + dsAUDIOSUPPORT_DD = 0x02, + dsAUDIOSUPPORT_DDPLUS = 0x04, + dsAUDIOSUPPORT_DAD = 0x08, + dsAUDIOSUPPORT_DAPv2 = 0x10, + dsAUDIOSUPPORT_MS12 = 0x20, + dsAUDIOSUPPORT_MS12V2 = 0x40, + dsAUDIOSUPPORT_Invalid = 0x80, +} dsAudioCapabilities_t; + +typedef enum _dsAudioARCTypes_t { + dsAUDIOARCSUPPORT_NONE = 0x0, + dsAUDIOARCSUPPORT_ARC = 0x01, + dsAUDIOARCSUPPORT_eARC = 0x02, +} dsAudioARCTypes_t; + +typedef enum _dsMS12Capabilities_t { + dsMS12SUPPORT_NONE = 0x0, + dsMS12SUPPORT_DolbyVolume = 0x01, + dsMS12SUPPORT_InteligentEqualizer = 0x02, + dsMS12SUPPORT_DialogueEnhancer = 0x04, + dsMS12SUPPORT_Invalid = 0x80, +} dsMS12Capabilities_t; + +typedef struct _dsVolumeLeveller_t { + int mode; // 0 = off, 1= on, 2= auto + int level; +} dsVolumeLeveller_t; + +typedef struct _dsSurroundVirtualizer_t { + int mode; // 0 = off, 1= on, 2= auto + int boost; +} dsSurroundVirtualizer_t; + +typedef enum StereoMode { + dsAUDIO_STEREO_UNKNOWN, /**< Unknown mode. */ + dsAUDIO_STEREO_MONO = 1, /**< Mono mode. */ + dsAUDIO_STEREO_STEREO, /**< Normal stereo mode (L+R). */ + dsAUDIO_STEREO_SURROUND, /**< Surround mode. */ + dsAUDIO_STEREO_PASSTHRU, /**< Passthrough mode. */ + dsAUDIO_STEREO_DD, /**< Dolby Digital. */ + dsAUDIO_STEREO_DDPLUS, /**< Dolby Digital Plus. */ + dsAUDIO_STEREO_MAX /**< Maximum index for audio stereo types. */ +} dsAudioStereoMode_t; + +typedef enum _dsATMOSCapability_t { + dsAUDIO_ATMOS_NOTSUPPORTED = 0, /**< ATMOS audio not supported */ + dsAUDIO_ATMOS_DDPLUSSTREAM, /**< can handle dd plus stream which is only way to pass ATMOS metadata */ + dsAUDIO_ATMOS_ATMOSMETADATA, /**< capable of parsing ATMOS metadata */ +} dsATMOSCapability_t; + +typedef enum _dsAudioInput_t +{ + dsAUDIO_INPUT_PRIMARY = 0, /**< Primary Audio Input is main audio input provided to audio mixer */ + dsAUDIO_INPUT_SYSTEM, /**< System Audio Input to audio mixer , e.g Beep Sounds */ + dsAUDIO_INPUT_MAX /**< Out of range */ +} dsAudioInput_t; + +typedef enum _dsHdcpProtocolVersion_t { + dsHDCP_VERSION_1X = 0, /**< HDCP Protocol version 1.x */ + dsHDCP_VERSION_2X, /**< HDCP Protocol version 2.x */ + dsHDCP_VERSION_MAX /**< Maximum index for HDCP protocol. */ +} dsHdcpProtocolVersion_t; + +typedef enum _dsHdcpStatus_t { + dsHDCP_STATUS_UNPOWERED = 0, /**< Connected Sink Device does not support HDCP */ + dsHDCP_STATUS_UNAUTHENTICATED, /**< HDCP Authentication Process is not initiated */ + dsHDCP_STATUS_AUTHENTICATED, /**< HDCP Authentication Process is initiated and Passed */ + dsHDCP_STATUS_AUTHENTICATIONFAILURE, /**< HDCP Authentication Failure or Link Integroty Failure */ + dsHDCP_STATUS_INPROGRESS, /**< HDCP Authentication in Progress */ + dsHDCP_STATUS_PORTDISABLED, /**< HDMI output port disabled */ + dsHDCP_STATUS_MAX /**< Maximum index for HDCP status. */ +} dsHdcpStatus_t; + +typedef enum _dsVideoResolution_t { + dsVIDEO_PIXELRES_720x480, /**< 720x480 Resolution. */ + dsVIDEO_PIXELRES_720x576, /**< 720x576 Resolution. */ + dsVIDEO_PIXELRES_1280x720, /**< 1280x720 Resolution. */ + dsVIDEO_PIXELRES_1920x1080, /**< 1920x1080 Resolution. */ + dsVIDEO_PIXELRES_3840x2160, /**< 3840x2160 Resolution. */ + dsVIDEO_PIXELRES_4096x2160, /**< 3840x2160 Resolution. */ + dsVIDEO_PIXELRES_MAX /**< Maximum index for Video ouptut resolutions. */ +} dsVideoResolution_t; + +// typedef enum _dsTVResolution_t { +// dsTV_RESOLUTION_480i = 0x0001, /**< 480i Resolution. */ +// dsTV_RESOLUTION_480p = 0x0002, /**< 480p Resolution. */ +// dsTV_RESOLUTION_576i = 0x0004, /**< 576p Resolution. */ +// dsTV_RESOLUTION_576p = 0x0008, /**< 576p Resolution. */ +// dsTV_RESOLUTION_720p = 0x0010, /**< 720p Resolution. */ +// dsTV_RESOLUTION_1080i = 0x0020, /**< 1080i Resolution. */ +// dsTV_RESOLUTION_1080p = 0x0040, /**< 1080p Resolution. */ +// dsTV_RESOLUTION_2160p30 = 0x0080, /**< 2160p30 Resolution. */ +// dsTV_RESOLUTION_2160p60 = 0x0100, /**< 2160p60 Resolution. */ +// } dsTVResolution_t; + +typedef enum _dsTVResolution_t { + dsTV_RESOLUTION_480i = 0x0001, + dsTV_RESOLUTION_480p = 0x0002, + dsTV_RESOLUTION_576i = 0x0004, + dsTV_RESOLUTION_576p = 0x0008, + dsTV_RESOLUTION_576p50 = 0x0010, + dsTV_RESOLUTION_720p = 0x0020, + dsTV_RESOLUTION_720p50 = 0x0040, + dsTV_RESOLUTION_1080i = 0x0080, + dsTV_RESOLUTION_1080p = 0x0100, + dsTV_RESOLUTION_1080p24 = 0x0200, + dsTV_RESOLUTION_1080p25 = 0x0400, + dsTV_RESOLUTION_1080i25 = 0x0800, + dsTV_RESOLUTION_1080p30 = 0x1000, + dsTV_RESOLUTION_1080i50 = 0x2000, + dsTV_RESOLUTION_1080p50 = 0x4000, + dsTV_RESOLUTION_1080p60 = 0x8000, + dsTV_RESOLUTION_2160p24 = 0x10000, + dsTV_RESOLUTION_2160p25 = 0x20000, + dsTV_RESOLUTION_2160p30 = 0x40000, + dsTV_RESOLUTION_2160p50 = 0x80000, + dsTV_RESOLUTION_2160p60 = 0x100000, +} dsTVResolution_t; + +typedef enum _dsVideoFrameRate_t { + dsVIDEO_FRAMERATE_UNKNOWN, /**< Unknown frame rate. */ + dsVIDEO_FRAMERATE_24, /**< Played at 24 frames per second. */ + dsVIDEO_FRAMERATE_25, /**< Played at 25 frames per second. */ + dsVIDEO_FRAMERATE_30, /**< Played at 30 frames per second. */ + dsVIDEO_FRAMERATE_60, /**< Played at 60 frames per second. */ + dsVIDEO_FRAMERATE_23dot98, /**< Played at 23.98 frames per second. */ + dsVIDEO_FRAMERATE_29dot97, /**< Played at 29.97 frames per second. */ + dsVIDEO_FRAMERATE_50, /**< Played at 50 frames per second. */ + dsVIDEO_FRAMERATE_59dot94, /**< Played at 59.94 frames per second. */ + dsVIDEO_FRAMERATE_100, /**< Played at 100 frames per second. */ + dsVIDEO_FRAMERATE_119dot88, /**< Played at 119.88 frames per second. */ + dsVIDEO_FRAMERATE_120, /**< Played at 120 frames per second. */ + dsVIDEO_FRAMERATE_200, /**< Played at 200 frames per second. */ + dsVIDEO_FRAMERATE_239dot76, /**< Played at 23.76 frames per second. */ + dsVIDEO_FRAMERATE_240, /**< Played at 240 frames per second. */ + dsVIDEO_FRAMERATE_MAX /**< Maximum index for video frame rates. */ +} dsVideoFrameRate_t; + +typedef enum _dsVideoZoom_t { + dsVIDEO_ZOOM_UNKNOWN = -1, /**< Unknown mode. */ + dsVIDEO_ZOOM_NONE = 0, /**< Decoder format conversion is inactive. */ + dsVIDEO_ZOOM_FULL, /**< Full screen (16:9 video is streched to fit 4:3 frame). */ + dsVIDEO_ZOOM_LB_16_9, /**< 16:9 Letterbox (16:9 video is placed in a 4:3 frame with a full letterbox effect). */ + dsVIDEO_ZOOM_LB_14_9, /**< 14:9 Letterbox (16:9 video is transferred into a 4:3 frame with 14:9 letterbox effect). */ + dsVIDEO_ZOOM_CCO, /**< Center Cut-out (16:9 video is cut to fill 4:3 frame with its center part). */ + dsVIDEO_ZOOM_PAN_SCAN, /**< Pan & Scan (16:9 is cut and panned to fille 4:3 frame, following MPEG pan & scan vectors). */ + dsVIDEO_ZOOM_LB_2_21_1_ON_4_3, /**< 2.21:1 Letterbox on 4:3 (video is transferred into 4:3 frame with a 2.21:1 letterbox effect). */ + dsVIDEO_ZOOM_LB_2_21_1_ON_16_9, /**< 2.21:1 Letterbox on 16:9 (video is transferred into 16:9 frame with a 2.21:1 letterbox effect). */ + dsVIDEO_ZOOM_PLATFORM, /**< Control over the decoder format conversions is managed by the platform. */ + dsVIDEO_ZOOM_16_9_ZOOM, /**< 16:9 Zoom (4:3 video is zoomed to fill 16:9 frame). */ + dsVIDEO_ZOOM_PILLARBOX_4_3, /**< Pillarbox 4:3 (4:3 video is placed in a 16:9 frame with a pillarbox effect) */ + dsVIDEO_ZOOM_WIDE_4_3, /**< Wide 4:3 (4:3 video is stretched to fill 16:9 frame). */ + dsVIDEO_ZOOM_MAX /**< Maximum index for screen zoom modes. */ +} dsVideoZoom_t; + +typedef enum _dsVideoAspectRatio_t { + dsVIDEO_ASPECT_RATIO_4x3, /**< 4:3 aspect ratio. */ + dsVIDEO_ASPECT_RATIO_16x9, /**< 16:9 aspect ratio. */ + dsVIDEO_ASPECT_RATIO_MAX /**< Maximum index for video aspect ratios. */ +} dsVideoAspectRatio_t; + +typedef enum _dsVideoStereoScopicMode_t { + dsVIDEO_SSMODE_UNKNOWN = 0, /**< Unknown mode. */ + dsVIDEO_SSMODE_2D, /**< 2D mode. */ + dsVIDEO_SSMODE_3D_SIDE_BY_SIDE, /**< 3D side by side (L/R) stereo mode. */ + dsVIDEO_SSMODE_3D_TOP_AND_BOTTOM, /**< 3D top & bottom stereo mode. */ + dsVIDEO_SSMODE_MAX /**< Maximum index for video stereoscopic modes. */ +} dsVideoStereoScopicMode_t; + +typedef struct _dsVideoPortResolution_t { + char name[32]; /**< Name the resolution (e.g. 480i, 480p, 1080p24). */ + dsVideoResolution_t pixelResolution; /**< The resolution associated with the name. */ + dsVideoAspectRatio_t aspectRatio; /**< The associated aspect ratio. */ + dsVideoStereoScopicMode_t stereoScopicMode; /**< The associated stereoscopic mode. */ + dsVideoFrameRate_t frameRate; /**< The associated frame rate. */ + bool interlaced; /**< The associated scan mode(@a true if interlaced, @a false if progressive). */ +} dsVideoPortResolution_t; + +typedef enum _dsHDRStandard_t { + dsHDRSTANDARD_NONE = 0x0, + dsHDRSTANDARD_HDR10 = 0x01, + dsHDRSTANDARD_HLG = 0x02, + dsHDRSTANDARD_DolbyVision = 0x04, + dsHDRSTANDARD_TechnicolorPrime = 0x08, + dsHDRSTANDARD_HDR10PLUS = 0x10, + dsHDRSTANDARD_SDR = 0x20, + dsHDRSTANDARD_Invalid = 0x80, +} dsHDRStandard_t; + +typedef enum _dsSURROUNDMode_t { + dsSURROUNDMODE_NONE = 0x0, + dsSURROUNDMODE_DD = 0x1, + dsSURROUNDMODE_DDPLUS = 0x2, +} dsSURROUNDMode_t; + +typedef enum _dsDisplayColorDepth_t { + dsDISPLAY_COLORDEPTH_UNKNOWN = 0x0, /* Unknown color depth */ + dsDISPLAY_COLORDEPTH_8BIT = 0x01, /* 8 bit color depth */ + dsDISPLAY_COLORDEPTH_10BIT = 0x02, /* 10 bit color depth */ + dsDISPLAY_COLORDEPTH_12BIT = 0x04, /* 12 bit color depth */ + dsDISPLAY_COLORDEPTH_AUTO = 0x08 /* Automatic color depth */ +} dsDisplayColorDepth_t; + +typedef enum _dsHdmiInPort_t { + dsHDMI_IN_PORT_NONE = -1, + dsHDMI_IN_PORT_0, + dsHDMI_IN_PORT_1, + dsHDMI_IN_PORT_2, + dsHDMI_IN_PORT_MAX +} dsHdmiInPort_t; + +typedef enum _dsHdmiInSignalStatus_t { + dsHDMI_IN_SIGNAL_STATUS_NONE = -1, + dsHDMI_IN_SIGNAL_STATUS_NOSIGNAL, + dsHDMI_IN_SIGNAL_STATUS_UNSTABLE, + dsHDMI_IN_SIGNAL_STATUS_NOTSUPPORTED, + dsHDMI_IN_SIGNAL_STATUS_STABLE, + dsHDMI_IN_SIGNAL_STATUS_MAX +} dsHdmiInSignalStatus_t; + +typedef enum dsAviContentType { + dsAVICONTENT_TYPE_GRAPHICS, /*!< Content type Graphics. - ITC=1, CN1=0, CN0=0 */ + dsAVICONTENT_TYPE_PHOTO, /*!< Content type Photo - ITC=1, CN1=0, CN0=1 */ + dsAVICONTENT_TYPE_CINEMA, /*!< Content type Cinema - ITC=1, CN1=1, CN0=0 */ + dsAVICONTENT_TYPE_GAME, /*!< Content type Game - ITC=1, CN1=1, CN0=1 */ + dsAVICONTENT_TYPE_NOT_SIGNALLED,/*!< Content type no data - ITC=0, CN1=0, CN0=0 */ + dsAVICONTENT_TYPE_MAX, /*!< Out of range */ +}dsAviContentType_t; + +struct dsSpd_infoframe_st { + uint8_t pkttype; + uint8_t version; + uint8_t length; /*length=25*/ + uint8_t rsd; + uint8_t checksum; + /*Vendor Name Character*/ + uint8_t vendor_name[8]; + /*Product Description Character*/ + uint8_t product_des[16]; + /*byte 25*/ + uint8_t source_info; +}; + +typedef enum tv_hdmi_edid_version_e { + HDMI_EDID_VER_14 = 0, + HDMI_EDID_VER_20, + HDMI_EDID_VER_MAX, +} tv_hdmi_edid_version_t; + +typedef enum _dsAudioPortState { + dsAUDIOPORT_STATE_UNINITIALIZED, + dsAUDIOPORT_STATE_INITIALIZED, + dsAUDIOPORT_STATE_MAX +} dsAudioPortState_t; + +typedef enum { + dsERR_NONE = 0, ///< Input output operation is successful + dsERR_GENERAL = 1, ///< Operation general error. + dsERR_INVALID_PARAM, ///< Invalid parameter is passed to the module + dsERR_INVALID_STATE, ///< Module is in an invalid state + dsERR_ALREADY_INITIALIZED, ///< Module is already initialised + dsERR_NOT_INITIALIZED, ///< Module is not initialised + dsERR_OPERATION_NOT_SUPPORTED, ///< Operation not supported + dsERR_RESOURCE_NOT_AVAILABLE, ///< Resources have failed to allocate + dsERR_OPERATION_FAILED, ///< The attempted operation has failed. Used when a SoC call has a failure + dsErr_MAX +} dsError_t; + +#define MAX_LANGUAGE_LEN 10 +#define DSMGR_MAX_VIDEO_PORT_NAME_LENGTH 128 + +typedef struct { + bool isEnabled; + bool result; + char port[DSMGR_MAX_VIDEO_PORT_NAME_LENGTH]; + } dsMgrStandbyVideoStateParam_t; + +typedef struct { + bool result; + bool isEnabled; + char port[DSMGR_MAX_VIDEO_PORT_NAME_LENGTH]; + } IARM_Bus_PWRMgr_StandbyVideoState_Param_t; + +typedef enum _dsSleepMode_t { + dsHOST_SLEEP_MODE_LIGHT, /**< Light sleep mode. */ + dsHOST_SLEEP_MODE_DEEP, /**< Deep sleep mode. */ + dsHOST_SLEEP_MODE_MAX, /**< Maximum index for sleep modes */ +} dsSleepMode_t; + +typedef enum __dsFPDTimeFormat_t { + dsFPD_TIME_12_HOUR, /**< 12 hour time format. */ + dsFPD_TIME_24_HOUR, /**< 24 hour time format. */ + dsFPD_TIME_STRING /**< Text string. */ +} dsFPDTimeFormat_t; + +typedef enum _dsCompInSignalStatus_t { + dsCOMP_IN_SIGNAL_STATUS_NONE = -1, + dsCOMP_IN_SIGNAL_STATUS_NOSIGNAL, + dsCOMP_IN_SIGNAL_STATUS_UNSTABLE, + dsCOMP_IN_SIGNAL_STATUS_NOTSUPPORTED, + dsCOMP_IN_SIGNAL_STATUS_STABLE, + dsCOMP_IN_SIGNAL_STATUS_MAX +} dsCompInSignalStatus_t; + +typedef enum _dsCompositeInPort_t { + dsCOMPOSITE_IN_PORT_NONE = -1, + dsCOMPOSITE_IN_PORT_0, + dsCOMPOSITE_IN_PORT_1, + dsCOMPOSITE_IN_PORT_MAX +} dsCompositeInPort_t; + +typedef enum dsHdmiMaxCapabilityVersion{ + HDMI_COMPATIBILITY_VERSION_14 = 0, /*!< Hdmi Compatibility Version 1.4 */ + HDMI_COMPATIBILITY_VERSION_20, /*!< Hdmi Compatibility Version 2.0 */ + HDMI_COMPATIBILITY_VERSION_21, /*!< Hdmi Compatibility Version 2.1 */ + HDMI_COMPATIBILITY_VERSION_MAX /*!< Out of bounds */ + }dsHdmiMaxCapabilityVersion_t; + +typedef enum dsVRRType { + dsVRR_NONE, + dsVRR_HDMI_VRR, + dsVRR_AMD_FREESYNC, + dsVRR_AMD_FREESYNC_PREMIUM, + dsVRR_AMD_FREESYNC_PREMIUM_PRO +} dsVRRType_t; + +typedef enum _dsAVIScanInformation_t { + dsAVI_SCAN_TYPE_NO_DATA = 0, ///< No data signalling - S1=0, S0=0 + dsAVI_SCAN_TYPE_OVERSCAN = 1, ///< Overscan signalling - S1=0, S0=1 + dsAVI_SCAN_TYPE_UNDERSCAN = 2, ///< Underscan signalling - S1=1, S0=0 + dsAVI_SCAN_TYPE_MAX ///< Out of range +} dsAVIScanInformation_t; + +typedef struct _dsHdmiInVrrStatus_t +{ + dsVRRType_t vrrType; /*! Type of VRR */ + double vrrAmdfreesyncFramerate_Hz; /*! Display VRR FrameRate in Hz */ +} dsHdmiInVrrStatus_t; + +/*! DS Manager Event Data */ +typedef struct _DSMgr_EventData_t { + union { + struct _RESOLUTION_DATA { + /* Declare Event Data structure for Video resolution Event */ + int width; /*!< Resolution Width */ + int height; /*!< Key code */ + } resn; /*Reolution data*/ + struct _DFC_DATA { + /* Declare Event Data structure for Zoom settings Event */ + int zoomsettings; + } dfc; /*zoom data*/ + + struct _AUDIOMODE_DATA { + /* Declare Event Data structure for Video resolution Event */ + int type; /*!< device type */ + int mode; /*!< device mode */ + } Audioport; /*Audio mode data*/ + + struct _ATMOS_CAPS_CHANGE { + dsATMOSCapability_t caps; + bool status; + } AtmosCapsChange; + + struct _HDMI_HPD_DATA { + /* Declare HDMI HPD Data */ + int event; + } hdmi_hpd; /*HDMI Hot Plug detect*/ + + struct _HDMI_HDCP_DATA { + /* Declare HDMI DCP Data */ + int hdcpStatus; + } hdmi_hdcp; /*HDMI HDCP Hot Plug detect*/ + + struct _HDMI_RXSENSE_DATA { + /* Declare HDMI Rx Sense status */ + int status; + } hdmi_rxsense; /*HDMI Rx Sense Data*/ + + struct _HDMI_IN_CONNECT_DATA { + dsHdmiInPort_t port; + bool isPortConnected; + } hdmi_in_connect; + + struct _HDMI_IN_STATUS_DATA { + /* Declare HDMI Input status*/ + dsHdmiInPort_t port; + bool isPresented; + } hdmi_in_status; /*HDMI in status change detect*/ + + struct _HDMI_IN_SIG_STATUS_DATA { + /* Declare HDMI In signal status*/ + dsHdmiInPort_t port; + dsHdmiInSignalStatus_t status; + } hdmi_in_sig_status; /*HDMI in signal change detect*/ + + struct _HDMI_IN_VIDEO_MODE_DATA { + /* Declare HDMI In signal status*/ + dsHdmiInPort_t port; + dsVideoPortResolution_t resolution; + } hdmi_in_video_mode; /*HDMI in video mode update*/ + + struct _COMPOSITE_IN_CONNECT_DATA { + dsCompositeInPort_t port; + bool isPortConnected; + } composite_in_connect; + + struct _COMPOSITE_IN_STATUS_DATA { + /* Declare Composite Input status*/ + dsCompositeInPort_t port; + bool isPresented; + } composite_in_status; /*Composite in status change detect*/ + + struct _COMPOSITE_IN_SIG_STATUS_DATA { + /* Declare Composite In signal status*/ + dsCompositeInPort_t port; + dsCompInSignalStatus_t status; + } composite_in_sig_status; /*Composite in signal change detect*/ + + struct _COMPOSITE_IN_VIDEO_MODE_DATA{ + /* Declare COMPOSITE In Video Mode*/ + dsCompositeInPort_t port; + dsVideoPortResolution_t resolution; + }composite_in_video_mode; /*Composite in video mode update*/ + + struct _FPD_TIME_FORMAT { + dsFPDTimeFormat_t eTimeFormat; + } FPDTimeFormat; + + struct _HDCP_PROTOCOL_DATA { + dsHdcpProtocolVersion_t protocolVersion; + } HDCPProtocolVersion; + struct _SLEEP_MODE_DATA { + dsSleepMode_t sleepMode; + } sleepModeInfo; + + struct _AUDIO_LEVEL_DATA { + int level; + } AudioLevelInfo; + + struct _AUDIO_OUT_CONNECT_DATA { + dsAudioPortType_t portType; + unsigned int uiPortNo; + bool isPortConnected; + } audio_out_connect; + + struct _AUDIO_FORMAT_DATA { + dsAudioFormat_t audioFormat; + } AudioFormatInfo; + + struct _LANGUAGE_DATA { + char audioLanguage[MAX_LANGUAGE_LEN]; + } AudioLanguageInfo; + + struct _FADER_CONTROL_DATA { + int mixerbalance; + } FaderControlInfo; + + struct _ASSOCIATED_AUDIO_MIXING_DATA { + bool mixing; + } AssociatedAudioMixingInfo; + + struct _VIDEO_FORMAT_DATA { + dsHDRStandard_t videoFormat; + } VideoFormatInfo; + + struct _AUDIO_PORTSTATE_DATA { + dsAudioPortState_t audioPortState; + } AudioPortStateInfo; + + struct _HDMI_IN_ALLM_MODE_DATA { + /* Declare HDMI In ALLM Mode*/ + dsHdmiInPort_t port; + bool allm_mode; + } hdmi_in_allm_mode; /*HDMI in ALLM Mode change*/ + + struct _HDMI_IN_VRR_MODE_DATA{ + /* Declare HDMI In VRR Mode*/ + dsHdmiInPort_t port; + dsVRRType_t vrr_type; + }hdmi_in_vrr_mode; /*HDMI in VRR Mode change*/ + + struct _HDMI_IN_CONTENT_TYPE_DATA{ + dsHdmiInPort_t port; + dsAviContentType_t aviContentType; + }hdmi_in_content_type; + struct _HDMI_IN_AV_LATENCY{ + int audio_output_delay; + int video_latency; + }hdmi_in_av_latency; /*HDMI in AVLatency change*/ + struct _DISPLAY_FRAMERATE_CHANGE { + char framerate[20]; + }DisplayFrameRateChange; + } data; +} IARM_Bus_DSMgr_EventData_t; + +typedef enum _dsDisplayEvent_t { + dsDISPLAY_EVENT_CONNECTED = 0, //!< Display connected event. + dsDISPLAY_EVENT_DISCONNECTED, //!< Display disconnected event. + dsDISPLAY_RXSENSE_ON, //!< Rx Sense ON event + dsDISPLAY_RXSENSE_OFF, //!< Rx Sense OFF event + dsDISPLAY_HDCPPROTOCOL_CHANGE, //!< HDCP Protocol Version Change event + dsDISPLAY_EVENT_MAX +} dsDisplayEvent_t; + +typedef enum _dsDisplayColorSpace_t +{ + dsDISPLAY_COLORSPACE_UNKNOWN = 0, ///< Unknown color space + dsDISPLAY_COLORSPACE_RGB = 1, ///< RGB color space + dsDISPLAY_COLORSPACE_YCbCr422 = 2, ///< YCbCr4.2.2 color space + dsDISPLAY_COLORSPACE_YCbCr444 = 3, ///< YCbCr4.4.4 color space + dsDISPLAY_COLORSPACE_YCbCr420 = 4, ///< YCbCr4.2.0 color space + dsDISPLAY_COLORSPACE_AUTO = 5, ///< Automatic color space + dsDISPLAY_COLORSPACE_MAX ///< Out of range +} dsDisplayColorSpace_t; + +typedef enum _dsDisplayQuantizationRange_t +{ + dsDISPLAY_QUANTIZATIONRANGE_UNKNOWN = 0, ///< Unknown quantization range + dsDISPLAY_QUANTIZATIONRANGE_LIMITED = 1, ///< Limited quantization range + dsDISPLAY_QUANTIZATIONRANGE_FULL = 2, ///< Full quantization range + dsDISPLAY_QUANTIZATIONRANGE_MAX ///< Out of range +} dsDisplayQuantizationRange_t; + +typedef uint32_t dsFPDColor_t; +#define dsFPDColor_Make(R8,G8,B8) (((R8)<< 8)|((G8)<<8)|((B8) )) +#define dsFPD_COLOR_WHITE dsFPDColor_Make(0xFF, 0xFF, 0xFF) + +typedef struct _dsFPDColorConfig_t{ + int id; + dsFPDColor_t color; +}dsFPDColorConfig_t; + +namespace device { + +template +using List = std::vector; + +} + +namespace device { + +class Exception : public std::exception { + int _err; + std::string _msg; + +public: + Exception(const char* msg = "No Message for this exception") throw() + : _msg(msg) + { + } + + Exception(int err, const char* msg = "No Message for this Exception") throw() + : _err(err) + , _msg(msg){}; + + virtual const std::string& getMessage() const + { + return _msg; + } + + virtual int getCode() const + { + return _err; + } + + virtual const char* what() const throw() + { + return _msg.c_str(); + } + + virtual ~Exception() throw(){}; +}; + +} + +namespace device { +class AudioStereoModeImpl { +public: + virtual ~AudioStereoModeImpl() = default; + virtual const std::string& getName() const = 0; + + virtual std::string toString() = 0; + +}; + +class AudioStereoMode { +protected: + static AudioStereoModeImpl* impl; + int audioMode; + +public: + AudioStereoMode(); + static void setImpl(AudioStereoModeImpl* newImpl); + const std::string& getName() const; + + static const int kMono; //!< Indicates audio mode of type mono. + static const int kStereo; //!< Indicates audio mode of type stereo. + static const int kSurround; //!< Indicates audio mode of type surround. + static const int kPassThru; //!< Indicates audio mode of type pass through. + static const int kDD; //!< Indicates audio mode of type dolby digital. + static const int kDDPlus; //!< Indicates audio mode of type dolby digital plus. + static const int kMax; //!< Indicates maximum number of audio modes supported. + + bool operator==(const AudioStereoMode& other) const { + return audioMode == other.audioMode; + } + AudioStereoMode& operator=(int mode) { + audioMode = mode; + return *this; +} + + std::string toString(); + AudioStereoMode(int id); +}; + +} + +namespace device { + +class AudioOutputPortTypeImpl { +public: + virtual ~AudioOutputPortTypeImpl() = default; + + virtual int getId() const = 0; +}; + +class AudioOutputPortType { +protected: + static AudioOutputPortTypeImpl* impl; + +public: + AudioOutputPortType(); + static void setImpl(AudioOutputPortTypeImpl* newImpl); + + static const int kHDMI; + static const int kARC; + static const int kSPDIF; + static const int kSPEAKER; + static const int kHEADPHONE; + int getId() const; + + +}; + +} +namespace device { + +class AudioOutputPortImpl { +public: + virtual ~AudioOutputPortImpl() = default; + + virtual const AudioOutputPortType& getType() const = 0; + + virtual const std::string& getName() const = 0; + virtual std::vector getMS12AudioProfileList() const = 0; + virtual void getAudioCapabilities(int* capabilities) = 0; + virtual void getMS12Capabilities(int* capabilities) = 0; + virtual bool isAudioMSDecode() const = 0; + + virtual bool getEnablePersist() = 0; + virtual void getHdmiArcPortId(int *portId) = 0; + virtual bool isConnected() = 0; + virtual void setDRCMode(int DRCMode) = 0; + virtual void setCompression (int compresionLevel) = 0; + virtual int getCompression() = 0; + virtual void setDolbyVolumeMode(bool dolbyVolumeMode) = 0; + virtual void setDialogEnhancement(int enhancerlevel) = 0; + virtual int getDialogEnhancement() = 0; + virtual void resetDialogEnhancement() = 0; + virtual void setIntelligentEqualizerMode (int intelligentEqualizerMode) = 0; + virtual int getIntelligentEqualizerMode() = 0; + virtual void setGraphicEqualizerMode (int graphicEqualizerMode) = 0; + virtual int getGraphicEqualizerMode() = 0; + virtual void setMS12AudioProfile(std::string audioProfileName) = 0; + virtual void resetVolumeLeveller() = 0; + virtual void resetSurroundVirtualizer() = 0; + virtual void resetBassEnhancer() = 0; + virtual void getSupportedARCTypes(int *types) = 0; + virtual void setEnablePersist(bool pEnable) = 0; + virtual dsError_t setEnablePort(bool pEnable) = 0; + virtual bool isMuted() = 0; + virtual void setAudioAtmosOutputMode (int enable) = 0; + virtual bool getSinkDeviceAtmosCapability(dsATMOSCapability_t& atmosCapability) = 0; + virtual void setAudioDelayOffset(int audioDelayOffsetMs) = 0; + virtual void setAudioDelay(int audioDelayMs) = 0; + virtual void getAudioDelay(uint32_t audioDelayMs) = 0; + virtual void getSecondaryLanguage(std::string secondaryLanguage) = 0; + virtual void setSecondaryLanguage(std::string secondaryLanguage) = 0; + virtual void setPrimaryLanguage(std::string primaryLanguage) = 0; + virtual void getPrimaryLanguage(std::string primaryLanguage) = 0; + virtual void getFaderControl(int *mixerBalance) = 0; + virtual void setFaderControl(int mixerBalance) = 0; + virtual void setAssociatedAudioMixing(bool mixing) = 0; + virtual void setGain(float newGain) = 0; + virtual void setMISteering(bool MISteering) = 0; + virtual void setSurroundVirtualizer(dsSurroundVirtualizer_t surroundVirtualizer) = 0; + virtual void setBassEnhancer(int bassBoost) = 0; + virtual void enableSurroundDecoder(bool enableSurroundDecoder) = 0; + virtual void setVolumeLeveller(dsVolumeLeveller_t volumeLeveller) = 0; + virtual bool getMISteering() = 0; + virtual dsSurroundVirtualizer_t getSurroundVirtualizer() = 0; + virtual int getDRCMode() = 0; + virtual float getLevel() = 0; + virtual float getGain() = 0; + virtual bool isSurroundDecoderEnabled() = 0; + virtual int getBassEnhancer() = 0; + virtual dsVolumeLeveller_t getVolumeLeveller() = 0; + virtual bool getStereoAuto() = 0; + virtual void setStereoAuto(bool stereoAuto, bool persist) = 0; + virtual std::string getMS12AudioProfile() = 0; + virtual void setMS12AudioProfileSetttingsOverride(std::string audioProfileState,std::string audioProfileName,std::string audioProfileSettingsName, std::string audioProfileSettingValue) = 0; + virtual void setLevel(float level) = 0; + virtual void setMuted(bool muted) = 0; + virtual void getAssociatedAudioMixing(bool *mixing) = 0; + virtual bool isEnabled() = 0; + virtual void setSAD(std::vector sad_list) = 0; + virtual void reInitializeAudioOutputPort() = 0; + virtual void getAudioDelayOffset (uint32_t audioDelayOffsetMs) = 0; + // virtual const List getSupportedStereoModes() const = 0; + virtual std::vector getSupportedStereoModes() const = 0; + + + + + virtual AudioStereoMode getStereoMode(const bool toPersist) const= 0; + + virtual AudioStereoMode getStereoMode() const= 0; + + + virtual void enableARC(dsAudioARCTypes_t type, bool enable) = 0; + + virtual uint32_t getDolbyVolumeMode() const = 0; + + virtual void setStereoMode(const std::string &mode, bool persist) = 0; + + +}; + +class AudioOutputPort { +protected: + static AudioOutputPortImpl* impl; + +public: + AudioOutputPort(); + static void setImpl(AudioOutputPortImpl* newImpl); + static AudioOutputPort& getInstance(); + + const AudioOutputPortType& getType() const; + + // dsATMOSCapability_t atmosCapability=dsATMOSCapability_t::dsAUDIO_ATMOS_ATMOSMETADATA; + const std::string& getName() const; + std::vector getMS12AudioProfileList() const; + void getAudioCapabilities(int* capabilities); + void getMS12Capabilities(int* capabilities); + bool isAudioMSDecode(); + void reInitializeAudioOutputPort(); + bool getEnablePersist(); + void getHdmiArcPortId(int *portId); + bool isConnected(); + + int getDRCMode(); + void setDRCMode(int DRCMode); + void setCompression (int compresionLevel); + int getCompression(); + void setDolbyVolumeMode(bool dolbyVolumeMode); + + void setDialogEnhancement(int enhancerlevel); + int getDialogEnhancement(); + void setIntelligentEqualizerMode (int intelligentEqualizerMode); + int getIntelligentEqualizerMode(); + void setGraphicEqualizerMode (int graphicEqualizerMode); + int getGraphicEqualizerMode(); + void setMS12AudioProfile(std::string audioProfileName); + void resetVolumeLeveller(); + void resetSurroundVirtualizer(); + void resetBassEnhancer(); + void resetDialogEnhancement(); + void getSupportedARCTypes(int *types); + void setEnablePersist(bool pEnable); + dsError_t setEnablePort(bool pEnable); + bool isMuted(); + void setAudioAtmosOutputMode (int enable); + bool getSinkDeviceAtmosCapability(dsATMOSCapability_t& atmosCapability); + void setAudioDelayOffset(int audioDelayOffsetMs); + void setAudioDelay(int audioDelayMs); + void getAudioDelay(uint32_t audioDelayMs); + void getSecondaryLanguage(std::string secondaryLanguage); + void setSecondaryLanguage(std::string secondaryLanguage); + void setPrimaryLanguage(std::string primaryLanguage); + void getPrimaryLanguage(std::string primaryLanguage); + void getFaderControl(int *mixerBalance); + void setFaderControl(int mixerBalance); + void setAssociatedAudioMixing(bool mixing); + void setGain(float newGain); + void setMISteering(bool MISteering); + void setSurroundVirtualizer(dsSurroundVirtualizer_t surroundVirtualizer); + void setBassEnhancer(int bassBoost); + void enableSurroundDecoder(bool enableSurroundDecoder); + void setVolumeLeveller(dsVolumeLeveller_t volumeLeveller); + bool getMISteering(); + dsSurroundVirtualizer_t getSurroundVirtualizer(); + float getLevel(); + float getGain(); + bool isSurroundDecoderEnabled(); + int getBassEnhancer(); + dsVolumeLeveller_t getVolumeLeveller(); + bool getStereoAuto(); + void setStereoAuto(bool stereoAuto, bool persist); + std::string getMS12AudioProfile(); + void setMS12AudioProfileSetttingsOverride(std::string audioProfileState,std::string audioProfileName,std::string audioProfileSettingsName, std::string audioProfileSettingValue); + void setLevel(float level); + void setMuted(bool muted); + void getAssociatedAudioMixing(bool *mixing); + bool isEnabled(); + void setSAD(std::vector sad_list); + void getAudioDelayOffset (uint32_t audioDelayOffsetMs); + + // const List getSupportedStereoModes() const; + const std::vector getSupportedStereoModes() const; + + AudioStereoMode getStereoMode(const bool toPersist) const; + + AudioStereoMode getStereoMode() const; + + void enableARC(dsAudioARCTypes_t type, bool enable); + uint32_t getDolbyVolumeMode() const; + void setStereoMode(const std::string &mode, bool persist); + void setAudioDucking(dsAudioDuckingAction_t action, dsAudioDuckingType_t type, float level) { + (void)action; + (void)type; + (void)level; + } + + + + +}; + +} + +namespace device { +class CompositeInputImpl { +public: + virtual ~CompositeInputImpl() = default; + virtual uint8_t getNumberOfInputs() const = 0; + virtual bool isPortConnected(int8_t Port) const = 0; + virtual void selectPort(int8_t Port) const = 0; + virtual void scaleVideo(int32_t x, int32_t y, int32_t width, int32_t height) const = 0; +}; + +class CompositeInput { +protected: + static CompositeInputImpl* impl; + +public: + CompositeInput(); + static void setImpl(CompositeInputImpl* newImpl); + static CompositeInput& getInstance(); + + uint8_t getNumberOfInputs() const; + bool isPortConnected(int8_t port) const; + void selectPort(int8_t port) const; + void scaleVideo(int32_t x, int32_t y, int32_t width, int32_t height) const; +}; + +} + +namespace device { + +class HdmiInputImpl { +public: + virtual ~HdmiInputImpl() = default; + + virtual uint8_t getNumberOfInputs() const = 0; + virtual bool isPortConnected(int8_t Port) const = 0; + virtual std::string getCurrentVideoMode() const = 0; + virtual void selectPort(int8_t Port,bool audioMix = false, int videoPlane = 0,bool topMost = false) const = 0; + virtual void scaleVideo(int32_t x, int32_t y, int32_t width, int32_t height) const = 0; + // virtual void setAudioMixerLevels(dsAudioInput_t gain, int volume) const = 0; + virtual void getEDIDBytesInfo(int iHdmiPort, std::vector& edid) const = 0; + virtual void getHDMISPDInfo(int iHdmiPort, std::vector& data) const = 0; + virtual void setEdidVersion(int iHdmiPort, int iEdidVersion) const = 0; + virtual void getEdidVersion(int iHdmiPort, int* iEdidVersion) const = 0; + virtual void getHdmiALLMStatus(int iHdmiPort, bool* allmStatus) const = 0; + virtual void getVRRStatus(int iHdmiPort, dsHdmiInVrrStatus_t *vrrStatus) const = 0; + virtual void getSupportedGameFeatures(std::vector& featureList) const = 0; + virtual void getAVLatency(int *audio_output_delay, int *video_latency) const = 0; + virtual void setEdid2AllmSupport(int iHdmiPort, bool allmsupport) const = 0; + virtual void getEdid2AllmSupport(int iHdmiPort, bool *allmsupport) const = 0; + virtual void setVRRSupport(int iHdmiPort, bool vrrsupport) const = 0; + virtual void getVRRSupport(int iHdmiPort, bool *vrrsupport) const = 0; + virtual void getCurrentVideoModeObj (dsVideoPortResolution_t &resolution) const = 0; + virtual void getHdmiVersion (int iHdmiPort, dsHdmiMaxCapabilityVersion_t *capversion) const = 0; + virtual dsError_t getHDMIARCPortId(int &portId) const = 0; +}; + +class HdmiInput { +protected: + static HdmiInputImpl* impl; + +public: + HdmiInput(); + static void setImpl(HdmiInputImpl* newImpl); + static HdmiInput& getInstance(); // Changed return type + + uint8_t getNumberOfInputs() const; + bool isPortConnected(int8_t port) const; + std::string getCurrentVideoMode() const; + void selectPort(int8_t Port,bool audioMix = false, int videoPlane = 0,bool topMost = false) const; + void scaleVideo(int32_t x, int32_t y, int32_t width, int32_t height) const; + void getEDIDBytesInfo(int iHdmiPort, std::vector& edid) const; + void getHDMISPDInfo(int iHdmiPort, std::vector& data) const; + void setEdidVersion(int iHdmiPort, int iEdidVersion) const; + void getEdidVersion(int iHdmiPort, int* iEdidVersion) const; + + void getHdmiALLMStatus(int iHdmiPort, bool* allmStatus) const; + void getVRRStatus(int iHdmiPort, dsHdmiInVrrStatus_t *vrrStatus) const; + void getSupportedGameFeatures(std::vector& featureList) const; + void getAVLatency(int *audio_output_delay, int *video_latency)const; + void setEdid2AllmSupport(int iport, bool allmSupport) const; + void getEdid2AllmSupport(int iport, bool *allmSupport) const; + void setVRRSupport(int iHdmiPort, bool vrrsupport) const; + void getVRRSupport(int iHdmiPort, bool *vrrsupport) const; + void getCurrentVideoModeObj (dsVideoPortResolution_t &resolution) const; + void getHdmiVersion (int iHdmiPort, dsHdmiMaxCapabilityVersion_t *capversion) const; + dsError_t getHDMIARCPortId(int &portId) const; +}; + +} + +namespace device { +class SleepMode; +class SleepModeImpl { +public: + virtual ~SleepModeImpl() = default; + virtual SleepMode & getInstanceById(int id) = 0; + virtual SleepMode & getInstanceByName(const std::string &name) = 0; + virtual List getSleepModes() = 0; + virtual const std::string& toString() const = 0; +}; + +class SleepMode { +protected: + static SleepModeImpl* impl; + +public: + SleepMode(); + static void setImpl(SleepModeImpl* newImpl); + + static SleepMode& getInstance(); + static SleepMode& getInstance(int id); + static SleepMode& getInstance(const std::string &name); + + List getSleepModes(); + const std::string& toString() const; +}; +} + + +namespace device { + +class VideoDFCImpl { +public: + virtual ~VideoDFCImpl() = default; + virtual const std::string& getName() const = 0; + +}; + +class VideoDFC { +protected: + static VideoDFCImpl* impl; + +public: + VideoDFC(); + static void setImpl(VideoDFCImpl* newImpl); + const std::string& getName() const; + +}; + +} + +namespace device { + +class VideoDeviceImpl { +public: + virtual ~VideoDeviceImpl() = default; + + virtual int getFRFMode(int* frfmode) const = 0; + virtual int setFRFMode(int frfmode) const = 0; + virtual int getCurrentDisframerate(char* framerate) const = 0; + virtual int setDisplayframerate(const char* framerate) const = 0; + virtual void setDFC(std::string zoomSetting) = 0; + virtual const VideoDFC& getDFC() = 0; + virtual void getHDRCapabilities(int* capabilities) = 0; + virtual void getSettopSupportedResolutions(std::list& resolutions) = 0; +}; + +class VideoDevice { +protected: + static VideoDeviceImpl* impl; + +public: + VideoDevice(); + + static void setImpl(VideoDeviceImpl* newImpl); + static VideoDevice& getInstance(); + + int getFRFMode(int* frfmode) const; + int setFRFMode(int frfmode) const; + int getCurrentDisframerate(char* framerate) const; + int setDisplayframerate(const char* framerate) const; + + const VideoDFC& getDFC(); + void setDFC(std::string zoomSetting); + void getHDRCapabilities(int* capabilities); + void getSettopSupportedResolutions(std::list& resolutions); + +}; + +} + +namespace device { + +class DSConstant { +private: + bool enabled; + +protected: + int _id; + std::string _name; + + +public: + + DSConstant() : enabled(false), _id(0), _name("_UNASSIGNED NAME_"){}; + + DSConstant(const int id, const std::string &name) : enabled(false), _id(id), _name(name){}; + + virtual ~DSConstant() {}; + + virtual bool operator==(int id) const { + return id == _id; + } + +}; + +} + +namespace device { + class PixelResolution : public DSConstant{ + public: + static const int k720x480; //!< Indicates 720x480 video resolution. + static const int k720x576; //!< Indicates 720x576 video resolution. + static const int k1280x720; //!< Indicates 1280x720 video resolution. + static const int k1366x768; //!< Indicates 1366x768 video resolution. + static const int k1920x1080; //!< Indicates 1920x1080 video resolution. + + static const int k3840x2160; //!< Indicates 3840x2160 video resolution. + static const int k4096x2160; //!< Indicates 4096x2160 video resolution. + + static const int kMax; //!< Indicates the maximum number of video resolutions supported. + + PixelResolution(int id); + PixelResolution() = default; + virtual ~PixelResolution() = default; + }; +} + +namespace device { + + class FrameRate : public DSConstant { + float _value; //!< Indicates the supported frame rate value in fps. + public: + static const int kUnknown; //!< Indicates video frame rate of unknown type. + static const int k24; //!< Indicates video frame rate of 24 fps. + static const int k25; //!< Indicates video frame rate of 25 fps. + static const int k30; //!< Indicates video frame rate of 30 fps. + static const int k60; //!< Indicates video frame rate of 60 fps. + static const int k23dot98; //!< Indicates video frame rate of 23.98 fps. + static const int k29dot97; //!< Indicates video frame rate of 29.97 fps. + static const int k50; //!< Indicates video frame rate of 50 fps. + static const int k59dot94; //!< Indicates video frame rate of 59.94 fps. + static const int kMax; //!< Indicates maximum number of frame rates supported. + + virtual ~FrameRate() = default; + + FrameRate(int id); + FrameRate(float value); + }; + +} + +namespace device { + +class VideoResolutionImpl { +public: + virtual ~VideoResolutionImpl() = default; + + virtual const std::string& getName() const = 0; + virtual const PixelResolution& getPixelResolution() const = 0; + virtual const FrameRate& getFrameRate() const = 0; +}; + +class VideoResolution { +protected: + static VideoResolutionImpl* impl; + +public: + static void setImpl(VideoResolutionImpl* newImpl); + const std::string& getName() const; + const PixelResolution & getPixelResolution() const; + const FrameRate & getFrameRate() const; +}; + +} + +namespace device { + +class VideoOutputPortTypeImpl { +public: + virtual ~VideoOutputPortTypeImpl() = default; + + virtual int getId() const = 0; + virtual const List getSupportedResolutions() const = 0; +}; + +class VideoOutputPortType : public DSConstant{ +protected: + static VideoOutputPortTypeImpl* impl; + +public: + VideoOutputPortType(); + VideoOutputPortType(int type){ + _id = type; + } + + static void setImpl(VideoOutputPortTypeImpl* newImpl); + + int getId() const; + const List getSupportedResolutions() const; + + static const int kRF; + static const int kBaseband; + static const int kSVideo; + static const int k1394; + static const int kDVI; + static const int kComponent; + static const int kHDMI; + static const int kInternal; + static const int kScart; + static const int kMax; +}; + +} + +namespace device{ + class DisplayImpl{ + public: + virtual ~DisplayImpl() = default; + + virtual void getEDIDBytes(std::vector &edid) const = 0; + virtual bool isConnectedDeviceRepeater() = 0; + virtual int getSurroundMode() = 0; + virtual void setAllmEnabled(bool enable) = 0; + virtual void setAVIContentType(int contentType) = 0; + virtual void setAVIScanInformation(int scanInfo) = 0; + }; + class Display { + protected: + static DisplayImpl* impl; + + public: + static void setImpl(DisplayImpl* newImpl); + static Display& getInstance(); + + void getEDIDBytes(std::vector& edid); + int getSurroundMode(); + bool isConnectedDeviceRepeater(); + void setAllmEnabled(bool enable); + void setAVIContentType(int contentType); + void setAVIScanInformation(int scanInfo); + +}; + +} + +namespace device { + +class VideoOutputPortImpl { +public: + virtual ~VideoOutputPortImpl() = default; + + virtual const VideoOutputPortType& getType() const = 0; + virtual const std::string& getName() const = 0; + virtual const VideoResolution& getDefaultResolution() const = 0; + virtual int getHDCPProtocol() = 0; + virtual int getHDCPReceiverProtocol() = 0; + virtual int getHDCPCurrentProtocol() = 0; + virtual int getHDCPStatus() = 0; + virtual AudioOutputPort& getAudioOutputPort() const = 0; + virtual bool isDisplayConnected() = 0; + virtual bool isContentProtected() = 0; + virtual Display& getDisplay() = 0; + virtual bool setScartParameter(std::string sScartParameter, std::string sScartParameterData) = 0; + + virtual void getTVHDRCapabilities(int* capabilities) = 0; + virtual bool setForceHDRMode (dsHDRStandard_t mode) = 0; + virtual int getPreferredColorDepth(bool persist) = 0; + virtual void getColorDepthCapabilities(unsigned int *capabilities) = 0; + virtual void setPreferredColorDepth(dsDisplayColorDepth_t colorDepth, bool persist) = 0; + virtual bool getCurrentOutputSettings(int& videoEOTF, int& matrixCoefficients, int& colorSpace, int& colorDepth, int& quantizationRange) = 0; + virtual bool isConnected() const = 0; + virtual void setResolution(std::string resolution, bool persist, bool isIgnoreEdid) = 0; + + virtual const VideoResolution& getResolution() const =0; + + virtual void getSupportedTvResolutions(int *tvResolutions) = 0; + virtual int getVideoEOTF() = 0; + virtual bool isActive() = 0; + virtual void setAllmEnabled(bool enable) = 0; + + virtual int GetHdmiPreference() = 0; + virtual bool SetHdmiPreference(dsHdcpProtocolVersion_t hdcpProtocol) = 0; + virtual int getColorSpace() const = 0; + virtual int getColorDepth() const = 0; + virtual int getQuantizationRange() const = 0; + virtual bool IsOutputHDR() = 0; + + +}; + +class VideoOutputPort { +protected: + static VideoOutputPortImpl* impl; + +public: + VideoOutputPort(); + + static void setImpl(VideoOutputPortImpl* newImpl); + static VideoOutputPort& getInstance(); + + const VideoOutputPortType& getType() const; + const std::string& getName() const; + const VideoResolution& getDefaultResolution() const; + int getHDCPProtocol(); + int getHDCPReceiverProtocol(); + int getHDCPCurrentProtocol(); + int getHDCPStatus(); + AudioOutputPort& getAudioOutputPort(); + bool isDisplayConnected(); + bool isContentProtected(); + Display& getDisplay(); + void getSupportedTvResolutions(int *tvResolutions); + const VideoResolution& getResolution() const; + + void setResolution(std::string resolution, bool persist, bool isIgnoreEdid); + bool getCurrentOutputSettings(int& videoEOTF, int& matrixCoefficients, int& colorSpace, int& colorDepth, int& quantizationRange); + + void setPreferredColorDepth(dsDisplayColorDepth_t colorDepth, bool persist); + void getColorDepthCapabilities(unsigned int *capabilities); + int getPreferredColorDepth(bool persist); + bool setForceHDRMode (dsHDRStandard_t mode); + void getTVHDRCapabilities(int* capabilities); + bool setScartParameter(std::string sScartParameter, std::string sScartParameterData); + int getVideoEOTF(); + bool isActive(); + void setAllmEnabled(bool enable); + int GetHdmiPreference(); + bool SetHdmiPreference(dsHdcpProtocolVersion_t hdcpProtocol); + int getColorSpace() const; + int getColorDepth() const; + int getQuantizationRange() const; + bool IsOutputHDR(); + +}; + +} + +namespace device { + +class VideoOutputPortConfigImpl { +public: + virtual ~VideoOutputPortConfigImpl() = default; + + virtual VideoOutputPortType& getPortType(int id) = 0; + virtual VideoOutputPort& getPort(const std::string& name) = 0; +}; + +class VideoOutputPortConfig { +protected: + static VideoOutputPortConfigImpl* impl; + +public: + VideoOutputPortConfig(); + + static void setImpl(VideoOutputPortConfigImpl* newImpl); + static VideoOutputPortConfig& getInstance(); + + VideoOutputPortType& getPortType(int id); + VideoOutputPort& getPort(const std::string& name); +}; + +} + +class ManagerImpl { +public: + virtual ~ManagerImpl() = default; + + virtual void Initialize() = 0; + virtual void DeInitialize() = 0; +}; + +namespace device { +class Manager { +protected: + static ManagerImpl* impl; + +public: + Manager(); + + static void setImpl(ManagerImpl* newImpl); + static Manager& getInstance(); + + inline static bool IsInitialized = false; + static void Initialize(); + static void DeInitialize(); +}; +} + +namespace device { + +class HostImpl; +class IDisplayEventsImpl; +class IAudioOutputPortEventsImpl; +class IDisplayDeviceEventsImpl; +class IHdmiInEventsImpl; +class IVideoDeviceEventsImpl; +class IVideoOutputPortEventsImpl; +class ICompositeInEventsImpl; + +class Host { +protected: + static HostImpl* impl; + +public: + static void setImpl(HostImpl* newImpl); + static Host& getInstance(); + + SleepMode getPreferredSleepMode(); + int setPreferredSleepMode(const SleepMode mode); + List getAvailableSleepModes(); + List getVideoOutputPorts(); + List getAudioOutputPorts(); + List getVideoDevices(); + VideoOutputPort& getVideoOutputPort(const std::string& name); + AudioOutputPort& getAudioOutputPort(const std::string& name); + void getHostEDID(std::vector& edid) const; + std::string getDefaultVideoPortName(); + std::string getDefaultAudioPortName(); + + void getMS12ConfigDetails(std::string type); + bool isHDMIOutPortPresent(); + void getSecondaryLanguage(std::string secondaryLanguage); + void setSecondaryLanguage(std::string secondaryLanguage); + void getSinkDeviceAtmosCapability(dsATMOSCapability_t atmosCapability); + void getFaderControl(int *mixerBalance); + void setFaderControl(int mixerBalance); + void setPrimaryLanguage(std::string primaryLanguage); + void getPrimaryLanguage(std::string primaryLanguage); + void setAudioAtmosOutputMode (int enable); + void setAssociatedAudioMixing(bool mixing); + void getCurrentAudioFormat(dsAudioFormat_t audioFormat); + void getAssociatedAudioMixing(bool *mixing); + void setAudioMixerLevels(dsAudioInput_t gain, int volume) ; + +class IDisplayEvents { + protected: + static IDisplayEventsImpl* impl; + + public: + static void setImpl(IDisplayEventsImpl* newImpl); + static IDisplayEvents& getInstance(); + virtual void OnDisplayRxSense(dsDisplayEvent_t displayEvent); +}; + +class IAudioOutputPortEvents { + protected: + static IAudioOutputPortEventsImpl* impl; + + public: + static void setImpl(IAudioOutputPortEventsImpl* newImpl); + static IAudioOutputPortEvents& getInstance(); + virtual void OnAudioOutHotPlug(dsAudioPortType_t portType, uint32_t uiPortNumber, bool isPortConnected); + virtual void OnAudioFormatUpdate(dsAudioFormat_t audioFormat); + virtual void OnDolbyAtmosCapabilitiesChanged(dsATMOSCapability_t atmosCapability, bool status); + virtual void OnAudioPortStateChanged(dsAudioPortState_t audioPortState); + virtual void OnAssociatedAudioMixingChanged(bool mixing); + virtual void OnAudioFaderControlChanged(int mixerBalance); + virtual void OnAudioPrimaryLanguageChanged(const std::string& primaryLanguage); + virtual void OnAudioSecondaryLanguageChanged(const std::string& secondaryLanguage); + virtual void OnAudioModeEvent(dsAudioPortType_t audioPortType, dsAudioStereoMode_t audioStereoMode); + virtual void OnAudioLevelChangedEvent(int audioLevel); +}; + +class IDisplayDeviceEvents { + protected: + static IDisplayDeviceEventsImpl* impl; + public: + static void setImpl(IDisplayDeviceEventsImpl* newImpl); + static IDisplayDeviceEvents& getInstance(); + + virtual void OnDisplayHDMIHotPlug(dsDisplayEvent_t displayEvent); +}; + +class IHdmiInEvents { + protected: + static IHdmiInEventsImpl* impl; + + public: + static void setImpl(IHdmiInEventsImpl* newImpl); + static IHdmiInEvents& getInstance(); + + virtual void OnHdmiInEventHotPlug(dsHdmiInPort_t port, bool isConnected); + virtual void OnHdmiInEventSignalStatus(dsHdmiInPort_t port, dsHdmiInSignalStatus_t signalStatus); + virtual void OnHdmiInEventStatus(dsHdmiInPort_t activePort, bool isPresented); + virtual void OnHdmiInVideoModeUpdate(dsHdmiInPort_t port, const dsVideoPortResolution_t& videoPortResolution); + virtual void OnHdmiInAllmStatus(dsHdmiInPort_t port, bool allmStatus); + virtual void OnHdmiInAVIContentType(dsHdmiInPort_t port, dsAviContentType_t aviContentType); + virtual void OnHdmiInVRRStatus(dsHdmiInPort_t port, dsVRRType_t vrrType); + virtual void OnHdmiInAVLatency(int audioDelay, int videoDelay); +}; + +class ICompositeInEvents { + protected: + static ICompositeInEventsImpl* impl; + + public: + static void setImpl(ICompositeInEventsImpl* newImpl); + static ICompositeInEvents& getInstance(); + + virtual void OnCompositeInHotPlug(dsCompositeInPort_t port, bool isConnected); + virtual void OnCompositeInSignalStatus(dsCompositeInPort_t port, dsCompInSignalStatus_t signalStatus); + virtual void OnCompositeInStatus(dsCompositeInPort_t activePort, bool isPresented); + virtual void OnCompositeInVideoModeUpdate(dsCompositeInPort_t activePort, dsVideoPortResolution_t videoResolution); + }; + +class IVideoDeviceEvents { + protected: + static IVideoDeviceEventsImpl* impl; + + public: + static void setImpl(IVideoDeviceEventsImpl* newImpl); + static IVideoDeviceEvents& getInstance(); + + virtual void OnZoomSettingsChanged(dsVideoZoom_t zoomSetting); + virtual void OnDisplayFrameratePreChange(const std::string& frameRate); + virtual void OnDisplayFrameratePostChange(const std::string& frameRate); +}; + +class IVideoOutputPortEvents { + protected: + static IVideoOutputPortEventsImpl* impl; + + public: + static void setImpl(IVideoOutputPortEventsImpl* newImpl); + static IVideoOutputPortEvents& getInstance(); + + virtual void OnResolutionPreChange(const int width, const int height); + virtual void OnResolutionPostChange(const int width, const int height); + virtual void OnVideoFormatUpdate(dsHDRStandard_t videoFormatHDR); + virtual void OnHDCPStatusChange(dsHdcpStatus_t hdcpStatus); +}; + +virtual dsError_t Register(IVideoDeviceEvents* listener, const std::string& clientName = ""); +virtual dsError_t UnRegister(IVideoDeviceEvents* listener); +virtual dsError_t Register(IDisplayEvents* listener, const std::string& clientName = ""); +virtual dsError_t UnRegister(IDisplayEvents* listener); +virtual dsError_t Register(IAudioOutputPortEvents* listener, const std::string& clientName = ""); +virtual dsError_t UnRegister(IAudioOutputPortEvents* listener); +virtual dsError_t Register(IDisplayDeviceEvents* listener, const std::string& clientName = ""); +virtual dsError_t UnRegister(IDisplayDeviceEvents* listener); +virtual dsError_t Register(IHdmiInEvents* listener, const std::string& clientName = ""); +virtual dsError_t UnRegister(IHdmiInEvents* listener); +virtual dsError_t Register(IVideoOutputPortEvents* listener, const std::string& clientName = ""); +virtual dsError_t UnRegister(IVideoOutputPortEvents* listener); +virtual dsError_t Register(ICompositeInEvents* listener, const std::string& clientName = ""); +virtual dsError_t UnRegister(ICompositeInEvents* listener); +}; + +class HostImpl { +public: + virtual ~HostImpl() = default; + virtual SleepMode getPreferredSleepMode() = 0; + virtual int setPreferredSleepMode(const SleepMode mode) = 0; + virtual List getAvailableSleepModes() = 0; + virtual List getVideoOutputPorts() = 0; + virtual List getAudioOutputPorts() = 0; + virtual List getVideoDevices() = 0; + virtual VideoOutputPort& getVideoOutputPort(const std::string& name) = 0; + virtual AudioOutputPort& getAudioOutputPort(const std::string& name) = 0; + virtual void getHostEDID(std::vector& edid) const = 0; + virtual std::string getDefaultVideoPortName() = 0; + virtual std::string getDefaultAudioPortName() = 0; + + virtual void getMS12ConfigDetails(std::string type)=0; + virtual bool isHDMIOutPortPresent() = 0; + virtual void getSecondaryLanguage(std::string secondaryLanguage) = 0; + virtual void setSecondaryLanguage(std::string secondaryLanguage) = 0; + virtual void getSinkDeviceAtmosCapability(dsATMOSCapability_t atmosCapability) = 0; + virtual void getFaderControl(int *mixerBalance) = 0; + virtual void setFaderControl(int mixerBalance) = 0; + virtual void setPrimaryLanguage(std::string primaryLanguage) = 0; + virtual void getPrimaryLanguage(std::string primaryLanguage) = 0; + virtual void setAudioAtmosOutputMode (int enable) = 0; + virtual void setAssociatedAudioMixing(bool mixing) = 0; + virtual void getCurrentAudioFormat(dsAudioFormat_t audioFormat) = 0; + virtual void getAssociatedAudioMixing(bool *mixing) = 0; + virtual void setAudioMixerLevels(dsAudioInput_t inputType, int volumeLevel) = 0; + + virtual dsError_t Register(Host::IDisplayEvents* listener) = 0; + virtual dsError_t UnRegister(Host::IDisplayEvents* listener) = 0; + virtual dsError_t Register(Host::IAudioOutputPortEvents* listener) = 0; + virtual dsError_t UnRegister(Host::IAudioOutputPortEvents* listener) = 0; + virtual dsError_t Register(Host::IDisplayDeviceEvents* listener) = 0; + virtual dsError_t UnRegister(Host::IDisplayDeviceEvents* listener) = 0; + virtual dsError_t Register(Host::IHdmiInEvents* listener) = 0; + virtual dsError_t UnRegister(Host::IHdmiInEvents* listener) = 0; + virtual dsError_t Register(Host::IVideoDeviceEvents* listener) = 0; + virtual dsError_t UnRegister(Host::IVideoDeviceEvents* listener) = 0; + virtual dsError_t Register(Host::IVideoOutputPortEvents* listener) = 0; + virtual dsError_t UnRegister(Host::IVideoOutputPortEvents* listener) = 0; + virtual dsError_t Register(Host::ICompositeInEvents* listener) = 0; + virtual dsError_t UnRegister(Host::ICompositeInEvents* listener) = 0; +}; + + +class IDisplayEventsImpl { +public: + virtual ~IDisplayEventsImpl() = default; + virtual void OnDisplayRxSense(dsDisplayEvent_t displayEvent) = 0; +}; + +class IAudioOutputPortEventsImpl { +public: + virtual ~IAudioOutputPortEventsImpl() = default; + + virtual void OnAudioOutHotPlug(dsAudioPortType_t portType, uint32_t uiPortNumber, bool isPortConnected) = 0; + virtual void OnAudioFormatUpdate(dsAudioFormat_t audioFormat) = 0; + virtual void OnDolbyAtmosCapabilitiesChanged(dsATMOSCapability_t atmosCapability, bool status) = 0; + virtual void OnAudioPortStateChanged(dsAudioPortState_t audioPortState) = 0; + virtual void OnAssociatedAudioMixingChanged(bool mixing) = 0; + virtual void OnAudioFaderControlChanged(int mixerBalance) = 0; + virtual void OnAudioPrimaryLanguageChanged(const std::string& primaryLanguage) = 0; + virtual void OnAudioSecondaryLanguageChanged(const std::string& secondaryLanguage) = 0; + virtual void OnAudioModeEvent(dsAudioPortType_t audioPortType, dsAudioStereoMode_t audioStereoMode) = 0; + virtual void OnAudioLevelChangedEvent(int audioLevel) = 0; + +}; + +class IDisplayDeviceEventsImpl { +public: + virtual ~IDisplayDeviceEventsImpl() = default; + + virtual void OnDisplayHDMIHotPlug(dsDisplayEvent_t displayEvent) = 0; +}; + +class IHdmiInEventsImpl { +public: + virtual ~IHdmiInEventsImpl() = default; + + virtual void OnHdmiInEventHotPlug(dsHdmiInPort_t port, bool isConnected) = 0; + virtual void OnHdmiInEventSignalStatus(dsHdmiInPort_t port, dsHdmiInSignalStatus_t signalStatus) = 0; + virtual void OnHdmiInEventStatus(dsHdmiInPort_t activePort, bool isPresented) = 0; + virtual void OnHdmiInVideoModeUpdate(dsHdmiInPort_t port, const dsVideoPortResolution_t& videoPortResolution) = 0; + virtual void OnHdmiInAllmStatus(dsHdmiInPort_t port, bool allmStatus) = 0; + virtual void OnHdmiInAVIContentType(dsHdmiInPort_t port, dsAviContentType_t aviContentType) = 0; + virtual void OnHdmiInVRRStatus(dsHdmiInPort_t port, dsVRRType_t vrrType) = 0; + virtual void OnHdmiInAVLatency(int audioDelay, int videoDelay) = 0; + +}; + + class ICompositeInEventsImpl { + public: + virtual ~ICompositeInEventsImpl() = default; + virtual void OnCompositeInHotPlug(dsCompositeInPort_t port, bool isConnected) = 0; + virtual void OnCompositeInSignalStatus(dsCompositeInPort_t port, dsCompInSignalStatus_t signalStatus) = 0; + virtual void OnCompositeInStatus(dsCompositeInPort_t activePort, bool isPresented) = 0; + virtual void OnCompositeInVideoModeUpdate(dsCompositeInPort_t activePort, dsVideoPortResolution_t videoResolution) = 0; + }; + +class IVideoDeviceEventsImpl { +public: + virtual ~IVideoDeviceEventsImpl() = default; + + virtual void OnZoomSettingsChanged(dsVideoZoom_t zoomSetting) = 0; + virtual void OnDisplayFrameratePreChange(const std::string& frameRate) = 0; + virtual void OnDisplayFrameratePostChange(const std::string& frameRate) = 0; + +}; + +class IVideoOutputPortEventsImpl { +public: + virtual ~IVideoOutputPortEventsImpl() = default; + + virtual void OnResolutionPreChange(const int width, const int height) = 0; + virtual void OnResolutionPostChange(const int width, const int height) = 0; + virtual void OnVideoFormatUpdate(dsHDRStandard_t videoFormatHDR) = 0; + virtual void OnHDCPStatusChange(dsHdcpStatus_t hdcpStatus) = 0; + +}; + +} + +namespace device { +class FrontPanelIndicator { +public: + class Color; + class ColorImpl { + public: + virtual ~ColorImpl() = default; + virtual const Color& getInstanceById(int id) = 0; + virtual const Color& getInstanceByName(const std::string& name) = 0; + virtual std::string getName() const = 0; + }; + + class Color { +protected: + static ColorImpl* impl; + +public: + Color(); + + static void setImpl(ColorImpl* newImpl); + static Color& getInstance(); + static const Color& getInstance(int id); + static const Color& getInstance(const std::string& name); + + static const int kWhite; + + std::string getName() const; + virtual ~Color(); + }; + + // static FrontPanelIndicator& getInstance() + // { + // static FrontPanelIndicator instance; + // return instance; + // } + + class FrontPanelIndicatorImpl { + public: + virtual ~FrontPanelIndicatorImpl() = default; + virtual FrontPanelIndicator& getInstanceInt(int id) = 0; + virtual FrontPanelIndicator& getInstanceString(const std::string& name) = 0; + virtual void setState(const bool bState) const = 0; + virtual std::string getName() const = 0; + virtual void setBrightness(const int brightness, const bool toPersist = false) const = 0; + virtual int getBrightness(const bool persist=false) const = 0; + virtual void setColor(const Color &newColor, const bool toPersist) const = 0; + virtual void setColorInt(const uint32_t color, const bool toPersist) const = 0; + virtual void getBrightnessLevels(int &levels,int &min,int &max) const = 0; + virtual int getColorMode() const = 0; + virtual std::string getColorName() const = 0; + virtual List getSupportedColors() const =0; + }; + + // FrontPanelIndicatorImpl* impl; + + public: + static FrontPanelIndicatorImpl* impl; + FrontPanelIndicator(); + + static void setImpl(FrontPanelIndicatorImpl* newImpl); + + static FrontPanelIndicator& getInstance(const std::string& name); + static FrontPanelIndicator& getInstance(int id); + static FrontPanelIndicator& getInstance(); + + void setState(const bool bState) const; + std::string getName() const; + void setBrightness(const int brightness, const bool toPersist = false) const; + int getBrightness(const bool persist = false) const; + void setColor(const Color& newColor, const bool toPersist = false) const; + void setColor(const uint32_t color, const bool toPersist = false) const; + // void setColorInt(const uint32_t color, const bool toPersist) const; + void getBrightnessLevels(int& levels, int& min, int& max) const; + int getColorMode() const; + std::string getColorName() const; + List getSupportedColors() const; + +}; + +class FrontPanelTextDisplay; +class FrontPanelTextDisplayImpl { +public: + virtual ~FrontPanelTextDisplayImpl() = default; + virtual int getCurrentTimeFormat() const = 0; + virtual void setTimeFormat(const int iTimeFormat) const = 0; + virtual void setText(const std::string text) const = 0; + virtual void setMode(int mode) const = 0; + virtual int getTextBrightness() const = 0; + virtual void setTextBrightness(const int brightness) const = 0; + virtual FrontPanelTextDisplay& getInstanceById(int id) = 0; + virtual FrontPanelTextDisplay& getInstanceByName(const std::string& name) = 0; +}; + +class FrontPanelTextDisplay : public FrontPanelIndicator{ +protected: + static FrontPanelTextDisplayImpl* impl; + +public: + FrontPanelTextDisplay(); + + static void setImpl(FrontPanelTextDisplayImpl* newImpl); + + int getCurrentTimeFormat() const; + void setTimeFormat(const int iTimeFormat); + static FrontPanelTextDisplay& getInstance(const std::string& name); + static FrontPanelTextDisplay& getInstance(int id); + static FrontPanelTextDisplay& getInstance(); + static const int kModeClock12Hr; + static const int kModeClock24Hr; + + void setText(const std::string text); + void setMode(int mode); + int getTextBrightness() const; + void setTextBrightness(const int brightness) const; +}; + +class FrontPanelConfig; +class FrontPanelConfigImpl { +public: + virtual ~FrontPanelConfigImpl() = default; + virtual List getIndicators() const = 0; + virtual FrontPanelTextDisplay& getTextDisplay() const = 0; + virtual FrontPanelTextDisplay& getTextDisplay(const std::string &name) const = 0; + virtual List getTextDisplays() const = 0; + virtual FrontPanelTextDisplay& getTextDisplay(int id) const = 0; +}; + +class FrontPanelConfig { +protected: + static FrontPanelConfigImpl* impl; + +public: + FrontPanelConfig(); + + static void setImpl(FrontPanelConfigImpl* newImpl); + static FrontPanelConfig& getInstance(); + + List getIndicators(); + FrontPanelTextDisplay& getTextDisplay(const std::string& name); + List getTextDisplays(); + FrontPanelTextDisplay& getTextDisplay(int id); + FrontPanelTextDisplay& getTextDisplay() const; +}; + +} + + +#define RT_OK 0 +#define RT_ERROR 1 +#define RT_ERROR_QUEUE_EMPTY 1006 + + +typedef uint32_t rtError; +typedef void(*remoteDisconnectCallback)(void *data); + +class rtValue; + +class rtIObject +{ + public: + typedef unsigned long refcount_t; + + virtual ~rtIObject(){ + } +}; + +class rtString{ + public: + std::string mData; + rtString(const char* s){ + mData = s; + } + rtString(const rtString& s){ + mData = s.mData; + } + rtString(){ + mData = ""; + } + const char* cString() const{ + return mData.c_str(); + } + rtString& operator=(const char* s){ + mData = s; + return *this; + } + + rtString& operator=(const rtString& s){ + mData = s.mData; + return *this; + } + +}; +typedef rtError (*rtFunctionCB)(int numArgs, const rtValue* args, rtValue* result, void* context); + +class rtFunctionCallback{ + public: + rtFunctionCallback(rtFunctionCB cb, void* context = NULL){ + + } + ~rtFunctionCallback() = default; + +}; + +/* +Based on pxCore, Copyright 2015-2018 John Robinson +Licensed under the Apache License, Version 2.0 +*/ +template +class rtRef +{ +public: + rtRef(): mRef(NULL) {} + rtRef(const T* p): mRef(NULL) {asn(p); } + rtRef(const rtRef& r): mRef(NULL) {asn(r.getPtr());} + rtRef(rtRef&& r) noexcept: mRef(r.mRef) {r.mRef = nullptr;} + virtual ~rtRef() { + } + + T* operator->() const {return mRef;} + operator T* () const {return mRef;} + T* getPtr() const {return mRef;} + T* ptr() const {return mRef;} + T& operator*() const {return *mRef;} + + bool operator! () const {return mRef == NULL; } + inline rtRef& operator=(const T* p) {asn(p); return *this;} + inline rtRef& operator=(const rtRef& r) {asn(r.mRef); return *this;} + + inline friend bool operator==(const T* lhs,const rtRef& rhs) {return lhs==rhs.mRef;} + inline friend bool operator==(const rtRef& lhs,const T* rhs) {return lhs.mRef==rhs;} + inline friend bool operator==(const rtRef& lhs,const rtRef& rhs) {return lhs.mRef==rhs.mRef;} + + void asn(const T* p) + { + if (mRef != p) + { + if (mRef) + { + delete mRef; + mRef = NULL; + } + mRef = const_cast(p); + + } + } + + T* mRef; +}; + +class rtObjectBaseImpl{ + public: + virtual ~rtObjectBaseImpl() = default; + virtual rtError set(const char* name, const char* value) const = 0; + virtual rtError set(const char* name, bool value) const = 0; + virtual rtError set(const char* name, const rtValue& value) const = 0; + virtual rtString get(const char* name) const = 0; + virtual rtError sendReturns(const char* messageName, rtString& result) const = 0; +}; + +class rtObjectBase{ +protected: + static rtObjectBaseImpl* impl; +public: + + static rtObjectBase& getInstance(); + static void setImpl(rtObjectBaseImpl* newImpl); + + rtError set(const char* name, const char* value); + rtError set(const char* name, bool value); + rtError set(const char* name, const rtValue& value); + + //To avoid linker issues with templated code, the complete definition of this + //templated function is included in this header file instead of separating it to .cpp + template + rtError sendReturns(const char* messageName, T& result) { + return impl->sendReturns(messageName, result); + } + + template + T get(const char* name) { + return impl->get(name); + } + virtual ~rtObjectBase() = default; +}; + +class rtMapObject: public rtObjectBase, public rtIObject{ + public: + virtual ~rtMapObject() = default; + +}; + +class rtObjectRef; +class rtObjectRefImpl{ + public: + virtual rtError send(const char* messageName, const rtValue& arg1) = 0; + virtual rtError send(const char* messageName) = 0; + virtual rtError send(const char* messageName, const char* method, rtFunctionCallback* callback) = 0; + virtual rtError send(const char* messageName, rtObjectRef& base) = 0; + +}; + +class rtObjectRef : public rtRef, public rtObjectBase{ +protected: + static rtObjectRefImpl* impl; +public: + + + static rtObjectRef& getInstance(); + + static void setImpl(rtObjectRefImpl* newImpl); + + rtObjectRef(); + + rtObjectRef(const rtObjectRef&); + + rtObjectRef(const rtMapObject* o); + + rtObjectRef& operator=(rtMapObject* o); + + rtObjectRef& operator=(const rtObjectRef&); + + rtObjectRef& operator=(rtIObject* o); + + rtObjectRef& operator=(rtObjectRef&&); + + rtError send(const char* messageName); + + rtError send(const char* messageName, const char* method, rtFunctionCallback* callback); + + rtError send(const char* messageName, const rtValue& arg1); + + rtError send(const char* messageName, rtObjectRef& base); + virtual ~rtObjectRef(); + +}; + +class rtArrayObject; + +struct rtValue_{ + std::string stringValue; + bool boolValue; +}; + +class rtValueImpl{ + public: + virtual void rtValueConstructor(bool v) const = 0; + virtual void rtValueConstructor(const char* v) const = 0; + virtual void rtValueConstructor(rtArrayObject* v) const = 0; + virtual void rtValueConstructor(const rtString& v) const = 0; +}; + +class rtValue +{ + protected: + static rtValueImpl* impl; + public: + rtValue_ mValue; + + static rtValue& getInstance(); + static void setImpl(rtValueImpl* newImpl); + + rtValue(); + rtValue(bool v); + rtValue(const char* v); + rtValue(const rtString& v); + rtValue(rtIObject* v); + + rtValue(const rtObjectRef& v); + rtValue(const rtValue& v); + ~rtValue(); + rtValue& operator=(bool v); + rtValue& operator=(const char* v); + rtValue& operator=(const rtString& v); + rtValue& operator=(const rtIObject* v); + rtValue& operator=(const rtObjectRef& v); + rtValue& operator=(const rtValue& v); + + rtObjectRef toObject() const; + void setString (const char* v); + void setString (const rtString& v); + +}; + +class rtArrayObjectImpl{ + public: + virtual void pushBack(const char* v) const = 0; + virtual void pushBack(rtValue v) const = 0; +}; + + +class rtArrayObject : public rtObjectBase, public rtIObject{ +protected: + static rtArrayObjectImpl* impl; +public: + static rtArrayObject& getInstance(); + static void setImpl(rtArrayObjectImpl* newImpl); + + void pushBack(const char* v); + void pushBack(rtValue v); + virtual ~rtArrayObject() = default; + +}; + +class rtRemoteEnvironment{ + + +}; + +class floatingRtFunctionsImpl{ + public: + virtual ~floatingRtFunctionsImpl() = default; + virtual rtError rtRemoteLocateObject(rtRemoteEnvironment *env, const char* str, rtObjectRef& obj, int x, remoteDisconnectCallback back, void *cbdata=NULL) = 0; + virtual rtRemoteEnvironment* rtEnvironmentGetGlobal() = 0; + virtual rtError rtRemoteShutdown(rtRemoteEnvironment *env) = 0; + virtual rtError rtRemoteInit(rtRemoteEnvironment *env) = 0; + virtual rtError rtRemoteProcessSingleItem() = 0; + virtual char* rtStrError(rtError err) = 0; + +}; + +class floatingRtFunctions{ +public: + static floatingRtFunctionsImpl* impl; + static floatingRtFunctions& getInstance(); + static void setImpl(floatingRtFunctionsImpl* newImpl); + +}; + + rtError rtRemoteProcessSingleItem(); + rtError rtRemoteLocateObject(rtRemoteEnvironment* env, const char* str, rtObjectRef& obj, int x, remoteDisconnectCallback back, void* cbdata = nullptr); + rtRemoteEnvironment* rtEnvironmentGetGlobal(); + rtError rtRemoteInit(rtRemoteEnvironment* env); + rtError rtRemoteShutdown(rtRemoteEnvironment* env); + char* rtStrError(rtError err); + + +namespace edid_parser { + + enum edid_status_e { + EDID_STATUS_OK, + EDID_STATUS_INVALID_PARAMETER, + EDID_STATUS_NOT_SUPPORTED, + EDID_STATUS_INVALID_HEADER, + EDID_STATUS_INVALID_CHECKSUM + }; + + enum edid_native_e { + EDID_NATIVE, + EDID_NOT_NATIVE + }; + + enum edid_progressive_e { + EDID_PROGRESSIVE, + EDID_INTERLACED + }; + + enum HDR_standard_t { + HDR_standard_NONE = 0x0, + HDR_standard_HDR10 = 0x01, // SMPTE ST 2084 + HDR_standard_HLG = 0x02, // Hybrid Log-Gamma + HDR_standard_DolbyVersion = 0x04, // ? + HDR_standard_SDR = 0x08, // Traditional gamma - SDR Luminance Range + HDR_standard_Traditional_HDR = 0x10 // Traditional gamma - HDR Luminance Range + }; + + struct edid_res_t { + int width; + int height; + int refresh; + edid_progressive_e progressive; + edid_native_e native; + }; + + enum colorimetry_info_t { + COLORIMETRY_INFO_NONE = 0x0, + COLORIMETRY_INFO_XVYCC601 = 0x01, + COLORIMETRY_INFO_XVYCC709 = 0x02, + COLORIMETRY_INFO_SYCC601 = 0x04, + COLORIMETRY_INFO_ADOBEYCC601 = 0x08, + COLORIMETRY_INFO_ADOBERGB = 0x10, + COLORIMETRY_INFO_BT2020CL = 0x20, + COLORIMETRY_INFO_BT2020NCL = 0x40, + COLORIMETRY_INFO_BT2020RGB = 0x80, + COLORIMETRY_INFO_DCI_P3 = 0x100 + }; + + struct edid_data_t { + edid_res_t res; + // bitmask of HDR_standard_t values + uint8_t hdr_capabilities; + char manufacturer_name[4]; /* Manufacturer name of the display device.*/ + int32_t product_code; /* Product code of the display device. */ + int32_t serial_number; /* Serial number of the display device. */ + int32_t manufacture_week; /* Manufacturing week of the display device. */ + int32_t manufacture_year; /* Manufacturing year of the display device. */ + uint8_t edid_version[2]; /* EDID version. */ + uint8_t physical_address_a; /* Physical Address for HDMI node A */ + uint8_t physical_address_b; /* Physical Address for HDMI node B */ + uint8_t physical_address_c; /* Physical Address for HDMI node C */ + uint8_t physical_address_d; /* Physical Address for HDMI node D */ + char monitor_name[14]; /* Connected display monitor name. */ + uint32_t colorimetry_info; /* bitmask of enum colorimetry_info_t */ +}; + + class edidParserImpl{ + public: + static edidParserImpl* impl; + + static void setImpl(edidParserImpl* newImpl); + + virtual edid_status_e EDID_Parse(unsigned char* bytes, size_t count, edid_data_t* data_ptr) = 0; + virtual edid_status_e EDID_Verify(unsigned char* bytes, size_t count) = 0; + + }; + + edid_status_e EDID_Parse(unsigned char* bytes, size_t count, edid_data_t* data_ptr); + edid_status_e EDID_Verify(unsigned char* bytes, size_t count); +} + +class drmImpl{ + public: + virtual ~drmImpl() = default; + static drmImpl* impl; + static void setImpl(drmImpl* newImpl); + + virtual drmModeEncoderPtr drmModeGetEncoder(int fd, uint32_t encoder_id) = 0; + virtual void drmModeFreeEncoder(drmModeEncoderPtr* encoder) = 0; + virtual drmModeConnectorPtr drmModeGetConnector(int fd, uint32_t connectorId) = 0; + virtual drmModeCrtcPtr drmModeGetCrtc(int fd, uint32_t crtcId) = 0; + virtual drmModeResPtr drmModeGetResources(int fd) = 0; + virtual void drmModeFreeConnector( drmModeConnectorPtr ptr ) = 0; + virtual void drmModeFreeCrtc( drmModeCrtcPtr ptr ) = 0; + virtual void drmModeFreeResources( drmModeResPtr ptr ) = 0; + virtual drmModePropertyPtr drmModeGetProperty(int fd, uint32_t propertyId) = 0; + virtual void drmModeFreeProperty(drmModePropertyPtr ptr) = 0; + virtual drmModePlaneResPtr drmModeGetPlaneResources(int fd) = 0; + virtual drmModePlanePtr drmModeGetPlane(int fd, uint32_t plane_id) = 0; + virtual drmModeObjectPropertiesPtr drmModeObjectGetProperties(int fd,uint32_t object_id, uint32_t object_type) = 0; + virtual void drmModeFreeObjectProperties(drmModeObjectPropertiesPtr ptr) = 0; + virtual void drmModeFreePlane( drmModePlanePtr ptr ) = 0; + virtual void drmModeFreePlaneResources(drmModePlaneResPtr ptr) = 0; + virtual void drmModeFreeFB(drmModeFBPtr ptr) = 0; + virtual drmModeFBPtr drmModeGetFB(int fd, uint32_t bufferId) = 0; + virtual void drmModeFreeEncoder( drmModeEncoderPtr ptr ) = 0; + virtual int drmSetClientCap(int fd, uint64_t capability, uint64_t value) = 0; + +}; + +//drmModeEncoderPtr drmModeGetEncoder(int fd, uint32_t encoder_id); +//void drmModeFreeEncoder(drmModeEncoderPtr* encoder); +//drmModeConnectorPtr drmModeGetConnector(int fd, uint32_t connectorId); +//drmModeCrtcPtr drmModeGetCrtc(int fd, uint32_t crtcId); +//drmModeResPtr drmModeGetResources(int fd); +//void drmModeFreeConnector( drmModeConnectorPtr ptr ); +//void drmModeFreeCrtc( drmModeCrtcPtr ptr ); +//void drmModeFreeResources( drmModeResPtr ptr ); +//drmModePropertyPtr drmModeGetProperty(int fd, uint32_t propertyId); +//void drmModeFreeProperty(drmModePropertyPtr ptr); +//drmModePlaneResPtrResPtr drmModeGetPlaneResources(int fd); +//drmModePlaneResPtr drmModeGetPlane(int fd, uint32_t plane_id); +//drmModeObjectPropertiesPtr drmModeObjectGetProperties(int fd,uint32_t object_id, uint32_t object_type); +//void drmModeFreeObjectProperties(drmModeObjectPropertiesPtr ptr); +//void drmModeFreePlane( drmModePlaneResPtr ptr ); +//void drmModeFreePlaneResources(drmModePlaneResPtrResPtr ptr); + diff --git a/ci/mocks/testframework_overrides.h b/ci/mocks/testframework_overrides.h index 14c9920a..c9fe9c00 100644 --- a/ci/mocks/testframework_overrides.h +++ b/ci/mocks/testframework_overrides.h @@ -26,6 +26,11 @@ /* ctrlm-main calls IARM_Bus_RegisterEvent as a plain function (defined in stubs_iarm.cpp) */ extern IARM_Result_t IARM_Bus_RegisterEvent(IARM_EventId_t maxEventId); +/* Pinned testframework Iarm.h stops at UNKNOWN; ctrlm also references MAX. */ +#ifndef DEEPSLEEP_WAKEUPREASON_MAX +#define DEEPSLEEP_WAKEUPREASON_MAX (DEEPSLEEP_WAKEUPREASON_UNKNOWN + 1) +#endif + /* IARM common API string not present in the pinned testframework mock */ #ifndef IARM_BUS_COMMON_API_PowerPreChange #define IARM_BUS_COMMON_API_PowerPreChange "PowerPreChange" From aac526491ffdd52253beb803884d3faf43b4642b Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Tue, 21 Apr 2026 13:41:35 +0000 Subject: [PATCH 39/72] Testing --- ci/build_dependencies.sh | 27 +++------------------------ ci/cov_build.sh | 3 --- 2 files changed, 3 insertions(+), 27 deletions(-) diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh index b1d2d705..97fc0e47 100644 --- a/ci/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -21,7 +21,6 @@ set -x set -e ############################## GITHUB_WORKSPACE="${PWD}" -ls -la ${GITHUB_WORKSPACE} cd ${GITHUB_WORKSPACE} git config --global --add safe.directory "${GITHUB_WORKSPACE}" @@ -34,9 +33,7 @@ apt install -y \ libsqlite3-dev \ libcurl4-openssl-dev \ libsystemd-dev \ - libboost-all-dev \ libglib2.0-dev \ - libgio2.0-cil-dev \ libjansson-dev \ libarchive-dev \ libssl-dev \ @@ -45,12 +42,7 @@ apt install -y \ uuid-dev \ libevdev-dev \ libdrm-dev \ - gperf \ - meson \ - valgrind \ - lcov \ - libsafec-dev \ - clang + libsafec-dev pip install jsonref ########################################### @@ -86,9 +78,6 @@ XRSDK_HEADERS_DIR="$HEADERS_DIR/xr-voice-sdk" mkdir -p "${HEADERS_DIR}" mkdir -p "${HEADERS_DIR}/rdk/iarmbus" mkdir -p "${HEADERS_DIR}/rdk/ds" -mkdir -p "${HEADERS_DIR}/rdk/ds-rpc" -mkdir -p "${HEADERS_DIR}/rdk/ds-hal" -mkdir -p "${HEADERS_DIR}/rdk/halif/ds-hal" mkdir -p "${HEADERS_DIR}/rdk/iarmmgrs-hal" mkdir -p "${XRSDK_HEADERS_DIR}" @@ -126,9 +115,8 @@ cp "$POWER_HAL_DIR/include/plat_power.h" rdk/iarmmgrs-hal/pwrMgr.h [ -f rdk/iarmmgrs-hal/deepSleepMgr.h ] [ -f rdk/iarmmgrs-hal/pwrMgr.h ] -# Device settings headers (types provided via -include devicesettings.h) +# Device settings headers (types provided via force-included devicesettings.h mock) touch rdk/ds/audioOutputPort.hpp -touch rdk/ds/compositeIn.hpp touch rdk/ds/dsDisplay.h touch rdk/ds/dsError.h touch rdk/ds/dsMgr.h @@ -136,20 +124,14 @@ touch rdk/ds/dsRpc.h touch rdk/ds/dsTypes.h touch rdk/ds/dsUtl.h touch rdk/ds/exception.hpp -touch rdk/ds/hdmiIn.hpp touch rdk/ds/host.hpp -touch rdk/ds/list.hpp -# manager.hpp is empty — device::Manager is provided by the force-included devicesettings.h touch rdk/ds/manager.hpp -touch rdk/ds/sleepMode.hpp -touch rdk/ds/videoDevice.hpp touch rdk/ds/videoOutputPort.hpp touch rdk/ds/videoOutputPortConfig.hpp touch rdk/ds/videoOutputPortType.hpp touch rdk/ds/videoResolution.hpp touch rdk/ds/frontPanelIndicator.hpp touch rdk/ds/frontPanelConfig.hpp -touch rdk/ds/frontPanelTextDisplay.hpp # rfcapi.h (types provided via -include Rfc.h) touch rfcapi.h @@ -172,9 +154,6 @@ cd ${GITHUB_WORKSPACE} mkdir -p "${GITHUB_WORKSPACE}/install/usr/include" printf '{}\n' > "${GITHUB_WORKSPACE}/install/usr/include/ctrlm_config_empty.json" -# Copy system headers for compatibility -cp -r /usr/include/glib-2.0/* /usr/lib/x86_64-linux-gnu/glib-2.0/include/* "${HEADERS_DIR}/" 2>/dev/null || true - ############################ # 4. Create stub shared libraries for linking echo "======================================================================================" @@ -189,7 +168,7 @@ void __stub_placeholder(void) {} STUB_EOF # Build stub .so for each missing library -for lib in xr-voice-sdk rdkversion IARMBus ds dshalcli nopoll rfcapi secure_wrapper evdev; do +for lib in xr-voice-sdk rdkversion IARMBus ds rfcapi secure_wrapper evdev; do gcc -shared -fPIC -o "${STUB_LIB_DIR}/lib${lib}.so" /tmp/stub.c done diff --git a/ci/cov_build.sh b/ci/cov_build.sh index e7b9c37f..8e34ff98 100644 --- a/ci/cov_build.sh +++ b/ci/cov_build.sh @@ -75,9 +75,6 @@ cmake -G Ninja -S "$GITHUB_WORKSPACE" -B build/control \ -I ${HEADERS_DIR} \ -I ${HEADERS_DIR}/rdk/iarmbus \ -I ${HEADERS_DIR}/rdk/ds \ --I ${HEADERS_DIR}/rdk/ds-rpc \ --I ${HEADERS_DIR}/rdk/ds-hal \ --I ${HEADERS_DIR}/rdk/halif/ds-hal \ -I ${HEADERS_DIR}/rdk/iarmmgrs-hal \ -I ${GITHUB_WORKSPACE}/install/usr/include \ -I /usr/include/glib-2.0 \ From a2bd13bb96bacab669587e9f86c78c999d4bda35 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Tue, 21 Apr 2026 13:50:11 +0000 Subject: [PATCH 40/72] Testing --- ci/build_dependencies.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh index 97fc0e47..9ab9c930 100644 --- a/ci/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -168,7 +168,9 @@ void __stub_placeholder(void) {} STUB_EOF # Build stub .so for each missing library -for lib in xr-voice-sdk rdkversion IARMBus ds rfcapi secure_wrapper evdev; do +# nopoll and dshalcli are unused (factory-only) but unconditionally linked by CMakeLists.txt +# We can remove them from the link list in the future if desired, but for now just provide stubs to satisfy the linker. +for lib in xr-voice-sdk rdkversion IARMBus ds nopoll dshalcli rfcapi secure_wrapper evdev; do gcc -shared -fPIC -o "${STUB_LIB_DIR}/lib${lib}.so" /tmp/stub.c done From 02d9da3b26873519037e4be6f236af61aa7bf324 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Tue, 21 Apr 2026 11:24:40 -0400 Subject: [PATCH 41/72] Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- NOTICE | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/NOTICE b/NOTICE index 1c76658f..d103597c 100644 --- a/NOTICE +++ b/NOTICE @@ -18,13 +18,3 @@ Some files in this repository were originally generated from XML using qdbusxml2 Copyright 2024 Comcast Cable Communications Management, LLC Licensed under the Apache License, Version 2.0 - -Copyright (c) 2007 Dave Airlie -Copyright (c) 2007 Jakob Bornecrantz -Copyright (c) 2008 Red Hat Inc. -Copyright (c) 2007-2008 Tungsten Graphics, Inc., Cedar Park, TX., USA -Copyright (c) 2007-2008 Intel Corporation -Licensed under the MIT License - -Based on pxCore, Copyright 2015-2018 John Robinson -Licensed under the Apache License, Version 2.0 From 69e0be26ddc40dc6dbae355cc48bc1776ed2cb66 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Tue, 21 Apr 2026 15:25:26 +0000 Subject: [PATCH 42/72] Removing rdkversion mock --- ci/build_dependencies.sh | 8 ++++++++ ci/mocks/control/rdkversion.h | 33 --------------------------------- 2 files changed, 8 insertions(+), 33 deletions(-) delete mode 100644 ci/mocks/control/rdkversion.h diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh index 9ab9c930..736cc11a 100644 --- a/ci/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -64,9 +64,13 @@ git -C rdk-halif-deepsleep_manager sparse-checkout set include git clone --depth 1 --filter=blob:none --sparse https://github.com/rdkcentral/rdk-halif-power_manager.git git -C rdk-halif-power_manager sparse-checkout set include +git clone --depth 1 --filter=blob:none --sparse --branch develop https://github.com/rdkcentral/rdkversion.git +git -C rdkversion sparse-checkout set src + IARMMGRS_DIR="$GITHUB_WORKSPACE/iarmmgrs" DEEPSLEEP_HAL_DIR="$GITHUB_WORKSPACE/rdk-halif-deepsleep_manager" POWER_HAL_DIR="$GITHUB_WORKSPACE/rdk-halif-power_manager" +RDKVERSION_DIR="$GITHUB_WORKSPACE/rdkversion" ############################ # 3. Create stub/empty headers for external dependencies @@ -140,6 +144,10 @@ touch rfcapi.h find "$IARMMGRS_DIR" -name comcastIrKeyCodes.h -print -quit | xargs -r -I{} cp "{}" comcastIrKeyCodes.h [ -f comcastIrKeyCodes.h ] +# rdkversion.h (used by ctrlm_main.cpp) +cp "$RDKVERSION_DIR/src/rdkversion.h" rdkversion.h +[ -f rdkversion.h ] + # secure_wrapper (types provided via empty stub — no v_secure_* calls in core) touch secure_wrapper.h diff --git a/ci/mocks/control/rdkversion.h b/ci/mocks/control/rdkversion.h deleted file mode 100644 index fd27f7e3..00000000 --- a/ci/mocks/control/rdkversion.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Stub for rdkversion.h - * - * Copyright 2026 RDK Management - * Licensed under the Apache License, Version 2.0 - */ -#ifndef _RDKVERSION_H_ -#define _RDKVERSION_H_ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct { - char *image_name; - char *stb_name; - char *branch_name; - char *version_name; - char *image_build_time; - bool production_build; - char *parse_error; -} rdk_version_info_t; - -int rdk_version_parse_version(rdk_version_info_t *info); -void rdk_version_object_free(rdk_version_info_t *info); - -#ifdef __cplusplus -} -#endif - -#endif /* _RDKVERSION_H_ */ From 799d6673d8790790af9b8b0e612ef5ed904bc54d Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Tue, 21 Apr 2026 11:27:51 -0400 Subject: [PATCH 43/72] Update ci/build_dependencies.sh Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- ci/build_dependencies.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh index 736cc11a..5b46e12f 100644 --- a/ci/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -49,11 +49,15 @@ pip install jsonref # 2. Clone the required repositories # 1.0.13 -git clone https://github.com/rdkcentral/xr-voice-sdk.git -git -C xr-voice-sdk checkout e55c99a0ec947b0ad3efc308bf8e3de0a42140d5 - -git clone https://github.com/rdkcentral/entservices-testframework.git -git -C entservices-testframework checkout 584e3ec70fd5e044982910b4eb15c465808bb6d1 +git init xr-voice-sdk +git -C xr-voice-sdk remote add origin https://github.com/rdkcentral/xr-voice-sdk.git +git -C xr-voice-sdk fetch --depth 1 --filter=blob:none origin e55c99a0ec947b0ad3efc308bf8e3de0a42140d5 +git -C xr-voice-sdk checkout FETCH_HEAD + +git init entservices-testframework +git -C entservices-testframework remote add origin https://github.com/rdkcentral/entservices-testframework.git +git -C entservices-testframework fetch --depth 1 --filter=blob:none origin 584e3ec70fd5e044982910b4eb15c465808bb6d1 +git -C entservices-testframework checkout FETCH_HEAD git clone --depth 1 --filter=blob:none --sparse --branch develop https://github.com/rdkcentral/iarmmgrs.git git -C iarmmgrs sparse-checkout set hal From 3ec51bc1976dfa46e0e38ec1cf80b82d9fc59780 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Tue, 21 Apr 2026 11:48:54 -0400 Subject: [PATCH 44/72] Update ci/cov_build.sh Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- ci/cov_build.sh | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/ci/cov_build.sh b/ci/cov_build.sh index 8e34ff98..81db9233 100644 --- a/ci/cov_build.sh +++ b/ci/cov_build.sh @@ -100,13 +100,9 @@ cmake -G Ninja -S "$GITHUB_WORKSPACE" -B build/control \ -Wall -Wno-error \ -DSAFEC_DUMMY_API \ -DDISABLE_SECURITY_TOKEN" \ --DCMAKE_EXE_LINKER_FLAGS="-L${GITHUB_WORKSPACE}/install/usr/lib -Wl,--unresolved-symbols=ignore-all" - - -# control's CMakeLists.txt adds -Werror via target_compile_options, which appends -# after CMAKE_CXX_FLAGS and overrides our -Wno-error. Strip it from generated build files. -find "${GITHUB_WORKSPACE}/build/control" \( -name "*.ninja" -o -name "flags.make" \) -exec sed -i 's/\(^\|[[:space:]]\)-Werror\([[:space:]]\|$\)/\1\2/g' {} \; - +-DCMAKE_EXE_LINKER_FLAGS="-L${GITHUB_WORKSPACE}/install/usr/lib -Wl,--unresolved-symbols=ignore-all" \ +-DCMAKE_COMPILE_WARNING_AS_ERROR=OFF \ +-DCTRLM_WERROR=OFF cmake --build build/control -j$(nproc) 2>&1 echo "======================================================================================" echo "control build complete" From 47a30b6abd3c33ef83926e70ab87291f3670582c Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Tue, 21 Apr 2026 15:49:12 +0000 Subject: [PATCH 45/72] Update --- ci/build_dependencies.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh index 5b46e12f..2a3d5183 100644 --- a/ci/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -107,8 +107,10 @@ touch rdk/iarmbus/libIBus.h touch rdk/iarmbus/libIBusDaemon.h # IARM manager headers -# sysMgr.h is included by ctrlm, but the required SYSMgr types already come from the forced -# Iarm.h mock. Using the real header here causes duplicate typedefs, so provide a shim only. +# sysMgr.h conflicts with the forced Iarm.h mock, which already provides the +# needed SYSMgr types. Use a shim here. To remove it later, either stop +# force-including those overlapping Iarm.h declarations or drop sysMgr.h from +# ctrlm source. cat > rdk/iarmmgrs-hal/sysMgr.h <<'EOF' #ifndef CTRLM_CI_SYSMGR_SHIM_H #define CTRLM_CI_SYSMGR_SHIM_H From 8915c26edf0622ebd9f53522fb0d9ae28738856f Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Tue, 21 Apr 2026 15:50:49 +0000 Subject: [PATCH 46/72] Update --- LICENSE | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/LICENSE b/LICENSE index 5c3c293d..d6456956 100644 --- a/LICENSE +++ b/LICENSE @@ -200,26 +200,3 @@ 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. - - -MIT License - -Copyright (c) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. From 42bf11679de926b95cdb33230d6ee60085d15599 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Tue, 21 Apr 2026 16:24:01 +0000 Subject: [PATCH 47/72] Small tweaks to git commands --- ci/build_dependencies.sh | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh index 2a3d5183..cb22d26e 100644 --- a/ci/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -48,16 +48,9 @@ pip install jsonref ########################################### # 2. Clone the required repositories -# 1.0.13 -git init xr-voice-sdk -git -C xr-voice-sdk remote add origin https://github.com/rdkcentral/xr-voice-sdk.git -git -C xr-voice-sdk fetch --depth 1 --filter=blob:none origin e55c99a0ec947b0ad3efc308bf8e3de0a42140d5 -git -C xr-voice-sdk checkout FETCH_HEAD - -git init entservices-testframework -git -C entservices-testframework remote add origin https://github.com/rdkcentral/entservices-testframework.git -git -C entservices-testframework fetch --depth 1 --filter=blob:none origin 584e3ec70fd5e044982910b4eb15c465808bb6d1 -git -C entservices-testframework checkout FETCH_HEAD +git clone --depth 1 --filter=blob:none --branch develop https://github.com/rdkcentral/xr-voice-sdk.git + +git clone --depth 1 --filter=blob:none --branch develop https://github.com/rdkcentral/entservices-testframework.git git clone --depth 1 --filter=blob:none --sparse --branch develop https://github.com/rdkcentral/iarmmgrs.git git -C iarmmgrs sparse-checkout set hal From 81392f9ff171eb8d270d697c04bf3b7109b8eb8c Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Tue, 21 Apr 2026 16:55:04 +0000 Subject: [PATCH 48/72] Updating mock comments --- ci/mocks/control/rdkx_logger.h | 9 +++++++++ ci/mocks/control/xr_voice_sdk.h | 8 ++++++++ ci/mocks/safec_lib.h | 4 ++++ ci/mocks/testframework/devicesettings.h | 9 +++++++++ ci/mocks/testframework_overrides.h | 7 +++++-- 5 files changed, 35 insertions(+), 2 deletions(-) diff --git a/ci/mocks/control/rdkx_logger.h b/ci/mocks/control/rdkx_logger.h index 4ea58c39..9e35a84c 100644 --- a/ci/mocks/control/rdkx_logger.h +++ b/ci/mocks/control/rdkx_logger.h @@ -16,6 +16,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + +/* + * CI mock for the installed rdkx logger surface. + * + * ctrlm and xr_voice_sdk.h expect logger types, macros, and some std:: names + * from rdkx_logger.h, but that installed header is not available as a simple + * source header in this reduced native build. This file provides only the + * compile-time surface ctrlm needs and keeps logging as a no-op in CI. + */ #ifndef _RDKX_LOGGER_H_ #define _RDKX_LOGGER_H_ diff --git a/ci/mocks/control/xr_voice_sdk.h b/ci/mocks/control/xr_voice_sdk.h index d150e4f5..7fd26dc1 100644 --- a/ci/mocks/control/xr_voice_sdk.h +++ b/ci/mocks/control/xr_voice_sdk.h @@ -4,6 +4,14 @@ * Copyright 2026 RDK Management * Licensed under the Apache License, Version 2.0 */ + +/* + * CI compatibility header for the small portion of the VSDK API used by ctrlm. + * + * The real xr_voice_sdk.h pulls in additional SDK and logger headers, including + * the installed rdkx_logger surface, which are not self-contained in this + * reduced native build. This mock keeps only the declarations ctrlm uses. + */ #ifndef _XR_VOICE_SDK_H_ #define _XR_VOICE_SDK_H_ diff --git a/ci/mocks/safec_lib.h b/ci/mocks/safec_lib.h index 08edb533..0441bb9e 100644 --- a/ci/mocks/safec_lib.h +++ b/ci/mocks/safec_lib.h @@ -24,6 +24,10 @@ * In CI this file is copied from ci/mocks/ into ci/headers/ by * build_dependencies.sh so it is resolved on the generated-headers include * path used by cov_build.sh. + * + * This exists because ctrlm includes safec_lib.h directly, while the native CI + * environment provides the underlying libsafec package headers instead of that + * project-local wrapper. */ #ifndef _SAFEC_LIB_H_ diff --git a/ci/mocks/testframework/devicesettings.h b/ci/mocks/testframework/devicesettings.h index 28927b64..2a8fb270 100644 --- a/ci/mocks/testframework/devicesettings.h +++ b/ci/mocks/testframework/devicesettings.h @@ -20,6 +20,15 @@ #pragma once +/* + * CI aggregate of the device-settings type surface ctrlm needs. + * + * The reduced native build does not bring in the full device-settings header + * stack, and ctrlm relies on these types across many translation units. This + * file is force-included in CI to provide those declarations without pulling in + * the full runtime dependency set. + */ + #include #include #include diff --git a/ci/mocks/testframework_overrides.h b/ci/mocks/testframework_overrides.h index c9fe9c00..1e98f64a 100644 --- a/ci/mocks/testframework_overrides.h +++ b/ci/mocks/testframework_overrides.h @@ -17,8 +17,11 @@ * limitations under the License. */ /* - * Supplements the entservices-testframework mocks with declarations ctrlm needs - * that are not (yet) in the upstream testframework develop branch. We can remove this file once the necessary declarations are merged upstream. + * CI patch layer for gaps in the entservices-testframework mock headers. + * + * ctrlm needs a few IARM declarations that are missing from the testframework + * headers used by this reduced build. This file adds only those missing pieces + * and can be removed once they exist upstream. */ #ifndef _CONTROL_TESTFRAMEWORK_OVERRIDES_H_ #define _CONTROL_TESTFRAMEWORK_OVERRIDES_H_ From a4584baea53dee14d554f6552e40fd10019f49e2 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Tue, 21 Apr 2026 16:58:09 +0000 Subject: [PATCH 49/72] Clean up --- ci/mocks/testframework/devicesettings.h | 1 - 1 file changed, 1 deletion(-) diff --git a/ci/mocks/testframework/devicesettings.h b/ci/mocks/testframework/devicesettings.h index 2a8fb270..2b3397d3 100644 --- a/ci/mocks/testframework/devicesettings.h +++ b/ci/mocks/testframework/devicesettings.h @@ -69,7 +69,6 @@ typedef unsigned int drm_drawable_t; #include #include #include -#include typedef enum _dsAudioPortType_t { dsAUDIOPORT_TYPE_ID_LR, /**< RCA audio output. */ From 1834446d065f0f95ce95ef7b8c241b93b0c54cc9 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Tue, 21 Apr 2026 17:05:27 +0000 Subject: [PATCH 50/72] Making changes suggested from copilot --- ci/mocks/control/rdkx_logger.h | 4 ++-- ci/mocks/control/xr_voice_sdk.h | 6 +++--- ci/mocks/safec_lib.h | 6 +++--- ci/mocks/testframework_overrides.h | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/ci/mocks/control/rdkx_logger.h b/ci/mocks/control/rdkx_logger.h index 9e35a84c..2504b27b 100644 --- a/ci/mocks/control/rdkx_logger.h +++ b/ci/mocks/control/rdkx_logger.h @@ -25,8 +25,8 @@ * source header in this reduced native build. This file provides only the * compile-time surface ctrlm needs and keeps logging as a no-op in CI. */ -#ifndef _RDKX_LOGGER_H_ -#define _RDKX_LOGGER_H_ +#ifndef CTRLM_CI_RDKX_LOGGER_H_ +#define CTRLM_CI_RDKX_LOGGER_H_ #ifdef __cplusplus #include diff --git a/ci/mocks/control/xr_voice_sdk.h b/ci/mocks/control/xr_voice_sdk.h index 7fd26dc1..e177ea24 100644 --- a/ci/mocks/control/xr_voice_sdk.h +++ b/ci/mocks/control/xr_voice_sdk.h @@ -12,8 +12,8 @@ * the installed rdkx_logger surface, which are not self-contained in this * reduced native build. This mock keeps only the declarations ctrlm uses. */ -#ifndef _XR_VOICE_SDK_H_ -#define _XR_VOICE_SDK_H_ +#ifndef CTRLM_CI_XR_VOICE_SDK_H_ +#define CTRLM_CI_XR_VOICE_SDK_H_ #include #include @@ -47,4 +47,4 @@ void vsdk_thread_poll(vsdk_thread_poll_response_t response, void *data); } #endif -#endif /* _XR_VOICE_SDK_H_ */ +#endif /* CTRLM_CI_XR_VOICE_SDK_H_ */ diff --git a/ci/mocks/safec_lib.h b/ci/mocks/safec_lib.h index 0441bb9e..37d75748 100644 --- a/ci/mocks/safec_lib.h +++ b/ci/mocks/safec_lib.h @@ -30,8 +30,8 @@ * project-local wrapper. */ -#ifndef _SAFEC_LIB_H_ -#define _SAFEC_LIB_H_ +#ifndef CTRLM_CI_SAFEC_LIB_H_ +#define CTRLM_CI_SAFEC_LIB_H_ #include #include @@ -41,4 +41,4 @@ #define ERR_CHK(rc) do { (void)(rc); } while(0) #endif -#endif /* _SAFEC_LIB_H_ */ +#endif /* CTRLM_CI_SAFEC_LIB_H_ */ diff --git a/ci/mocks/testframework_overrides.h b/ci/mocks/testframework_overrides.h index 1e98f64a..520aba6b 100644 --- a/ci/mocks/testframework_overrides.h +++ b/ci/mocks/testframework_overrides.h @@ -23,8 +23,8 @@ * headers used by this reduced build. This file adds only those missing pieces * and can be removed once they exist upstream. */ -#ifndef _CONTROL_TESTFRAMEWORK_OVERRIDES_H_ -#define _CONTROL_TESTFRAMEWORK_OVERRIDES_H_ +#ifndef CTRLM_CI_TESTFRAMEWORK_OVERRIDES_H_ +#define CTRLM_CI_TESTFRAMEWORK_OVERRIDES_H_ /* ctrlm-main calls IARM_Bus_RegisterEvent as a plain function (defined in stubs_iarm.cpp) */ extern IARM_Result_t IARM_Bus_RegisterEvent(IARM_EventId_t maxEventId); @@ -48,4 +48,4 @@ typedef struct { #define IARM_BUS_COMMON_API_PowerPreChange_Param_t IARM_Bus_CommonAPI_PowerPreChange_Param_t #endif -#endif /* _CONTROL_TESTFRAMEWORK_OVERRIDES_H_ */ +#endif /* CTRLM_CI_TESTFRAMEWORK_OVERRIDES_H_ */ From 11b658945b7759926f93dcc9189f9101f588f3a3 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Tue, 21 Apr 2026 17:09:41 +0000 Subject: [PATCH 51/72] Updates --- ci/mocks/testframework/devicesettings.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ci/mocks/testframework/devicesettings.h b/ci/mocks/testframework/devicesettings.h index 2b3397d3..5a26332f 100644 --- a/ci/mocks/testframework/devicesettings.h +++ b/ci/mocks/testframework/devicesettings.h @@ -671,12 +671,12 @@ class Exception : public std::exception { std::string _msg; public: - Exception(const char* msg = "No Message for this exception") throw() + Exception(const char* msg = "No Message for this exception") noexcept : _msg(msg) { } - Exception(int err, const char* msg = "No Message for this Exception") throw() + Exception(int err, const char* msg = "No Message for this Exception") noexcept : _err(err) , _msg(msg){}; @@ -690,12 +690,12 @@ class Exception : public std::exception { return _err; } - virtual const char* what() const throw() + virtual const char* what() const noexcept { return _msg.c_str(); } - virtual ~Exception() throw(){}; + virtual ~Exception() noexcept{}; }; } From e551ccdc67699b1979f04d39001370dfd8115293 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Tue, 21 Apr 2026 17:10:34 +0000 Subject: [PATCH 52/72] Updates --- ci/mocks/testframework/devicesettings.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/mocks/testframework/devicesettings.h b/ci/mocks/testframework/devicesettings.h index 5a26332f..2df6f760 100644 --- a/ci/mocks/testframework/devicesettings.h +++ b/ci/mocks/testframework/devicesettings.h @@ -649,7 +649,7 @@ typedef enum _dsDisplayQuantizationRange_t } dsDisplayQuantizationRange_t; typedef uint32_t dsFPDColor_t; -#define dsFPDColor_Make(R8,G8,B8) (((R8)<< 8)|((G8)<<8)|((B8) )) +#define dsFPDColor_Make(R8,G8,B8) (((R8)<<16)|((G8)<<8)|((B8))) #define dsFPD_COLOR_WHITE dsFPDColor_Make(0xFF, 0xFF, 0xFF) typedef struct _dsFPDColorConfig_t{ From f13e68840362fc9e8be0e985b1e8dde510e9d54f Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Tue, 21 Apr 2026 13:11:19 -0400 Subject: [PATCH 53/72] Update ci/cov_build.sh Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- ci/cov_build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/cov_build.sh b/ci/cov_build.sh index 81db9233..5bee1ffd 100644 --- a/ci/cov_build.sh +++ b/ci/cov_build.sh @@ -21,7 +21,7 @@ set -x set -e ############################## GITHUB_WORKSPACE="${PWD}" -ls -la ${GITHUB_WORKSPACE} +ls -la "${GITHUB_WORKSPACE}" ############################ # Build control (ctrlm-main) From 71f0eb55371c9db363b9425d6978c2725035471c Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Tue, 21 Apr 2026 13:11:42 -0400 Subject: [PATCH 54/72] Update ci/mocks/control/rdkx_logger.h Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- ci/mocks/control/rdkx_logger.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/mocks/control/rdkx_logger.h b/ci/mocks/control/rdkx_logger.h index 2504b27b..861948ba 100644 --- a/ci/mocks/control/rdkx_logger.h +++ b/ci/mocks/control/rdkx_logger.h @@ -172,7 +172,7 @@ typedef struct { #endif /* XLOGD_OUTPUT is used as an output-handle VALUE (second arg to xlog_fprintf), not a logging macro */ #ifndef XLOGD_OUTPUT -#define XLOGD_OUTPUT NULL +#define XLOGD_OUTPUT 0 #endif #ifndef XLOGD_AUTOMATION_INFO From e0b3a17f18a1d63c1dffae225b214a2f4dec1c37 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Tue, 21 Apr 2026 17:45:11 +0000 Subject: [PATCH 55/72] Test --- ci/cov_build.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ci/cov_build.sh b/ci/cov_build.sh index 5bee1ffd..611d8abb 100644 --- a/ci/cov_build.sh +++ b/ci/cov_build.sh @@ -100,9 +100,13 @@ cmake -G Ninja -S "$GITHUB_WORKSPACE" -B build/control \ -Wall -Wno-error \ -DSAFEC_DUMMY_API \ -DDISABLE_SECURITY_TOKEN" \ --DCMAKE_EXE_LINKER_FLAGS="-L${GITHUB_WORKSPACE}/install/usr/lib -Wl,--unresolved-symbols=ignore-all" \ --DCMAKE_COMPILE_WARNING_AS_ERROR=OFF \ --DCTRLM_WERROR=OFF +-DCMAKE_EXE_LINKER_FLAGS="-L${GITHUB_WORKSPACE}/install/usr/lib -Wl,--unresolved-symbols=ignore-all" + +# CMakeLists.txt unconditionally adds -Werror via target_compile_options, which +# appends after CMAKE_CXX_FLAGS and overrides our -Wno-error. Strip it from +# the generated build files after cmake configure. +find "${GITHUB_WORKSPACE}/build/control" \( -name "*.ninja" -o -name "flags.make" \) -exec sed -i 's/\(^\|[[:space:]]\)-Werror\([[:space:]]\|$\)/\1\2/g' {} \; + cmake --build build/control -j$(nproc) 2>&1 echo "======================================================================================" echo "control build complete" From 6ffeaafe26d0d691ce028eabac257ba85bbad352 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Tue, 21 Apr 2026 17:49:34 +0000 Subject: [PATCH 56/72] Updates --- ci/mocks/control/rdkx_logger.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/mocks/control/rdkx_logger.h b/ci/mocks/control/rdkx_logger.h index 861948ba..468c2e31 100644 --- a/ci/mocks/control/rdkx_logger.h +++ b/ci/mocks/control/rdkx_logger.h @@ -210,4 +210,4 @@ typedef struct { #define XLOG_FLUSH() do { } while(0) #endif -#endif /* _RDKX_LOGGER_H_ */ +#endif /* CTRLM_CI_RDKX_LOGGER_H_ */ From 846908808accae3602ce1fdf848b9d975c7f1ad9 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Tue, 21 Apr 2026 18:42:21 +0000 Subject: [PATCH 57/72] Initial commit of mock reduction --- ci/mocks/control/rdkx_logger.h | 213 -------------------------------- ci/mocks/control/xr_voice_sdk.h | 50 -------- 2 files changed, 263 deletions(-) delete mode 100644 ci/mocks/control/rdkx_logger.h delete mode 100644 ci/mocks/control/xr_voice_sdk.h diff --git a/ci/mocks/control/rdkx_logger.h b/ci/mocks/control/rdkx_logger.h deleted file mode 100644 index 468c2e31..00000000 --- a/ci/mocks/control/rdkx_logger.h +++ /dev/null @@ -1,213 +0,0 @@ -/* - * If not stated otherwise in this file or this component's license file the - * following copyright and licenses apply: - * - * Copyright 2026 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. - */ - -/* - * CI mock for the installed rdkx logger surface. - * - * ctrlm and xr_voice_sdk.h expect logger types, macros, and some std:: names - * from rdkx_logger.h, but that installed header is not available as a simple - * source header in this reduced native build. This file provides only the - * compile-time surface ctrlm needs and keeps logging as a no-op in CI. - */ -#ifndef CTRLM_CI_RDKX_LOGGER_H_ -#define CTRLM_CI_RDKX_LOGGER_H_ - -#ifdef __cplusplus -#include -#include -#include -/* The real rdkx_logger.h pulls in std:: namespace indirectly; replicate only the needed names here */ -// ctrlm expects these to be in the global namespace, so we need to pull them in here -using std::get; -using std::map; -using std::string; -using std::tuple; -#endif - -/* Log option flags */ -#define XLOG_OPTS_DATE (1 << 0) -#define XLOG_OPTS_TIME (1 << 1) -#define XLOG_OPTS_LF (1 << 2) -#define XLOG_OPTS_MOD_NAME (1 << 3) -#define XLOG_OPTS_LEVEL (1 << 4) -#define XLOG_OPTS_COLOR (1 << 5) - -/* Module IDs */ -#define XLOG_MODULE_ID_CTRLM 0 -#define XLOG_MODULE_ID_VSDK 1 -#define XLOG_MODULE_ID_XRAUDIO 2 - -#ifndef XLOG_MODULE_ID -#define XLOG_MODULE_ID XLOG_MODULE_ID_CTRLM -#endif - -/* Stub types and functions used by xlog_fprintf */ -#ifndef XLOG_OPTS_DEFAULT -#define XLOG_OPTS_DEFAULT 0 -#endif - -#ifndef XLOG_COLOR_NONE -#define XLOG_COLOR_NONE 0 -#endif - -#ifndef XLOG_COLOR_BLU -#define XLOG_COLOR_BLU 0 -#endif - -#ifndef XLOG_COLOR_GRN -#define XLOG_COLOR_GRN 0 -#endif - -#ifndef XLOG_LINE_NONE -#define XLOG_LINE_NONE 0 -#endif - -typedef int xlog_level_t; - -#ifndef XLOG_LEVEL_DEBUG -#define XLOG_LEVEL_DEBUG 0 -#endif - -#ifndef XLOG_LEVEL_INFO -#define XLOG_LEVEL_INFO 1 -#endif - -#ifndef XLOG_LEVEL_WARN -#define XLOG_LEVEL_WARN 2 -#endif - -#ifndef XLOG_LEVEL_ERROR -#define XLOG_LEVEL_ERROR 3 -#endif - -#ifndef XLOG_LEVEL_FATAL -#define XLOG_LEVEL_FATAL 4 -#endif - -#ifndef XLOG_LEVEL_TELEMETRY -#define XLOG_LEVEL_TELEMETRY 5 -#endif - -#ifndef XLOG_BUF_SIZE_DEFAULT -#define XLOG_BUF_SIZE_DEFAULT 0 -#endif - -typedef struct { - int options; - int color; - const char *function; - int line; - int level; - int id; - int size_max; -} xlog_args_t; - -#ifndef xlog_fprintf -#define xlog_fprintf(args, output, fmt, ...) do { (void)(args); (void)(output); (void)sizeof(fmt); } while(0) -#endif - -#ifndef xlog_printf -#define xlog_printf(args, fmt, ...) do { (void)(args); (void)sizeof(fmt); } while(0) -#endif - -#ifndef xlog_init -#define xlog_init(id, path, options, console, syslog) (0) -#endif - -#ifndef xlog_level_set_all -#define xlog_level_set_all(level) do { (void)(level); } while(0) -#endif - -#ifndef xlog_level_get -#define xlog_level_get(id) (XLOG_LEVEL_INFO) -#endif - -#ifndef xlog_term -#define xlog_term() do { } while(0) -#endif - -/* Logging macros - silently discard in stub builds (avoids -Werror=format-zero-length) */ -#ifndef XLOGD -#define XLOGD(level, opts, color, size, fmt, ...) do { (void)(level); (void)(opts); (void)(color); (void)(size); (void)sizeof(fmt); } while(0) -#endif -#ifndef XLOGD_INFO -#define XLOGD_INFO(fmt, ...) do { (void)sizeof(fmt); } while(0) -#endif -#ifndef XLOGD_DEBUG -#define XLOGD_DEBUG(fmt, ...) do { (void)sizeof(fmt); } while(0) -#endif -#ifndef XLOGD_ERROR -#define XLOGD_ERROR(fmt, ...) do { (void)sizeof(fmt); } while(0) -#endif -#ifndef XLOGD_WARN -#define XLOGD_WARN(fmt, ...) do { (void)sizeof(fmt); } while(0) -#endif -#ifndef XLOGD_FATAL -#define XLOGD_FATAL(fmt, ...) do { (void)sizeof(fmt); } while(0) -#endif -#ifndef XLOGD_TELEMETRY -#define XLOGD_TELEMETRY(fmt, ...) do { (void)sizeof(fmt); } while(0) -#endif -#ifndef XLOGD_INFO_OPTS -#define XLOGD_INFO_OPTS(opts, fmt, ...) do { (void)(opts); (void)sizeof(fmt); } while(0) -#endif -#ifndef XLOGD_NO_LF -#define XLOGD_NO_LF(level, fmt, ...) do { (void)(level); (void)sizeof(fmt); } while(0) -#endif -/* XLOGD_OUTPUT is used as an output-handle VALUE (second arg to xlog_fprintf), not a logging macro */ -#ifndef XLOGD_OUTPUT -#define XLOGD_OUTPUT 0 -#endif - -#ifndef XLOGD_AUTOMATION_INFO -#define XLOGD_AUTOMATION_INFO(fmt, ...) do { (void)sizeof(fmt); } while(0) -#endif -#ifndef XLOGD_AUTOMATION_DEBUG -#define XLOGD_AUTOMATION_DEBUG(fmt, ...) do { (void)sizeof(fmt); } while(0) -#endif -#ifndef XLOGD_AUTOMATION_ERROR -#define XLOGD_AUTOMATION_ERROR(fmt, ...) do { (void)sizeof(fmt); } while(0) -#endif -#ifndef XLOGD_AUTOMATION_WARN -#define XLOGD_AUTOMATION_WARN(fmt, ...) do { (void)sizeof(fmt); } while(0) -#endif -#ifndef XLOGD_AUTOMATION_TELEMETRY -#define XLOGD_AUTOMATION_TELEMETRY(fmt, ...) do { (void)sizeof(fmt); } while(0) -#endif - -#ifndef XLOG_INFO -#define XLOG_INFO(fmt, ...) do { (void)sizeof(fmt); } while(0) -#endif -#ifndef XLOG_DEBUG -#define XLOG_DEBUG(fmt, ...) do { (void)sizeof(fmt); } while(0) -#endif -#ifndef XLOG_ERROR -#define XLOG_ERROR(fmt, ...) do { (void)sizeof(fmt); } while(0) -#endif -#ifndef XLOG_WARN -#define XLOG_WARN(fmt, ...) do { (void)sizeof(fmt); } while(0) -#endif -#ifndef XLOG_RAW -#define XLOG_RAW(fmt, ...) do { (void)sizeof(fmt); } while(0) -#endif -#ifndef XLOG_FLUSH -#define XLOG_FLUSH() do { } while(0) -#endif - -#endif /* CTRLM_CI_RDKX_LOGGER_H_ */ diff --git a/ci/mocks/control/xr_voice_sdk.h b/ci/mocks/control/xr_voice_sdk.h deleted file mode 100644 index e177ea24..00000000 --- a/ci/mocks/control/xr_voice_sdk.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Stub for xr_voice_sdk.h - * - * Copyright 2026 RDK Management - * Licensed under the Apache License, Version 2.0 - */ - -/* - * CI compatibility header for the small portion of the VSDK API used by ctrlm. - * - * The real xr_voice_sdk.h pulls in additional SDK and logger headers, including - * the installed rdkx_logger surface, which are not self-contained in this - * reduced native build. This mock keeps only the declarations ctrlm uses. - */ -#ifndef CTRLM_CI_XR_VOICE_SDK_H_ -#define CTRLM_CI_XR_VOICE_SDK_H_ - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* xr_voice_sdk API */ -int xr_voice_sdk_init(void); -int xr_voice_sdk_term(void); - -/* vsdk API used by ctrlm-main */ -#define VSDK_VERSION_QTY_MAX (16) - -typedef struct { - const char *name; - const char *version; - const char *branch; - const char *commit_id; -} vsdk_version_info_t; - -typedef void (*vsdk_thread_poll_response_t)(void *data); - -void vsdk_version(vsdk_version_info_t *info, uint32_t *qty); -bool vsdk_init(bool console, const char *filename, uint32_t file_size_max); -void vsdk_term(void); -void vsdk_thread_poll(vsdk_thread_poll_response_t response, void *data); - -#ifdef __cplusplus -} -#endif - -#endif /* CTRLM_CI_XR_VOICE_SDK_H_ */ From 10579d0b92056b31fcec888a48a1060f711669be Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Tue, 21 Apr 2026 18:42:28 +0000 Subject: [PATCH 58/72] Updates --- ci/build_dependencies.sh | 12 +++++++++-- ci/cov_build.sh | 5 ++--- ci/mocks/xlog_ci_compat.h | 42 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 54 insertions(+), 5 deletions(-) create mode 100644 ci/mocks/xlog_ci_compat.h diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh index cb22d26e..c1929922 100644 --- a/ci/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -82,8 +82,7 @@ mkdir -p "${HEADERS_DIR}/rdk/ds" mkdir -p "${HEADERS_DIR}/rdk/iarmmgrs-hal" mkdir -p "${XRSDK_HEADERS_DIR}" -# Copy real xr-voice-sdk headers where control's source matches the real API. -# xr_voice_sdk.h is NOT copied: it requires rdkx_logger.h installed types unavailable in source form. +# Copy real xr-voice-sdk headers. # xr_fdc.h is NOT copied: only needed when FDC_ENABLED=ON cp "$GITHUB_WORKSPACE/xr-voice-sdk/src/xr-speech-vrex/xrsv.h" "${XRSDK_HEADERS_DIR}/" cp "$GITHUB_WORKSPACE/xr-voice-sdk/src/xr-speech-router/xrsr.h" "${XRSDK_HEADERS_DIR}/" @@ -92,6 +91,15 @@ cp "$GITHUB_WORKSPACE/xr-voice-sdk/src/xr-speech-vrex/xrsv_http/xrsv_http.h" "${ cp "$GITHUB_WORKSPACE/xr-voice-sdk/src/xr-speech-vrex/xrsv_ws_nextgen/xrsv_ws_nextgen.h" "${XRSDK_HEADERS_DIR}/" cp "$GITHUB_WORKSPACE/xr-voice-sdk/src/xr-timestamp/xr_timestamp.h" "${XRSDK_HEADERS_DIR}/" +# Generate rdkx_logger_modules.h from xr-voice-sdk's module configuration, +# then copy the real rdkx_logger and xr_voice_sdk headers. +# This replaces the hand-written ci/mocks/control/ stubs. +python3 "$GITHUB_WORKSPACE/xr-voice-sdk/scripts/rdkx_logger_modules_to_c.py" \ + "$GITHUB_WORKSPACE/xr-voice-sdk/src/xr-logger/rdkv/rdkx_logger_modules.json" \ + "${XRSDK_HEADERS_DIR}/rdkx_logger_modules" "mw" +cp "$GITHUB_WORKSPACE/xr-voice-sdk/src/xr-logger/rdkx_logger_mw.h" "${XRSDK_HEADERS_DIR}/rdkx_logger.h" +cp "$GITHUB_WORKSPACE/xr-voice-sdk/src/xr_voice_sdk.h" "${XRSDK_HEADERS_DIR}/xr_voice_sdk.h" + cd "${HEADERS_DIR}" # IARM headers (types provided via -include Iarm.h) diff --git a/ci/cov_build.sh b/ci/cov_build.sh index 611d8abb..8551ee0c 100644 --- a/ci/cov_build.sh +++ b/ci/cov_build.sh @@ -28,7 +28,7 @@ ls -la "${GITHUB_WORKSPACE}" echo "building control (ctrlm-main)" XRSDK_REAL_HEADERS="$GITHUB_WORKSPACE/ci/headers/xr-voice-sdk" -CTRL_STUBS="$GITHUB_WORKSPACE/ci/mocks/control" +XLOG_COMPAT="$GITHUB_WORKSPACE/ci/mocks/xlog_ci_compat.h" LOCAL_TESTFRAMEWORK_MOCKS="$GITHUB_WORKSPACE/ci/mocks/testframework" MOCK_DIR="$GITHUB_WORKSPACE/entservices-testframework/Tests/mocks" MOCK_OVERRIDES="$GITHUB_WORKSPACE/ci/mocks/testframework_overrides.h" @@ -68,7 +68,6 @@ cmake -G Ninja -S "$GITHUB_WORKSPACE" -B build/control \ -DCTRLM_CONFIG_JSON_MAIN_ADD="${EMPTY_JSON}" \ -DCMAKE_CXX_FLAGS=" \ -I ${XRSDK_REAL_HEADERS} \ --I ${CTRL_STUBS} \ -I ${LOCAL_TESTFRAMEWORK_MOCKS} \ -I ${MOCK_DIR} \ -I ${MOCK_DIR}/devicesettings \ @@ -80,6 +79,7 @@ cmake -G Ninja -S "$GITHUB_WORKSPACE" -B build/control \ -I /usr/include/glib-2.0 \ -I /usr/lib/x86_64-linux-gnu/glib-2.0/include \ -I /usr/include/libdrm \ +-include ${XLOG_COMPAT} \ -include ${MOCK_DIR}/Iarm.h \ -include ${MOCK_OVERRIDES} \ -include ${LOCAL_TESTFRAMEWORK_MOCKS}/devicesettings.h \ @@ -89,7 +89,6 @@ cmake -G Ninja -S "$GITHUB_WORKSPACE" -B build/control \ -DDISABLE_SECURITY_TOKEN" \ -DCMAKE_C_FLAGS=" \ -I ${XRSDK_REAL_HEADERS} \ --I ${CTRL_STUBS} \ -I ${LOCAL_TESTFRAMEWORK_MOCKS} \ -I ${MOCK_DIR} \ -I ${HEADERS_DIR} \ diff --git a/ci/mocks/xlog_ci_compat.h b/ci/mocks/xlog_ci_compat.h new file mode 100644 index 00000000..43836b73 --- /dev/null +++ b/ci/mocks/xlog_ci_compat.h @@ -0,0 +1,42 @@ +/* + * If not stated otherwise in this file or this component's license file the + * following copyright and licenses apply: + * + * Copyright 2026 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. + */ + +/* + * CI compatibility shim. + * + * The production rdkx_logger.h is included transitively everywhere via + * ctrlm_log.h. In the Yocto build the SDK headers pull several std:: names + * into the global namespace. A handful of ctrlm TUs (e.g. ctrlm_utils.cpp) + * rely on those names being globally visible. This tiny header replicates + * that behaviour for the CI native build. + */ +#ifndef CTRLM_CI_XLOG_COMPAT_H_ +#define CTRLM_CI_XLOG_COMPAT_H_ + +#ifdef __cplusplus +#include +#include +#include +using std::get; +using std::map; +using std::string; +using std::tuple; +#endif + +#endif /* CTRLM_CI_XLOG_COMPAT_H_ */ From f159487f5a0c58851ef4c1f6b3b06e299be3725c Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Tue, 21 Apr 2026 19:04:33 +0000 Subject: [PATCH 59/72] Updates --- ci/build_dependencies.sh | 5 + ci/cov_build.sh | 5 +- ci/mocks/devicesettings_ctrlm.patch | 39 + ci/mocks/testframework/devicesettings.h | 2305 ----------------------- 4 files changed, 45 insertions(+), 2309 deletions(-) create mode 100644 ci/mocks/devicesettings_ctrlm.patch delete mode 100644 ci/mocks/testframework/devicesettings.h diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh index c1929922..dca67c95 100644 --- a/ci/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -52,6 +52,11 @@ git clone --depth 1 --filter=blob:none --branch develop https://github.com/rdkce git clone --depth 1 --filter=blob:none --branch develop https://github.com/rdkcentral/entservices-testframework.git +# Patch the upstream testframework devicesettings.h with ctrlm-specific +# additions (ducking types, setAudioDucking, Host::IsInitialized). +# We can remove this if added to upstream testframework +git -C entservices-testframework apply "$GITHUB_WORKSPACE/ci/mocks/devicesettings_ctrlm.patch" + git clone --depth 1 --filter=blob:none --sparse --branch develop https://github.com/rdkcentral/iarmmgrs.git git -C iarmmgrs sparse-checkout set hal diff --git a/ci/cov_build.sh b/ci/cov_build.sh index 8551ee0c..9a126485 100644 --- a/ci/cov_build.sh +++ b/ci/cov_build.sh @@ -29,7 +29,6 @@ echo "building control (ctrlm-main)" XRSDK_REAL_HEADERS="$GITHUB_WORKSPACE/ci/headers/xr-voice-sdk" XLOG_COMPAT="$GITHUB_WORKSPACE/ci/mocks/xlog_ci_compat.h" -LOCAL_TESTFRAMEWORK_MOCKS="$GITHUB_WORKSPACE/ci/mocks/testframework" MOCK_DIR="$GITHUB_WORKSPACE/entservices-testframework/Tests/mocks" MOCK_OVERRIDES="$GITHUB_WORKSPACE/ci/mocks/testframework_overrides.h" HEADERS_DIR="$GITHUB_WORKSPACE/ci/headers" @@ -68,7 +67,6 @@ cmake -G Ninja -S "$GITHUB_WORKSPACE" -B build/control \ -DCTRLM_CONFIG_JSON_MAIN_ADD="${EMPTY_JSON}" \ -DCMAKE_CXX_FLAGS=" \ -I ${XRSDK_REAL_HEADERS} \ --I ${LOCAL_TESTFRAMEWORK_MOCKS} \ -I ${MOCK_DIR} \ -I ${MOCK_DIR}/devicesettings \ -I ${HEADERS_DIR} \ @@ -82,14 +80,13 @@ cmake -G Ninja -S "$GITHUB_WORKSPACE" -B build/control \ -include ${XLOG_COMPAT} \ -include ${MOCK_DIR}/Iarm.h \ -include ${MOCK_OVERRIDES} \ --include ${LOCAL_TESTFRAMEWORK_MOCKS}/devicesettings.h \ +-include ${MOCK_DIR}/devicesettings.h \ -include ${MOCK_DIR}/Rfc.h \ -Wall -Wno-error \ -DSAFEC_DUMMY_API \ -DDISABLE_SECURITY_TOKEN" \ -DCMAKE_C_FLAGS=" \ -I ${XRSDK_REAL_HEADERS} \ --I ${LOCAL_TESTFRAMEWORK_MOCKS} \ -I ${MOCK_DIR} \ -I ${HEADERS_DIR} \ -I ${HEADERS_DIR}/rdk/iarmbus \ diff --git a/ci/mocks/devicesettings_ctrlm.patch b/ci/mocks/devicesettings_ctrlm.patch new file mode 100644 index 00000000..bb4d45a1 --- /dev/null +++ b/ci/mocks/devicesettings_ctrlm.patch @@ -0,0 +1,39 @@ +--- a/Tests/mocks/devicesettings.h 2026-04-21 19:00:22.239951643 +0000 ++++ b/Tests/mocks/devicesettings.h 2026-04-21 19:02:02.376352344 +0000 +@@ -72,6 +72,16 @@ + dsAUDIOPORT_TYPE_MAX /**< Maximum index for audio port type. */ + } dsAudioPortType_t; + ++typedef enum _dsAudioDuckingAction_t { ++ dsAUDIO_DUCKINGACTION_START = 0, ++ dsAUDIO_DUCKINGACTION_STOP = 1 ++} dsAudioDuckingAction_t; ++ ++typedef enum _dsAudioDuckingType_t { ++ dsAUDIO_DUCKINGTYPE_ABSOLUTE = 0, ++ dsAUDIO_DUCKINGTYPE_RELATIVE = 1 ++} dsAudioDuckingType_t; ++ + typedef enum _dsVideoPortType_t { + dsVIDEOPORT_TYPE_RF = 0, ///< RF modulator (channel 3/4) video output + dsVIDEOPORT_TYPE_BB, ///< Baseband (composite, RCA) video output +@@ -934,6 +944,11 @@ + void enableARC(dsAudioARCTypes_t type, bool enable); + uint32_t getDolbyVolumeMode() const; + void setStereoMode(const std::string &mode, bool persist); ++ void setAudioDucking(dsAudioDuckingAction_t action, dsAudioDuckingType_t type, float level) { ++ (void)action; ++ (void)type; ++ (void)level; ++ } + + + +@@ -1444,6 +1459,7 @@ + class Host { + protected: + static HostImpl* impl; ++ inline static bool IsInitialized = false; + + public: + static void setImpl(HostImpl* newImpl); diff --git a/ci/mocks/testframework/devicesettings.h b/ci/mocks/testframework/devicesettings.h deleted file mode 100644 index 2df6f760..00000000 --- a/ci/mocks/testframework/devicesettings.h +++ /dev/null @@ -1,2305 +0,0 @@ -/** -* If not stated otherwise in this file or this component's LICENSE -* file the following copyright and licenses apply: -* -* Copyright 2024 RDK Management -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* -**/ - -#pragma once - -/* - * CI aggregate of the device-settings type surface ctrlm needs. - * - * The reduced native build does not bring in the full device-settings header - * stack, and ctrlm relies on these types across many translation units. This - * file is force-included in CI to provide those declarations without pulling in - * the full runtime dependency set. - */ - -#include -#include -#include -#include -#include -#include - -/* -* Copyright (c) 2007 Dave Airlie -* Copyright (c) 2007 Jakob Bornecrantz -* Copyright (c) 2008 Red Hat Inc. -* Copyright (c) 2007-2008 Tungsten Graphics, Inc., Cedar Park, TX., USA -* Copyright (c) 2007-2008 Intel Corporation -* Licensed under the MIT License -*/ -#define DRM_DISPLAY_MODE_LEN 32 -#define DRM_PROP_NAME_LEN 32 - -#define DRM_MODE_PROP_RANGE (1<<1) -#define DRM_MODE_PROP_ENUM (1<<3) /* enumerated type with text strings */ -#define DRM_MODE_PROP_BLOB (1<<4) -#define DRM_MODE_PROP_BITMASK (1<<5) /* bitmask of enumerated types */ - -#define DRM_MODE_PROP_LEGACY_TYPE ( \ - DRM_MODE_PROP_RANGE | \ - DRM_MODE_PROP_ENUM | \ - DRM_MODE_PROP_BLOB | \ - DRM_MODE_PROP_BITMASK) - -#define DRM_MODE_PROP_EXTENDED_TYPE 0x0000ffc0 - -typedef unsigned int drm_context_t; -typedef unsigned int drm_magic_t; -typedef unsigned int drm_handle_t; -typedef unsigned int drm_drawable_t; - - -#include -#include -#include - -typedef enum _dsAudioPortType_t { - dsAUDIOPORT_TYPE_ID_LR, /**< RCA audio output. */ - dsAUDIOPORT_TYPE_HDMI, /**< HDMI audio output. */ - dsAUDIOPORT_TYPE_SPDIF, /**< S/PDIF audio output. */ - dsAUDIOPORT_TYPE_SPEAKER, /**< SPEAKER audio output. */ - dsAUDIOPORT_TYPE_HDMI_ARC, /** < HDMI ARC/EARC audio output. */ - dsAUDIOPORT_TYPE_HEADPHONE, /**< 3.5mm headphone jack. */ - dsAUDIOPORT_TYPE_MAX /**< Maximum index for audio port type. */ -} dsAudioPortType_t; - -typedef enum _dsAudioDuckingAction_t { - dsAUDIO_DUCKINGACTION_START = 0, - dsAUDIO_DUCKINGACTION_STOP = 1 -} dsAudioDuckingAction_t; - -typedef enum _dsAudioDuckingType_t { - dsAUDIO_DUCKINGTYPE_ABSOLUTE = 0, - dsAUDIO_DUCKINGTYPE_RELATIVE = 1 -} dsAudioDuckingType_t; - -typedef enum _dsVideoPortType_t { - dsVIDEOPORT_TYPE_RF = 0, ///< RF modulator (channel 3/4) video output - dsVIDEOPORT_TYPE_BB, ///< Baseband (composite, RCA) video output - dsVIDEOPORT_TYPE_SVIDEO, ///< S-Video video output - dsVIDEOPORT_TYPE_1394, ///< IEEE 1394 (Firewire) video output - dsVIDEOPORT_TYPE_DVI, ///< DVI (Panel-Link, HDCP) video output - dsVIDEOPORT_TYPE_COMPONENT, ///< Component video output - dsVIDEOPORT_TYPE_HDMI, ///< HDMI video output - dsVIDEOPORT_TYPE_HDMI_INPUT, ///< HDMI video input - dsVIDEOPORT_TYPE_INTERNAL, ///< Internal (integrated/internal display) video output - dsVIDEOPORT_TYPE_MAX ///< Out of range -} dsVideoPortType_t; - -typedef enum _dsAudioFormat_t { - dsAUDIO_FORMAT_NONE, - dsAUDIO_FORMAT_PCM, - dsAUDIO_FORMAT_DOLBY_AC3, - dsAUDIO_FORMAT_DOLBY_EAC3, - dsAUDIO_FORMAT_DOLBY_AC4, - dsAUDIO_FORMAT_DOLBY_MAT, - dsAUDIO_FORMAT_DOLBY_TRUEHD, - dsAUDIO_FORMAT_DOLBY_EAC3_ATMOS, - dsAUDIO_FORMAT_DOLBY_TRUEHD_ATMOS, - dsAUDIO_FORMAT_DOLBY_MAT_ATMOS, - dsAUDIO_FORMAT_DOLBY_AC4_ATMOS, - dsAUDIO_FORMAT_AAC, - dsAUDIO_FORMAT_VORBIS, - dsAUDIO_FORMAT_WMA, - dsAUDIO_FORMAT_UNKNOWN, - dsAUDIO_FORMAT_MAX /**< Maximum . */ -} dsAudioFormat_t; - -typedef enum _dsAudioCapabilities_t { - dsAUDIOSUPPORT_NONE = 0x0, - dsAUDIOSUPPORT_ATMOS = 0x01, - dsAUDIOSUPPORT_DD = 0x02, - dsAUDIOSUPPORT_DDPLUS = 0x04, - dsAUDIOSUPPORT_DAD = 0x08, - dsAUDIOSUPPORT_DAPv2 = 0x10, - dsAUDIOSUPPORT_MS12 = 0x20, - dsAUDIOSUPPORT_MS12V2 = 0x40, - dsAUDIOSUPPORT_Invalid = 0x80, -} dsAudioCapabilities_t; - -typedef enum _dsAudioARCTypes_t { - dsAUDIOARCSUPPORT_NONE = 0x0, - dsAUDIOARCSUPPORT_ARC = 0x01, - dsAUDIOARCSUPPORT_eARC = 0x02, -} dsAudioARCTypes_t; - -typedef enum _dsMS12Capabilities_t { - dsMS12SUPPORT_NONE = 0x0, - dsMS12SUPPORT_DolbyVolume = 0x01, - dsMS12SUPPORT_InteligentEqualizer = 0x02, - dsMS12SUPPORT_DialogueEnhancer = 0x04, - dsMS12SUPPORT_Invalid = 0x80, -} dsMS12Capabilities_t; - -typedef struct _dsVolumeLeveller_t { - int mode; // 0 = off, 1= on, 2= auto - int level; -} dsVolumeLeveller_t; - -typedef struct _dsSurroundVirtualizer_t { - int mode; // 0 = off, 1= on, 2= auto - int boost; -} dsSurroundVirtualizer_t; - -typedef enum StereoMode { - dsAUDIO_STEREO_UNKNOWN, /**< Unknown mode. */ - dsAUDIO_STEREO_MONO = 1, /**< Mono mode. */ - dsAUDIO_STEREO_STEREO, /**< Normal stereo mode (L+R). */ - dsAUDIO_STEREO_SURROUND, /**< Surround mode. */ - dsAUDIO_STEREO_PASSTHRU, /**< Passthrough mode. */ - dsAUDIO_STEREO_DD, /**< Dolby Digital. */ - dsAUDIO_STEREO_DDPLUS, /**< Dolby Digital Plus. */ - dsAUDIO_STEREO_MAX /**< Maximum index for audio stereo types. */ -} dsAudioStereoMode_t; - -typedef enum _dsATMOSCapability_t { - dsAUDIO_ATMOS_NOTSUPPORTED = 0, /**< ATMOS audio not supported */ - dsAUDIO_ATMOS_DDPLUSSTREAM, /**< can handle dd plus stream which is only way to pass ATMOS metadata */ - dsAUDIO_ATMOS_ATMOSMETADATA, /**< capable of parsing ATMOS metadata */ -} dsATMOSCapability_t; - -typedef enum _dsAudioInput_t -{ - dsAUDIO_INPUT_PRIMARY = 0, /**< Primary Audio Input is main audio input provided to audio mixer */ - dsAUDIO_INPUT_SYSTEM, /**< System Audio Input to audio mixer , e.g Beep Sounds */ - dsAUDIO_INPUT_MAX /**< Out of range */ -} dsAudioInput_t; - -typedef enum _dsHdcpProtocolVersion_t { - dsHDCP_VERSION_1X = 0, /**< HDCP Protocol version 1.x */ - dsHDCP_VERSION_2X, /**< HDCP Protocol version 2.x */ - dsHDCP_VERSION_MAX /**< Maximum index for HDCP protocol. */ -} dsHdcpProtocolVersion_t; - -typedef enum _dsHdcpStatus_t { - dsHDCP_STATUS_UNPOWERED = 0, /**< Connected Sink Device does not support HDCP */ - dsHDCP_STATUS_UNAUTHENTICATED, /**< HDCP Authentication Process is not initiated */ - dsHDCP_STATUS_AUTHENTICATED, /**< HDCP Authentication Process is initiated and Passed */ - dsHDCP_STATUS_AUTHENTICATIONFAILURE, /**< HDCP Authentication Failure or Link Integroty Failure */ - dsHDCP_STATUS_INPROGRESS, /**< HDCP Authentication in Progress */ - dsHDCP_STATUS_PORTDISABLED, /**< HDMI output port disabled */ - dsHDCP_STATUS_MAX /**< Maximum index for HDCP status. */ -} dsHdcpStatus_t; - -typedef enum _dsVideoResolution_t { - dsVIDEO_PIXELRES_720x480, /**< 720x480 Resolution. */ - dsVIDEO_PIXELRES_720x576, /**< 720x576 Resolution. */ - dsVIDEO_PIXELRES_1280x720, /**< 1280x720 Resolution. */ - dsVIDEO_PIXELRES_1920x1080, /**< 1920x1080 Resolution. */ - dsVIDEO_PIXELRES_3840x2160, /**< 3840x2160 Resolution. */ - dsVIDEO_PIXELRES_4096x2160, /**< 3840x2160 Resolution. */ - dsVIDEO_PIXELRES_MAX /**< Maximum index for Video ouptut resolutions. */ -} dsVideoResolution_t; - -// typedef enum _dsTVResolution_t { -// dsTV_RESOLUTION_480i = 0x0001, /**< 480i Resolution. */ -// dsTV_RESOLUTION_480p = 0x0002, /**< 480p Resolution. */ -// dsTV_RESOLUTION_576i = 0x0004, /**< 576p Resolution. */ -// dsTV_RESOLUTION_576p = 0x0008, /**< 576p Resolution. */ -// dsTV_RESOLUTION_720p = 0x0010, /**< 720p Resolution. */ -// dsTV_RESOLUTION_1080i = 0x0020, /**< 1080i Resolution. */ -// dsTV_RESOLUTION_1080p = 0x0040, /**< 1080p Resolution. */ -// dsTV_RESOLUTION_2160p30 = 0x0080, /**< 2160p30 Resolution. */ -// dsTV_RESOLUTION_2160p60 = 0x0100, /**< 2160p60 Resolution. */ -// } dsTVResolution_t; - -typedef enum _dsTVResolution_t { - dsTV_RESOLUTION_480i = 0x0001, - dsTV_RESOLUTION_480p = 0x0002, - dsTV_RESOLUTION_576i = 0x0004, - dsTV_RESOLUTION_576p = 0x0008, - dsTV_RESOLUTION_576p50 = 0x0010, - dsTV_RESOLUTION_720p = 0x0020, - dsTV_RESOLUTION_720p50 = 0x0040, - dsTV_RESOLUTION_1080i = 0x0080, - dsTV_RESOLUTION_1080p = 0x0100, - dsTV_RESOLUTION_1080p24 = 0x0200, - dsTV_RESOLUTION_1080p25 = 0x0400, - dsTV_RESOLUTION_1080i25 = 0x0800, - dsTV_RESOLUTION_1080p30 = 0x1000, - dsTV_RESOLUTION_1080i50 = 0x2000, - dsTV_RESOLUTION_1080p50 = 0x4000, - dsTV_RESOLUTION_1080p60 = 0x8000, - dsTV_RESOLUTION_2160p24 = 0x10000, - dsTV_RESOLUTION_2160p25 = 0x20000, - dsTV_RESOLUTION_2160p30 = 0x40000, - dsTV_RESOLUTION_2160p50 = 0x80000, - dsTV_RESOLUTION_2160p60 = 0x100000, -} dsTVResolution_t; - -typedef enum _dsVideoFrameRate_t { - dsVIDEO_FRAMERATE_UNKNOWN, /**< Unknown frame rate. */ - dsVIDEO_FRAMERATE_24, /**< Played at 24 frames per second. */ - dsVIDEO_FRAMERATE_25, /**< Played at 25 frames per second. */ - dsVIDEO_FRAMERATE_30, /**< Played at 30 frames per second. */ - dsVIDEO_FRAMERATE_60, /**< Played at 60 frames per second. */ - dsVIDEO_FRAMERATE_23dot98, /**< Played at 23.98 frames per second. */ - dsVIDEO_FRAMERATE_29dot97, /**< Played at 29.97 frames per second. */ - dsVIDEO_FRAMERATE_50, /**< Played at 50 frames per second. */ - dsVIDEO_FRAMERATE_59dot94, /**< Played at 59.94 frames per second. */ - dsVIDEO_FRAMERATE_100, /**< Played at 100 frames per second. */ - dsVIDEO_FRAMERATE_119dot88, /**< Played at 119.88 frames per second. */ - dsVIDEO_FRAMERATE_120, /**< Played at 120 frames per second. */ - dsVIDEO_FRAMERATE_200, /**< Played at 200 frames per second. */ - dsVIDEO_FRAMERATE_239dot76, /**< Played at 23.76 frames per second. */ - dsVIDEO_FRAMERATE_240, /**< Played at 240 frames per second. */ - dsVIDEO_FRAMERATE_MAX /**< Maximum index for video frame rates. */ -} dsVideoFrameRate_t; - -typedef enum _dsVideoZoom_t { - dsVIDEO_ZOOM_UNKNOWN = -1, /**< Unknown mode. */ - dsVIDEO_ZOOM_NONE = 0, /**< Decoder format conversion is inactive. */ - dsVIDEO_ZOOM_FULL, /**< Full screen (16:9 video is streched to fit 4:3 frame). */ - dsVIDEO_ZOOM_LB_16_9, /**< 16:9 Letterbox (16:9 video is placed in a 4:3 frame with a full letterbox effect). */ - dsVIDEO_ZOOM_LB_14_9, /**< 14:9 Letterbox (16:9 video is transferred into a 4:3 frame with 14:9 letterbox effect). */ - dsVIDEO_ZOOM_CCO, /**< Center Cut-out (16:9 video is cut to fill 4:3 frame with its center part). */ - dsVIDEO_ZOOM_PAN_SCAN, /**< Pan & Scan (16:9 is cut and panned to fille 4:3 frame, following MPEG pan & scan vectors). */ - dsVIDEO_ZOOM_LB_2_21_1_ON_4_3, /**< 2.21:1 Letterbox on 4:3 (video is transferred into 4:3 frame with a 2.21:1 letterbox effect). */ - dsVIDEO_ZOOM_LB_2_21_1_ON_16_9, /**< 2.21:1 Letterbox on 16:9 (video is transferred into 16:9 frame with a 2.21:1 letterbox effect). */ - dsVIDEO_ZOOM_PLATFORM, /**< Control over the decoder format conversions is managed by the platform. */ - dsVIDEO_ZOOM_16_9_ZOOM, /**< 16:9 Zoom (4:3 video is zoomed to fill 16:9 frame). */ - dsVIDEO_ZOOM_PILLARBOX_4_3, /**< Pillarbox 4:3 (4:3 video is placed in a 16:9 frame with a pillarbox effect) */ - dsVIDEO_ZOOM_WIDE_4_3, /**< Wide 4:3 (4:3 video is stretched to fill 16:9 frame). */ - dsVIDEO_ZOOM_MAX /**< Maximum index for screen zoom modes. */ -} dsVideoZoom_t; - -typedef enum _dsVideoAspectRatio_t { - dsVIDEO_ASPECT_RATIO_4x3, /**< 4:3 aspect ratio. */ - dsVIDEO_ASPECT_RATIO_16x9, /**< 16:9 aspect ratio. */ - dsVIDEO_ASPECT_RATIO_MAX /**< Maximum index for video aspect ratios. */ -} dsVideoAspectRatio_t; - -typedef enum _dsVideoStereoScopicMode_t { - dsVIDEO_SSMODE_UNKNOWN = 0, /**< Unknown mode. */ - dsVIDEO_SSMODE_2D, /**< 2D mode. */ - dsVIDEO_SSMODE_3D_SIDE_BY_SIDE, /**< 3D side by side (L/R) stereo mode. */ - dsVIDEO_SSMODE_3D_TOP_AND_BOTTOM, /**< 3D top & bottom stereo mode. */ - dsVIDEO_SSMODE_MAX /**< Maximum index for video stereoscopic modes. */ -} dsVideoStereoScopicMode_t; - -typedef struct _dsVideoPortResolution_t { - char name[32]; /**< Name the resolution (e.g. 480i, 480p, 1080p24). */ - dsVideoResolution_t pixelResolution; /**< The resolution associated with the name. */ - dsVideoAspectRatio_t aspectRatio; /**< The associated aspect ratio. */ - dsVideoStereoScopicMode_t stereoScopicMode; /**< The associated stereoscopic mode. */ - dsVideoFrameRate_t frameRate; /**< The associated frame rate. */ - bool interlaced; /**< The associated scan mode(@a true if interlaced, @a false if progressive). */ -} dsVideoPortResolution_t; - -typedef enum _dsHDRStandard_t { - dsHDRSTANDARD_NONE = 0x0, - dsHDRSTANDARD_HDR10 = 0x01, - dsHDRSTANDARD_HLG = 0x02, - dsHDRSTANDARD_DolbyVision = 0x04, - dsHDRSTANDARD_TechnicolorPrime = 0x08, - dsHDRSTANDARD_HDR10PLUS = 0x10, - dsHDRSTANDARD_SDR = 0x20, - dsHDRSTANDARD_Invalid = 0x80, -} dsHDRStandard_t; - -typedef enum _dsSURROUNDMode_t { - dsSURROUNDMODE_NONE = 0x0, - dsSURROUNDMODE_DD = 0x1, - dsSURROUNDMODE_DDPLUS = 0x2, -} dsSURROUNDMode_t; - -typedef enum _dsDisplayColorDepth_t { - dsDISPLAY_COLORDEPTH_UNKNOWN = 0x0, /* Unknown color depth */ - dsDISPLAY_COLORDEPTH_8BIT = 0x01, /* 8 bit color depth */ - dsDISPLAY_COLORDEPTH_10BIT = 0x02, /* 10 bit color depth */ - dsDISPLAY_COLORDEPTH_12BIT = 0x04, /* 12 bit color depth */ - dsDISPLAY_COLORDEPTH_AUTO = 0x08 /* Automatic color depth */ -} dsDisplayColorDepth_t; - -typedef enum _dsHdmiInPort_t { - dsHDMI_IN_PORT_NONE = -1, - dsHDMI_IN_PORT_0, - dsHDMI_IN_PORT_1, - dsHDMI_IN_PORT_2, - dsHDMI_IN_PORT_MAX -} dsHdmiInPort_t; - -typedef enum _dsHdmiInSignalStatus_t { - dsHDMI_IN_SIGNAL_STATUS_NONE = -1, - dsHDMI_IN_SIGNAL_STATUS_NOSIGNAL, - dsHDMI_IN_SIGNAL_STATUS_UNSTABLE, - dsHDMI_IN_SIGNAL_STATUS_NOTSUPPORTED, - dsHDMI_IN_SIGNAL_STATUS_STABLE, - dsHDMI_IN_SIGNAL_STATUS_MAX -} dsHdmiInSignalStatus_t; - -typedef enum dsAviContentType { - dsAVICONTENT_TYPE_GRAPHICS, /*!< Content type Graphics. - ITC=1, CN1=0, CN0=0 */ - dsAVICONTENT_TYPE_PHOTO, /*!< Content type Photo - ITC=1, CN1=0, CN0=1 */ - dsAVICONTENT_TYPE_CINEMA, /*!< Content type Cinema - ITC=1, CN1=1, CN0=0 */ - dsAVICONTENT_TYPE_GAME, /*!< Content type Game - ITC=1, CN1=1, CN0=1 */ - dsAVICONTENT_TYPE_NOT_SIGNALLED,/*!< Content type no data - ITC=0, CN1=0, CN0=0 */ - dsAVICONTENT_TYPE_MAX, /*!< Out of range */ -}dsAviContentType_t; - -struct dsSpd_infoframe_st { - uint8_t pkttype; - uint8_t version; - uint8_t length; /*length=25*/ - uint8_t rsd; - uint8_t checksum; - /*Vendor Name Character*/ - uint8_t vendor_name[8]; - /*Product Description Character*/ - uint8_t product_des[16]; - /*byte 25*/ - uint8_t source_info; -}; - -typedef enum tv_hdmi_edid_version_e { - HDMI_EDID_VER_14 = 0, - HDMI_EDID_VER_20, - HDMI_EDID_VER_MAX, -} tv_hdmi_edid_version_t; - -typedef enum _dsAudioPortState { - dsAUDIOPORT_STATE_UNINITIALIZED, - dsAUDIOPORT_STATE_INITIALIZED, - dsAUDIOPORT_STATE_MAX -} dsAudioPortState_t; - -typedef enum { - dsERR_NONE = 0, ///< Input output operation is successful - dsERR_GENERAL = 1, ///< Operation general error. - dsERR_INVALID_PARAM, ///< Invalid parameter is passed to the module - dsERR_INVALID_STATE, ///< Module is in an invalid state - dsERR_ALREADY_INITIALIZED, ///< Module is already initialised - dsERR_NOT_INITIALIZED, ///< Module is not initialised - dsERR_OPERATION_NOT_SUPPORTED, ///< Operation not supported - dsERR_RESOURCE_NOT_AVAILABLE, ///< Resources have failed to allocate - dsERR_OPERATION_FAILED, ///< The attempted operation has failed. Used when a SoC call has a failure - dsErr_MAX -} dsError_t; - -#define MAX_LANGUAGE_LEN 10 -#define DSMGR_MAX_VIDEO_PORT_NAME_LENGTH 128 - -typedef struct { - bool isEnabled; - bool result; - char port[DSMGR_MAX_VIDEO_PORT_NAME_LENGTH]; - } dsMgrStandbyVideoStateParam_t; - -typedef struct { - bool result; - bool isEnabled; - char port[DSMGR_MAX_VIDEO_PORT_NAME_LENGTH]; - } IARM_Bus_PWRMgr_StandbyVideoState_Param_t; - -typedef enum _dsSleepMode_t { - dsHOST_SLEEP_MODE_LIGHT, /**< Light sleep mode. */ - dsHOST_SLEEP_MODE_DEEP, /**< Deep sleep mode. */ - dsHOST_SLEEP_MODE_MAX, /**< Maximum index for sleep modes */ -} dsSleepMode_t; - -typedef enum __dsFPDTimeFormat_t { - dsFPD_TIME_12_HOUR, /**< 12 hour time format. */ - dsFPD_TIME_24_HOUR, /**< 24 hour time format. */ - dsFPD_TIME_STRING /**< Text string. */ -} dsFPDTimeFormat_t; - -typedef enum _dsCompInSignalStatus_t { - dsCOMP_IN_SIGNAL_STATUS_NONE = -1, - dsCOMP_IN_SIGNAL_STATUS_NOSIGNAL, - dsCOMP_IN_SIGNAL_STATUS_UNSTABLE, - dsCOMP_IN_SIGNAL_STATUS_NOTSUPPORTED, - dsCOMP_IN_SIGNAL_STATUS_STABLE, - dsCOMP_IN_SIGNAL_STATUS_MAX -} dsCompInSignalStatus_t; - -typedef enum _dsCompositeInPort_t { - dsCOMPOSITE_IN_PORT_NONE = -1, - dsCOMPOSITE_IN_PORT_0, - dsCOMPOSITE_IN_PORT_1, - dsCOMPOSITE_IN_PORT_MAX -} dsCompositeInPort_t; - -typedef enum dsHdmiMaxCapabilityVersion{ - HDMI_COMPATIBILITY_VERSION_14 = 0, /*!< Hdmi Compatibility Version 1.4 */ - HDMI_COMPATIBILITY_VERSION_20, /*!< Hdmi Compatibility Version 2.0 */ - HDMI_COMPATIBILITY_VERSION_21, /*!< Hdmi Compatibility Version 2.1 */ - HDMI_COMPATIBILITY_VERSION_MAX /*!< Out of bounds */ - }dsHdmiMaxCapabilityVersion_t; - -typedef enum dsVRRType { - dsVRR_NONE, - dsVRR_HDMI_VRR, - dsVRR_AMD_FREESYNC, - dsVRR_AMD_FREESYNC_PREMIUM, - dsVRR_AMD_FREESYNC_PREMIUM_PRO -} dsVRRType_t; - -typedef enum _dsAVIScanInformation_t { - dsAVI_SCAN_TYPE_NO_DATA = 0, ///< No data signalling - S1=0, S0=0 - dsAVI_SCAN_TYPE_OVERSCAN = 1, ///< Overscan signalling - S1=0, S0=1 - dsAVI_SCAN_TYPE_UNDERSCAN = 2, ///< Underscan signalling - S1=1, S0=0 - dsAVI_SCAN_TYPE_MAX ///< Out of range -} dsAVIScanInformation_t; - -typedef struct _dsHdmiInVrrStatus_t -{ - dsVRRType_t vrrType; /*! Type of VRR */ - double vrrAmdfreesyncFramerate_Hz; /*! Display VRR FrameRate in Hz */ -} dsHdmiInVrrStatus_t; - -/*! DS Manager Event Data */ -typedef struct _DSMgr_EventData_t { - union { - struct _RESOLUTION_DATA { - /* Declare Event Data structure for Video resolution Event */ - int width; /*!< Resolution Width */ - int height; /*!< Key code */ - } resn; /*Reolution data*/ - struct _DFC_DATA { - /* Declare Event Data structure for Zoom settings Event */ - int zoomsettings; - } dfc; /*zoom data*/ - - struct _AUDIOMODE_DATA { - /* Declare Event Data structure for Video resolution Event */ - int type; /*!< device type */ - int mode; /*!< device mode */ - } Audioport; /*Audio mode data*/ - - struct _ATMOS_CAPS_CHANGE { - dsATMOSCapability_t caps; - bool status; - } AtmosCapsChange; - - struct _HDMI_HPD_DATA { - /* Declare HDMI HPD Data */ - int event; - } hdmi_hpd; /*HDMI Hot Plug detect*/ - - struct _HDMI_HDCP_DATA { - /* Declare HDMI DCP Data */ - int hdcpStatus; - } hdmi_hdcp; /*HDMI HDCP Hot Plug detect*/ - - struct _HDMI_RXSENSE_DATA { - /* Declare HDMI Rx Sense status */ - int status; - } hdmi_rxsense; /*HDMI Rx Sense Data*/ - - struct _HDMI_IN_CONNECT_DATA { - dsHdmiInPort_t port; - bool isPortConnected; - } hdmi_in_connect; - - struct _HDMI_IN_STATUS_DATA { - /* Declare HDMI Input status*/ - dsHdmiInPort_t port; - bool isPresented; - } hdmi_in_status; /*HDMI in status change detect*/ - - struct _HDMI_IN_SIG_STATUS_DATA { - /* Declare HDMI In signal status*/ - dsHdmiInPort_t port; - dsHdmiInSignalStatus_t status; - } hdmi_in_sig_status; /*HDMI in signal change detect*/ - - struct _HDMI_IN_VIDEO_MODE_DATA { - /* Declare HDMI In signal status*/ - dsHdmiInPort_t port; - dsVideoPortResolution_t resolution; - } hdmi_in_video_mode; /*HDMI in video mode update*/ - - struct _COMPOSITE_IN_CONNECT_DATA { - dsCompositeInPort_t port; - bool isPortConnected; - } composite_in_connect; - - struct _COMPOSITE_IN_STATUS_DATA { - /* Declare Composite Input status*/ - dsCompositeInPort_t port; - bool isPresented; - } composite_in_status; /*Composite in status change detect*/ - - struct _COMPOSITE_IN_SIG_STATUS_DATA { - /* Declare Composite In signal status*/ - dsCompositeInPort_t port; - dsCompInSignalStatus_t status; - } composite_in_sig_status; /*Composite in signal change detect*/ - - struct _COMPOSITE_IN_VIDEO_MODE_DATA{ - /* Declare COMPOSITE In Video Mode*/ - dsCompositeInPort_t port; - dsVideoPortResolution_t resolution; - }composite_in_video_mode; /*Composite in video mode update*/ - - struct _FPD_TIME_FORMAT { - dsFPDTimeFormat_t eTimeFormat; - } FPDTimeFormat; - - struct _HDCP_PROTOCOL_DATA { - dsHdcpProtocolVersion_t protocolVersion; - } HDCPProtocolVersion; - struct _SLEEP_MODE_DATA { - dsSleepMode_t sleepMode; - } sleepModeInfo; - - struct _AUDIO_LEVEL_DATA { - int level; - } AudioLevelInfo; - - struct _AUDIO_OUT_CONNECT_DATA { - dsAudioPortType_t portType; - unsigned int uiPortNo; - bool isPortConnected; - } audio_out_connect; - - struct _AUDIO_FORMAT_DATA { - dsAudioFormat_t audioFormat; - } AudioFormatInfo; - - struct _LANGUAGE_DATA { - char audioLanguage[MAX_LANGUAGE_LEN]; - } AudioLanguageInfo; - - struct _FADER_CONTROL_DATA { - int mixerbalance; - } FaderControlInfo; - - struct _ASSOCIATED_AUDIO_MIXING_DATA { - bool mixing; - } AssociatedAudioMixingInfo; - - struct _VIDEO_FORMAT_DATA { - dsHDRStandard_t videoFormat; - } VideoFormatInfo; - - struct _AUDIO_PORTSTATE_DATA { - dsAudioPortState_t audioPortState; - } AudioPortStateInfo; - - struct _HDMI_IN_ALLM_MODE_DATA { - /* Declare HDMI In ALLM Mode*/ - dsHdmiInPort_t port; - bool allm_mode; - } hdmi_in_allm_mode; /*HDMI in ALLM Mode change*/ - - struct _HDMI_IN_VRR_MODE_DATA{ - /* Declare HDMI In VRR Mode*/ - dsHdmiInPort_t port; - dsVRRType_t vrr_type; - }hdmi_in_vrr_mode; /*HDMI in VRR Mode change*/ - - struct _HDMI_IN_CONTENT_TYPE_DATA{ - dsHdmiInPort_t port; - dsAviContentType_t aviContentType; - }hdmi_in_content_type; - struct _HDMI_IN_AV_LATENCY{ - int audio_output_delay; - int video_latency; - }hdmi_in_av_latency; /*HDMI in AVLatency change*/ - struct _DISPLAY_FRAMERATE_CHANGE { - char framerate[20]; - }DisplayFrameRateChange; - } data; -} IARM_Bus_DSMgr_EventData_t; - -typedef enum _dsDisplayEvent_t { - dsDISPLAY_EVENT_CONNECTED = 0, //!< Display connected event. - dsDISPLAY_EVENT_DISCONNECTED, //!< Display disconnected event. - dsDISPLAY_RXSENSE_ON, //!< Rx Sense ON event - dsDISPLAY_RXSENSE_OFF, //!< Rx Sense OFF event - dsDISPLAY_HDCPPROTOCOL_CHANGE, //!< HDCP Protocol Version Change event - dsDISPLAY_EVENT_MAX -} dsDisplayEvent_t; - -typedef enum _dsDisplayColorSpace_t -{ - dsDISPLAY_COLORSPACE_UNKNOWN = 0, ///< Unknown color space - dsDISPLAY_COLORSPACE_RGB = 1, ///< RGB color space - dsDISPLAY_COLORSPACE_YCbCr422 = 2, ///< YCbCr4.2.2 color space - dsDISPLAY_COLORSPACE_YCbCr444 = 3, ///< YCbCr4.4.4 color space - dsDISPLAY_COLORSPACE_YCbCr420 = 4, ///< YCbCr4.2.0 color space - dsDISPLAY_COLORSPACE_AUTO = 5, ///< Automatic color space - dsDISPLAY_COLORSPACE_MAX ///< Out of range -} dsDisplayColorSpace_t; - -typedef enum _dsDisplayQuantizationRange_t -{ - dsDISPLAY_QUANTIZATIONRANGE_UNKNOWN = 0, ///< Unknown quantization range - dsDISPLAY_QUANTIZATIONRANGE_LIMITED = 1, ///< Limited quantization range - dsDISPLAY_QUANTIZATIONRANGE_FULL = 2, ///< Full quantization range - dsDISPLAY_QUANTIZATIONRANGE_MAX ///< Out of range -} dsDisplayQuantizationRange_t; - -typedef uint32_t dsFPDColor_t; -#define dsFPDColor_Make(R8,G8,B8) (((R8)<<16)|((G8)<<8)|((B8))) -#define dsFPD_COLOR_WHITE dsFPDColor_Make(0xFF, 0xFF, 0xFF) - -typedef struct _dsFPDColorConfig_t{ - int id; - dsFPDColor_t color; -}dsFPDColorConfig_t; - -namespace device { - -template -using List = std::vector; - -} - -namespace device { - -class Exception : public std::exception { - int _err; - std::string _msg; - -public: - Exception(const char* msg = "No Message for this exception") noexcept - : _msg(msg) - { - } - - Exception(int err, const char* msg = "No Message for this Exception") noexcept - : _err(err) - , _msg(msg){}; - - virtual const std::string& getMessage() const - { - return _msg; - } - - virtual int getCode() const - { - return _err; - } - - virtual const char* what() const noexcept - { - return _msg.c_str(); - } - - virtual ~Exception() noexcept{}; -}; - -} - -namespace device { -class AudioStereoModeImpl { -public: - virtual ~AudioStereoModeImpl() = default; - virtual const std::string& getName() const = 0; - - virtual std::string toString() = 0; - -}; - -class AudioStereoMode { -protected: - static AudioStereoModeImpl* impl; - int audioMode; - -public: - AudioStereoMode(); - static void setImpl(AudioStereoModeImpl* newImpl); - const std::string& getName() const; - - static const int kMono; //!< Indicates audio mode of type mono. - static const int kStereo; //!< Indicates audio mode of type stereo. - static const int kSurround; //!< Indicates audio mode of type surround. - static const int kPassThru; //!< Indicates audio mode of type pass through. - static const int kDD; //!< Indicates audio mode of type dolby digital. - static const int kDDPlus; //!< Indicates audio mode of type dolby digital plus. - static const int kMax; //!< Indicates maximum number of audio modes supported. - - bool operator==(const AudioStereoMode& other) const { - return audioMode == other.audioMode; - } - AudioStereoMode& operator=(int mode) { - audioMode = mode; - return *this; -} - - std::string toString(); - AudioStereoMode(int id); -}; - -} - -namespace device { - -class AudioOutputPortTypeImpl { -public: - virtual ~AudioOutputPortTypeImpl() = default; - - virtual int getId() const = 0; -}; - -class AudioOutputPortType { -protected: - static AudioOutputPortTypeImpl* impl; - -public: - AudioOutputPortType(); - static void setImpl(AudioOutputPortTypeImpl* newImpl); - - static const int kHDMI; - static const int kARC; - static const int kSPDIF; - static const int kSPEAKER; - static const int kHEADPHONE; - int getId() const; - - -}; - -} -namespace device { - -class AudioOutputPortImpl { -public: - virtual ~AudioOutputPortImpl() = default; - - virtual const AudioOutputPortType& getType() const = 0; - - virtual const std::string& getName() const = 0; - virtual std::vector getMS12AudioProfileList() const = 0; - virtual void getAudioCapabilities(int* capabilities) = 0; - virtual void getMS12Capabilities(int* capabilities) = 0; - virtual bool isAudioMSDecode() const = 0; - - virtual bool getEnablePersist() = 0; - virtual void getHdmiArcPortId(int *portId) = 0; - virtual bool isConnected() = 0; - virtual void setDRCMode(int DRCMode) = 0; - virtual void setCompression (int compresionLevel) = 0; - virtual int getCompression() = 0; - virtual void setDolbyVolumeMode(bool dolbyVolumeMode) = 0; - virtual void setDialogEnhancement(int enhancerlevel) = 0; - virtual int getDialogEnhancement() = 0; - virtual void resetDialogEnhancement() = 0; - virtual void setIntelligentEqualizerMode (int intelligentEqualizerMode) = 0; - virtual int getIntelligentEqualizerMode() = 0; - virtual void setGraphicEqualizerMode (int graphicEqualizerMode) = 0; - virtual int getGraphicEqualizerMode() = 0; - virtual void setMS12AudioProfile(std::string audioProfileName) = 0; - virtual void resetVolumeLeveller() = 0; - virtual void resetSurroundVirtualizer() = 0; - virtual void resetBassEnhancer() = 0; - virtual void getSupportedARCTypes(int *types) = 0; - virtual void setEnablePersist(bool pEnable) = 0; - virtual dsError_t setEnablePort(bool pEnable) = 0; - virtual bool isMuted() = 0; - virtual void setAudioAtmosOutputMode (int enable) = 0; - virtual bool getSinkDeviceAtmosCapability(dsATMOSCapability_t& atmosCapability) = 0; - virtual void setAudioDelayOffset(int audioDelayOffsetMs) = 0; - virtual void setAudioDelay(int audioDelayMs) = 0; - virtual void getAudioDelay(uint32_t audioDelayMs) = 0; - virtual void getSecondaryLanguage(std::string secondaryLanguage) = 0; - virtual void setSecondaryLanguage(std::string secondaryLanguage) = 0; - virtual void setPrimaryLanguage(std::string primaryLanguage) = 0; - virtual void getPrimaryLanguage(std::string primaryLanguage) = 0; - virtual void getFaderControl(int *mixerBalance) = 0; - virtual void setFaderControl(int mixerBalance) = 0; - virtual void setAssociatedAudioMixing(bool mixing) = 0; - virtual void setGain(float newGain) = 0; - virtual void setMISteering(bool MISteering) = 0; - virtual void setSurroundVirtualizer(dsSurroundVirtualizer_t surroundVirtualizer) = 0; - virtual void setBassEnhancer(int bassBoost) = 0; - virtual void enableSurroundDecoder(bool enableSurroundDecoder) = 0; - virtual void setVolumeLeveller(dsVolumeLeveller_t volumeLeveller) = 0; - virtual bool getMISteering() = 0; - virtual dsSurroundVirtualizer_t getSurroundVirtualizer() = 0; - virtual int getDRCMode() = 0; - virtual float getLevel() = 0; - virtual float getGain() = 0; - virtual bool isSurroundDecoderEnabled() = 0; - virtual int getBassEnhancer() = 0; - virtual dsVolumeLeveller_t getVolumeLeveller() = 0; - virtual bool getStereoAuto() = 0; - virtual void setStereoAuto(bool stereoAuto, bool persist) = 0; - virtual std::string getMS12AudioProfile() = 0; - virtual void setMS12AudioProfileSetttingsOverride(std::string audioProfileState,std::string audioProfileName,std::string audioProfileSettingsName, std::string audioProfileSettingValue) = 0; - virtual void setLevel(float level) = 0; - virtual void setMuted(bool muted) = 0; - virtual void getAssociatedAudioMixing(bool *mixing) = 0; - virtual bool isEnabled() = 0; - virtual void setSAD(std::vector sad_list) = 0; - virtual void reInitializeAudioOutputPort() = 0; - virtual void getAudioDelayOffset (uint32_t audioDelayOffsetMs) = 0; - // virtual const List getSupportedStereoModes() const = 0; - virtual std::vector getSupportedStereoModes() const = 0; - - - - - virtual AudioStereoMode getStereoMode(const bool toPersist) const= 0; - - virtual AudioStereoMode getStereoMode() const= 0; - - - virtual void enableARC(dsAudioARCTypes_t type, bool enable) = 0; - - virtual uint32_t getDolbyVolumeMode() const = 0; - - virtual void setStereoMode(const std::string &mode, bool persist) = 0; - - -}; - -class AudioOutputPort { -protected: - static AudioOutputPortImpl* impl; - -public: - AudioOutputPort(); - static void setImpl(AudioOutputPortImpl* newImpl); - static AudioOutputPort& getInstance(); - - const AudioOutputPortType& getType() const; - - // dsATMOSCapability_t atmosCapability=dsATMOSCapability_t::dsAUDIO_ATMOS_ATMOSMETADATA; - const std::string& getName() const; - std::vector getMS12AudioProfileList() const; - void getAudioCapabilities(int* capabilities); - void getMS12Capabilities(int* capabilities); - bool isAudioMSDecode(); - void reInitializeAudioOutputPort(); - bool getEnablePersist(); - void getHdmiArcPortId(int *portId); - bool isConnected(); - - int getDRCMode(); - void setDRCMode(int DRCMode); - void setCompression (int compresionLevel); - int getCompression(); - void setDolbyVolumeMode(bool dolbyVolumeMode); - - void setDialogEnhancement(int enhancerlevel); - int getDialogEnhancement(); - void setIntelligentEqualizerMode (int intelligentEqualizerMode); - int getIntelligentEqualizerMode(); - void setGraphicEqualizerMode (int graphicEqualizerMode); - int getGraphicEqualizerMode(); - void setMS12AudioProfile(std::string audioProfileName); - void resetVolumeLeveller(); - void resetSurroundVirtualizer(); - void resetBassEnhancer(); - void resetDialogEnhancement(); - void getSupportedARCTypes(int *types); - void setEnablePersist(bool pEnable); - dsError_t setEnablePort(bool pEnable); - bool isMuted(); - void setAudioAtmosOutputMode (int enable); - bool getSinkDeviceAtmosCapability(dsATMOSCapability_t& atmosCapability); - void setAudioDelayOffset(int audioDelayOffsetMs); - void setAudioDelay(int audioDelayMs); - void getAudioDelay(uint32_t audioDelayMs); - void getSecondaryLanguage(std::string secondaryLanguage); - void setSecondaryLanguage(std::string secondaryLanguage); - void setPrimaryLanguage(std::string primaryLanguage); - void getPrimaryLanguage(std::string primaryLanguage); - void getFaderControl(int *mixerBalance); - void setFaderControl(int mixerBalance); - void setAssociatedAudioMixing(bool mixing); - void setGain(float newGain); - void setMISteering(bool MISteering); - void setSurroundVirtualizer(dsSurroundVirtualizer_t surroundVirtualizer); - void setBassEnhancer(int bassBoost); - void enableSurroundDecoder(bool enableSurroundDecoder); - void setVolumeLeveller(dsVolumeLeveller_t volumeLeveller); - bool getMISteering(); - dsSurroundVirtualizer_t getSurroundVirtualizer(); - float getLevel(); - float getGain(); - bool isSurroundDecoderEnabled(); - int getBassEnhancer(); - dsVolumeLeveller_t getVolumeLeveller(); - bool getStereoAuto(); - void setStereoAuto(bool stereoAuto, bool persist); - std::string getMS12AudioProfile(); - void setMS12AudioProfileSetttingsOverride(std::string audioProfileState,std::string audioProfileName,std::string audioProfileSettingsName, std::string audioProfileSettingValue); - void setLevel(float level); - void setMuted(bool muted); - void getAssociatedAudioMixing(bool *mixing); - bool isEnabled(); - void setSAD(std::vector sad_list); - void getAudioDelayOffset (uint32_t audioDelayOffsetMs); - - // const List getSupportedStereoModes() const; - const std::vector getSupportedStereoModes() const; - - AudioStereoMode getStereoMode(const bool toPersist) const; - - AudioStereoMode getStereoMode() const; - - void enableARC(dsAudioARCTypes_t type, bool enable); - uint32_t getDolbyVolumeMode() const; - void setStereoMode(const std::string &mode, bool persist); - void setAudioDucking(dsAudioDuckingAction_t action, dsAudioDuckingType_t type, float level) { - (void)action; - (void)type; - (void)level; - } - - - - -}; - -} - -namespace device { -class CompositeInputImpl { -public: - virtual ~CompositeInputImpl() = default; - virtual uint8_t getNumberOfInputs() const = 0; - virtual bool isPortConnected(int8_t Port) const = 0; - virtual void selectPort(int8_t Port) const = 0; - virtual void scaleVideo(int32_t x, int32_t y, int32_t width, int32_t height) const = 0; -}; - -class CompositeInput { -protected: - static CompositeInputImpl* impl; - -public: - CompositeInput(); - static void setImpl(CompositeInputImpl* newImpl); - static CompositeInput& getInstance(); - - uint8_t getNumberOfInputs() const; - bool isPortConnected(int8_t port) const; - void selectPort(int8_t port) const; - void scaleVideo(int32_t x, int32_t y, int32_t width, int32_t height) const; -}; - -} - -namespace device { - -class HdmiInputImpl { -public: - virtual ~HdmiInputImpl() = default; - - virtual uint8_t getNumberOfInputs() const = 0; - virtual bool isPortConnected(int8_t Port) const = 0; - virtual std::string getCurrentVideoMode() const = 0; - virtual void selectPort(int8_t Port,bool audioMix = false, int videoPlane = 0,bool topMost = false) const = 0; - virtual void scaleVideo(int32_t x, int32_t y, int32_t width, int32_t height) const = 0; - // virtual void setAudioMixerLevels(dsAudioInput_t gain, int volume) const = 0; - virtual void getEDIDBytesInfo(int iHdmiPort, std::vector& edid) const = 0; - virtual void getHDMISPDInfo(int iHdmiPort, std::vector& data) const = 0; - virtual void setEdidVersion(int iHdmiPort, int iEdidVersion) const = 0; - virtual void getEdidVersion(int iHdmiPort, int* iEdidVersion) const = 0; - virtual void getHdmiALLMStatus(int iHdmiPort, bool* allmStatus) const = 0; - virtual void getVRRStatus(int iHdmiPort, dsHdmiInVrrStatus_t *vrrStatus) const = 0; - virtual void getSupportedGameFeatures(std::vector& featureList) const = 0; - virtual void getAVLatency(int *audio_output_delay, int *video_latency) const = 0; - virtual void setEdid2AllmSupport(int iHdmiPort, bool allmsupport) const = 0; - virtual void getEdid2AllmSupport(int iHdmiPort, bool *allmsupport) const = 0; - virtual void setVRRSupport(int iHdmiPort, bool vrrsupport) const = 0; - virtual void getVRRSupport(int iHdmiPort, bool *vrrsupport) const = 0; - virtual void getCurrentVideoModeObj (dsVideoPortResolution_t &resolution) const = 0; - virtual void getHdmiVersion (int iHdmiPort, dsHdmiMaxCapabilityVersion_t *capversion) const = 0; - virtual dsError_t getHDMIARCPortId(int &portId) const = 0; -}; - -class HdmiInput { -protected: - static HdmiInputImpl* impl; - -public: - HdmiInput(); - static void setImpl(HdmiInputImpl* newImpl); - static HdmiInput& getInstance(); // Changed return type - - uint8_t getNumberOfInputs() const; - bool isPortConnected(int8_t port) const; - std::string getCurrentVideoMode() const; - void selectPort(int8_t Port,bool audioMix = false, int videoPlane = 0,bool topMost = false) const; - void scaleVideo(int32_t x, int32_t y, int32_t width, int32_t height) const; - void getEDIDBytesInfo(int iHdmiPort, std::vector& edid) const; - void getHDMISPDInfo(int iHdmiPort, std::vector& data) const; - void setEdidVersion(int iHdmiPort, int iEdidVersion) const; - void getEdidVersion(int iHdmiPort, int* iEdidVersion) const; - - void getHdmiALLMStatus(int iHdmiPort, bool* allmStatus) const; - void getVRRStatus(int iHdmiPort, dsHdmiInVrrStatus_t *vrrStatus) const; - void getSupportedGameFeatures(std::vector& featureList) const; - void getAVLatency(int *audio_output_delay, int *video_latency)const; - void setEdid2AllmSupport(int iport, bool allmSupport) const; - void getEdid2AllmSupport(int iport, bool *allmSupport) const; - void setVRRSupport(int iHdmiPort, bool vrrsupport) const; - void getVRRSupport(int iHdmiPort, bool *vrrsupport) const; - void getCurrentVideoModeObj (dsVideoPortResolution_t &resolution) const; - void getHdmiVersion (int iHdmiPort, dsHdmiMaxCapabilityVersion_t *capversion) const; - dsError_t getHDMIARCPortId(int &portId) const; -}; - -} - -namespace device { -class SleepMode; -class SleepModeImpl { -public: - virtual ~SleepModeImpl() = default; - virtual SleepMode & getInstanceById(int id) = 0; - virtual SleepMode & getInstanceByName(const std::string &name) = 0; - virtual List getSleepModes() = 0; - virtual const std::string& toString() const = 0; -}; - -class SleepMode { -protected: - static SleepModeImpl* impl; - -public: - SleepMode(); - static void setImpl(SleepModeImpl* newImpl); - - static SleepMode& getInstance(); - static SleepMode& getInstance(int id); - static SleepMode& getInstance(const std::string &name); - - List getSleepModes(); - const std::string& toString() const; -}; -} - - -namespace device { - -class VideoDFCImpl { -public: - virtual ~VideoDFCImpl() = default; - virtual const std::string& getName() const = 0; - -}; - -class VideoDFC { -protected: - static VideoDFCImpl* impl; - -public: - VideoDFC(); - static void setImpl(VideoDFCImpl* newImpl); - const std::string& getName() const; - -}; - -} - -namespace device { - -class VideoDeviceImpl { -public: - virtual ~VideoDeviceImpl() = default; - - virtual int getFRFMode(int* frfmode) const = 0; - virtual int setFRFMode(int frfmode) const = 0; - virtual int getCurrentDisframerate(char* framerate) const = 0; - virtual int setDisplayframerate(const char* framerate) const = 0; - virtual void setDFC(std::string zoomSetting) = 0; - virtual const VideoDFC& getDFC() = 0; - virtual void getHDRCapabilities(int* capabilities) = 0; - virtual void getSettopSupportedResolutions(std::list& resolutions) = 0; -}; - -class VideoDevice { -protected: - static VideoDeviceImpl* impl; - -public: - VideoDevice(); - - static void setImpl(VideoDeviceImpl* newImpl); - static VideoDevice& getInstance(); - - int getFRFMode(int* frfmode) const; - int setFRFMode(int frfmode) const; - int getCurrentDisframerate(char* framerate) const; - int setDisplayframerate(const char* framerate) const; - - const VideoDFC& getDFC(); - void setDFC(std::string zoomSetting); - void getHDRCapabilities(int* capabilities); - void getSettopSupportedResolutions(std::list& resolutions); - -}; - -} - -namespace device { - -class DSConstant { -private: - bool enabled; - -protected: - int _id; - std::string _name; - - -public: - - DSConstant() : enabled(false), _id(0), _name("_UNASSIGNED NAME_"){}; - - DSConstant(const int id, const std::string &name) : enabled(false), _id(id), _name(name){}; - - virtual ~DSConstant() {}; - - virtual bool operator==(int id) const { - return id == _id; - } - -}; - -} - -namespace device { - class PixelResolution : public DSConstant{ - public: - static const int k720x480; //!< Indicates 720x480 video resolution. - static const int k720x576; //!< Indicates 720x576 video resolution. - static const int k1280x720; //!< Indicates 1280x720 video resolution. - static const int k1366x768; //!< Indicates 1366x768 video resolution. - static const int k1920x1080; //!< Indicates 1920x1080 video resolution. - - static const int k3840x2160; //!< Indicates 3840x2160 video resolution. - static const int k4096x2160; //!< Indicates 4096x2160 video resolution. - - static const int kMax; //!< Indicates the maximum number of video resolutions supported. - - PixelResolution(int id); - PixelResolution() = default; - virtual ~PixelResolution() = default; - }; -} - -namespace device { - - class FrameRate : public DSConstant { - float _value; //!< Indicates the supported frame rate value in fps. - public: - static const int kUnknown; //!< Indicates video frame rate of unknown type. - static const int k24; //!< Indicates video frame rate of 24 fps. - static const int k25; //!< Indicates video frame rate of 25 fps. - static const int k30; //!< Indicates video frame rate of 30 fps. - static const int k60; //!< Indicates video frame rate of 60 fps. - static const int k23dot98; //!< Indicates video frame rate of 23.98 fps. - static const int k29dot97; //!< Indicates video frame rate of 29.97 fps. - static const int k50; //!< Indicates video frame rate of 50 fps. - static const int k59dot94; //!< Indicates video frame rate of 59.94 fps. - static const int kMax; //!< Indicates maximum number of frame rates supported. - - virtual ~FrameRate() = default; - - FrameRate(int id); - FrameRate(float value); - }; - -} - -namespace device { - -class VideoResolutionImpl { -public: - virtual ~VideoResolutionImpl() = default; - - virtual const std::string& getName() const = 0; - virtual const PixelResolution& getPixelResolution() const = 0; - virtual const FrameRate& getFrameRate() const = 0; -}; - -class VideoResolution { -protected: - static VideoResolutionImpl* impl; - -public: - static void setImpl(VideoResolutionImpl* newImpl); - const std::string& getName() const; - const PixelResolution & getPixelResolution() const; - const FrameRate & getFrameRate() const; -}; - -} - -namespace device { - -class VideoOutputPortTypeImpl { -public: - virtual ~VideoOutputPortTypeImpl() = default; - - virtual int getId() const = 0; - virtual const List getSupportedResolutions() const = 0; -}; - -class VideoOutputPortType : public DSConstant{ -protected: - static VideoOutputPortTypeImpl* impl; - -public: - VideoOutputPortType(); - VideoOutputPortType(int type){ - _id = type; - } - - static void setImpl(VideoOutputPortTypeImpl* newImpl); - - int getId() const; - const List getSupportedResolutions() const; - - static const int kRF; - static const int kBaseband; - static const int kSVideo; - static const int k1394; - static const int kDVI; - static const int kComponent; - static const int kHDMI; - static const int kInternal; - static const int kScart; - static const int kMax; -}; - -} - -namespace device{ - class DisplayImpl{ - public: - virtual ~DisplayImpl() = default; - - virtual void getEDIDBytes(std::vector &edid) const = 0; - virtual bool isConnectedDeviceRepeater() = 0; - virtual int getSurroundMode() = 0; - virtual void setAllmEnabled(bool enable) = 0; - virtual void setAVIContentType(int contentType) = 0; - virtual void setAVIScanInformation(int scanInfo) = 0; - }; - class Display { - protected: - static DisplayImpl* impl; - - public: - static void setImpl(DisplayImpl* newImpl); - static Display& getInstance(); - - void getEDIDBytes(std::vector& edid); - int getSurroundMode(); - bool isConnectedDeviceRepeater(); - void setAllmEnabled(bool enable); - void setAVIContentType(int contentType); - void setAVIScanInformation(int scanInfo); - -}; - -} - -namespace device { - -class VideoOutputPortImpl { -public: - virtual ~VideoOutputPortImpl() = default; - - virtual const VideoOutputPortType& getType() const = 0; - virtual const std::string& getName() const = 0; - virtual const VideoResolution& getDefaultResolution() const = 0; - virtual int getHDCPProtocol() = 0; - virtual int getHDCPReceiverProtocol() = 0; - virtual int getHDCPCurrentProtocol() = 0; - virtual int getHDCPStatus() = 0; - virtual AudioOutputPort& getAudioOutputPort() const = 0; - virtual bool isDisplayConnected() = 0; - virtual bool isContentProtected() = 0; - virtual Display& getDisplay() = 0; - virtual bool setScartParameter(std::string sScartParameter, std::string sScartParameterData) = 0; - - virtual void getTVHDRCapabilities(int* capabilities) = 0; - virtual bool setForceHDRMode (dsHDRStandard_t mode) = 0; - virtual int getPreferredColorDepth(bool persist) = 0; - virtual void getColorDepthCapabilities(unsigned int *capabilities) = 0; - virtual void setPreferredColorDepth(dsDisplayColorDepth_t colorDepth, bool persist) = 0; - virtual bool getCurrentOutputSettings(int& videoEOTF, int& matrixCoefficients, int& colorSpace, int& colorDepth, int& quantizationRange) = 0; - virtual bool isConnected() const = 0; - virtual void setResolution(std::string resolution, bool persist, bool isIgnoreEdid) = 0; - - virtual const VideoResolution& getResolution() const =0; - - virtual void getSupportedTvResolutions(int *tvResolutions) = 0; - virtual int getVideoEOTF() = 0; - virtual bool isActive() = 0; - virtual void setAllmEnabled(bool enable) = 0; - - virtual int GetHdmiPreference() = 0; - virtual bool SetHdmiPreference(dsHdcpProtocolVersion_t hdcpProtocol) = 0; - virtual int getColorSpace() const = 0; - virtual int getColorDepth() const = 0; - virtual int getQuantizationRange() const = 0; - virtual bool IsOutputHDR() = 0; - - -}; - -class VideoOutputPort { -protected: - static VideoOutputPortImpl* impl; - -public: - VideoOutputPort(); - - static void setImpl(VideoOutputPortImpl* newImpl); - static VideoOutputPort& getInstance(); - - const VideoOutputPortType& getType() const; - const std::string& getName() const; - const VideoResolution& getDefaultResolution() const; - int getHDCPProtocol(); - int getHDCPReceiverProtocol(); - int getHDCPCurrentProtocol(); - int getHDCPStatus(); - AudioOutputPort& getAudioOutputPort(); - bool isDisplayConnected(); - bool isContentProtected(); - Display& getDisplay(); - void getSupportedTvResolutions(int *tvResolutions); - const VideoResolution& getResolution() const; - - void setResolution(std::string resolution, bool persist, bool isIgnoreEdid); - bool getCurrentOutputSettings(int& videoEOTF, int& matrixCoefficients, int& colorSpace, int& colorDepth, int& quantizationRange); - - void setPreferredColorDepth(dsDisplayColorDepth_t colorDepth, bool persist); - void getColorDepthCapabilities(unsigned int *capabilities); - int getPreferredColorDepth(bool persist); - bool setForceHDRMode (dsHDRStandard_t mode); - void getTVHDRCapabilities(int* capabilities); - bool setScartParameter(std::string sScartParameter, std::string sScartParameterData); - int getVideoEOTF(); - bool isActive(); - void setAllmEnabled(bool enable); - int GetHdmiPreference(); - bool SetHdmiPreference(dsHdcpProtocolVersion_t hdcpProtocol); - int getColorSpace() const; - int getColorDepth() const; - int getQuantizationRange() const; - bool IsOutputHDR(); - -}; - -} - -namespace device { - -class VideoOutputPortConfigImpl { -public: - virtual ~VideoOutputPortConfigImpl() = default; - - virtual VideoOutputPortType& getPortType(int id) = 0; - virtual VideoOutputPort& getPort(const std::string& name) = 0; -}; - -class VideoOutputPortConfig { -protected: - static VideoOutputPortConfigImpl* impl; - -public: - VideoOutputPortConfig(); - - static void setImpl(VideoOutputPortConfigImpl* newImpl); - static VideoOutputPortConfig& getInstance(); - - VideoOutputPortType& getPortType(int id); - VideoOutputPort& getPort(const std::string& name); -}; - -} - -class ManagerImpl { -public: - virtual ~ManagerImpl() = default; - - virtual void Initialize() = 0; - virtual void DeInitialize() = 0; -}; - -namespace device { -class Manager { -protected: - static ManagerImpl* impl; - -public: - Manager(); - - static void setImpl(ManagerImpl* newImpl); - static Manager& getInstance(); - - inline static bool IsInitialized = false; - static void Initialize(); - static void DeInitialize(); -}; -} - -namespace device { - -class HostImpl; -class IDisplayEventsImpl; -class IAudioOutputPortEventsImpl; -class IDisplayDeviceEventsImpl; -class IHdmiInEventsImpl; -class IVideoDeviceEventsImpl; -class IVideoOutputPortEventsImpl; -class ICompositeInEventsImpl; - -class Host { -protected: - static HostImpl* impl; - -public: - static void setImpl(HostImpl* newImpl); - static Host& getInstance(); - - SleepMode getPreferredSleepMode(); - int setPreferredSleepMode(const SleepMode mode); - List getAvailableSleepModes(); - List getVideoOutputPorts(); - List getAudioOutputPorts(); - List getVideoDevices(); - VideoOutputPort& getVideoOutputPort(const std::string& name); - AudioOutputPort& getAudioOutputPort(const std::string& name); - void getHostEDID(std::vector& edid) const; - std::string getDefaultVideoPortName(); - std::string getDefaultAudioPortName(); - - void getMS12ConfigDetails(std::string type); - bool isHDMIOutPortPresent(); - void getSecondaryLanguage(std::string secondaryLanguage); - void setSecondaryLanguage(std::string secondaryLanguage); - void getSinkDeviceAtmosCapability(dsATMOSCapability_t atmosCapability); - void getFaderControl(int *mixerBalance); - void setFaderControl(int mixerBalance); - void setPrimaryLanguage(std::string primaryLanguage); - void getPrimaryLanguage(std::string primaryLanguage); - void setAudioAtmosOutputMode (int enable); - void setAssociatedAudioMixing(bool mixing); - void getCurrentAudioFormat(dsAudioFormat_t audioFormat); - void getAssociatedAudioMixing(bool *mixing); - void setAudioMixerLevels(dsAudioInput_t gain, int volume) ; - -class IDisplayEvents { - protected: - static IDisplayEventsImpl* impl; - - public: - static void setImpl(IDisplayEventsImpl* newImpl); - static IDisplayEvents& getInstance(); - virtual void OnDisplayRxSense(dsDisplayEvent_t displayEvent); -}; - -class IAudioOutputPortEvents { - protected: - static IAudioOutputPortEventsImpl* impl; - - public: - static void setImpl(IAudioOutputPortEventsImpl* newImpl); - static IAudioOutputPortEvents& getInstance(); - virtual void OnAudioOutHotPlug(dsAudioPortType_t portType, uint32_t uiPortNumber, bool isPortConnected); - virtual void OnAudioFormatUpdate(dsAudioFormat_t audioFormat); - virtual void OnDolbyAtmosCapabilitiesChanged(dsATMOSCapability_t atmosCapability, bool status); - virtual void OnAudioPortStateChanged(dsAudioPortState_t audioPortState); - virtual void OnAssociatedAudioMixingChanged(bool mixing); - virtual void OnAudioFaderControlChanged(int mixerBalance); - virtual void OnAudioPrimaryLanguageChanged(const std::string& primaryLanguage); - virtual void OnAudioSecondaryLanguageChanged(const std::string& secondaryLanguage); - virtual void OnAudioModeEvent(dsAudioPortType_t audioPortType, dsAudioStereoMode_t audioStereoMode); - virtual void OnAudioLevelChangedEvent(int audioLevel); -}; - -class IDisplayDeviceEvents { - protected: - static IDisplayDeviceEventsImpl* impl; - public: - static void setImpl(IDisplayDeviceEventsImpl* newImpl); - static IDisplayDeviceEvents& getInstance(); - - virtual void OnDisplayHDMIHotPlug(dsDisplayEvent_t displayEvent); -}; - -class IHdmiInEvents { - protected: - static IHdmiInEventsImpl* impl; - - public: - static void setImpl(IHdmiInEventsImpl* newImpl); - static IHdmiInEvents& getInstance(); - - virtual void OnHdmiInEventHotPlug(dsHdmiInPort_t port, bool isConnected); - virtual void OnHdmiInEventSignalStatus(dsHdmiInPort_t port, dsHdmiInSignalStatus_t signalStatus); - virtual void OnHdmiInEventStatus(dsHdmiInPort_t activePort, bool isPresented); - virtual void OnHdmiInVideoModeUpdate(dsHdmiInPort_t port, const dsVideoPortResolution_t& videoPortResolution); - virtual void OnHdmiInAllmStatus(dsHdmiInPort_t port, bool allmStatus); - virtual void OnHdmiInAVIContentType(dsHdmiInPort_t port, dsAviContentType_t aviContentType); - virtual void OnHdmiInVRRStatus(dsHdmiInPort_t port, dsVRRType_t vrrType); - virtual void OnHdmiInAVLatency(int audioDelay, int videoDelay); -}; - -class ICompositeInEvents { - protected: - static ICompositeInEventsImpl* impl; - - public: - static void setImpl(ICompositeInEventsImpl* newImpl); - static ICompositeInEvents& getInstance(); - - virtual void OnCompositeInHotPlug(dsCompositeInPort_t port, bool isConnected); - virtual void OnCompositeInSignalStatus(dsCompositeInPort_t port, dsCompInSignalStatus_t signalStatus); - virtual void OnCompositeInStatus(dsCompositeInPort_t activePort, bool isPresented); - virtual void OnCompositeInVideoModeUpdate(dsCompositeInPort_t activePort, dsVideoPortResolution_t videoResolution); - }; - -class IVideoDeviceEvents { - protected: - static IVideoDeviceEventsImpl* impl; - - public: - static void setImpl(IVideoDeviceEventsImpl* newImpl); - static IVideoDeviceEvents& getInstance(); - - virtual void OnZoomSettingsChanged(dsVideoZoom_t zoomSetting); - virtual void OnDisplayFrameratePreChange(const std::string& frameRate); - virtual void OnDisplayFrameratePostChange(const std::string& frameRate); -}; - -class IVideoOutputPortEvents { - protected: - static IVideoOutputPortEventsImpl* impl; - - public: - static void setImpl(IVideoOutputPortEventsImpl* newImpl); - static IVideoOutputPortEvents& getInstance(); - - virtual void OnResolutionPreChange(const int width, const int height); - virtual void OnResolutionPostChange(const int width, const int height); - virtual void OnVideoFormatUpdate(dsHDRStandard_t videoFormatHDR); - virtual void OnHDCPStatusChange(dsHdcpStatus_t hdcpStatus); -}; - -virtual dsError_t Register(IVideoDeviceEvents* listener, const std::string& clientName = ""); -virtual dsError_t UnRegister(IVideoDeviceEvents* listener); -virtual dsError_t Register(IDisplayEvents* listener, const std::string& clientName = ""); -virtual dsError_t UnRegister(IDisplayEvents* listener); -virtual dsError_t Register(IAudioOutputPortEvents* listener, const std::string& clientName = ""); -virtual dsError_t UnRegister(IAudioOutputPortEvents* listener); -virtual dsError_t Register(IDisplayDeviceEvents* listener, const std::string& clientName = ""); -virtual dsError_t UnRegister(IDisplayDeviceEvents* listener); -virtual dsError_t Register(IHdmiInEvents* listener, const std::string& clientName = ""); -virtual dsError_t UnRegister(IHdmiInEvents* listener); -virtual dsError_t Register(IVideoOutputPortEvents* listener, const std::string& clientName = ""); -virtual dsError_t UnRegister(IVideoOutputPortEvents* listener); -virtual dsError_t Register(ICompositeInEvents* listener, const std::string& clientName = ""); -virtual dsError_t UnRegister(ICompositeInEvents* listener); -}; - -class HostImpl { -public: - virtual ~HostImpl() = default; - virtual SleepMode getPreferredSleepMode() = 0; - virtual int setPreferredSleepMode(const SleepMode mode) = 0; - virtual List getAvailableSleepModes() = 0; - virtual List getVideoOutputPorts() = 0; - virtual List getAudioOutputPorts() = 0; - virtual List getVideoDevices() = 0; - virtual VideoOutputPort& getVideoOutputPort(const std::string& name) = 0; - virtual AudioOutputPort& getAudioOutputPort(const std::string& name) = 0; - virtual void getHostEDID(std::vector& edid) const = 0; - virtual std::string getDefaultVideoPortName() = 0; - virtual std::string getDefaultAudioPortName() = 0; - - virtual void getMS12ConfigDetails(std::string type)=0; - virtual bool isHDMIOutPortPresent() = 0; - virtual void getSecondaryLanguage(std::string secondaryLanguage) = 0; - virtual void setSecondaryLanguage(std::string secondaryLanguage) = 0; - virtual void getSinkDeviceAtmosCapability(dsATMOSCapability_t atmosCapability) = 0; - virtual void getFaderControl(int *mixerBalance) = 0; - virtual void setFaderControl(int mixerBalance) = 0; - virtual void setPrimaryLanguage(std::string primaryLanguage) = 0; - virtual void getPrimaryLanguage(std::string primaryLanguage) = 0; - virtual void setAudioAtmosOutputMode (int enable) = 0; - virtual void setAssociatedAudioMixing(bool mixing) = 0; - virtual void getCurrentAudioFormat(dsAudioFormat_t audioFormat) = 0; - virtual void getAssociatedAudioMixing(bool *mixing) = 0; - virtual void setAudioMixerLevels(dsAudioInput_t inputType, int volumeLevel) = 0; - - virtual dsError_t Register(Host::IDisplayEvents* listener) = 0; - virtual dsError_t UnRegister(Host::IDisplayEvents* listener) = 0; - virtual dsError_t Register(Host::IAudioOutputPortEvents* listener) = 0; - virtual dsError_t UnRegister(Host::IAudioOutputPortEvents* listener) = 0; - virtual dsError_t Register(Host::IDisplayDeviceEvents* listener) = 0; - virtual dsError_t UnRegister(Host::IDisplayDeviceEvents* listener) = 0; - virtual dsError_t Register(Host::IHdmiInEvents* listener) = 0; - virtual dsError_t UnRegister(Host::IHdmiInEvents* listener) = 0; - virtual dsError_t Register(Host::IVideoDeviceEvents* listener) = 0; - virtual dsError_t UnRegister(Host::IVideoDeviceEvents* listener) = 0; - virtual dsError_t Register(Host::IVideoOutputPortEvents* listener) = 0; - virtual dsError_t UnRegister(Host::IVideoOutputPortEvents* listener) = 0; - virtual dsError_t Register(Host::ICompositeInEvents* listener) = 0; - virtual dsError_t UnRegister(Host::ICompositeInEvents* listener) = 0; -}; - - -class IDisplayEventsImpl { -public: - virtual ~IDisplayEventsImpl() = default; - virtual void OnDisplayRxSense(dsDisplayEvent_t displayEvent) = 0; -}; - -class IAudioOutputPortEventsImpl { -public: - virtual ~IAudioOutputPortEventsImpl() = default; - - virtual void OnAudioOutHotPlug(dsAudioPortType_t portType, uint32_t uiPortNumber, bool isPortConnected) = 0; - virtual void OnAudioFormatUpdate(dsAudioFormat_t audioFormat) = 0; - virtual void OnDolbyAtmosCapabilitiesChanged(dsATMOSCapability_t atmosCapability, bool status) = 0; - virtual void OnAudioPortStateChanged(dsAudioPortState_t audioPortState) = 0; - virtual void OnAssociatedAudioMixingChanged(bool mixing) = 0; - virtual void OnAudioFaderControlChanged(int mixerBalance) = 0; - virtual void OnAudioPrimaryLanguageChanged(const std::string& primaryLanguage) = 0; - virtual void OnAudioSecondaryLanguageChanged(const std::string& secondaryLanguage) = 0; - virtual void OnAudioModeEvent(dsAudioPortType_t audioPortType, dsAudioStereoMode_t audioStereoMode) = 0; - virtual void OnAudioLevelChangedEvent(int audioLevel) = 0; - -}; - -class IDisplayDeviceEventsImpl { -public: - virtual ~IDisplayDeviceEventsImpl() = default; - - virtual void OnDisplayHDMIHotPlug(dsDisplayEvent_t displayEvent) = 0; -}; - -class IHdmiInEventsImpl { -public: - virtual ~IHdmiInEventsImpl() = default; - - virtual void OnHdmiInEventHotPlug(dsHdmiInPort_t port, bool isConnected) = 0; - virtual void OnHdmiInEventSignalStatus(dsHdmiInPort_t port, dsHdmiInSignalStatus_t signalStatus) = 0; - virtual void OnHdmiInEventStatus(dsHdmiInPort_t activePort, bool isPresented) = 0; - virtual void OnHdmiInVideoModeUpdate(dsHdmiInPort_t port, const dsVideoPortResolution_t& videoPortResolution) = 0; - virtual void OnHdmiInAllmStatus(dsHdmiInPort_t port, bool allmStatus) = 0; - virtual void OnHdmiInAVIContentType(dsHdmiInPort_t port, dsAviContentType_t aviContentType) = 0; - virtual void OnHdmiInVRRStatus(dsHdmiInPort_t port, dsVRRType_t vrrType) = 0; - virtual void OnHdmiInAVLatency(int audioDelay, int videoDelay) = 0; - -}; - - class ICompositeInEventsImpl { - public: - virtual ~ICompositeInEventsImpl() = default; - virtual void OnCompositeInHotPlug(dsCompositeInPort_t port, bool isConnected) = 0; - virtual void OnCompositeInSignalStatus(dsCompositeInPort_t port, dsCompInSignalStatus_t signalStatus) = 0; - virtual void OnCompositeInStatus(dsCompositeInPort_t activePort, bool isPresented) = 0; - virtual void OnCompositeInVideoModeUpdate(dsCompositeInPort_t activePort, dsVideoPortResolution_t videoResolution) = 0; - }; - -class IVideoDeviceEventsImpl { -public: - virtual ~IVideoDeviceEventsImpl() = default; - - virtual void OnZoomSettingsChanged(dsVideoZoom_t zoomSetting) = 0; - virtual void OnDisplayFrameratePreChange(const std::string& frameRate) = 0; - virtual void OnDisplayFrameratePostChange(const std::string& frameRate) = 0; - -}; - -class IVideoOutputPortEventsImpl { -public: - virtual ~IVideoOutputPortEventsImpl() = default; - - virtual void OnResolutionPreChange(const int width, const int height) = 0; - virtual void OnResolutionPostChange(const int width, const int height) = 0; - virtual void OnVideoFormatUpdate(dsHDRStandard_t videoFormatHDR) = 0; - virtual void OnHDCPStatusChange(dsHdcpStatus_t hdcpStatus) = 0; - -}; - -} - -namespace device { -class FrontPanelIndicator { -public: - class Color; - class ColorImpl { - public: - virtual ~ColorImpl() = default; - virtual const Color& getInstanceById(int id) = 0; - virtual const Color& getInstanceByName(const std::string& name) = 0; - virtual std::string getName() const = 0; - }; - - class Color { -protected: - static ColorImpl* impl; - -public: - Color(); - - static void setImpl(ColorImpl* newImpl); - static Color& getInstance(); - static const Color& getInstance(int id); - static const Color& getInstance(const std::string& name); - - static const int kWhite; - - std::string getName() const; - virtual ~Color(); - }; - - // static FrontPanelIndicator& getInstance() - // { - // static FrontPanelIndicator instance; - // return instance; - // } - - class FrontPanelIndicatorImpl { - public: - virtual ~FrontPanelIndicatorImpl() = default; - virtual FrontPanelIndicator& getInstanceInt(int id) = 0; - virtual FrontPanelIndicator& getInstanceString(const std::string& name) = 0; - virtual void setState(const bool bState) const = 0; - virtual std::string getName() const = 0; - virtual void setBrightness(const int brightness, const bool toPersist = false) const = 0; - virtual int getBrightness(const bool persist=false) const = 0; - virtual void setColor(const Color &newColor, const bool toPersist) const = 0; - virtual void setColorInt(const uint32_t color, const bool toPersist) const = 0; - virtual void getBrightnessLevels(int &levels,int &min,int &max) const = 0; - virtual int getColorMode() const = 0; - virtual std::string getColorName() const = 0; - virtual List getSupportedColors() const =0; - }; - - // FrontPanelIndicatorImpl* impl; - - public: - static FrontPanelIndicatorImpl* impl; - FrontPanelIndicator(); - - static void setImpl(FrontPanelIndicatorImpl* newImpl); - - static FrontPanelIndicator& getInstance(const std::string& name); - static FrontPanelIndicator& getInstance(int id); - static FrontPanelIndicator& getInstance(); - - void setState(const bool bState) const; - std::string getName() const; - void setBrightness(const int brightness, const bool toPersist = false) const; - int getBrightness(const bool persist = false) const; - void setColor(const Color& newColor, const bool toPersist = false) const; - void setColor(const uint32_t color, const bool toPersist = false) const; - // void setColorInt(const uint32_t color, const bool toPersist) const; - void getBrightnessLevels(int& levels, int& min, int& max) const; - int getColorMode() const; - std::string getColorName() const; - List getSupportedColors() const; - -}; - -class FrontPanelTextDisplay; -class FrontPanelTextDisplayImpl { -public: - virtual ~FrontPanelTextDisplayImpl() = default; - virtual int getCurrentTimeFormat() const = 0; - virtual void setTimeFormat(const int iTimeFormat) const = 0; - virtual void setText(const std::string text) const = 0; - virtual void setMode(int mode) const = 0; - virtual int getTextBrightness() const = 0; - virtual void setTextBrightness(const int brightness) const = 0; - virtual FrontPanelTextDisplay& getInstanceById(int id) = 0; - virtual FrontPanelTextDisplay& getInstanceByName(const std::string& name) = 0; -}; - -class FrontPanelTextDisplay : public FrontPanelIndicator{ -protected: - static FrontPanelTextDisplayImpl* impl; - -public: - FrontPanelTextDisplay(); - - static void setImpl(FrontPanelTextDisplayImpl* newImpl); - - int getCurrentTimeFormat() const; - void setTimeFormat(const int iTimeFormat); - static FrontPanelTextDisplay& getInstance(const std::string& name); - static FrontPanelTextDisplay& getInstance(int id); - static FrontPanelTextDisplay& getInstance(); - static const int kModeClock12Hr; - static const int kModeClock24Hr; - - void setText(const std::string text); - void setMode(int mode); - int getTextBrightness() const; - void setTextBrightness(const int brightness) const; -}; - -class FrontPanelConfig; -class FrontPanelConfigImpl { -public: - virtual ~FrontPanelConfigImpl() = default; - virtual List getIndicators() const = 0; - virtual FrontPanelTextDisplay& getTextDisplay() const = 0; - virtual FrontPanelTextDisplay& getTextDisplay(const std::string &name) const = 0; - virtual List getTextDisplays() const = 0; - virtual FrontPanelTextDisplay& getTextDisplay(int id) const = 0; -}; - -class FrontPanelConfig { -protected: - static FrontPanelConfigImpl* impl; - -public: - FrontPanelConfig(); - - static void setImpl(FrontPanelConfigImpl* newImpl); - static FrontPanelConfig& getInstance(); - - List getIndicators(); - FrontPanelTextDisplay& getTextDisplay(const std::string& name); - List getTextDisplays(); - FrontPanelTextDisplay& getTextDisplay(int id); - FrontPanelTextDisplay& getTextDisplay() const; -}; - -} - - -#define RT_OK 0 -#define RT_ERROR 1 -#define RT_ERROR_QUEUE_EMPTY 1006 - - -typedef uint32_t rtError; -typedef void(*remoteDisconnectCallback)(void *data); - -class rtValue; - -class rtIObject -{ - public: - typedef unsigned long refcount_t; - - virtual ~rtIObject(){ - } -}; - -class rtString{ - public: - std::string mData; - rtString(const char* s){ - mData = s; - } - rtString(const rtString& s){ - mData = s.mData; - } - rtString(){ - mData = ""; - } - const char* cString() const{ - return mData.c_str(); - } - rtString& operator=(const char* s){ - mData = s; - return *this; - } - - rtString& operator=(const rtString& s){ - mData = s.mData; - return *this; - } - -}; -typedef rtError (*rtFunctionCB)(int numArgs, const rtValue* args, rtValue* result, void* context); - -class rtFunctionCallback{ - public: - rtFunctionCallback(rtFunctionCB cb, void* context = NULL){ - - } - ~rtFunctionCallback() = default; - -}; - -/* -Based on pxCore, Copyright 2015-2018 John Robinson -Licensed under the Apache License, Version 2.0 -*/ -template -class rtRef -{ -public: - rtRef(): mRef(NULL) {} - rtRef(const T* p): mRef(NULL) {asn(p); } - rtRef(const rtRef& r): mRef(NULL) {asn(r.getPtr());} - rtRef(rtRef&& r) noexcept: mRef(r.mRef) {r.mRef = nullptr;} - virtual ~rtRef() { - } - - T* operator->() const {return mRef;} - operator T* () const {return mRef;} - T* getPtr() const {return mRef;} - T* ptr() const {return mRef;} - T& operator*() const {return *mRef;} - - bool operator! () const {return mRef == NULL; } - inline rtRef& operator=(const T* p) {asn(p); return *this;} - inline rtRef& operator=(const rtRef& r) {asn(r.mRef); return *this;} - - inline friend bool operator==(const T* lhs,const rtRef& rhs) {return lhs==rhs.mRef;} - inline friend bool operator==(const rtRef& lhs,const T* rhs) {return lhs.mRef==rhs;} - inline friend bool operator==(const rtRef& lhs,const rtRef& rhs) {return lhs.mRef==rhs.mRef;} - - void asn(const T* p) - { - if (mRef != p) - { - if (mRef) - { - delete mRef; - mRef = NULL; - } - mRef = const_cast(p); - - } - } - - T* mRef; -}; - -class rtObjectBaseImpl{ - public: - virtual ~rtObjectBaseImpl() = default; - virtual rtError set(const char* name, const char* value) const = 0; - virtual rtError set(const char* name, bool value) const = 0; - virtual rtError set(const char* name, const rtValue& value) const = 0; - virtual rtString get(const char* name) const = 0; - virtual rtError sendReturns(const char* messageName, rtString& result) const = 0; -}; - -class rtObjectBase{ -protected: - static rtObjectBaseImpl* impl; -public: - - static rtObjectBase& getInstance(); - static void setImpl(rtObjectBaseImpl* newImpl); - - rtError set(const char* name, const char* value); - rtError set(const char* name, bool value); - rtError set(const char* name, const rtValue& value); - - //To avoid linker issues with templated code, the complete definition of this - //templated function is included in this header file instead of separating it to .cpp - template - rtError sendReturns(const char* messageName, T& result) { - return impl->sendReturns(messageName, result); - } - - template - T get(const char* name) { - return impl->get(name); - } - virtual ~rtObjectBase() = default; -}; - -class rtMapObject: public rtObjectBase, public rtIObject{ - public: - virtual ~rtMapObject() = default; - -}; - -class rtObjectRef; -class rtObjectRefImpl{ - public: - virtual rtError send(const char* messageName, const rtValue& arg1) = 0; - virtual rtError send(const char* messageName) = 0; - virtual rtError send(const char* messageName, const char* method, rtFunctionCallback* callback) = 0; - virtual rtError send(const char* messageName, rtObjectRef& base) = 0; - -}; - -class rtObjectRef : public rtRef, public rtObjectBase{ -protected: - static rtObjectRefImpl* impl; -public: - - - static rtObjectRef& getInstance(); - - static void setImpl(rtObjectRefImpl* newImpl); - - rtObjectRef(); - - rtObjectRef(const rtObjectRef&); - - rtObjectRef(const rtMapObject* o); - - rtObjectRef& operator=(rtMapObject* o); - - rtObjectRef& operator=(const rtObjectRef&); - - rtObjectRef& operator=(rtIObject* o); - - rtObjectRef& operator=(rtObjectRef&&); - - rtError send(const char* messageName); - - rtError send(const char* messageName, const char* method, rtFunctionCallback* callback); - - rtError send(const char* messageName, const rtValue& arg1); - - rtError send(const char* messageName, rtObjectRef& base); - virtual ~rtObjectRef(); - -}; - -class rtArrayObject; - -struct rtValue_{ - std::string stringValue; - bool boolValue; -}; - -class rtValueImpl{ - public: - virtual void rtValueConstructor(bool v) const = 0; - virtual void rtValueConstructor(const char* v) const = 0; - virtual void rtValueConstructor(rtArrayObject* v) const = 0; - virtual void rtValueConstructor(const rtString& v) const = 0; -}; - -class rtValue -{ - protected: - static rtValueImpl* impl; - public: - rtValue_ mValue; - - static rtValue& getInstance(); - static void setImpl(rtValueImpl* newImpl); - - rtValue(); - rtValue(bool v); - rtValue(const char* v); - rtValue(const rtString& v); - rtValue(rtIObject* v); - - rtValue(const rtObjectRef& v); - rtValue(const rtValue& v); - ~rtValue(); - rtValue& operator=(bool v); - rtValue& operator=(const char* v); - rtValue& operator=(const rtString& v); - rtValue& operator=(const rtIObject* v); - rtValue& operator=(const rtObjectRef& v); - rtValue& operator=(const rtValue& v); - - rtObjectRef toObject() const; - void setString (const char* v); - void setString (const rtString& v); - -}; - -class rtArrayObjectImpl{ - public: - virtual void pushBack(const char* v) const = 0; - virtual void pushBack(rtValue v) const = 0; -}; - - -class rtArrayObject : public rtObjectBase, public rtIObject{ -protected: - static rtArrayObjectImpl* impl; -public: - static rtArrayObject& getInstance(); - static void setImpl(rtArrayObjectImpl* newImpl); - - void pushBack(const char* v); - void pushBack(rtValue v); - virtual ~rtArrayObject() = default; - -}; - -class rtRemoteEnvironment{ - - -}; - -class floatingRtFunctionsImpl{ - public: - virtual ~floatingRtFunctionsImpl() = default; - virtual rtError rtRemoteLocateObject(rtRemoteEnvironment *env, const char* str, rtObjectRef& obj, int x, remoteDisconnectCallback back, void *cbdata=NULL) = 0; - virtual rtRemoteEnvironment* rtEnvironmentGetGlobal() = 0; - virtual rtError rtRemoteShutdown(rtRemoteEnvironment *env) = 0; - virtual rtError rtRemoteInit(rtRemoteEnvironment *env) = 0; - virtual rtError rtRemoteProcessSingleItem() = 0; - virtual char* rtStrError(rtError err) = 0; - -}; - -class floatingRtFunctions{ -public: - static floatingRtFunctionsImpl* impl; - static floatingRtFunctions& getInstance(); - static void setImpl(floatingRtFunctionsImpl* newImpl); - -}; - - rtError rtRemoteProcessSingleItem(); - rtError rtRemoteLocateObject(rtRemoteEnvironment* env, const char* str, rtObjectRef& obj, int x, remoteDisconnectCallback back, void* cbdata = nullptr); - rtRemoteEnvironment* rtEnvironmentGetGlobal(); - rtError rtRemoteInit(rtRemoteEnvironment* env); - rtError rtRemoteShutdown(rtRemoteEnvironment* env); - char* rtStrError(rtError err); - - -namespace edid_parser { - - enum edid_status_e { - EDID_STATUS_OK, - EDID_STATUS_INVALID_PARAMETER, - EDID_STATUS_NOT_SUPPORTED, - EDID_STATUS_INVALID_HEADER, - EDID_STATUS_INVALID_CHECKSUM - }; - - enum edid_native_e { - EDID_NATIVE, - EDID_NOT_NATIVE - }; - - enum edid_progressive_e { - EDID_PROGRESSIVE, - EDID_INTERLACED - }; - - enum HDR_standard_t { - HDR_standard_NONE = 0x0, - HDR_standard_HDR10 = 0x01, // SMPTE ST 2084 - HDR_standard_HLG = 0x02, // Hybrid Log-Gamma - HDR_standard_DolbyVersion = 0x04, // ? - HDR_standard_SDR = 0x08, // Traditional gamma - SDR Luminance Range - HDR_standard_Traditional_HDR = 0x10 // Traditional gamma - HDR Luminance Range - }; - - struct edid_res_t { - int width; - int height; - int refresh; - edid_progressive_e progressive; - edid_native_e native; - }; - - enum colorimetry_info_t { - COLORIMETRY_INFO_NONE = 0x0, - COLORIMETRY_INFO_XVYCC601 = 0x01, - COLORIMETRY_INFO_XVYCC709 = 0x02, - COLORIMETRY_INFO_SYCC601 = 0x04, - COLORIMETRY_INFO_ADOBEYCC601 = 0x08, - COLORIMETRY_INFO_ADOBERGB = 0x10, - COLORIMETRY_INFO_BT2020CL = 0x20, - COLORIMETRY_INFO_BT2020NCL = 0x40, - COLORIMETRY_INFO_BT2020RGB = 0x80, - COLORIMETRY_INFO_DCI_P3 = 0x100 - }; - - struct edid_data_t { - edid_res_t res; - // bitmask of HDR_standard_t values - uint8_t hdr_capabilities; - char manufacturer_name[4]; /* Manufacturer name of the display device.*/ - int32_t product_code; /* Product code of the display device. */ - int32_t serial_number; /* Serial number of the display device. */ - int32_t manufacture_week; /* Manufacturing week of the display device. */ - int32_t manufacture_year; /* Manufacturing year of the display device. */ - uint8_t edid_version[2]; /* EDID version. */ - uint8_t physical_address_a; /* Physical Address for HDMI node A */ - uint8_t physical_address_b; /* Physical Address for HDMI node B */ - uint8_t physical_address_c; /* Physical Address for HDMI node C */ - uint8_t physical_address_d; /* Physical Address for HDMI node D */ - char monitor_name[14]; /* Connected display monitor name. */ - uint32_t colorimetry_info; /* bitmask of enum colorimetry_info_t */ -}; - - class edidParserImpl{ - public: - static edidParserImpl* impl; - - static void setImpl(edidParserImpl* newImpl); - - virtual edid_status_e EDID_Parse(unsigned char* bytes, size_t count, edid_data_t* data_ptr) = 0; - virtual edid_status_e EDID_Verify(unsigned char* bytes, size_t count) = 0; - - }; - - edid_status_e EDID_Parse(unsigned char* bytes, size_t count, edid_data_t* data_ptr); - edid_status_e EDID_Verify(unsigned char* bytes, size_t count); -} - -class drmImpl{ - public: - virtual ~drmImpl() = default; - static drmImpl* impl; - static void setImpl(drmImpl* newImpl); - - virtual drmModeEncoderPtr drmModeGetEncoder(int fd, uint32_t encoder_id) = 0; - virtual void drmModeFreeEncoder(drmModeEncoderPtr* encoder) = 0; - virtual drmModeConnectorPtr drmModeGetConnector(int fd, uint32_t connectorId) = 0; - virtual drmModeCrtcPtr drmModeGetCrtc(int fd, uint32_t crtcId) = 0; - virtual drmModeResPtr drmModeGetResources(int fd) = 0; - virtual void drmModeFreeConnector( drmModeConnectorPtr ptr ) = 0; - virtual void drmModeFreeCrtc( drmModeCrtcPtr ptr ) = 0; - virtual void drmModeFreeResources( drmModeResPtr ptr ) = 0; - virtual drmModePropertyPtr drmModeGetProperty(int fd, uint32_t propertyId) = 0; - virtual void drmModeFreeProperty(drmModePropertyPtr ptr) = 0; - virtual drmModePlaneResPtr drmModeGetPlaneResources(int fd) = 0; - virtual drmModePlanePtr drmModeGetPlane(int fd, uint32_t plane_id) = 0; - virtual drmModeObjectPropertiesPtr drmModeObjectGetProperties(int fd,uint32_t object_id, uint32_t object_type) = 0; - virtual void drmModeFreeObjectProperties(drmModeObjectPropertiesPtr ptr) = 0; - virtual void drmModeFreePlane( drmModePlanePtr ptr ) = 0; - virtual void drmModeFreePlaneResources(drmModePlaneResPtr ptr) = 0; - virtual void drmModeFreeFB(drmModeFBPtr ptr) = 0; - virtual drmModeFBPtr drmModeGetFB(int fd, uint32_t bufferId) = 0; - virtual void drmModeFreeEncoder( drmModeEncoderPtr ptr ) = 0; - virtual int drmSetClientCap(int fd, uint64_t capability, uint64_t value) = 0; - -}; - -//drmModeEncoderPtr drmModeGetEncoder(int fd, uint32_t encoder_id); -//void drmModeFreeEncoder(drmModeEncoderPtr* encoder); -//drmModeConnectorPtr drmModeGetConnector(int fd, uint32_t connectorId); -//drmModeCrtcPtr drmModeGetCrtc(int fd, uint32_t crtcId); -//drmModeResPtr drmModeGetResources(int fd); -//void drmModeFreeConnector( drmModeConnectorPtr ptr ); -//void drmModeFreeCrtc( drmModeCrtcPtr ptr ); -//void drmModeFreeResources( drmModeResPtr ptr ); -//drmModePropertyPtr drmModeGetProperty(int fd, uint32_t propertyId); -//void drmModeFreeProperty(drmModePropertyPtr ptr); -//drmModePlaneResPtrResPtr drmModeGetPlaneResources(int fd); -//drmModePlaneResPtr drmModeGetPlane(int fd, uint32_t plane_id); -//drmModeObjectPropertiesPtr drmModeObjectGetProperties(int fd,uint32_t object_id, uint32_t object_type); -//void drmModeFreeObjectProperties(drmModeObjectPropertiesPtr ptr); -//void drmModeFreePlane( drmModePlaneResPtr ptr ); -//void drmModeFreePlaneResources(drmModePlaneResPtrResPtr ptr); - From 34c7fb3f3fbe3fe880d16e8c25421779250dd389 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Tue, 21 Apr 2026 19:06:38 +0000 Subject: [PATCH 60/72] Updates --- .github/copilot-instructions.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 3a8cf33c..937fa748 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -7,11 +7,12 @@ This is the **ctrlm-main** (Control Manager) plugin — a Thunder/WPEFramework p The `ci/` directory contains **native CI build support files only**. It is not part of the application. - `ci/build_dependencies.sh` / `ci/cov_build.sh` — scripts that build the plugin in a CI container without a full RDK target image -- `ci/mocks/control/` — control-specific stub headers (rdkx_logger, xr_voice_sdk, rdkversion) that are not available upstream -- `ci/mocks/testframework/` — repo-owned replacements for pinned testframework mocks when ctrlm needs local changes without mutating the clone in CI +- `ci/mocks/xlog_ci_compat.h` — minimal shim that pulls `std::string`, `std::map`, `std::tuple`, `std::get` into the global namespace (mirrors the transitive effect of the real rdkx_logger.h in the Yocto build) - `ci/mocks/testframework_overrides.h` — supplements testframework mocks with declarations ctrlm needs that are not yet upstream +- `ci/mocks/devicesettings_ctrlm.patch` — patch applied to the testframework `devicesettings.h` at CI time for ctrlm-specific additions (ducking types, `setAudioDucking`, `Host::IsInitialized`). Remove once these land in testframework develop. +- `ci/mocks/safec_lib.h` — compatibility shim mapping `safec_lib.h` to system libsafec headers - `ci/headers/` — empty stub headers and real xr-voice-sdk headers generated/copied at CI build time; not committed to source -Mock/stub headers for platform libraries (IARM, DeviceSettings, RFC, Telemetry, Thunder, etc.) and Thunder/ThunderTools patches are sourced from `entservices-testframework/` at CI build time. Control-specific mocks remain in `ci/mocks/control/`. Real xr-voice-sdk headers are copied into `ci/headers/xr-voice-sdk/` and placed first on the include path to override testframework mocks where the real API matches. +Real xr-voice-sdk headers (including `rdkx_logger.h`, `xr_voice_sdk.h`, and generated `rdkx_logger_modules.h`) are produced by `build_dependencies.sh` and placed in `ci/headers/xr-voice-sdk/`. Mock/stub headers for platform libraries (IARM, DeviceSettings, RFC, etc.) are sourced from `entservices-testframework/` at CI build time. When suggesting code or answering questions, treat CI mocks as scaffolding, not as authoritative API definitions. For real API shapes refer to the installed headers under `install/usr/include/` or the upstream repositories (Thunder, entservices-apis, xr-voice-sdk). From 700be5a48982b51bb065b56d5494ed8f23e9a735 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Tue, 21 Apr 2026 19:10:37 +0000 Subject: [PATCH 61/72] Updates --- ci/mocks/devicesettings_ctrlm.patch | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ci/mocks/devicesettings_ctrlm.patch b/ci/mocks/devicesettings_ctrlm.patch index bb4d45a1..51ca1e6f 100644 --- a/ci/mocks/devicesettings_ctrlm.patch +++ b/ci/mocks/devicesettings_ctrlm.patch @@ -29,11 +29,11 @@ -@@ -1444,6 +1459,7 @@ - class Host { +@@ -1418,6 +1433,7 @@ + class Manager { protected: - static HostImpl* impl; + static ManagerImpl* impl; + inline static bool IsInitialized = false; public: - static void setImpl(HostImpl* newImpl); + Manager(); From 1e72897329d7015f97c9c5c34e574c7f561fc863 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Tue, 21 Apr 2026 19:14:53 +0000 Subject: [PATCH 62/72] Fixing patch --- ci/mocks/devicesettings_ctrlm.patch | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/ci/mocks/devicesettings_ctrlm.patch b/ci/mocks/devicesettings_ctrlm.patch index 51ca1e6f..017a86f9 100644 --- a/ci/mocks/devicesettings_ctrlm.patch +++ b/ci/mocks/devicesettings_ctrlm.patch @@ -1,5 +1,5 @@ ---- a/Tests/mocks/devicesettings.h 2026-04-21 19:00:22.239951643 +0000 -+++ b/Tests/mocks/devicesettings.h 2026-04-21 19:02:02.376352344 +0000 +--- a/Tests/mocks/devicesettings.h 2026-04-21 19:12:58.154981897 +0000 ++++ b/Tests/mocks/devicesettings.h 2026-04-21 19:13:50.591192520 +0000 @@ -72,6 +72,16 @@ dsAUDIOPORT_TYPE_MAX /**< Maximum index for audio port type. */ } dsAudioPortType_t; @@ -29,11 +29,12 @@ -@@ -1418,6 +1433,7 @@ - class Manager { - protected: +@@ -1420,6 +1435,8 @@ static ManagerImpl* impl; -+ inline static bool IsInitialized = false; public: ++ inline static bool IsInitialized = false; ++ Manager(); + + static void setImpl(ManagerImpl* newImpl); From 1cc5e024d576e00233f1097c0a8d198f1138f8bd Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Tue, 21 Apr 2026 15:19:37 -0400 Subject: [PATCH 63/72] Update ci/mocks/testframework_overrides.h Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- ci/mocks/testframework_overrides.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ci/mocks/testframework_overrides.h b/ci/mocks/testframework_overrides.h index 520aba6b..3e1a5b4b 100644 --- a/ci/mocks/testframework_overrides.h +++ b/ci/mocks/testframework_overrides.h @@ -27,7 +27,13 @@ #define CTRLM_CI_TESTFRAMEWORK_OVERRIDES_H_ /* ctrlm-main calls IARM_Bus_RegisterEvent as a plain function (defined in stubs_iarm.cpp) */ +#ifdef __cplusplus +extern "C" { +#endif extern IARM_Result_t IARM_Bus_RegisterEvent(IARM_EventId_t maxEventId); +#ifdef __cplusplus +} +#endif /* Pinned testframework Iarm.h stops at UNKNOWN; ctrlm also references MAX. */ #ifndef DEEPSLEEP_WAKEUPREASON_MAX From f8d1ceed581b02e11932f7f2fb2a11748cf68d7f Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Tue, 21 Apr 2026 19:22:31 +0000 Subject: [PATCH 64/72] More tests --- .github/copilot-instructions.md | 2 +- ci/build_dependencies.sh | 3 ++- ci/cov_build.sh | 6 ++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 937fa748..24670848 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -9,7 +9,7 @@ The `ci/` directory contains **native CI build support files only**. It is not p - `ci/build_dependencies.sh` / `ci/cov_build.sh` — scripts that build the plugin in a CI container without a full RDK target image - `ci/mocks/xlog_ci_compat.h` — minimal shim that pulls `std::string`, `std::map`, `std::tuple`, `std::get` into the global namespace (mirrors the transitive effect of the real rdkx_logger.h in the Yocto build) - `ci/mocks/testframework_overrides.h` — supplements testframework mocks with declarations ctrlm needs that are not yet upstream -- `ci/mocks/devicesettings_ctrlm.patch` — patch applied to the testframework `devicesettings.h` at CI time for ctrlm-specific additions (ducking types, `setAudioDucking`, `Host::IsInitialized`). Remove once these land in testframework develop. +- `ci/mocks/devicesettings_ctrlm.patch` — patch applied to the testframework `devicesettings.h` at CI time for ctrlm-specific additions (ducking types, `setAudioDucking`, `Manager::IsInitialized`). Remove once these land in testframework develop. - `ci/mocks/safec_lib.h` — compatibility shim mapping `safec_lib.h` to system libsafec headers - `ci/headers/` — empty stub headers and real xr-voice-sdk headers generated/copied at CI build time; not committed to source diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh index dca67c95..b7f3960e 100644 --- a/ci/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -30,6 +30,7 @@ git config --global --add safe.directory "${GITHUB_WORKSPACE}" apt update apt install -y \ + pkg-config \ libsqlite3-dev \ libcurl4-openssl-dev \ libsystemd-dev \ @@ -53,7 +54,7 @@ git clone --depth 1 --filter=blob:none --branch develop https://github.com/rdkce git clone --depth 1 --filter=blob:none --branch develop https://github.com/rdkcentral/entservices-testframework.git # Patch the upstream testframework devicesettings.h with ctrlm-specific -# additions (ducking types, setAudioDucking, Host::IsInitialized). +# additions (ducking types, setAudioDucking, Manager::IsInitialized). # We can remove this if added to upstream testframework git -C entservices-testframework apply "$GITHUB_WORKSPACE/ci/mocks/devicesettings_ctrlm.patch" diff --git a/ci/cov_build.sh b/ci/cov_build.sh index 9a126485..a7f39028 100644 --- a/ci/cov_build.sh +++ b/ci/cov_build.sh @@ -33,6 +33,7 @@ MOCK_DIR="$GITHUB_WORKSPACE/entservices-testframework/Tests/mocks" MOCK_OVERRIDES="$GITHUB_WORKSPACE/ci/mocks/testframework_overrides.h" HEADERS_DIR="$GITHUB_WORKSPACE/ci/headers" EMPTY_JSON="$GITHUB_WORKSPACE/install/usr/include/ctrlm_config_empty.json" +GLIB_CFLAGS="$(pkg-config --cflags glib-2.0)" cmake -G Ninja -S "$GITHUB_WORKSPACE" -B build/control \ -DCMAKE_INSTALL_PREFIX="${GITHUB_WORKSPACE}/install/usr" \ @@ -74,9 +75,8 @@ cmake -G Ninja -S "$GITHUB_WORKSPACE" -B build/control \ -I ${HEADERS_DIR}/rdk/ds \ -I ${HEADERS_DIR}/rdk/iarmmgrs-hal \ -I ${GITHUB_WORKSPACE}/install/usr/include \ --I /usr/include/glib-2.0 \ --I /usr/lib/x86_64-linux-gnu/glib-2.0/include \ -I /usr/include/libdrm \ +${GLIB_CFLAGS} \ -include ${XLOG_COMPAT} \ -include ${MOCK_DIR}/Iarm.h \ -include ${MOCK_OVERRIDES} \ @@ -93,6 +93,8 @@ cmake -G Ninja -S "$GITHUB_WORKSPACE" -B build/control \ -I ${HEADERS_DIR}/rdk/ds \ -I ${HEADERS_DIR}/rdk/iarmmgrs-hal \ -I ${GITHUB_WORKSPACE}/install/usr/include \ +-I /usr/include/libdrm \ +${GLIB_CFLAGS} \ -Wall -Wno-error \ -DSAFEC_DUMMY_API \ -DDISABLE_SECURITY_TOKEN" \ From 9cdf6be304da404d8b5828f06b296ec5f14f0941 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Tue, 21 Apr 2026 15:30:28 -0400 Subject: [PATCH 65/72] Update ci/build_dependencies.sh Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- ci/build_dependencies.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh index b7f3960e..98818bf2 100644 --- a/ci/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -21,7 +21,7 @@ set -x set -e ############################## GITHUB_WORKSPACE="${PWD}" -cd ${GITHUB_WORKSPACE} +cd "${GITHUB_WORKSPACE}" git config --global --add safe.directory "${GITHUB_WORKSPACE}" From 223c1eed9a89751238ce0d43cd103464861d3ee1 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Tue, 21 Apr 2026 15:30:55 -0400 Subject: [PATCH 66/72] Update ci/build_dependencies.sh Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- ci/build_dependencies.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh index 98818bf2..186e2af3 100644 --- a/ci/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -43,8 +43,9 @@ apt install -y \ uuid-dev \ libevdev-dev \ libdrm-dev \ - libsafec-dev -pip install jsonref + libsafec-dev \ + python3-pip +python3 -m pip install jsonref ########################################### # 2. Clone the required repositories From c91803376b3c009e1ba0bcdd3202d2d489a62785 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Tue, 21 Apr 2026 19:43:11 +0000 Subject: [PATCH 67/72] Update --- .github/copilot-instructions.md | 2 +- ci/build_dependencies.sh | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 24670848..ff832a34 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -13,6 +13,6 @@ The `ci/` directory contains **native CI build support files only**. It is not p - `ci/mocks/safec_lib.h` — compatibility shim mapping `safec_lib.h` to system libsafec headers - `ci/headers/` — empty stub headers and real xr-voice-sdk headers generated/copied at CI build time; not committed to source -Real xr-voice-sdk headers (including `rdkx_logger.h`, `xr_voice_sdk.h`, and generated `rdkx_logger_modules.h`) are produced by `build_dependencies.sh` and placed in `ci/headers/xr-voice-sdk/`. Mock/stub headers for platform libraries (IARM, DeviceSettings, RFC, etc.) are sourced from `entservices-testframework/` at CI build time. +CI currently pins `xr-voice-sdk` to tag `1.0.13` in `build_dependencies.sh`. Real xr-voice-sdk headers (including `rdkx_logger.h`, `xr_voice_sdk.h`, and generated `rdkx_logger_modules.h`) are produced by `build_dependencies.sh` and placed in `ci/headers/xr-voice-sdk/`. Mock/stub headers for platform libraries (IARM, DeviceSettings, RFC, etc.) are sourced from `entservices-testframework/` at CI build time. When suggesting code or answering questions, treat CI mocks as scaffolding, not as authoritative API definitions. For real API shapes refer to the installed headers under `install/usr/include/` or the upstream repositories (Thunder, entservices-apis, xr-voice-sdk). diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh index 186e2af3..8a698096 100644 --- a/ci/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -50,7 +50,8 @@ python3 -m pip install jsonref ########################################### # 2. Clone the required repositories -git clone --depth 1 --filter=blob:none --branch develop https://github.com/rdkcentral/xr-voice-sdk.git +XRSDK_REF="1.0.13" +git clone --depth 1 --filter=blob:none --branch "${XRSDK_REF}" https://github.com/rdkcentral/xr-voice-sdk.git git clone --depth 1 --filter=blob:none --branch develop https://github.com/rdkcentral/entservices-testframework.git From 74a0fac229e4ed72557e2c20a859cac4b7e0b561 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Wed, 22 Apr 2026 16:48:28 +0000 Subject: [PATCH 68/72] Updating comment of stripping -Werror from generated build --- ci/cov_build.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ci/cov_build.sh b/ci/cov_build.sh index a7f39028..3a51b921 100644 --- a/ci/cov_build.sh +++ b/ci/cov_build.sh @@ -100,9 +100,10 @@ ${GLIB_CFLAGS} \ -DDISABLE_SECURITY_TOKEN" \ -DCMAKE_EXE_LINKER_FLAGS="-L${GITHUB_WORKSPACE}/install/usr/lib -Wl,--unresolved-symbols=ignore-all" -# CMakeLists.txt unconditionally adds -Werror via target_compile_options, which -# appends after CMAKE_CXX_FLAGS and overrides our -Wno-error. Strip it from -# the generated build files after cmake configure. +# CMakeLists.txt unconditionally appends -Werror via target_compile_options, which +# comes after CMAKE_CXX_FLAGS and overrides -Wno-error. Strip it from the generated +# build files after cmake configure. To remove this, add an ENABLE_WERROR option to +# CMakeLists.txt that appends -Wno-error when OFF, and pass -DENABLE_WERROR=OFF here. find "${GITHUB_WORKSPACE}/build/control" \( -name "*.ninja" -o -name "flags.make" \) -exec sed -i 's/\(^\|[[:space:]]\)-Werror\([[:space:]]\|$\)/\1\2/g' {} \; cmake --build build/control -j$(nproc) 2>&1 From 4b3a2c56f2af1041ebd4478a2a17fc41f0e364b3 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Tue, 5 May 2026 08:23:25 -0400 Subject: [PATCH 69/72] Update ci/mocks/devicesettings_ctrlm.patch Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- ci/mocks/devicesettings_ctrlm.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/mocks/devicesettings_ctrlm.patch b/ci/mocks/devicesettings_ctrlm.patch index 017a86f9..d2faf8a8 100644 --- a/ci/mocks/devicesettings_ctrlm.patch +++ b/ci/mocks/devicesettings_ctrlm.patch @@ -33,7 +33,7 @@ static ManagerImpl* impl; public: -+ inline static bool IsInitialized = false; ++ static bool IsInitialized; + Manager(); From 43c2acec23645e9570f8ebc46f65b4ec7d8fe940 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Tue, 5 May 2026 09:12:11 -0400 Subject: [PATCH 70/72] Update ci/build_dependencies.sh Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- ci/build_dependencies.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh index 8a698096..9abff1c9 100644 --- a/ci/build_dependencies.sh +++ b/ci/build_dependencies.sh @@ -172,7 +172,7 @@ cp "$GITHUB_WORKSPACE/ci/mocks/safec_lib.h" safec_lib.h echo "Stub headers created successfully" -cd ${GITHUB_WORKSPACE} +cd "${GITHUB_WORKSPACE}" mkdir -p "${GITHUB_WORKSPACE}/install/usr/include" printf '{}\n' > "${GITHUB_WORKSPACE}/install/usr/include/ctrlm_config_empty.json" From 112b9f85ef278299387747a66536d86425381589 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Tue, 5 May 2026 13:23:46 +0000 Subject: [PATCH 71/72] Cleanup Co-authored-by: Copilot --- ci/mocks/testframework_overrides.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/mocks/testframework_overrides.h b/ci/mocks/testframework_overrides.h index 3e1a5b4b..c551a450 100644 --- a/ci/mocks/testframework_overrides.h +++ b/ci/mocks/testframework_overrides.h @@ -46,12 +46,12 @@ extern IARM_Result_t IARM_Bus_RegisterEvent(IARM_EventId_t maxEventId); #endif /* Struct not present in the pinned testframework mock */ -#ifndef IARM_BUS_COMMON_API_PowerPreChange_Param_t +#ifndef CTRLM_IARM_BUS_COMMON_API_POWERPRECHANGE_PARAM_T_DEFINED +#define CTRLM_IARM_BUS_COMMON_API_POWERPRECHANGE_PARAM_T_DEFINED typedef struct { IARM_Bus_PWRMgr_PowerState_t newState; IARM_Bus_PWRMgr_PowerState_t curState; } IARM_Bus_CommonAPI_PowerPreChange_Param_t; -#define IARM_BUS_COMMON_API_PowerPreChange_Param_t IARM_Bus_CommonAPI_PowerPreChange_Param_t #endif #endif /* CTRLM_CI_TESTFRAMEWORK_OVERRIDES_H_ */ From 06448856fffd532c680c3aaa989cd8f8677a51e8 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Tue, 5 May 2026 13:34:33 +0000 Subject: [PATCH 72/72] Fix issues create by copilot suggestion Co-authored-by: Copilot --- ci/mocks/testframework_overrides.h | 9 --------- 1 file changed, 9 deletions(-) diff --git a/ci/mocks/testframework_overrides.h b/ci/mocks/testframework_overrides.h index c551a450..22b8a0a2 100644 --- a/ci/mocks/testframework_overrides.h +++ b/ci/mocks/testframework_overrides.h @@ -26,15 +26,6 @@ #ifndef CTRLM_CI_TESTFRAMEWORK_OVERRIDES_H_ #define CTRLM_CI_TESTFRAMEWORK_OVERRIDES_H_ -/* ctrlm-main calls IARM_Bus_RegisterEvent as a plain function (defined in stubs_iarm.cpp) */ -#ifdef __cplusplus -extern "C" { -#endif -extern IARM_Result_t IARM_Bus_RegisterEvent(IARM_EventId_t maxEventId); -#ifdef __cplusplus -} -#endif - /* Pinned testframework Iarm.h stops at UNKNOWN; ctrlm also references MAX. */ #ifndef DEEPSLEEP_WAKEUPREASON_MAX #define DEEPSLEEP_WAKEUPREASON_MAX (DEEPSLEEP_WAKEUPREASON_UNKNOWN + 1)