framework/src/st_things/things_stack/utils/things_network.c
//--------------------------------------------------------------------------------
/**
 * Function definition for handle stop soft ap.
 */
Function definition for handle stop soft ap.
Function definition for handle stop soft ap .
bool things_handle_stop_soft_ap(wifi_manager_ap_config_s *connect_config)
{
	wifi_manager_result_e result = WIFI_MANAGER_SUCCESS;
	wifi_manager_info_s info;
	wifi_manager_get_info(&info);
	if (info.mode == SOFTAP_MODE) {
		if (wifi_manager_set_mode(STA_MODE, NULL) != WIFI_MANAGER_SUCCESS) {
			THINGS_LOG_E(TAG, "Failed to change to STA mode)");
			return false;
		}
		usleep(100000);
	}
	g_retry_connect_cnt = 0;
	result = wifi_manager_connect_ap(connect_config);
	if (result != WIFI_MANAGER_SUCCESS) {
		THINGS_LOG_E(TAG, "Failed to connect WiFi");
		return false;
	}
	return true;
}
bool things_handle_stop_soft_ap ( wifi_manager_ap_config_s * connect_config ) { wifi_manager_result_e result = WIFI_MANAGER_SUCCESS ; wifi_manager_info_s info ; wifi_manager_get_info ( & info ) ; if ( info . mode == SOFTAP_MODE ) { if ( wifi_manager_set_mode ( STA_MODE , NULL ) != WIFI_MANAGER_SUCCESS ) { THINGS_LOG_E ( TAG , " " ) ; return false ; } usleep ( 100000 ) ; } g_retry_connect_cnt = 0 ; result = wifi_manager_connect_ap ( connect_config ) ; if ( result != WIFI_MANAGER_SUCCESS ) { THINGS_LOG_E ( TAG , " " ) ; return false ; } return true ; }
Function definition for handle stop soft ap.
Function definition for handle stop soft ap .
// Initialize the WiFi manager result with success. // Keep Wi-Fi Manager information. // Get the Wi-Fi Manager information(ip4 address,mac address,rssi,mode). // Set wifi manager state mode in station mode. // Set the WiFi connect retry count to 0. // Connect to Access point.