当TokenClient未就绪时,允许TinyServe动设备列表

This commit is contained in:
HuangKeng 2016-05-26 03:01:39 +00:00
parent f980db9268
commit 6f6106eba3
1 changed files with 6 additions and 4 deletions

View File

@ -507,8 +507,10 @@ void DevicesManagement::DeviceRequest(DeviceAtions act, const Device* dv)
{ {
TS("DevicesManagement::DeviceRequest"); TS("DevicesManagement::DeviceRequest");
if (Port)return; bool PortOk = true;
if (Port->Status < 2) return; if (Port == nullptr)PortOk = false;
if (Port->Status < 2) PortOk = false;
if(Port == false)debug_printf("Port Not Realy\r\n");
byte id = dv->Address; byte id = dv->Address;
switch (act) switch (act)
@ -526,12 +528,12 @@ void DevicesManagement::DeviceRequest(DeviceAtions act, const Device* dv)
case DeviceAtions::Register: case DeviceAtions::Register:
PushDev((Device*)dv); PushDev((Device*)dv);
debug_printf("节点注册入网 ID=0x%02X\r\n", id); debug_printf("节点注册入网 ID=0x%02X\r\n", id);
SendDevices(act, dv); if(PortOk)SendDevices(act, dv);
return; return;
case DeviceAtions::Delete: case DeviceAtions::Delete:
debug_printf("节点删除~~ ID=0x%02X\r\n", id); debug_printf("节点删除~~ ID=0x%02X\r\n", id);
DeleteDev(id); DeleteDev(id);
//SendDevices(act, dv); //if(PortOk)SendDevices(act, dv);
break; break;
default: default:
debug_printf("无法识别的节点操作 Act=%d ID=0x%02X\r\n", (byte)act, id); debug_printf("无法识别的节点操作 Act=%d ID=0x%02X\r\n", (byte)act, id);