libraries/ESP8266WiFiMesh/src/ESP8266WiFiMesh.cpp
void ESP8266WiFiMesh::connectToNode(String target_ssid, String message)
{
	WiFiClient curr_client;
	WiFi.begin( target_ssid.c_str() );

	int wait = 1500;
	while((WiFi.status() == WL_DISCONNECTED) && wait--)
		delay(3);

	/* If the connection timed out */
	if (WiFi.status() != 3)
		return;

	/* Connect to the node's server */
	if (!curr_client.connect(SERVER_IP_ADDR, SERVER_PORT)) 
		return;

	if (!exchangeInfo(message, curr_client))
		return;

	curr_client.stop();
	WiFi.disconnect();
}
/**
 * Connect to the AP at ssid, send them a message then disconnect.
 *
 * @target_ssid The name of the AP the other node has set up.
 * @message The string to send to the node.
 * 
 */
Connect to the AP at ssid, send them a message then disconnect.
@target_ssid The name of the AP the other node has set up.
@message The string to send to the node.
Connect to the AP at ssid send them a message then disconnect . @target_ssid The name of the AP the other node has set up . @message The string to send to the node .
void ESP8266WiFiMesh::connectToNode(String target_ssid, String message)
{
	WiFiClient curr_client;
	WiFi.begin( target_ssid.c_str() );
	int wait = 1500;
	while((WiFi.status() == WL_DISCONNECTED) && wait--)
		delay(3);
	if (WiFi.status() != 3)
		return;
	if (!curr_client.connect(SERVER_IP_ADDR, SERVER_PORT)) 
		return;
	if (!exchangeInfo(message, curr_client))
		return;
	curr_client.stop();
	WiFi.disconnect();
}
void ESP8266WiFiMesh :: connectToNode ( String target_ssid , String message ) { WiFiClient curr_client ; WiFi . begin ( target_ssid . c_str ( ) ) ; int wait = 1500 ; while ( ( WiFi . status ( ) == WL_DISCONNECTED ) && wait -- ) delay ( 3 ) ; if ( WiFi . status ( ) != 3 ) return ; if ( ! curr_client . connect ( SERVER_IP_ADDR , SERVER_PORT ) ) return ; if ( ! exchangeInfo ( message , curr_client ) ) return ; curr_client . stop ( ) ; WiFi . disconnect ( ) ; }
Connect to the AP at ssid, send them a message then disconnect.
Connect to the AP at ssid send them a message then disconnect .
/* If the connection timed out */ /* Connect to the node's server */