Example #1
0
        public Task <SensorValue> RetrieveValue(SensorReadingType type)
        {
            return(Task.Run(() =>
            {
                switch (Sensor.Type)
                {
                case SensorReadingType.Temperature:
                    return new SensorValue {
                        Timestamp = DateTime.Now, ReadingType = Sensor.Type, ReadResult = 75
                    };

                case SensorReadingType.Humidity:
                    return new SensorValue {
                        Timestamp = DateTime.Now, ReadingType = Sensor.Type, ReadResult = arduino.analogRead("A0")
                    };

                case SensorReadingType.pH:
                    return new SensorValue {
                        Timestamp = DateTime.Now, ReadingType = Sensor.Type, ReadResult = 75
                    };

                default:
                    throw new ArgumentOutOfRangeException();
                }
            }));
        }
 public Task <SensorValue> RetrieveValue(SensorReadingType type)
 {
     throw new NotImplementedException();
 }