/// <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); }
/// <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; }