コード例 #1
0
        private CompositeData DecodeAvlData()
        {
            var packetDataComposite = new CompositeData("Data");

            var packetId = _reader.ReadData(1, DataType.TransferId);

            packetDataComposite.Add(packetId);

            var countData = _reader.ReadData(1, DataType.DataPacketCount);

            packetDataComposite.Add(countData);

            PacketData packetDataHandler = PacketFactory.CreatePacketReader(packetId.Value);

            for (var i = 0; i < int.Parse(countData.Value); i++)
            {
                var packetData = packetDataHandler.GetPacketData(_reader);
                packetDataComposite.Add(packetData);
            }

            packetDataComposite.Add(_reader.ReadData(1, DataType.DataPacketCount));

            packetDataComposite.ConfigureArraySegment();

            return(packetDataComposite);
        }