Beispiel #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DhtDevice" /> class.
        /// </summary>
        /// <param name="pin">The pin.</param>
        /// <param name="autoStart">if set to <c>true</c>, DHT is automatically started. Default value is <c>true</c>.</param>
        /// <param name="threadFactory">The thread factory.</param>
        /// <param name="dhtDeviceReporter">The DHT device reporter.</param>
        protected DhtDevice(IInputOutputBinaryPin pin, bool autoStart = true, IThreadFactory threadFactory = null, IDhtDeviceReporter dhtDeviceReporter = null)
        {
            this.thread            = ThreadFactory.EnsureThreadFactory(threadFactory).Create();
            this.pin               = pin;
            this.dhtDeviceReporter = dhtDeviceReporter;

            if (autoStart)
            {
                this.Start();
            }
            else
            {
                this.Stop();
            }
        }
Beispiel #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Dht22Device" /> class.
 /// </summary>
 /// <param name="pin">The pin.</param>
 /// <param name="autoStart">if set to <c>true</c> [automatic start].</param>
 /// <param name="threadFactory">The thread factory.</param>
 /// <param name="dhtDeviceReporter">The DHT device reporter.</param>
 public Dht22Device(IInputOutputBinaryPin pin, bool autoStart = true, IThreadFactory threadFactory = null, IDhtDeviceReporter dhtDeviceReporter = null)
     : base(pin, autoStart, threadFactory, dhtDeviceReporter)
 {
 }