Beispiel #1
0
        /// <summary>
        /// Reads the data from a memory buffer into this packet object.
        /// </summary>
        /// <param name="data">The data to be read.</param>
        /// <remarks>
        /// Decodes the raw data into usable information.
        /// </remarks>
        public override void ReadData(TCNetBinaryReader data)
        {
            base.ReadData(data);

            NodeCount        = data.ReadNetwork16();
            NodeListenerPort = data.ReadNetwork16();
        }
Beispiel #2
0
        /// <summary>
        /// Reads the data from a memory buffer into this packet object.
        /// </summary>
        /// <param name="data">The data to be read.</param>
        /// <remarks>
        /// Decodes the raw data into usable information.
        /// </remarks>
        public override void ReadData(TCNetBinaryReader data)
        {
            base.ReadData(data);

            DataType    = (DataTypes)data.ReadByte();
            LayerID     = data.ReadByte();
            Code        = data.ReadNetwork16();
            MessageType = (MessageTypes)data.ReadNetwork16();
        }
Beispiel #3
0
 /// <summary>
 /// Reads the data from a memory buffer into this packet object.
 /// </summary>
 /// <param name="data">The data to be read.</param>
 /// <remarks>
 /// Decodes the raw data into usable information.
 /// </remarks>
 public override void ReadData(TCNetBinaryReader data)
 {
     NodeID          = data.ReadNetwork16();
     ProtocolVersion = new Version(data.ReadByte(), data.ReadByte());
     Header          = data.ReadNetworkString(3);
     MessageType     = (MessageTypes)data.ReadByte();
     NodeName        = data.ReadNetworkString(8);
     SequenceNumber  = data.ReadByte();
     NodeType        = (NodeType)data.ReadByte();
     NodeOptions     = (NodeOptions)data.ReadNetwork16();
     Timestamp       = TimeSpan.FromTicks(data.ReadNetwork32() * (TimeSpan.TicksPerSecond / 1000000));
 }
Beispiel #4
0
        /// <summary>
        /// Reads the data from a memory buffer into this packet object.
        /// </summary>
        /// <param name="data">The data to be read.</param>
        /// <remarks>
        /// Decodes the raw data into usable information.
        /// </remarks>
        public override void ReadData(TCNetBinaryReader data)
        {
            base.ReadData(data);

            NodeCount        = data.ReadNetwork16();
            NodeListenerPort = data.ReadNetwork16();
            Uptime           = TimeSpan.FromSeconds(data.ReadNetwork16());
            data.ReadBytes(2);
            VendorName    = data.ReadNetworkString(16);
            DeviceName    = data.ReadNetworkString(16);
            DeviceVersion = new Version(data.ReadByte(), data.ReadByte(), data.ReadByte());
            data.ReadBytes(1);
        }
Beispiel #5
0
        /// <summary>
        /// Reads the data from a memory buffer into this packet object.
        /// </summary>
        /// <param name="data">The data to be read.</param>
        /// <remarks>
        /// Decodes the raw data into usable information.
        /// </remarks>
        public override void ReadData(TCNetBinaryReader data)
        {
            base.ReadData(data);

            DataSize        = data.ReadNetwork32();
            TotalPackets    = data.ReadNetwork32();
            PacketNumber    = data.ReadNetwork32();
            DataClusterSize = data.ReadNetwork32();

            long            readPosition = DataClusterSize;
            List <BeatData> beats        = new List <BeatData>();

            while (readPosition > 7)
            {
                BeatData beat = new BeatData();
                beat.BeatNumber = data.ReadNetwork16();
                beat.BeatType   = (BeatTypes)data.ReadByte();
                data.ReadByte();
                beat.BeatTimeStamp = data.ReadNetworkTime();

                beats.Add(beat);

                readPosition -= 8;
            }

            Beats = beats;
        }
Beispiel #6
0
        /// <summary>
        /// Reads the data from a memory buffer into this packet object.
        /// </summary>
        /// <param name="data">The data to be read.</param>
        /// <remarks>
        /// Decodes the raw data into usable information.
        /// </remarks>
        public override void ReadData(TCNetBinaryReader data)
        {
            base.ReadData(data);

            StepNumber = (TimeSyncSteps)data.ReadByte();
            data.ReadByte();
            NodeListenerPort = data.ReadNetwork16();
            RemoteTimestamp  = TimeSpan.FromTicks(data.ReadNetwork32() * (TimeSpan.TicksPerSecond / 1000000));
        }
Beispiel #7
0
        /// <summary>
        /// Reads the data from a memory buffer into this packet object.
        /// </summary>
        /// <param name="data">The data to be read.</param>
        /// <remarks>
        /// Decodes the raw data into usable information.
        /// </remarks>
        public override void ReadData(TCNetBinaryReader data)
        {
            base.ReadData(data);

            data.ReadByte();
            TrackID     = data.ReadNetwork16();
            TrackArtist = data.ReadNetworkString(256);
            TrackTitle  = data.ReadNetworkString(256);
            //TrackKey = data.ReadNetwork16();
        }
Beispiel #8
0
        /// <summary>
        /// Reads the data from a memory buffer into this packet object.
        /// </summary>
        /// <param name="data">The data to be read.</param>
        /// <remarks>
        /// Decodes the raw data into usable information.
        /// </remarks>
        public override void ReadData(TCNetBinaryReader data)
        {
            base.ReadData(data);

            ApplicationSignature = data.ReadNetwork16();
            int dataSize = (int)data.ReadNetwork32();

            TotalPackets = data.ReadNetwork32();
            PacketNumber = data.ReadNetwork32();

            ReadApplicationData(data, dataSize);
        }
Beispiel #9
0
        /// <summary>
        /// Reads the data from a memory buffer into this packet object.
        /// </summary>
        /// <param name="data">The data to be read.</param>
        /// <remarks>
        /// Decodes the raw data into usable information.
        /// </remarks>
        public override void ReadData(TCNetBinaryReader data)
        {
            base.ReadData(data);

            data.ReadByte();
            LayerState = (DeckState)data.ReadByte();
            data.ReadByte();
            SyncMaster = data.ReadByte();
            data.ReadByte();
            BeatMarker      = data.ReadByte();
            TrackLength     = data.ReadNetwork32();
            CurrentPosition = data.ReadNetwork32();
            Speed           = Math.Round((double)data.ReadNetwork32() / 32767.0, 3);
            data.ReadBytes(13);
            BeatNumber = data.ReadNetwork32();
            data.ReadBytes(51);
            BPM            = (double)data.ReadNetwork32() / 100.0;
            SpeedPitchBend = Math.Round((double)data.ReadNetwork16() / 32767.0, 3);
            TrackId        = data.ReadNetwork32();
        }