/// <summary>
        /// Reads the current data values from a Pedalog device.
        /// </summary>
        /// <returns>
        /// A <see cref="Data"/> struct containing the device's current readings, or
        /// <c>null</c> if the device has been disconnected. If <c>null</c> is returned,
        /// <see cref="Device.FindAll"/> should be called again to re-enumerate the
        /// connected devices.
        /// </returns>
        public Data? ReadData()
        {
            Data data = new Data();

            var result = (Result)Pedalog.ReadData(ref this, ref data);
            if (result != Result.Ok)
            {
                if (result == Result.NoDeviceFound)
                {
                    return null;
                }

                throw PedalogException.CreateSpecificExceptionFromError(result);
            }

            return data;
        }
 internal static extern int ReadData(ref Device device, ref Data data);