必须最少引用头文件
This commit is contained in:
parent
8f0f21b30f
commit
f11a652f3f
|
@ -11,6 +11,8 @@
|
|||
|
||||
#include "TokenNet\TokenController.h"
|
||||
|
||||
#include "Device\RTC.h"
|
||||
|
||||
AP0801* AP0801::Current = nullptr;
|
||||
|
||||
AP0801::AP0801()
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
#include "TokenNet\TokenClient.h"
|
||||
#include "Message\ProxyFactory.h"
|
||||
#include "App\Alarm.h"
|
||||
#include "Device\RTC.h"
|
||||
|
||||
// 阿波罗0801/0802
|
||||
class AP0801
|
||||
|
|
|
@ -32,6 +32,7 @@ bool ProxyFactory::Open(TokenClient* client)
|
|||
Client->Register("Proxy/Read", &ProxyFactory::Read, this);
|
||||
Client->Register("Proxy/QueryPorts",&ProxyFactory::QueryPorts, this);
|
||||
debug_printf("\r\n");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -244,23 +245,27 @@ bool ProxyFactory::QueryPorts(const Pair& args, Stream& result)
|
|||
bool ProxyFactory::Upload(Proxy& port, Buffer& data)
|
||||
{
|
||||
if (!Client)return false;
|
||||
|
||||
MemoryStream ms;
|
||||
BinaryPair bp(ms);
|
||||
bp.Set("Port", port.Name);
|
||||
bp.Set("Data", data);
|
||||
Client->Invoke("Proxy/Upload", Buffer(ms.GetBuffer(),ms.Position()));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ProxyFactory::UpOpen(Proxy& port)
|
||||
{
|
||||
if (!Client)return false;
|
||||
|
||||
MemoryStream ms;
|
||||
BinaryPair bp(ms);
|
||||
bp.Set("Port", port.Name);
|
||||
bp.Set("Open", (byte)0x01);
|
||||
|
||||
Client->Invoke("Proxy/Open", Buffer(ms.GetBuffer(), ms.Position()));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#define __ProxyFactory_H__
|
||||
|
||||
#include "Sys.h"
|
||||
#include "TokenNet\TokenMessage.h"
|
||||
#include "Message\Pair.h"
|
||||
#include "TokenNet\TokenClient.h"
|
||||
#include "Device\Proxy.h"
|
||||
|
@ -15,8 +14,8 @@ public:
|
|||
Dictionary<cstring, Proxy*> Proxys;
|
||||
TokenClient* Client;
|
||||
|
||||
|
||||
ProxyFactory();
|
||||
|
||||
// 工程打开
|
||||
bool Open(TokenClient* client);
|
||||
// 端口注册
|
||||
|
|
Loading…
Reference in New Issue