/// <summary> /// Parse TS_UD_SC_NET /// (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_UD_SC_NET</returns> private TS_UD_SC_NET ParseTsUdScNet(byte[] data, ref int currentIndex) { TS_UD_SC_NET netData = new TS_UD_SC_NET(); // reserve current index int reservedIndex = currentIndex; // TS_UD_SC_NET: Header netData.header.type = (TS_UD_HEADER_type_Values)ParseUInt16(data, ref currentIndex, false); netData.header.length = ParseUInt16(data, ref currentIndex, false); // TS_UD_SC_NET: MCSChannelID netData.MCSChannelId = ParseUInt16(data, ref currentIndex, false); // TS_UD_SC_NET: channelCount netData.channelCount = ParseUInt16(data, ref currentIndex, false); // TS_UD_SC_NET: channelIdArray netData.channelIdArray = new ushort[netData.channelCount]; for (int i = 0; i < netData.channelIdArray.Length; i++) { netData.channelIdArray[i] = ParseUInt16(data, ref currentIndex, false); } // TS_UD_SC_NET: Pad // (the even/odd checking option described in TD is granted to adapter, // thus adpter can verify their consistency) int remainDataLength = netData.header.length - (currentIndex - reservedIndex); netData.Pad = GetBytes(data, ref currentIndex, remainDataLength); return netData; }
public ConnectGCCRsp() { serverCoreData = new TS_UD_SC_CORE(); serverNetworkData = new TS_UD_SC_NET(); serverSecurityData = new TS_UD_SC_SEC1(); }