偏移量大于主数据区规定长度,转向写入配置数据区
This commit is contained in:
parent
ea88a63ebe
commit
0c27d93ab9
|
@ -21,6 +21,7 @@ TinyServer::TinyServer(TinyController* control)
|
|||
Control->Param = this;
|
||||
|
||||
Control->Mode = 2; // 服务端接收所有消息
|
||||
DataStoreLent =64;
|
||||
|
||||
Received = NULL;
|
||||
Param = NULL;
|
||||
|
@ -438,6 +439,10 @@ bool TinyServer::OnWrite(TinyMessage& msg, Device& dv)
|
|||
Stream ms = msg.ToStream();
|
||||
uint offset = ms.ReadEncodeInt();
|
||||
|
||||
if(offset>DataStoreLent)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
// 计算还有多少数据可写
|
||||
uint len = ms.Remain();
|
||||
int remain = dv.Store.Capacity() - offset;
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
class TinyServer
|
||||
{
|
||||
private:
|
||||
byte DataStoreLent;
|
||||
|
||||
public:
|
||||
TinyController* Control;
|
||||
|
|
Loading…
Reference in New Issue