int _net_dbus_get_vsie(unsigned int frame_id, char **vsie_str);
int _net_dbus_remove_vsie(unsigned int frame_id, const char *vsie_str);
int _net_dbus_get_vsie_list(GSList **vsie_list);
+int _net_dbus_flush_bss(void);
+
#ifdef __cplusplus
}
int net_wifi_get_vsie(unsigned int frame_id, char **vsie_str);
int net_wifi_remove_vsie(unsigned int frame_id, const char *vsie_str);
int net_wifi_get_vsie_list(GSList **vsie_list);
+int net_wifi_flush_bss(void);
int net_wifi_cancel_wps(void);
int _wifi_remove_vsie(wifi_manager_h wifi,
wifi_manager_vsie_frames_e frame_id, const char *vsie_str);
int _wifi_get_vsie_list(wifi_manager_vsie_list_cb callback, void *user_data);
+int _wifi_flush_bss(void);
/* WIFI Privilege Check */
int _wifi_check_get_privilege();
wifi_manager_vsie_list_cb callback, void *user_data);
/**
+ * @brief Flush BSS
+ * @since_tizen 4.0
+ * @return 0 on success, otherwise negative error value.
+ * @retval #WIFI_ERROR_NONE Successful
+ * @retval #WIFI_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WIFI_ERROR_INVALID_OPERATION Invalid operation
+ */
+int wifi_manager_flush_bss(wifi_manager_h wifi);
+
+/**
* @}
*/
GVariant *message = NULL;
GVariant *params;
- char path[CONNMAN_MAX_BUFLEN] = NETCONFIG_WIFI_PATH;
-
params = g_variant_new("(u)", mode);
- message = _net_invoke_dbus_method(NETCONFIG_SERVICE, path,
+ message = _net_invoke_dbus_method(NETCONFIG_SERVICE, NETCONFIG_WIFI_PATH,
NETCONFIG_WIFI_INTERFACE, "SetBgscan", params, &Error);
if (Error != NET_ERR_NONE)
return Error;
}
+int _net_dbus_flush_bss(void)
+{
+ __NETWORK_FUNC_ENTER__;
+
+ net_err_e Error = NET_ERR_NONE;
+ GVariant *message = NULL;
+
+ message = _net_invoke_dbus_method(NETCONFIG_SERVICE, NETCONFIG_WIFI_PATH,
+ NETCONFIG_WIFI_INTERFACE, "FlushBss", NULL, &Error);
+
+ if (message == NULL) {
+ WIFI_LOG(WIFI_ERROR, "Failed to flush bss");
+ __NETWORK_FUNC_EXIT__;
+ return Error;
+ }
+
+ g_variant_unref(message);
+ WIFI_LOG(WIFI_INFO, "Successfully flush bss\n");
+
+ return Error;
+}
+
static void __net_wps_cancel_reply(GObject *source_object,
GAsyncResult *res, gpointer user_data)
{
net_err_e Error = NET_ERR_NONE;
GVariant *message = NULL;
- char path[CONNMAN_MAX_BUFLEN] = NETCONFIG_WIFI_PATH;
-
- message = _net_invoke_dbus_method(NETCONFIG_SERVICE, path,
+ message = _net_invoke_dbus_method(NETCONFIG_SERVICE, NETCONFIG_WIFI_PATH,
NETCONFIG_WIFI_INTERFACE, "ResumeBgscan", NULL, &Error);
if (Error != NET_ERR_NONE)
net_err_e Error = NET_ERR_NONE;
GVariant *message = NULL;
- char path[CONNMAN_MAX_BUFLEN] = NETCONFIG_WIFI_PATH;
-
- message = _net_invoke_dbus_method(NETCONFIG_SERVICE, path,
+ message = _net_invoke_dbus_method(NETCONFIG_SERVICE, NETCONFIG_WIFI_PATH,
NETCONFIG_WIFI_INTERFACE, "PauseBgscan", NULL, &Error);
if (Error != NET_ERR_NONE)
}
//LCOV_EXCL_STOP
+EXPORT_API int net_wifi_flush_bss(void)
+{
+ __NETWORK_FUNC_ENTER__;
+
+ net_err_e Error = NET_ERR_NONE;
+
+ if (NetworkInfo.ref_count < 1) {
+ WIFI_LOG(WIFI_ERROR, "Application is not registered");
+ __NETWORK_FUNC_EXIT__;
+ return NET_ERR_APP_NOT_REGISTERED;
+ }
+
+ Error = _net_dbus_flush_bss();
+ if (Error != NET_ERR_NONE) {
+ WIFI_LOG(WIFI_ERROR, "Failed to flush bss. Error [%s]\n",
+ _net_print_error(Error));
+ __NETWORK_FUNC_EXIT__;
+ return Error;
+ }
+
+ __NETWORK_FUNC_EXIT__;
+ return NET_ERR_NONE;
+}
+
int net_open_connection_with_wifi_info(const net_wifi_connection_info_s *wifi_info)
{
__NETWORK_FUNC_ENTER__;
}
//LCOV_EXCL_STOP
+int _wifi_flush_bss(void)
+{
+ int rv;
+
+ rv = net_wifi_flush_bss();
+
+ if (rv != NET_ERR_NONE) {
+ WIFI_LOG(WIFI_ERROR, "Failed to flush bss");
+ return WIFI_MANAGER_ERROR_OPERATION_FAILED;
+ }
+
+ return WIFI_MANAGER_ERROR_NONE;
+}
+
int _wifi_get_connected_profile(wifi_manager_ap_h *ap)
{
int rv;
return _wifi_get_vsie_list(callback, user_data);
}
+
+EXPORT_API int wifi_manager_flush_bss(wifi_manager_h wifi)
+{
+ CHECK_FEATURE_SUPPORTED(WIFI_FEATURE);
+ WIFI_LOG(WIFI_INFO, "[App-->TizenMW] bss flush request");
+
+ int rv;
+
+ if (!(__wifi_check_handle_validity(wifi))) {
+ WIFI_LOG(WIFI_ERROR, "Invalid parameter"); //LCOV_EXCL_LINE
+ return WIFI_MANAGER_ERROR_INVALID_PARAMETER; //LCOV_EXCL_LINE
+ }
+
+ rv = _wifi_flush_bss();
+
+ if (rv != WIFI_MANAGER_ERROR_NONE)
+ WIFI_LOG(WIFI_ERROR, "[App<--TizenMW] Error!! bss flush Request failed. rv[%d]\n", rv);
+
+ return rv;
+
+}
//LCOV_EXCL_STOP
EXPORT_API int wifi_manager_specific_scan_create(wifi_manager_h wifi,
return 1;
}
+int test_wifi_manager_flush_bss(void)
+{
+ int rv;
+
+ rv = wifi_manager_flush_bss(wifi);
+
+ if (rv != WIFI_MANAGER_ERROR_NONE) {
+ printf("Fail to flush bss rv = %d\n", rv);
+ return -1;
+ }
+
+ printf("Request to flush bss\n");
+ return 1;
+}
+
int main(int argc, char **argv)
{
GMainLoop *mainloop;
printf("G - Get VSIE\n");
printf("H - Remove VSIE\n");
printf("I - Start Multi Scan\n");
+ printf("J - Flush BSS\n");
printf(LOG_RED "0 - Exit \n" LOG_END);
printf("ENTER - Show options menu.......\n");
case 'I':
rv = test_wifi_manager_specific_ap_start_multi_scan();
break;
+ case 'J':
+ rv = test_wifi_manager_flush_bss();
+ break;
default:
break;
}