返回消息带设备ID

This commit is contained in:
cdyong 2015-09-08 01:02:31 +00:00
parent f34ce2e35d
commit cca509b2d4
1 changed files with 11 additions and 10 deletions

View File

@ -103,16 +103,7 @@ bool TinyServer::OnReceive(TinyMessage& msg)
// 分发外网过来的消息。返回值表示是否有响应
bool TinyServer::Dispatch(TinyMessage& msg)
{
// 非休眠设备直接发送
//if(!dv->CanSleep())
//{
Send(msg);
//}
// 休眠设备进入发送队列
//else
//{
//}
// 先找到设备
Device* dv = FindDevice(msg.Dest);
if(!dv) return false;
@ -131,6 +122,16 @@ bool TinyServer::Dispatch(TinyMessage& msg)
rs = OnWrite(msg, *dv);
break;
}
// 非休眠设备直接发送
//if(!dv->CanSleep())
//{
Send(msg);
//}
// 休眠设备进入发送队列
//else
//{
//}
return rs;
}