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 1/4] 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 42cb68e4273121211d7a19971ce8e693a587af37 Mon Sep 17 00:00:00 2001 From: Gene Gallagher Date: Fri, 1 May 2026 18:05:31 +0000 Subject: [PATCH 2/4] RDKEMW-13898: prevent simultaneous irdb codes from different vendors --- src/ble/ctrlm_ble_network.cpp | 21 ++++++++++++++- src/database/ctrlm_database.cpp | 48 ++++++++++++++++++++++++++++----- src/database/ctrlm_database.h | 8 +++--- src/network/ctrlm_ir_rf_db.cpp | 43 +++++++++++++++++++++++++---- src/network/ctrlm_ir_rf_db.h | 31 ++++++++++++++++++++- 5 files changed, 134 insertions(+), 17 deletions(-) diff --git a/src/ble/ctrlm_ble_network.cpp b/src/ble/ctrlm_ble_network.cpp index 03e1322f..14eceead 100644 --- a/src/ble/ctrlm_ble_network.cpp +++ b/src/ble/ctrlm_ble_network.cpp @@ -794,10 +794,29 @@ void ctrlm_obj_network_ble_t::req_process_program_ir_codes(void *data, int size) } else { if(dqm->ir_codes) { + if (dqm->ir_codes->type == CTRLM_IRDB_DEV_TYPE_TV && (ir_rf_database_.get_avr_ir_vendor_id() != 0 && ir_rf_database_.get_avr_ir_vendor_id() != dqm->vendor_info.rcu_support_bitmask) ) { + // if we are programming TV codes but the previous AVR codes are from a different IRDB vendor, then clear out the AVR codes. + // the remote cannot send different codes from different IRDB vendors at the same time. + XLOGD_INFO("Programming TV codes from vendor %s(%d), but currently have AVR codes from %s(%d). Clearing AVR codes.", + dqm->vendor_info.name.c_str(), dqm->vendor_info.rcu_support_bitmask, + ir_rf_database_.get_avr_ir_vendor_name().c_str(),ir_rf_database_.get_avr_ir_vendor_id()); + + ir_rf_database_.clear_avr_ir_codes(); + + } else if (dqm->ir_codes->type == CTRLM_IRDB_DEV_TYPE_AVR && (ir_rf_database_.get_tv_ir_vendor_id() != 0 && ir_rf_database_.get_tv_ir_vendor_id() != dqm->vendor_info.rcu_support_bitmask) ) { + // if we are programming AVR codes but the previous TV codes are from a different IRDB vendor, then clear out the TV codes. + // the remote cannot send different codes from different IRDB vendors at the same time. + XLOGD_INFO("Programming AVR codes from vendor %s(%d), but currently have TV codes from %s(%d). Clearing TV codes.", + dqm->vendor_info.name.c_str(), dqm->vendor_info.rcu_support_bitmask, + ir_rf_database_.get_tv_ir_vendor_name().c_str(),ir_rf_database_.get_tv_ir_vendor_id()); + + ir_rf_database_.clear_tv_ir_codes(); + } + std::map> ir_codes; // First add IR Codes to the IR RF Database (this contains all of the logic for maintaining TV vs AVR codes) - ir_rf_database_.add_irdb_codes(dqm->ir_codes); + ir_rf_database_.add_irdb_codes(dqm->ir_codes, dqm->vendor_info.rcu_support_bitmask, dqm->vendor_info.name); XLOGD_INFO("\n%s", this->ir_rf_database_.to_string(true).c_str()); // Now get the IR codes for the BLE IR slots for(auto key : ctrlm_ble_ir_key_names) { diff --git a/src/database/ctrlm_database.cpp b/src/database/ctrlm_database.cpp index dfe2bb21..11ce9833 100644 --- a/src/database/ctrlm_database.cpp +++ b/src/database/ctrlm_database.cpp @@ -71,7 +71,11 @@ using namespace std; #define CTRLM_DB_IR_COMMAND_REPEATS "ir_command_repeats" #define CTRLM_DB_DEVICE_UPDATE_SESSION_STATE "du_session_state" #define CTRLM_DB_TV_IR_CODE_ID "tv_ir_code_id" +#define CTRLM_DB_TV_IR_VENDOR_ID "tv_ir_vendor_id" +#define CTRLM_DB_TV_IR_VENDOR_NAME "tv_ir_vendor_name" #define CTRLM_DB_AVR_IR_CODE_ID "avr_ir_code_id" +#define CTRLM_DB_AVR_IR_VENDOR_ID "avr_ir_vendor_id" +#define CTRLM_DB_AVR_IR_VENDOR_NAME "avr_ir_vendor_name" #define CTRLM_DB_TABLE_VOICE "ctrlm_voice" @@ -706,11 +710,13 @@ void ctrlm_db_ir_command_repeats_read(guchar **data, guint32 *length) { ctrlm_db_read_blob(CTRLM_DB_TABLE_CTRLMGR, CTRLM_DB_IR_COMMAND_REPEATS, data, length); } -void ctrlm_db_tv_ir_code_id_write(const std::string id) { +void ctrlm_db_tv_ir_code_id_write(const std::string id, unsigned char vendor_id, const std::string vendor_name) { ctrlm_db_write_blob(CTRLM_DB_TABLE_CTRLMGR, CTRLM_DB_TV_IR_CODE_ID, (const guchar*) id.c_str(), id.length()); + ctrlm_db_write_uint64(CTRLM_DB_TABLE_CTRLMGR, CTRLM_DB_TV_IR_VENDOR_ID, vendor_id); + ctrlm_db_write_blob(CTRLM_DB_TABLE_CTRLMGR, CTRLM_DB_TV_IR_VENDOR_NAME, (const guchar*) vendor_name.c_str(), vendor_name.length()); } -void ctrlm_db_tv_ir_code_id_read(std::string &id) { +void ctrlm_db_tv_ir_code_id_read(std::string &id, unsigned char &vendor_id, std::string &vendor_name) { guchar *data = NULL; guint32 length = 0; ctrlm_db_read_blob(CTRLM_DB_TABLE_CTRLMGR, CTRLM_DB_TV_IR_CODE_ID, &data, &length); @@ -718,15 +724,31 @@ void ctrlm_db_tv_ir_code_id_read(std::string &id) { id.assign((char *)data, length); ctrlm_db_free(data); } else { - XLOGD_WARN("Failed to load tv_ir_code_id from db"); + XLOGD_WARN("Failed to load %s from db", CTRLM_DB_TV_IR_CODE_ID); + } + + guint64 vendor_id_64 = 0; + ctrlm_db_read_uint64(CTRLM_DB_TABLE_CTRLMGR, CTRLM_DB_TV_IR_VENDOR_ID, (sqlite_uint64*)&vendor_id_64); + vendor_id = vendor_id_64; + + data = NULL; + length = 0; + ctrlm_db_read_blob(CTRLM_DB_TABLE_CTRLMGR, CTRLM_DB_TV_IR_VENDOR_NAME, &data, &length); + if(NULL != data) { + vendor_name.assign((char *)data, length); + ctrlm_db_free(data); + } else { + XLOGD_WARN("Failed to load %s from db", CTRLM_DB_TV_IR_VENDOR_NAME); } } -void ctrlm_db_avr_ir_code_id_write(const std::string id) { +void ctrlm_db_avr_ir_code_id_write(const std::string id, unsigned char vendor_id, const std::string vendor_name) { ctrlm_db_write_blob(CTRLM_DB_TABLE_CTRLMGR, CTRLM_DB_AVR_IR_CODE_ID, (const guchar*) id.c_str(), id.length()); + ctrlm_db_write_uint64(CTRLM_DB_TABLE_CTRLMGR, CTRLM_DB_AVR_IR_VENDOR_ID, vendor_id); + ctrlm_db_write_blob(CTRLM_DB_TABLE_CTRLMGR, CTRLM_DB_AVR_IR_VENDOR_NAME, (const guchar*) vendor_name.c_str(), vendor_name.length()); } -void ctrlm_db_avr_ir_code_id_read(std::string &id) { +void ctrlm_db_avr_ir_code_id_read(std::string &id, unsigned char &vendor_id, std::string &vendor_name) { guchar *data = NULL; guint32 length = 0; ctrlm_db_read_blob(CTRLM_DB_TABLE_CTRLMGR, CTRLM_DB_AVR_IR_CODE_ID, &data, &length); @@ -734,7 +756,21 @@ void ctrlm_db_avr_ir_code_id_read(std::string &id) { id.assign((char *)data, length); ctrlm_db_free(data); } else { - XLOGD_WARN("Failed to load avr_ir_code_id from db"); + XLOGD_WARN("Failed to load %s from db", CTRLM_DB_AVR_IR_CODE_ID); + } + + guint64 vendor_id_64 = 0; + ctrlm_db_read_uint64(CTRLM_DB_TABLE_CTRLMGR, CTRLM_DB_AVR_IR_VENDOR_ID, (sqlite_uint64*)&vendor_id_64); + vendor_id = vendor_id_64; + + data = NULL; + length = 0; + ctrlm_db_read_blob(CTRLM_DB_TABLE_CTRLMGR, CTRLM_DB_AVR_IR_VENDOR_NAME, &data, &length); + if(NULL != data) { + vendor_name.assign((char *)data, length); + ctrlm_db_free(data); + } else { + XLOGD_WARN("Failed to load %s from db", CTRLM_DB_AVR_IR_VENDOR_NAME); } } diff --git a/src/database/ctrlm_database.h b/src/database/ctrlm_database.h index 4716b075..f842c71f 100644 --- a/src/database/ctrlm_database.h +++ b/src/database/ctrlm_database.h @@ -77,10 +77,10 @@ void ctrlm_db_chime_volume_write(guchar *data, guint32 length); void ctrlm_db_chime_volume_read(guchar **data, guint32 *length); void ctrlm_db_ir_command_repeats_write(guchar *data, guint32 length); void ctrlm_db_ir_command_repeats_read(guchar **data, guint32 *length); -void ctrlm_db_tv_ir_code_id_write(const std::string id); -void ctrlm_db_tv_ir_code_id_read(std::string &id); -void ctrlm_db_avr_ir_code_id_write(const std::string id); -void ctrlm_db_avr_ir_code_id_read(std::string &id); +void ctrlm_db_tv_ir_code_id_write(const std::string id, unsigned char vendor_id, const std::string vendor_name); +void ctrlm_db_tv_ir_code_id_read(std::string &id, unsigned char &vendor_id, std::string &vendor_name); +void ctrlm_db_avr_ir_code_id_write(const std::string id, unsigned char vendor_id, const std::string vendor_name); +void ctrlm_db_avr_ir_code_id_read(std::string &id, unsigned char &vendor_id, std::string &vendor_name); void ctrlm_db_rf4ce_networks_list(std::vector *network_ids); void ctrlm_db_rf4ce_controllers_list(ctrlm_network_id_t network_id, std::vector *controller_ids); diff --git a/src/network/ctrlm_ir_rf_db.cpp b/src/network/ctrlm_ir_rf_db.cpp index 126e57cb..29e90205 100644 --- a/src/network/ctrlm_ir_rf_db.cpp +++ b/src/network/ctrlm_ir_rf_db.cpp @@ -42,7 +42,11 @@ ctrlm_ir_rf_db_t::ctrlm_ir_rf_db_t(bool power_toggle_favor_tv, bool power_discre this->power_toggle_favor_tv = power_toggle_favor_tv; this->power_discrete_favor_tv = power_discrete_favor_tv; this->tv_ir_code_id_ = "0"; + this->tv_ir_vendor_id_ = 0; + this->tv_ir_vendor_name_ = "INVALID"; this->avr_ir_code_id_ = "0"; + this->avr_ir_vendor_id_ = 0; + this->avr_ir_vendor_name_ = "INVALID"; } ctrlm_ir_rf_db_t::~ctrlm_ir_rf_db_t() { @@ -174,17 +178,21 @@ ctrlm_key_code_t to_ctrlm_keycode(ctrlm_irdb_key_code_t irdb_code) { } } -bool ctrlm_ir_rf_db_t::add_irdb_codes(ctrlm_irdb_ir_code_set_t *ir_codes) { +bool ctrlm_ir_rf_db_t::add_irdb_codes(ctrlm_irdb_ir_code_set_t *ir_codes, unsigned char ir_vendor_id, const std::string &ir_vendor_name) { bool ret = false; if(ir_codes) { ctrlm_ir_rf_db_dev_type_t type = ctrlm_ir_rf_db_entry_t::type_from_irdb(ir_codes->type); switch(type) { case CTRLM_IR_RF_DB_DEV_TV: { this->tv_ir_code_id_ = ir_codes->id; + this->tv_ir_vendor_id_ = ir_vendor_id; + this->tv_ir_vendor_name_ = ir_vendor_name; break; } case CTRLM_IR_RF_DB_DEV_AVR: { this->avr_ir_code_id_ = ir_codes->id; + this->avr_ir_vendor_id_ = ir_vendor_id; + this->avr_ir_vendor_name_ = ir_vendor_name; break; } default: { @@ -227,6 +235,8 @@ void ctrlm_ir_rf_db_t::clear_tv_ir_codes() { this->fix_common_slots_and_ir_flags(); this->tv_ir_code_id_ = "0"; + this->tv_ir_vendor_id_ = 0; + this->tv_ir_vendor_name_ = "INVALID"; } void ctrlm_ir_rf_db_t::clear_avr_ir_codes() { @@ -251,6 +261,8 @@ void ctrlm_ir_rf_db_t::clear_avr_ir_codes() { this->fix_common_slots_and_ir_flags(); this->avr_ir_code_id_ = "0"; + this->avr_ir_vendor_id_ = 0; + this->avr_ir_vendor_name_ = "INVALID"; } void ctrlm_ir_rf_db_t::clear_ir_codes() { @@ -259,7 +271,11 @@ void ctrlm_ir_rf_db_t::clear_ir_codes() { this->remove_entry(itr->first); } this->tv_ir_code_id_ = "0"; + this->tv_ir_vendor_id_ = 0; + this->tv_ir_vendor_name_ = "INVALID"; this->avr_ir_code_id_ = "0"; + this->avr_ir_vendor_id_ = 0; + this->avr_ir_vendor_name_ = "INVALID"; } ctrlm_ir_rf_db_entry_t *ctrlm_ir_rf_db_t::get_ir_code(ctrlm_key_code_t key) { @@ -274,7 +290,9 @@ std::string ctrlm_ir_rf_db_t::to_string(bool debug) const { std::stringstream ss; ss << "IR RF Database: "<< std::endl; ss << "\tTV IR Code ID <" << tv_ir_code_id_ << ">" << std::endl; + ss << "\tTV IR Vendor Info <" << tv_ir_vendor_name_ << ": " << (unsigned int)tv_ir_vendor_id_ << ">" << std::endl; ss << "\tAVR IR Code ID <" << avr_ir_code_id_ << ">" << std::endl; + ss << "\tAVR IR Vendor Info <" << avr_ir_vendor_name_ << ": " << (unsigned int)avr_ir_vendor_id_ << ">" << std::endl; for(auto itr = this->ir_rf_db.begin(); itr != this->ir_rf_db.end(); itr++) { if(itr->second != NULL) { ss << "\tKeySlot <" << ctrlm_key_code_str(itr->first) << ">, " << itr->second->to_string(debug) << std::endl; @@ -373,16 +391,16 @@ void ctrlm_ir_rf_db_t::load_db() { this->replace_entry(itr->first, entry); } } - ctrlm_db_tv_ir_code_id_read(tv_ir_code_id_); - ctrlm_db_avr_ir_code_id_read(avr_ir_code_id_); + ctrlm_db_tv_ir_code_id_read(tv_ir_code_id_, tv_ir_vendor_id_, tv_ir_vendor_name_); + ctrlm_db_avr_ir_code_id_read(avr_ir_code_id_, avr_ir_vendor_id_, avr_ir_vendor_name_); } bool ctrlm_ir_rf_db_t::store_db() { for(auto itr = this->ir_rf_db.begin(); itr != this->ir_rf_db.end(); itr++) { this->store_entry(itr->first); } - ctrlm_db_tv_ir_code_id_write(tv_ir_code_id_); - ctrlm_db_avr_ir_code_id_write(avr_ir_code_id_); + ctrlm_db_tv_ir_code_id_write(tv_ir_code_id_, tv_ir_vendor_id_, tv_ir_vendor_name_); + ctrlm_db_avr_ir_code_id_write(avr_ir_code_id_, avr_ir_vendor_id_, avr_ir_vendor_name_); return(true); // TODO, maybe change to void } @@ -449,7 +467,22 @@ std::string ctrlm_ir_rf_db_t::get_tv_ir_code_id() { return tv_ir_code_id_; } +unsigned char ctrlm_ir_rf_db_t::get_tv_ir_vendor_id() { + return tv_ir_vendor_id_; +} + +std::string ctrlm_ir_rf_db_t::get_tv_ir_vendor_name() { + return tv_ir_vendor_name_; +} + std::string ctrlm_ir_rf_db_t::get_avr_ir_code_id() { return avr_ir_code_id_; } +unsigned char ctrlm_ir_rf_db_t::get_avr_ir_vendor_id() { + return avr_ir_vendor_id_; +} + +std::string ctrlm_ir_rf_db_t::get_avr_ir_vendor_name() { + return avr_ir_vendor_name_; +} diff --git a/src/network/ctrlm_ir_rf_db.h b/src/network/ctrlm_ir_rf_db.h index c9f489a2..098a69e9 100644 --- a/src/network/ctrlm_ir_rf_db.h +++ b/src/network/ctrlm_ir_rf_db.h @@ -60,7 +60,7 @@ class ctrlm_ir_rf_db_t { * @param ir_codes A keymap supplied from the CTRLM IRDB component * @reutrn True if the entries were added to the IRRF Database, False otherwise. */ - bool add_irdb_codes(ctrlm_irdb_ir_code_set_t *ir_codes); + bool add_irdb_codes(ctrlm_irdb_ir_code_set_t *ir_codes, unsigned char ir_vendor_id = 0, const std::string &ir_vendor_name = ""); /** * Function to clear all TV IR codes stored in the IR RF Database @@ -120,11 +120,36 @@ class ctrlm_ir_rf_db_t { */ std::string get_tv_ir_code_id(); + /** + * Function used to get the TV IR vendor ID in the ControlMgr Database. + * @return the TV IR vendor ID as unsigned char + */ + unsigned char get_tv_ir_vendor_id(); + + /** + * Function used to get the TV IR vendor name in the ControlMgr Database. + * @return the TV IR vendor name in string form. + */ + std::string get_tv_ir_vendor_name(); + /** * Function used to get the AVR IR code ID in the ControlMgr Database. * @return the AVR IR code ID in string form. */ std::string get_avr_ir_code_id(); + + /** + * Function used to get the AVR IR vendor ID in the ControlMgr Database. + * @return the AVR IR vendor ID as unsigned char + */ + unsigned char get_avr_ir_vendor_id(); + + /** + * Function used to get the AVR IR vendor name in the ControlMgr Database. + * @return the AVR IR vendor name in string form. + */ + std::string get_avr_ir_vendor_name(); + private: /** @@ -157,7 +182,11 @@ class ctrlm_ir_rf_db_t { bool power_toggle_favor_tv; bool power_discrete_favor_tv; std::string tv_ir_code_id_; + unsigned char tv_ir_vendor_id_; + std::string tv_ir_vendor_name_; std::string avr_ir_code_id_; + unsigned char avr_ir_vendor_id_; + std::string avr_ir_vendor_name_; }; From b748acf2d3634a7b2d390e6f863e081a46e04227 Mon Sep 17 00:00:00 2001 From: Gene Gallagher <129112619+egalla204@users.noreply.github.com> Date: Mon, 4 May 2026 10:24:42 -0400 Subject: [PATCH 3/4] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- src/ble/ctrlm_ble_network.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/ble/ctrlm_ble_network.cpp b/src/ble/ctrlm_ble_network.cpp index 14eceead..2378db60 100644 --- a/src/ble/ctrlm_ble_network.cpp +++ b/src/ble/ctrlm_ble_network.cpp @@ -797,18 +797,18 @@ void ctrlm_obj_network_ble_t::req_process_program_ir_codes(void *data, int size) if (dqm->ir_codes->type == CTRLM_IRDB_DEV_TYPE_TV && (ir_rf_database_.get_avr_ir_vendor_id() != 0 && ir_rf_database_.get_avr_ir_vendor_id() != dqm->vendor_info.rcu_support_bitmask) ) { // if we are programming TV codes but the previous AVR codes are from a different IRDB vendor, then clear out the AVR codes. // the remote cannot send different codes from different IRDB vendors at the same time. - XLOGD_INFO("Programming TV codes from vendor %s(%d), but currently have AVR codes from %s(%d). Clearing AVR codes.", - dqm->vendor_info.name.c_str(), dqm->vendor_info.rcu_support_bitmask, - ir_rf_database_.get_avr_ir_vendor_name().c_str(),ir_rf_database_.get_avr_ir_vendor_id()); + XLOGD_INFO("Programming TV codes from vendor %s(0x%X), but currently have AVR codes from %s(0x%X). Clearing AVR codes.", + dqm->vendor_info.name.c_str(), (unsigned int)dqm->vendor_info.rcu_support_bitmask, + ir_rf_database_.get_avr_ir_vendor_name().c_str(), (unsigned int)ir_rf_database_.get_avr_ir_vendor_id()); ir_rf_database_.clear_avr_ir_codes(); } else if (dqm->ir_codes->type == CTRLM_IRDB_DEV_TYPE_AVR && (ir_rf_database_.get_tv_ir_vendor_id() != 0 && ir_rf_database_.get_tv_ir_vendor_id() != dqm->vendor_info.rcu_support_bitmask) ) { // if we are programming AVR codes but the previous TV codes are from a different IRDB vendor, then clear out the TV codes. // the remote cannot send different codes from different IRDB vendors at the same time. - XLOGD_INFO("Programming AVR codes from vendor %s(%d), but currently have TV codes from %s(%d). Clearing TV codes.", - dqm->vendor_info.name.c_str(), dqm->vendor_info.rcu_support_bitmask, - ir_rf_database_.get_tv_ir_vendor_name().c_str(),ir_rf_database_.get_tv_ir_vendor_id()); + XLOGD_INFO("Programming AVR codes from vendor %s(0x%X), but currently have TV codes from %s(0x%X). Clearing TV codes.", + dqm->vendor_info.name.c_str(), (unsigned int)dqm->vendor_info.rcu_support_bitmask, + ir_rf_database_.get_tv_ir_vendor_name().c_str(), (unsigned int)ir_rf_database_.get_tv_ir_vendor_id()); ir_rf_database_.clear_tv_ir_codes(); } From 1aa1a39e107f6b47542d7bc7c762748141092d06 Mon Sep 17 00:00:00 2001 From: Gene Gallagher Date: Wed, 6 May 2026 17:39:19 +0000 Subject: [PATCH 4/4] delete ctrlm db entry when clearing tv/avr codes from other vendor --- src/network/ctrlm_ir_rf_db.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/network/ctrlm_ir_rf_db.cpp b/src/network/ctrlm_ir_rf_db.cpp index 29e90205..6c821f5a 100644 --- a/src/network/ctrlm_ir_rf_db.cpp +++ b/src/network/ctrlm_ir_rf_db.cpp @@ -213,24 +213,34 @@ bool ctrlm_ir_rf_db_t::add_irdb_codes(ctrlm_irdb_ir_code_set_t *ir_codes, unsign } void ctrlm_ir_rf_db_t::clear_tv_ir_codes() { + ctrlm_db_ir_rf_database_delete(CTRLM_KEY_CODE_TV_POWER_ON); this->remove_entry(CTRLM_KEY_CODE_TV_POWER_ON); + + ctrlm_db_ir_rf_database_delete(CTRLM_KEY_CODE_TV_POWER_OFF); this->remove_entry(CTRLM_KEY_CODE_TV_POWER_OFF); + + ctrlm_db_ir_rf_database_delete(CTRLM_KEY_CODE_TV_POWER); this->remove_entry(CTRLM_KEY_CODE_TV_POWER); + if(this->has_entry(CTRLM_KEY_CODE_VOL_UP)) { if(this->ir_rf_db[CTRLM_KEY_CODE_VOL_UP]->get_type() == CTRLM_IR_RF_DB_DEV_TV) { + ctrlm_db_ir_rf_database_delete(CTRLM_KEY_CODE_VOL_UP); this->remove_entry(CTRLM_KEY_CODE_VOL_UP); } } if(this->has_entry(CTRLM_KEY_CODE_VOL_DOWN)) { if(this->ir_rf_db[CTRLM_KEY_CODE_VOL_DOWN]->get_type() == CTRLM_IR_RF_DB_DEV_TV) { + ctrlm_db_ir_rf_database_delete(CTRLM_KEY_CODE_VOL_DOWN); this->remove_entry(CTRLM_KEY_CODE_VOL_DOWN); } } if(this->has_entry(CTRLM_KEY_CODE_MUTE)) { if(this->ir_rf_db[CTRLM_KEY_CODE_MUTE]->get_type() == CTRLM_IR_RF_DB_DEV_TV) { + ctrlm_db_ir_rf_database_delete(CTRLM_KEY_CODE_MUTE); this->remove_entry(CTRLM_KEY_CODE_MUTE); } } + ctrlm_db_ir_rf_database_delete(CTRLM_KEY_CODE_INPUT_SELECT); this->remove_entry(CTRLM_KEY_CODE_INPUT_SELECT); this->fix_common_slots_and_ir_flags(); @@ -240,21 +250,30 @@ void ctrlm_ir_rf_db_t::clear_tv_ir_codes() { } void ctrlm_ir_rf_db_t::clear_avr_ir_codes() { + ctrlm_db_ir_rf_database_delete(CTRLM_KEY_CODE_AVR_POWER_ON); this->remove_entry(CTRLM_KEY_CODE_AVR_POWER_ON); + + ctrlm_db_ir_rf_database_delete(CTRLM_KEY_CODE_AVR_POWER_OFF); this->remove_entry(CTRLM_KEY_CODE_AVR_POWER_OFF); + + ctrlm_db_ir_rf_database_delete(CTRLM_KEY_CODE_AVR_POWER_TOGGLE); this->remove_entry(CTRLM_KEY_CODE_AVR_POWER_TOGGLE); + if(this->has_entry(CTRLM_KEY_CODE_VOL_UP)) { if(this->ir_rf_db[CTRLM_KEY_CODE_VOL_UP]->get_type() == CTRLM_IR_RF_DB_DEV_AVR) { + ctrlm_db_ir_rf_database_delete(CTRLM_KEY_CODE_VOL_UP); this->remove_entry(CTRLM_KEY_CODE_VOL_UP); } } if(this->has_entry(CTRLM_KEY_CODE_VOL_DOWN)) { if(this->ir_rf_db[CTRLM_KEY_CODE_VOL_DOWN]->get_type() == CTRLM_IR_RF_DB_DEV_AVR) { + ctrlm_db_ir_rf_database_delete(CTRLM_KEY_CODE_VOL_DOWN); this->remove_entry(CTRLM_KEY_CODE_VOL_DOWN); } } if(this->has_entry(CTRLM_KEY_CODE_MUTE)) { if(this->ir_rf_db[CTRLM_KEY_CODE_MUTE]->get_type() == CTRLM_IR_RF_DB_DEV_AVR) { + ctrlm_db_ir_rf_database_delete(CTRLM_KEY_CODE_MUTE); this->remove_entry(CTRLM_KEY_CODE_MUTE); } }