int frequency);
/**
+ * @brief Reset all WiFi configurations
+ * @since_tizen 7.5
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/network.profile
+ * @param[in] wifi The Wi-Fi handle
+ *
+ * @return 0 on success, otherwise negative error value.
+ * @retval #WIFI_MANAGER_ERROR_NONE Successful
+ * @retval #WIFI_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WIFI_MANAGER_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #WIFI_MANAGER_ERROR_NOT_SUPPORTED Not supported
+ */
+int wifi_manager_config_reset_configurations(wifi_manager_h wifi);
+
+/**
* @brief Enables or disables auto-scanning
* @details If auto-scanning is disabled, then background scan and wps scan don't work.
* By default, the auto-scanning is enabled automatically until disabling auto-scanning.
Name: capi-network-wifi-manager
Summary: Network Wi-Fi library in TIZEN C API
-Version: 1.3.21
+Version: 1.3.22
Release: 0
Group: System/Network
License: Apache-2.0
return Error;
}
#endif /* TIZEN_DA */
+
+int _net_dbus_reset_wifi_config(network_info_s *network_info)
+{
+ __NETWORK_FUNC_ENTER__;
+
+ net_err_e Error = NET_ERR_NONE;
+ GVariant *message = NULL;
+
+ message = _net_invoke_dbus_method(network_info, NETCONFIG_SERVICE, NETCONFIG_WIFI_PATH,
+ NETCONFIG_WIFI_INTERFACE, "ResetWifiConfig", NULL, &Error);
+
+ if (message == NULL) {
+ WIFI_LOG(WIFI_ERROR, "Failed to reset wifi config");
+ __NETWORK_FUNC_EXIT__;
+ return Error;
+ }
+
+ g_variant_unref(message);
+ WIFI_LOG(WIFI_INFO, "Successfully reset wifi config");
+
+ __NETWORK_FUNC_EXIT__;
+ return Error;
+}
//LCOV_EXCL_STOP
int _net_dbus_get_power_save_mode(network_info_s *network_info, unsigned int *ps_mode);
int _net_dbus_set_power_save_mode(network_info_s *network_info, net_wifi_power_save_mode_e ps_mode);
#endif /* TIZEN_DA */
+int _net_dbus_reset_wifi_config(network_info_s *network_info);
#ifdef __cplusplus
}
return Error;
}
#endif /* TIZEN_DA */
+
+int net_wifi_reset_wifi_config(network_info_s *network_info)
+{
+ __NETWORK_CAPI_FUNC_ENTER__;
+
+ net_err_e Error = NET_ERR_NONE;
+
+ Error = _net_dbus_reset_wifi_config(network_info);
+ if (Error != NET_ERR_NONE) {
+ WIFI_LOG(WIFI_ERROR, "Failed to reset wifi config. Error [%s]",
+ _net_print_error(Error));
+ __NETWORK_CAPI_FUNC_EXIT__;
+ return Error;
+ }
+
+ __NETWORK_CAPI_FUNC_EXIT__;
+ return NET_ERR_NONE;
+}
//LCOV_EXCL_STOP
int net_wifi_get_power_save_mode(network_info_s *network_info, unsigned int *ps_mode);
int net_wifi_set_power_save_mode(network_info_s *network_info, net_wifi_power_save_mode_e ps_mode);
#endif /* TIZEN_DA */
+int net_wifi_reset_wifi_config(network_info_s *network_info);
/**
* \}
__NETWORK_CAPI_FUNC_EXIT__;
return WIFI_MANAGER_ERROR_NONE;
}
+
+EXPORT_API int wifi_manager_config_reset_configurations(wifi_manager_h wifi)
+{
+ __NETWORK_CAPI_FUNC_ENTER__;
+
+ int rv;
+
+ CHECK_FEATURE_SUPPORTED(WIFI_FEATURE);
+
+ RET_ERR_IF_HANDLE_IS_NOT_VALID_OR_NOT_INITIALIZED(wifi, __NETWORK_CAPI_FUNC_EXIT__);
+
+ rv = _wifi_reset_wifi_config(wifi);
+ if (rv != WIFI_MANAGER_ERROR_NONE)
+ WIFI_LOG(WIFI_ERROR, "Filed to reset wifi configurations. rv[%d]\n", rv);
+
+ __NETWORK_CAPI_FUNC_EXIT__;
+ return rv;
+
+}
//LCOV_EXCL_STOP
EXPORT_API int wifi_manager_config_get_eap_anonymous_identity(wifi_manager_config_h config,
return WIFI_MANAGER_ERROR_NONE;
}
#endif /* TIZEN_DA */
+
+int _wifi_reset_wifi_config(wifi_manager_h wifi)
+{
+ net_tech_info_s tech_info;
+ int rv = NET_ERR_NONE;
+ wifi_manager_handle_s *wifi_handle = wifi;
+
+ rv = net_get_technology_properties(wifi_handle->network_info, &tech_info);
+ if (rv == NET_ERR_ACCESS_DENIED) {
+ WIFI_LOG(WIFI_ERROR, "Access denied"); //LCOV_EXCL_LINE
+ return WIFI_MANAGER_ERROR_PERMISSION_DENIED; //LCOV_EXCL_LINE
+ } else if (rv != NET_ERR_NONE) {
+ WIFI_LOG(WIFI_ERROR, "Failed to get technology properties"); //LCOV_EXCL_LINE
+ return WIFI_MANAGER_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE
+ }
+
+ if (!tech_info.powered)
+ rv = net_wifi_reset_wifi_config(wifi_handle->network_info);
+ else
+ rv = WIFI_MANAGER_ERROR_OPERATION_FAILED;
+
+ if (rv != NET_ERR_NONE) {
+ WIFI_LOG(WIFI_ERROR, "Failed to reset wifi config");
+ return WIFI_MANAGER_ERROR_OPERATION_FAILED;
+ }
+
+ return WIFI_MANAGER_ERROR_NONE;
+}
//LCOV_EXCL_STOP
int _wifi_get_power_save_mode(wifi_manager_h wifi, wifi_manager_power_save_mode_e *ps_mode);
int _wifi_set_power_save_mode(wifi_manager_h wifi, wifi_manager_power_save_mode_e ps_mode);
#endif /* TIZEN_DA */
+int _wifi_reset_wifi_config(wifi_manager_h wifi);
#ifdef __cplusplus
}
return 1;
}
+int wman_test_reset_wifi_configurations(wifi_manager_h wifi)
+{
+ int rv;
+
+ rv = wifi_manager_config_reset_configurations(wifi);
+
+ if (rv != WIFI_MANAGER_ERROR_NONE) {
+ printf("Fail to reset Wi-Fi configurations rv = %d\n", rv);
+ return -1;
+ }
+
+ printf("Request to reset Wi-Fi configurations\n");
+ return 1;
+}
+
int wman_test_set_ip_conflict_period(wifi_manager_h wifi)
{
int rv = 0;
int wman_test_get_auto_connect(wifi_manager_h wifi);
int wman_test_set_ap_auto_connect(wifi_manager_h wifi);
int wman_test_get_ap_auto_connect(wifi_manager_h wifi);
+int wman_test_reset_wifi_configurations(wifi_manager_h wifi);
int wman_test_set_ip_conflict_period(wifi_manager_h wifi);
int wman_test_get_ip_conflict_period(wifi_manager_h wifi);
int wman_test_netlink_scan(wifi_manager_h wifi);
#endif /* TIZEN_DA */
printf("[ - Get Interval of Auto Scan\n");
printf("] - Set Interval of Auto Scan\n");
+ printf("; - Remove All Wi-Fi configurations\n");
printf(LOG_RED "0 - Exit \n" LOG_END);
printf("ENTER - Show options menu.......\n");
case ']':
rv = wman_test_set_autoscan_interval(wifi);
break;
+ case ';':
+ rv = wman_test_reset_wifi_configurations(wifi);
+ break;
default:
break;
}