Ejemplo n.º 1
0
        public static Measure <Celsius> BytesToCelsius(ArraySegment <byte> input)
        {
            var result = Dpt9.BytesToDouble(input);

            if (result < -273 || result > 670760)
            {
                throw new ArgumentOutOfRangeException(nameof(input), $"Input results in {result} degree Celsius which is out of the specified range");
            }
            return(new Measure <Celsius>(result));
        }