如果已连接,不需要再次重启

This commit is contained in:
大石头 2017-03-22 17:50:44 +08:00
parent 3e20321e7b
commit 5f47a501da
3 changed files with 7 additions and 1 deletions

View File

@ -163,6 +163,9 @@ bool Esp8266::CheckReady()
_Reset = true;
}
// 如果已连接,不需要再次重启
if (Test(1, 500)) return true;
// 每两次启动会有一次打开失败,交替
if (!_Reset.Empty())
Reset(false); // 硬重启
@ -215,6 +218,9 @@ void Esp8266::OpenAP()
void Esp8266::OnClose()
{
// 断电
_Power = false;
if (_task) Sys.RemoveTask(_task);
At.Close();
@ -416,7 +422,7 @@ bool Esp8266::Test(int times, int interval)
String cmd = "AT";
for (int i = 0; i < times; i++)
{
if (i > 0) Reset(false);
//if (i > 0) Reset(false);
if (At.SendCmd(cmd, interval)) return true;
}

Binary file not shown.

Binary file not shown.