偏移量大于主数据区规定长度,转向写入配置数据区

This commit is contained in:
cdyong 2015-11-04 08:37:24 +00:00
parent ea88a63ebe
commit 0c27d93ab9
2 changed files with 7 additions and 1 deletions

View File

@ -21,6 +21,7 @@ TinyServer::TinyServer(TinyController* control)
Control->Param = this; Control->Param = this;
Control->Mode = 2; // 服务端接收所有消息 Control->Mode = 2; // 服务端接收所有消息
DataStoreLent =64;
Received = NULL; Received = NULL;
Param = NULL; Param = NULL;
@ -437,7 +438,11 @@ bool TinyServer::OnWrite(TinyMessage& msg, Device& dv)
// 起始地址为7位压缩编码整数 // 起始地址为7位压缩编码整数
Stream ms = msg.ToStream(); Stream ms = msg.ToStream();
uint offset = ms.ReadEncodeInt(); uint offset = ms.ReadEncodeInt();
if(offset>DataStoreLent)
{
return true;
}
// 计算还有多少数据可写 // 计算还有多少数据可写
uint len = ms.Remain(); uint len = ms.Remain();
int remain = dv.Store.Capacity() - offset; int remain = dv.Store.Capacity() - offset;

View File

@ -14,6 +14,7 @@
class TinyServer class TinyServer
{ {
private: private:
byte DataStoreLent;
public: public:
TinyController* Control; TinyController* Control;