{
PRINT_RETURN("wifi_manager_deactivate_callback", result);
- int ret = WIFI_MANAGER_ERROR_NONE;
- int data = (int)user_data;
g_nCallbackRet = result;
-
- switch (data) {
- case 1:
- ret = wifi_manager_activate(g_hWifi, wifi_manager_activated_callback, NULL);
- PRINT_RETURN("wifi_manager_activate", ret);
- break;
- case 2:
- ret = wifi_manager_activate_with_wifi_picker_tested(g_hWifi, wifi_manager_activated_with_picker_callback, NULL);
- PRINT_RETURN("wifi_manager_activate_with_wifi_picker_tested", ret);
- break;
- default :
- /* FPRINTF("[%s:%d] user_data is Unknown\\n", __FILE__, __LINE__); */
- QUIT_GMAIN_LOOP;
- break;
- }
+ QUIT_GMAIN_LOOP;
}
void wifi_manager_activated_with_picker_callback(wifi_manager_error_e result, void* user_data)
CHECK_RETURN("wifi_manager_is_activated", ret, WIFI_MANAGER_ERROR_NONE);
if (activated) {
- ret = wifi_manager_deactivate(g_hWifi, wifi_manager_deactivated_callback, (void *)1);
+ ret = wifi_manager_deactivate(g_hWifi, wifi_manager_deactivated_callback, NULL);
PRINT_RETURN("wifi_manager_deactivate", ret);
RUN_GMAIN_LOOP;
- } else {
+ }
+
+ ret = wifi_manager_activate(g_hWifi, wifi_manager_activated_callback, NULL);
+ PRINT_RETURN("wifi_manager_activate", ret);
+
+ RUN_GMAIN_LOOP;
+
+ while (retry_count < WIFI_ACTIVATION_RETRY &&
+ g_nCallbackRet != WIFI_MANAGER_ERROR_NONE) {
+ sleep(5);
ret = wifi_manager_activate(g_hWifi, wifi_manager_activated_callback, NULL);
PRINT_RETURN("wifi_manager_activate", ret);
+ retry_count++;
RUN_GMAIN_LOOP;
-
- while (retry_count < WIFI_ACTIVATION_RETRY &&
- g_nCallbackRet != WIFI_MANAGER_ERROR_NONE) {
- sleep(5);
- ret = wifi_manager_activate(g_hWifi, wifi_manager_activated_callback, NULL);
- PRINT_RETURN("wifi_manager_activate", ret);
- retry_count++;
-
- RUN_GMAIN_LOOP;
- }
}
CHECK_RETURN(CALLBACK_RETURN, g_nCallbackRet, WIFI_MANAGER_ERROR_NONE);
CHECK_RETURN("wifi_manager_is_activated", ret, WIFI_MANAGER_ERROR_NONE);
if (activated) {
- ret = wifi_manager_deactivate(g_hWifi, wifi_manager_deactivated_callback, (void *)2);
+ ret = wifi_manager_deactivate(g_hWifi, wifi_manager_deactivated_callback, NULL);
PRINT_RETURN("wifi_manager_deactivate", ret);
RUN_GMAIN_LOOP;
- } else {
+ }
+
+ ret = wifi_manager_activate_with_wifi_picker_tested(g_hWifi, wifi_manager_activated_with_picker_callback, NULL);
+ PRINT_RETURN("wifi_manager_activate_with_wifi_picker_tested", ret);
+
+ while (retry_count < WIFI_ACTIVATION_RETRY &&
+ g_nCallbackRet != WIFI_MANAGER_ERROR_NONE) {
+ sleep(5);
ret = wifi_manager_activate_with_wifi_picker_tested(g_hWifi, wifi_manager_activated_with_picker_callback, NULL);
PRINT_RETURN("wifi_manager_activate_with_wifi_picker_tested", ret);
+ retry_count++;
- while (retry_count < WIFI_ACTIVATION_RETRY &&
- g_nCallbackRet != WIFI_MANAGER_ERROR_NONE) {
- sleep(5);
- ret = wifi_manager_activate_with_wifi_picker_tested(g_hWifi, wifi_manager_activated_with_picker_callback, NULL);
- PRINT_RETURN("wifi_manager_activate_with_wifi_picker_tested", ret);
- retry_count++;
-
- RUN_GMAIN_LOOP;
- }
+ RUN_GMAIN_LOOP;
}
CHECK_RETURN(CALLBACK_RETURN, g_nCallbackRet, WIFI_MANAGER_ERROR_NONE);