コード例 #1
0
        /// <summary>
        /// ReadFromFrame frame type
        /// </summary>
        /// <param name="frame">frame containing encoded Mac SDU</param>
        /// <returns>type, reserved value on error</returns>
        static public bool GetType(Frame frame, out Type type)
        {
            if (frame != null && frame.LengthDataUsed >= 2)
            {
                FCS fcs = new FCS();
                fcs.Value = frame.ReadUInt16Canonical(0);
                type      = fcs.Type;
                return(true);
            }

            type = Type.Ack; // any value
            return(false);
        }
コード例 #2
0
ファイル: Header.cs プロジェクト: aura1213/netmf-interpreter
        /// <summary>
        /// ReadFromFrame frame type
        /// </summary>
        /// <param name="frame">frame containing encoded Mac SDU</param>
        /// <returns>type, reserved value on error</returns>
        static public bool GetType(Frame frame, out Type type)
        {
            if (frame != null && frame.LengthDataUsed >= 2)
            {
                FCS fcs = new FCS();
                fcs.Value = frame.ReadUInt16Canonical(0);
                type = fcs.Type;
                return true;
            }

            type = Type.Ack; // any value
            return false;
        }