From 2d0141b4d94a166caf477d2516115389426006a0 Mon Sep 17 00:00:00 2001 From: smanes0213 Date: Tue, 16 Sep 2025 11:50:17 +0530 Subject: [PATCH 1/5] RDKEMW-8150 : Move Firmware related APIs from SystemServices plugin to FirmwareUpdate Plugin Version : Minor Signed-off-by: smanes0213 --- .../FirmwareUpdateImplementation.cpp | 23 +++++++++++++++++++ FirmwareUpdate/FirmwareUpdateImplementation.h | 1 + 2 files changed, 24 insertions(+) diff --git a/FirmwareUpdate/FirmwareUpdateImplementation.cpp b/FirmwareUpdate/FirmwareUpdateImplementation.cpp index 08c6aec7..e12cfe35 100644 --- a/FirmwareUpdate/FirmwareUpdateImplementation.cpp +++ b/FirmwareUpdate/FirmwareUpdateImplementation.cpp @@ -1,3 +1,26 @@ + + /* + * @brief This function Enable/Disable the AutoReboot Feature (COMRPC). + * This will internally set the tr181 AutoReboot.Enable to True/False. + * @param[in] enable: Boolean to enable or disable AutoReboot + * @param[out] result: Result struct with success status + * @return: Core:: + */ + Core::hresult FirmwareUpdateImplementation::SetFirmwareAutoReboot(const bool enable, Exchange::IFirmwareUpdate::Result& result) + { + result.success = false; + const char* set_rfc_val = enable ? "true" : "false"; + WDMP_STATUS status = setRFCParameter((char*)"thunderapi", + TR181_AUTOREBOOT_ENABLE, set_rfc_val, WDMP_BOOLEAN); + if (WDMP_SUCCESS == status) { + result.success = true; + LOGINFO("Success Setting the setFirmwareAutoReboot value\n"); + return Core::ERROR_NONE; + } else { + LOGINFO("Failed Setting the setFirmwareAutoReboot value %s\n", getRFCErrorString(status)); + return Core::ERROR_GENERAL; + } + } /* * If not stated otherwise in this file or this component's LICENSE file the * following copyright and licenses apply: diff --git a/FirmwareUpdate/FirmwareUpdateImplementation.h b/FirmwareUpdate/FirmwareUpdateImplementation.h index c754db09..6eedae79 100644 --- a/FirmwareUpdate/FirmwareUpdateImplementation.h +++ b/FirmwareUpdate/FirmwareUpdateImplementation.h @@ -105,6 +105,7 @@ namespace Plugin { Core::hresult Unregister(Exchange::IFirmwareUpdate::INotification *notification ) ; Core::hresult UpdateFirmware(const string& firmwareFilepath , const string& firmwareType , Result &result ) override ; Core::hresult GetUpdateState(GetUpdateStateResult& getUpdateStateResult ) override; + Core::hresult SetFirmwareAutoReboot(const bool enable, Exchange::IFirmwareUpdate::Result& result) override; void startProgressTimer() ; int flashImage(const char *server_url, const char *upgrade_file, const char *reboot_flag, const char *proto, int upgrade_type, const char *maint ,const char *initiated_type ,const char * codebig) ; void flashImageThread(std::string firmwareFilepath,std::string firmwareType) ; From 1c7cfc38f1ec05a1aa6f88f4035d87d85e4f4a9f Mon Sep 17 00:00:00 2001 From: smanes0213 Date: Tue, 16 Sep 2025 12:49:03 +0530 Subject: [PATCH 2/5] Update FirmwareUpdateImplementation.cpp --- .../FirmwareUpdateImplementation.cpp | 45 +++++++++---------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/FirmwareUpdate/FirmwareUpdateImplementation.cpp b/FirmwareUpdate/FirmwareUpdateImplementation.cpp index e12cfe35..5b1ef455 100644 --- a/FirmwareUpdate/FirmwareUpdateImplementation.cpp +++ b/FirmwareUpdate/FirmwareUpdateImplementation.cpp @@ -1,26 +1,3 @@ - - /* - * @brief This function Enable/Disable the AutoReboot Feature (COMRPC). - * This will internally set the tr181 AutoReboot.Enable to True/False. - * @param[in] enable: Boolean to enable or disable AutoReboot - * @param[out] result: Result struct with success status - * @return: Core:: - */ - Core::hresult FirmwareUpdateImplementation::SetFirmwareAutoReboot(const bool enable, Exchange::IFirmwareUpdate::Result& result) - { - result.success = false; - const char* set_rfc_val = enable ? "true" : "false"; - WDMP_STATUS status = setRFCParameter((char*)"thunderapi", - TR181_AUTOREBOOT_ENABLE, set_rfc_val, WDMP_BOOLEAN); - if (WDMP_SUCCESS == status) { - result.success = true; - LOGINFO("Success Setting the setFirmwareAutoReboot value\n"); - return Core::ERROR_NONE; - } else { - LOGINFO("Failed Setting the setFirmwareAutoReboot value %s\n", getRFCErrorString(status)); - return Core::ERROR_GENERAL; - } - } /* * If not stated otherwise in this file or this component's LICENSE file the * following copyright and licenses apply: @@ -858,6 +835,28 @@ namespace WPEFramework { return status; } + /* + * @brief This function Enable/Disable the AutoReboot Feature (COMRPC). + * This will internally set the tr181 AutoReboot.Enable to True/False. + * @param[in] enable: Boolean to enable or disable AutoReboot + * @param[out] result: Result struct with success status + * @return: Core:: + */ + Core::hresult FirmwareUpdateImplementation::SetFirmwareAutoReboot(const bool enable, Exchange::IFirmwareUpdate::Result& result) + { + Core::hresult status = Core::ERROR_GENERAL; + const char* set_rfc_val = enable ? "true" : "false"; + WDMP_STATUS status = setRFCParameter((char*)"thunderapi", + TR181_AUTOREBOOT_ENABLE, set_rfc_val, WDMP_BOOLEAN); + if (WDMP_SUCCESS == status) { + result.success = true; + LOGINFO("Success Setting the setFirmwareAutoReboot value\n"); + status = Core::ERROR_NONE; + } else { + LOGINFO("Failed Setting the setFirmwareAutoReboot value %s\n", getRFCErrorString(status)); + } + return status; + } } // namespace Plugin } // namespace WPEFramework From 81f7ef204bb3e2e691f30bd3fc56175c266cc6aa Mon Sep 17 00:00:00 2001 From: Sankalp Maneshwar Date: Tue, 16 Sep 2025 17:31:56 +0530 Subject: [PATCH 3/5] Update FirmwareUpdateImplementation.cpp --- FirmwareUpdate/FirmwareUpdateImplementation.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/FirmwareUpdate/FirmwareUpdateImplementation.cpp b/FirmwareUpdate/FirmwareUpdateImplementation.cpp index 5b1ef455..48af4976 100644 --- a/FirmwareUpdate/FirmwareUpdateImplementation.cpp +++ b/FirmwareUpdate/FirmwareUpdateImplementation.cpp @@ -846,9 +846,9 @@ namespace WPEFramework { { Core::hresult status = Core::ERROR_GENERAL; const char* set_rfc_val = enable ? "true" : "false"; - WDMP_STATUS status = setRFCParameter((char*)"thunderapi", + WDMP_STATUS ret = setRFCParameter((char*)"thunderapi", TR181_AUTOREBOOT_ENABLE, set_rfc_val, WDMP_BOOLEAN); - if (WDMP_SUCCESS == status) { + if (WDMP_SUCCESS == ret) { result.success = true; LOGINFO("Success Setting the setFirmwareAutoReboot value\n"); status = Core::ERROR_NONE; From aad136a79e958efd5dd0229b66c53217158bc976 Mon Sep 17 00:00:00 2001 From: smanes0213 Date: Tue, 16 Sep 2025 18:36:25 +0530 Subject: [PATCH 4/5] Add required changes --- FirmwareUpdate/FirmwareUpdateHelper.h | 1 + FirmwareUpdate/FirmwareUpdateImplementation.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/FirmwareUpdate/FirmwareUpdateHelper.h b/FirmwareUpdate/FirmwareUpdateHelper.h index 1858e758..da2da9ce 100644 --- a/FirmwareUpdate/FirmwareUpdateHelper.h +++ b/FirmwareUpdate/FirmwareUpdateHelper.h @@ -113,6 +113,7 @@ #define RFC_MNG_NOTIFY "Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.ManageableNotification.Enable" #define RFC_FW_REBOOT_NOTIFY "Device.DeviceInfo.X_RDKCENTRAL-COM_xOpsDeviceMgmt.RPC.RebootPendingNotification" +#define TR181_AUTOREBOOT_ENABLE "Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.AutoReboot.Enable" //Firmware state #define _VALIDATION_FAILED "VALIDATION_FAILED" diff --git a/FirmwareUpdate/FirmwareUpdateImplementation.cpp b/FirmwareUpdate/FirmwareUpdateImplementation.cpp index 48af4976..2a8ce30a 100644 --- a/FirmwareUpdate/FirmwareUpdateImplementation.cpp +++ b/FirmwareUpdate/FirmwareUpdateImplementation.cpp @@ -853,7 +853,7 @@ namespace WPEFramework { LOGINFO("Success Setting the setFirmwareAutoReboot value\n"); status = Core::ERROR_NONE; } else { - LOGINFO("Failed Setting the setFirmwareAutoReboot value %s\n", getRFCErrorString(status)); + LOGINFO("Failed Setting the setFirmwareAutoReboot value %s\n", getRFCErrorString(ret)); } return status; } From ca0cb1df1ab3ac30a174e6f862bfc01d451c3edd Mon Sep 17 00:00:00 2001 From: dkumar798_comcast Date: Thu, 25 Sep 2025 03:57:19 +0000 Subject: [PATCH 5/5] RDKEMW-8150: Move Firmware related APIs from System plugin to FirmwareUpdate Reason for change: Moved Firmware related APIs from System plugin to FirmwareUpdate Test Procedure: Test - SetAutoReboot API Risks: Low Priority: P2 Version: Minor Signed-off-by:Dineshkumar P [dinesh_kumar2@comcast.com] --- FirmwareUpdate/FirmwareUpdateImplementation.cpp | 6 +++--- FirmwareUpdate/FirmwareUpdateImplementation.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/FirmwareUpdate/FirmwareUpdateImplementation.cpp b/FirmwareUpdate/FirmwareUpdateImplementation.cpp index 05e02613..18585d19 100644 --- a/FirmwareUpdate/FirmwareUpdateImplementation.cpp +++ b/FirmwareUpdate/FirmwareUpdateImplementation.cpp @@ -843,7 +843,7 @@ namespace WPEFramework { * @param[out] result: Result struct with success status * @return: Core:: */ - Core::hresult FirmwareUpdateImplementation::SetFirmwareAutoReboot(const bool enable, Exchange::IFirmwareUpdate::Result& result) + Core::hresult FirmwareUpdateImplementation::SetAutoReboot(const bool enable, Result& result) { Core::hresult status = Core::ERROR_GENERAL; const char* set_rfc_val = enable ? "true" : "false"; @@ -851,10 +851,10 @@ namespace WPEFramework { TR181_AUTOREBOOT_ENABLE, set_rfc_val, WDMP_BOOLEAN); if (WDMP_SUCCESS == ret) { result.success = true; - LOGINFO("Success Setting the setFirmwareAutoReboot value\n"); + LOGINFO("Success Setting the SetAutoReboot value\n"); status = Core::ERROR_NONE; } else { - LOGINFO("Failed Setting the setFirmwareAutoReboot value %s\n", getRFCErrorString(ret)); + LOGINFO("Failed Setting the SetAutoReboot value %s\n", getRFCErrorString(ret)); } return status; } diff --git a/FirmwareUpdate/FirmwareUpdateImplementation.h b/FirmwareUpdate/FirmwareUpdateImplementation.h index 6eedae79..06dd1f61 100644 --- a/FirmwareUpdate/FirmwareUpdateImplementation.h +++ b/FirmwareUpdate/FirmwareUpdateImplementation.h @@ -105,7 +105,7 @@ namespace Plugin { Core::hresult Unregister(Exchange::IFirmwareUpdate::INotification *notification ) ; Core::hresult UpdateFirmware(const string& firmwareFilepath , const string& firmwareType , Result &result ) override ; Core::hresult GetUpdateState(GetUpdateStateResult& getUpdateStateResult ) override; - Core::hresult SetFirmwareAutoReboot(const bool enable, Exchange::IFirmwareUpdate::Result& result) override; + Core::hresult SetAutoReboot(const bool enable, Result& result) override; void startProgressTimer() ; int flashImage(const char *server_url, const char *upgrade_file, const char *reboot_flag, const char *proto, int upgrade_type, const char *maint ,const char *initiated_type ,const char * codebig) ; void flashImageThread(std::string firmwareFilepath,std::string firmwareType) ;