The TS_DEACTIVATE_ALL_PDU structure is a standard T.128 Deactivate All PDU (see [T128] section 8.4.1).
file:///C:/ts_dev/TestSuites/MS-RDPBCGR/TestSuite/Src/TD/latest_XMLS_16may/RDPBCGR/ _rfc_ms-rdpbcgr2_1_3_1_1.xml
        /// <summary>
        /// Parse TS_DEACTIVATE_ALL_PDU
        /// (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_DEACTIVATE_ALL_PDU</returns>
        private TS_DEACTIVATE_ALL_PDU ParseTsDeactivateAllPdu(byte[] data, ref int currentIndex)
        {
            TS_DEACTIVATE_ALL_PDU pdu = new TS_DEACTIVATE_ALL_PDU();

            // TS_DEACTIVATE_ALL_PDU: shareControlHeader
            pdu.shareControlHeader = ParseTsShareControlHeader(data, ref currentIndex);

            // TS_DEACTIVATE_ALL_PDU: shareId
            pdu.shareId = ParseUInt32(data, ref currentIndex, false);

            // TS_DEACTIVATE_ALL_PDU: lengthSourceDescriptor
            pdu.lengthSourceDescriptor = ParseUInt16(data, ref currentIndex, false);

            // TS_DEACTIVATE_ALL_PDU: sourceDescriptor
            pdu.sourceDescriptor = GetBytes(data, ref currentIndex, (int)pdu.lengthSourceDescriptor);

            return pdu;
        }
Exemplo n.º 2
0
        private byte[] EncodeDeactivateAllData(TS_DEACTIVATE_ALL_PDU deactivateAllPduData)
        {
            List<byte> dataBuffer = new List<byte>();

            RdpbcgrEncoder.EncodeStructure(dataBuffer, deactivateAllPduData.shareControlHeader);
            RdpbcgrEncoder.EncodeStructure(dataBuffer, deactivateAllPduData.shareId);
            RdpbcgrEncoder.EncodeStructure(dataBuffer, deactivateAllPduData.lengthSourceDescriptor);
            RdpbcgrEncoder.EncodeBytes(dataBuffer, deactivateAllPduData.sourceDescriptor);

            return dataBuffer.ToArray();
        }