From 6f6106eba30b2ecbd3f212882ef2fd6be14a5718 Mon Sep 17 00:00:00 2001 From: HuangKeng Date: Thu, 26 May 2016 03:01:39 +0000 Subject: [PATCH] =?UTF-8?q?=E5=BD=93TokenClient=E6=9C=AA=E5=B0=B1=E7=BB=AA?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E5=85=81=E8=AE=B8TinyServe=E5=8A=A8=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TinyNet/DevicesManagement.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/TinyNet/DevicesManagement.cpp b/TinyNet/DevicesManagement.cpp index 31ec4d01..6da7c771 100644 --- a/TinyNet/DevicesManagement.cpp +++ b/TinyNet/DevicesManagement.cpp @@ -507,8 +507,10 @@ void DevicesManagement::DeviceRequest(DeviceAtions act, const Device* dv) { TS("DevicesManagement::DeviceRequest"); - if (Port)return; - if (Port->Status < 2) return; + bool PortOk = true; + 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; switch (act) @@ -526,12 +528,12 @@ void DevicesManagement::DeviceRequest(DeviceAtions act, const Device* dv) case DeviceAtions::Register: PushDev((Device*)dv); debug_printf("节点注册入网 ID=0x%02X\r\n", id); - SendDevices(act, dv); + if(PortOk)SendDevices(act, dv); return; case DeviceAtions::Delete: debug_printf("节点删除~~ ID=0x%02X\r\n", id); DeleteDev(id); - //SendDevices(act, dv); + //if(PortOk)SendDevices(act, dv); break; default: debug_printf("无法识别的节点操作 Act=%d ID=0x%02X\r\n", (byte)act, id);