初始化
This commit is contained in:
51
Commonlib/SystemHeader.cs
Normal file
51
Commonlib/SystemHeader.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
namespace RCUHost.Protocols
|
||||
{
|
||||
[StructLayoutAttribute(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
|
||||
public struct SystemHeader
|
||||
{
|
||||
#if SIMON
|
||||
public const string SYSTEM_ID = "T3SA";
|
||||
#else
|
||||
public const string SYSTEM_ID = "TSA1";
|
||||
#endif
|
||||
|
||||
public const ushort SIGNATURE = 0x55AA;
|
||||
|
||||
/// <summary>
|
||||
/// Magic
|
||||
/// </summary>
|
||||
public ushort Signature;
|
||||
|
||||
/// <summary>
|
||||
/// 帧总字节数,包括头部和数据
|
||||
/// </summary>
|
||||
public ushort FrameLength;
|
||||
|
||||
/// <summary>
|
||||
/// 系统标识
|
||||
/// </summary>
|
||||
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 4)]
|
||||
public char[] SystemID;
|
||||
|
||||
/// <summary>
|
||||
/// 指令代码
|
||||
/// </summary>
|
||||
public byte CmdType;
|
||||
|
||||
/// <summary>
|
||||
/// 帧序号
|
||||
/// </summary>
|
||||
public ushort FrameNo;
|
||||
|
||||
/// <summary>
|
||||
/// 主机编号(房号)
|
||||
/// </summary>
|
||||
public HostNumber HostNumber;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user