Skip to content

Commit

Permalink
op
Browse files Browse the repository at this point in the history
  • Loading branch information
bouyeijiang committed Sep 19, 2017
1 parent a6a8eb0 commit e53250c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Binary file modified .vs/Bouyei.BeidouLSP/v15/sqlite3/storage.ide
Binary file not shown.
11 changes: 8 additions & 3 deletions Bouyei.BeidouLSP/Structures/PacketMessage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ namespace Bouyei.BeidouLSP.Structures
[StructLayout(LayoutKind.Sequential)]
public class PacketFrom
{
private byte _msgFlag = 0x7e;
/// <summary>
/// 消息包标志位0x7e(头标志和尾标识)共用
/// </summary>
public byte msgFlag { get { return _msgFlag; } }
/// <summary>
/// 消息ID
/// </summary>
Expand Down Expand Up @@ -122,7 +127,7 @@ internal unsafe byte[] Escape(byte[] buffer)

fixed (byte* dst = new byte[rlen], src = buffer)
{
dst[0] = 0x7e;
dst[0] = _msgFlag;

while (i < len)
{
Expand Down Expand Up @@ -180,7 +185,7 @@ internal unsafe byte[] Escape(byte[] buffer)
break;
}

*(dst + index) = 0x7e;
*(dst + index) = _msgFlag;
++index;

byte[] nbuffer = new byte[index];
Expand Down Expand Up @@ -288,7 +293,7 @@ public class PacketHead
public class PacketMessage
{
/// <summary>
/// 标识位
/// 标识位,0x7e
/// </summary>
public UInt16 pmFlag = 0x7e;
/// <summary>
Expand Down

0 comments on commit e53250c

Please sign in to comment.