public override bool Decode(PduMarshaler marshaler)
        {
            HeaderBits = new Header(marshaler.ReadByte());

            Cmd_Values c = HeaderBits.Cmd;

            // TODO: Check this logic
            // Check in the special case that the Cmd bit field just
            // equals to Cmd_Values.Unknown
            if (c == Cmd_Values.Unknown)
            {
                return(false);
            }

            try
            {
                if (c == Cmd)
                {
                    DoUnmarshal(marshaler);
                    SetRawData(false, marshaler);
                    return(true);
                }
            }
            catch (OverflowException)
            {
                marshaler.Reset();
            }
            catch (RdpedycPduMismatchException)
            {
                marshaler.Reset();
            }

            return(false);
        }
 /// <summary>
 /// Marshal constructor
 /// </summary>
 /// <param name="cmd">Cmd field</param>
 /// <param name="sp">SP/Pri/Len field</param>
 /// <param name="cbChId">cbChId field</param>
 public Header(Cmd_Values cmd, int sp, cbChId_Values cbChId)
 {
     this.Cmd         = cmd;
     this.Sp          = sp;
     this.CbChannelId = cbChId;
 }
 /// <summary>
 /// Marshal constructor
 /// </summary>
 /// <param name="cmd">Cmd field</param>
 /// <param name="sp">SP field</param>
 /// <param name="cbChId">cbChId field</param>
 public Header(Cmd_Values cmd, int sp, cbChId_Values cbChId)
 {
     this.Cmd = cmd;
     this.Sp = sp;
     this.CbChannelId = cbChId;
 }