/// <summary> /// Parse TS_SHARECONTROLHEADER /// (parser index is updated according to parsed length) /// </summary> /// <param name="data">data to be parsed</param> /// <param name="currentIndex">current parser index</param> /// <returns>TS_SHARECONTROLHEADER</returns> private TS_SHARECONTROLHEADER ParseTsShareControlHeader(byte[] data, ref int currentIndex) { TS_SHARECONTROLHEADER header = new TS_SHARECONTROLHEADER(); // TS_SHARECONTROLHEADER: totalLength header.totalLength = ParseUInt16(data, ref currentIndex, false); // TS_SHARECONTROLHEADER: pduType header.pduType.typeAndVersionLow = ParseByte(data, ref currentIndex); header.pduType.versionHigh = (versionHigh_Values)ParseByte(data, ref currentIndex); // TS_SHARECONTROLHEADER: pduSource header.pduSource = ParseUInt16(data, ref currentIndex, false); return header; }
/// <summary> /// Get Share Control Header Type /// [Reference to 2.2.8.1.1.1.1 Share Control Header (TS_SHARECONTROLHEADER)] /// </summary> /// <param name="header">a TS_SHARECONTROLHEADER</param> /// <returns>the Share Control Header Type</returns> private ShareControlHeaderType GetShareControlHeaderType(TS_SHARECONTROLHEADER header) { // Get "type" info (In "typAndVersionLow" field, the lower four bits represents "type") int type = header.pduType.typeAndVersionLow & 0x0f; // Type cast return (ShareControlHeaderType)type; }