Example #1
0
        public object Deserialize(byte[] buffer)
        {
            _currentTime    = BitConverter.ToLong(buffer, 0);
            _gyroAxes.Pitch = BitConverter.ToFloat(buffer, 8);
            _gyroAxes.Roll  = BitConverter.ToFloat(buffer, 12);
            _gyroAxes.Yaw   = BitConverter.ToFloat(buffer, 16);

            _radioAxes.Pitch = BitConverter.ToFloat(buffer, 20);
            _radioAxes.Roll  = BitConverter.ToFloat(buffer, 24);
            _radioAxes.Yaw   = BitConverter.ToFloat(buffer, 28);

            _pidAxes.Pitch = BitConverter.ToFloat(buffer, 32);
            _pidAxes.Roll  = BitConverter.ToFloat(buffer, 36);
            _pidAxes.Yaw   = BitConverter.ToFloat(buffer, 40);
            return(this);
        }
Example #2
0
 /// <summary>
 /// Reads a single-precision floating-point value from the stream, using the bit converter
 /// for this reader. 4 bytes are read.
 /// </summary>
 /// <returns>The floating point value read</returns>
 public float ReadFloat()
 {
     ReadInternal(buffer, 4);
     return(BitConverter.ToFloat(buffer, 0));
 }