Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions FirmwareUpdate/FirmwareUpdateHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
22 changes: 22 additions & 0 deletions FirmwareUpdate/FirmwareUpdateImplementation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -836,6 +836,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::<StatusCode>
*/
Core::hresult FirmwareUpdateImplementation::SetAutoReboot(const bool enable, Result& result)
{
Core::hresult status = Core::ERROR_GENERAL;
const char* set_rfc_val = enable ? "true" : "false";
WDMP_STATUS ret = setRFCParameter((char*)"thunderapi",
TR181_AUTOREBOOT_ENABLE, set_rfc_val, WDMP_BOOLEAN);
if (WDMP_SUCCESS == ret) {
result.success = true;
LOGINFO("Success Setting the SetAutoReboot value\n");
status = Core::ERROR_NONE;
} else {
LOGINFO("Failed Setting the SetAutoReboot value %s\n", getRFCErrorString(ret));
}
return status;
}

} // namespace Plugin
} // namespace WPEFramework
Expand Down
1 change: 1 addition & 0 deletions FirmwareUpdate/FirmwareUpdateImplementation.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 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) ;
Expand Down
Loading