Exemplo n.º 1
0
 public MaslDtFrame(MaslFrameDirection direction, byte[] userData)
     : base(MaslFrameType.DT, direction, 0)
 {
     this.UserData = userData;
 }
Exemplo n.º 2
0
 public MaslDiFrame(MaslFrameDirection direction, byte majorReason, byte minorReason)
     : base(MaslFrameType.DI, direction, 0)
 {
     this.MajorReason = majorReason;
     this.MinorReason = minorReason;
 }
Exemplo n.º 3
0
 /// <summary>
 /// 使用指定错误消息和对作为此异常原因的内部异常的引用来初始化 DirectionFlagException 类的新实例。
 /// </summary>
 /// <param name="expectedDir">表示期望的方向。</param>
 /// <param name="message">解释异常原因的错误消息。</param>
 /// <param name="innerException">导致当前异常的异常;如果未指定内部异常,则是一个 null 引用(在 Visual Basic 中为 Nothing)。</param>
 public DirectionFlagException(MaslFrameDirection expectedDir, string message, Exception innerException)
     : base(Code, SubCode, message, innerException)
 {
     this.MinorReason = (expectedDir == MaslFrameDirection.Server2Client) ? (byte)1 : (byte)2;
 }
Exemplo n.º 4
0
 /// <summary>
 /// 初始化 DirectionFlagException 类的新实例。
 /// </summary>
 /// <param name="expectedDir">表示期望的方向。</param>
 public DirectionFlagException(MaslFrameDirection expectedDir)
     : base(Code, SubCode, "方向标志与期望的不一致。")
 {
     this.MinorReason = (expectedDir == MaslFrameDirection.Server2Client) ? (byte)1 : (byte)2;
 }
Exemplo n.º 5
0
 protected void ParseHeaderByte(byte value)
 {
     this.DeviceType = (byte)((value >> 5) & 0x07);
     this.FrameType  = (MaslFrameType)((value >> 1) & 0x0F);
     this.Direction  = (MaslFrameDirection)(value & 0x01);
 }
Exemplo n.º 6
0
 protected MaslFrame(MaslFrameType frameType, MaslFrameDirection direction, byte deviceType)
 {
     this.FrameType  = frameType;
     this.Direction  = direction;
     this.DeviceType = deviceType;
 }