把一些函数常量化,避免错误使用
This commit is contained in:
parent
150b1b52c5
commit
176d1b392a
|
@ -40,12 +40,12 @@ TinyServer::TinyServer(TinyController* control)
|
||||||
Devices.SetLength(0);
|
Devices.SetLength(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TinyServer::Send(Message& msg)
|
bool TinyServer::Send(Message& msg) const
|
||||||
{
|
{
|
||||||
return Control->Send(msg);
|
return Control->Send(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TinyServer::Reply(Message& msg)
|
bool TinyServer::Reply(Message& msg) const
|
||||||
{
|
{
|
||||||
return Control->Reply(msg);
|
return Control->Reply(msg);
|
||||||
}
|
}
|
||||||
|
@ -268,7 +268,7 @@ bool TinyServer::OnJoin(const TinyMessage& msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 网关重置节点通信密码
|
// 网关重置节点通信密码
|
||||||
bool TinyServer::ResetPassword(byte id)
|
bool TinyServer::ResetPassword(byte id) const
|
||||||
{
|
{
|
||||||
TS("TinyServer::ResetPassword");
|
TS("TinyServer::ResetPassword");
|
||||||
|
|
||||||
|
@ -320,7 +320,7 @@ bool TinyServer::OnDisjoin(const TinyMessage& msg)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TinyServer::Disjoin(TinyMessage& msg, uint crc)
|
bool TinyServer::Disjoin(TinyMessage& msg, uint crc) const
|
||||||
{
|
{
|
||||||
TS("TinyServer::Disjoin");
|
TS("TinyServer::Disjoin");
|
||||||
|
|
||||||
|
@ -541,7 +541,7 @@ bool TinyServer::OnWrite(TinyMessage& msg, Device& dv)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Device* TinyServer::FindDevice(byte id)
|
Device* TinyServer::FindDevice(byte id) const
|
||||||
{
|
{
|
||||||
if(id == 0) return NULL;
|
if(id == 0) return NULL;
|
||||||
|
|
||||||
|
@ -569,7 +569,7 @@ void GetDeviceKey(byte scr,Array& key,void* param)
|
||||||
key.Set(dv->Pass, 8);
|
key.Set(dv->Pass, 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
Device* TinyServer::FindDevice(const Array& hardid)
|
Device* TinyServer::FindDevice(const Array& hardid) const
|
||||||
{
|
{
|
||||||
if(hardid.Length() == 0) return NULL;
|
if(hardid.Length() == 0) return NULL;
|
||||||
|
|
||||||
|
@ -659,7 +659,7 @@ int TinyServer::LoadDevices()
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TinyServer::SaveDevices()
|
void TinyServer::SaveDevices() const
|
||||||
{
|
{
|
||||||
TS("TinyServer::SaveDevices");
|
TS("TinyServer::SaveDevices");
|
||||||
|
|
||||||
|
@ -743,7 +743,7 @@ bool TinyServer::LoadConfig()
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TinyServer::SaveConfig()
|
void TinyServer::SaveConfig() const
|
||||||
{
|
{
|
||||||
TS("TinyServer::SaveConfig");
|
TS("TinyServer::SaveConfig");
|
||||||
|
|
||||||
|
|
|
@ -22,8 +22,8 @@ public:
|
||||||
TinyServer(TinyController* control);
|
TinyServer(TinyController* control);
|
||||||
|
|
||||||
// 发送消息
|
// 发送消息
|
||||||
bool Send(Message& msg);
|
bool Send(Message& msg) const;
|
||||||
bool Reply(Message& msg);
|
bool Reply(Message& msg) const;
|
||||||
// 收到本地无线网消息
|
// 收到本地无线网消息
|
||||||
bool OnReceive(TinyMessage& msg);
|
bool OnReceive(TinyMessage& msg);
|
||||||
// 分发外网过来的消息。返回值表示是否有响应
|
// 分发外网过来的消息。返回值表示是否有响应
|
||||||
|
@ -34,16 +34,16 @@ public:
|
||||||
void* Param;
|
void* Param;
|
||||||
|
|
||||||
TArray<Device*> Devices;
|
TArray<Device*> Devices;
|
||||||
Device* FindDevice(byte id);
|
Device* FindDevice(byte id) const;
|
||||||
Device* FindDevice(const Array& hardid);
|
Device* FindDevice(const Array& hardid) const;
|
||||||
bool DeleteDevice(byte id);
|
bool DeleteDevice(byte id);
|
||||||
|
|
||||||
int LoadDevices();
|
int LoadDevices();
|
||||||
void SaveDevices();
|
void SaveDevices() const;
|
||||||
void ClearDevices();
|
void ClearDevices();
|
||||||
|
|
||||||
bool LoadConfig();
|
bool LoadConfig();
|
||||||
void SaveConfig();
|
void SaveConfig() const;
|
||||||
void ClearConfig();
|
void ClearConfig();
|
||||||
|
|
||||||
// 当前设备
|
// 当前设备
|
||||||
|
@ -58,9 +58,9 @@ public:
|
||||||
// 组网
|
// 组网
|
||||||
bool OnJoin(const TinyMessage& msg);
|
bool OnJoin(const TinyMessage& msg);
|
||||||
|
|
||||||
bool ResetPassword(byte id);
|
bool ResetPassword(byte id) const;
|
||||||
|
|
||||||
bool Disjoin(TinyMessage& msg,uint crc);
|
bool Disjoin(TinyMessage& msg,uint crc) const;
|
||||||
bool OnDisjoin(const TinyMessage& msg);
|
bool OnDisjoin(const TinyMessage& msg);
|
||||||
|
|
||||||
// 心跳
|
// 心跳
|
||||||
|
|
Loading…
Reference in New Issue