设备退网,删除后 再传送退网消息个哦gawayserver 会导致逻辑错误。。
This commit is contained in:
parent
7626f74d1c
commit
acad019d26
|
@ -103,7 +103,8 @@ bool TinyServer::OnReceive(TinyMessage& msg)
|
|||
dv = Current;
|
||||
break;
|
||||
case 2:
|
||||
OnDisjoin(msg);
|
||||
if(OnDisjoin(msg))
|
||||
if(Received) return Received(this, msg, Param);
|
||||
break;
|
||||
case 3:
|
||||
// 设置当前设备
|
||||
|
@ -346,13 +347,19 @@ bool TinyServer::OnDisjoin(const TinyMessage& msg)
|
|||
ushort crc1 = ms.ReadUInt16();
|
||||
ushort crc2 = Crc::Hash16(dv->GetHardID());
|
||||
if(crc1 == crc2)
|
||||
DeleteDevice(dv->Address);
|
||||
{
|
||||
//DeleteDevice(dv->Address);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
debug_printf("0x%02X 非法退网,请求的硬件校验 0x%04X 不等于本地硬件校验 0x%04X", dv->Address, crc1, crc2);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool TinyServer::Disjoin(TinyMessage& msg, ushort crc) const
|
||||
|
|
Loading…
Reference in New Issue