配置区写完后要重启

This commit is contained in:
cdyong 2016-01-02 07:52:21 +00:00
parent 199c45fa3a
commit 0744ccfbe5
1 changed files with 7 additions and 2 deletions

View File

@ -61,7 +61,7 @@ void TinyClient::Open()
HardCrc = Crc::Hash16(Array(Sys.ID, 16));
if(Sys.Version > 1) Encryption = true;
Control->Mode = 0; // 客户端只接收自己的消息
Control->Open();
@ -201,6 +201,11 @@ void TinyClient::OnWrite(const TinyMessage& msg)
dm.Offset -= 64;
Array bs(Cfg, Cfg->Length);
rt = dm.WriteData(bs, true);
Cfg->Save();
debug_printf("\r\n 配置区被修改200ms后重启\r\n");
Sys.Sleep(200);
Sys.Reset();
}
rs.Error = !rt;
@ -441,7 +446,7 @@ void TinyClient::Ping()
TS("TinyClient::Ping");
ushort off = Cfg->OfflineTime;
if(off < 10) off = 10;
if(off < 10) off = 30;
if(LastActive > 0 && LastActive + off * 1000 < Sys.Ms())
{
if(Server == 0) return;