使用默认SSID时候连接失败不算打开失败 即算他打开成功

测试  JionAP后打开wslink热点    并不会去连接热点    修改失败
This commit is contained in:
WangQiang 2016-08-01 01:22:23 +00:00
parent 3fdab25c7e
commit 209569edaa
1 changed files with 3 additions and 1 deletions

View File

@ -199,6 +199,7 @@ bool Esp8266::OnOpen()
SetDHCP(mode, true);
bool join = SSID && *SSID;
bool defSSID = *SSID == "Wslink";
// 等待WiFi自动连接
if(!AutoConn || !WaitForCmd("WIFI CONNECTED", 3000))
{
@ -208,7 +209,7 @@ bool Esp8266::OnOpen()
{
net_printf("启动AP!\r\n");
String name;
if(!join || *SSID == "Wslink")
if(!join || defSSID/**SSID == "Wslink"*/)
name = name + "WsLink-" + Buffer(Sys.ID, 3).ToHex();
else
// 这里需要等系统配置完成,修改为设备编码
@ -232,6 +233,7 @@ bool Esp8266::OnOpen()
if (i == 2)
{
net_printf("连接WiFi失败\r\n");
if (defSSID)return true;
return false;
}
}