This commit is contained in:
cdyong 2015-12-16 07:29:15 +00:00
parent 19f98c2b31
commit 1b4586ca77
4 changed files with 2 additions and 19 deletions

View File

@ -35,6 +35,7 @@ public:
byte Channel; // 通道
String Name; // 名称
byte Pass[8]; // 通信密码
byte MAC[6];
byte Store[32]; // 数据存储区

View File

@ -8,8 +8,6 @@ JoinMessage::JoinMessage() : HardID(0x10), Password(0x08)
TranID = 0;
Server = 0;
PanID = 0;
SendMode= 0;
Channel = 0;
Speed = 0;
Address = 0;
@ -24,15 +22,10 @@ bool JoinMessage::Read(Stream& ms)
Kind = ms.ReadUInt16();
TranID = ms.ReadUInt32();
HardID = ms.ReadArray();
Name = ms.ReadString();
//ms.ReadString().CopyTo(Name, ArrayLength(Name));
}
else
{
Server = ms.ReadByte();
WirKind = ms.ReadByte();
Channel = ms.ReadByte();
Speed = ms.ReadByte();
Address = ms.ReadByte();
@ -53,14 +46,10 @@ void JoinMessage::Write(Stream& ms)
ms.Write(Kind);
ms.Write(TranID);
ms.WriteArray(HardID);
ms.Write(Name);
}
else
{
ms.Write(Server);
ms.Write(WirKind);
ms.Write(PanID);
ms.Write(SendMode);
ms.Write(Channel);
ms.Write(Speed);
ms.Write(Address);
@ -85,9 +74,6 @@ String& JoinMessage::ToStr(String& str) const
{
str += "#";
str = str + " Server=" + Server;
str = str + " WirKind=" + WirKind;
str.Append("PanID=").Append(PanID, 16, 4);
str = str + " SendMode=" + SendMode;
str = str + " Channel=" + Channel;
str = str + " Speed=" + Speed;
str = str + " Address=" + Address;

View File

@ -16,13 +16,9 @@ public:
ushort Kind; // 类型
uint TranID; // 会话
ByteArray HardID; // 硬件编码。一般12~16字节
String Name; // 名称
// 响应数据
byte Server; // 网关地址
byte WirKind; //无线类型
ushort PanID; //无线网段
byte SendMode; //发送模式
byte Channel; // 通道
byte Speed; // 传输速度
byte Address; // 分配得到的设备地址

View File

@ -430,7 +430,7 @@ void TinyClient::Join()
dm.Kind = Type;
dm.HardID.Copy(Sys.ID, 16);
dm.TranID = TranID;
dm.Name =Cfg->Name;
//dm.Name = Cfg->Name;
dm.WriteMessage(msg);
dm.Show(true);