diff --git a/source/core/wifi_ctrl.c b/source/core/wifi_ctrl.c index d14f745c8..4bb60199e 100644 --- a/source/core/wifi_ctrl.c +++ b/source/core/wifi_ctrl.c @@ -199,10 +199,13 @@ unsigned int selfheal_event_publish_time(void) return atoi(buff) ? atoi(buff) : 1; } -int reboot_device(wifi_ctrl_t *ctrl) +int reboot_device(void* arg) { + wifi_ctrl_t *ctrl = (wifi_ctrl_t *)arg; bus_error_t rc; + wifi_util_dbg_print(WIFI_WEBCONFIG, + "%s : Setting the reboot reason as ECO Mode Reboot and rebooting the device\n", __FUNCTION__); rc = get_bus_descriptor()->bus_set_string_fn(&ctrl->handle, "Device.DeviceInfo.X_RDKCENTRAL-COM_LastRebootReason", "ECO Mode Reboot"); if (rc != bus_error_success) { diff --git a/source/core/wifi_ctrl.h b/source/core/wifi_ctrl.h index ebad8320f..11e0c9adc 100644 --- a/source/core/wifi_ctrl.h +++ b/source/core/wifi_ctrl.h @@ -431,6 +431,7 @@ int publish_endpoint_enable(void); int get_mld_mac_from_link_mac(mac_address_t in_addr, mac_address_t mld_addr); void hotspot_timing_start(void); void hotspot_timing_stop(void); +int reboot_device(void* arg); #if defined(CONFIG_IEEE80211BE) && !defined(CONFIG_GENERIC_MLO) unsigned int update_mld_groups(webconfig_subdoc_decoded_data_t *data, char **vap_names, unsigned int vap_names_size, wifi_dbg_type_t log_type); diff --git a/source/core/wifi_ctrl_webconfig.c b/source/core/wifi_ctrl_webconfig.c index 826eaa232..bf294c729 100644 --- a/source/core/wifi_ctrl_webconfig.c +++ b/source/core/wifi_ctrl_webconfig.c @@ -2208,7 +2208,7 @@ void ecomode_telemetry_update_and_reboot(unsigned int index, bool active) } system("systemctl restart onewifi.service"); #else - reboot_device(ctrl); + scheduler_add_timer_task(ctrl->sched, TRUE, NULL, reboot_device, ctrl, 0, 1, TRUE); #endif } #endif // defined (FEATURE_SUPPORT_ECOPOWERDOWN)