namespace Tinkerforge
{
    public static class ELaserRangeFinder
    {
        public static (byte AcquisitionCount, bool EnableQuickTermination, byte ThresholdValue, int MeasurementFrequency
            ) GetConfiguration(this BrickletLaserRangeFinder laserRangeFinder)
        {
            laserRangeFinder.GetConfiguration(out byte acquisitionCount, out bool enableQuickTermination,
                out byte thresholdValue, out int measurementFrequency);
            return (acquisitionCount, enableQuickTermination, thresholdValue, measurementFrequency);
        }

        public static (byte DistanceAverageLength, byte VelocityAverageLength) GetMovingAverage(
            this BrickletLaserRangeFinder laserRangeFinder)
        {
            laserRangeFinder.GetMovingAverage(out byte distanceAverageLength, out byte velocityAverageLength);
            return (distanceAverageLength, velocityAverageLength);
        }

        public static (char Option, int Min, int Max) GetDistanceCallbackThreshold(
            this BrickletLaserRangeFinder laserRangeFinder)
        {
            laserRangeFinder.GetDistanceCallbackThreshold(out char option, out int min, out int max);
            return (option, min, max);
        }

        public static (char Option, short Min, short Max) GetVelocityCallbackThreshold(
            this BrickletLaserRangeFinder laserRangeFinder)
        {
            laserRangeFinder.GetVelocityCallbackThreshold(out char option, out short min, out short max);
            return (option, min, max);
        }          
    }
}
