网关写自己的配置区
This commit is contained in:
parent
d1b6ed652d
commit
3d37053681
|
@ -43,6 +43,13 @@ TinyServer::TinyServer(TinyController* control)
|
||||||
|
|
||||||
bool TinyServer::Send(Message& msg) const
|
bool TinyServer::Send(Message& msg) const
|
||||||
{
|
{
|
||||||
|
auto mg = (TinyMessage&) msg;
|
||||||
|
|
||||||
|
//如果目标地址为往关地址
|
||||||
|
if(mg.Dest == Cfg->Address)
|
||||||
|
{
|
||||||
|
WriteCfg(mg);
|
||||||
|
}
|
||||||
// 附加目标物理地址
|
// 附加目标物理地址
|
||||||
//if(!msg.State)
|
//if(!msg.State)
|
||||||
{
|
{
|
||||||
|
@ -579,9 +586,9 @@ void TinyServer::SetChannel(byte channel)
|
||||||
zb->ExitConfig();
|
zb->ExitConfig();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void TinyServer::WriteCfg(TinyMessage& msg)
|
void TinyServer::WriteCfg(TinyMessage& msg)const
|
||||||
{
|
{
|
||||||
if(msg.Reply||msg.Length < 2) return;
|
if(msg.Code != 0x16||msg.Reply||msg.Length < 2) return;
|
||||||
// 起始地址为7位压缩编码整数
|
// 起始地址为7位压缩编码整数
|
||||||
Stream ms = msg.ToStream();
|
Stream ms = msg.ToStream();
|
||||||
uint offset = ms.ReadEncodeInt();
|
uint offset = ms.ReadEncodeInt();
|
||||||
|
|
|
@ -44,7 +44,7 @@ public:
|
||||||
|
|
||||||
void SetChannel(byte channel);
|
void SetChannel(byte channel);
|
||||||
|
|
||||||
void WriteCfg(TinyMessage& msg);
|
void WriteCfg(TinyMessage& msg)const;
|
||||||
bool LoadConfig();
|
bool LoadConfig();
|
||||||
void SaveConfig() const;
|
void SaveConfig() const;
|
||||||
void ClearConfig();
|
void ClearConfig();
|
||||||
|
|
Loading…
Reference in New Issue