DhtSensor Class

Definition

This class supports the DhtFirmata extensions to read DHT sensors over the firmata protocol.

public class DhtSensor : Iot.Device.Arduino.ExtendedCommandHandler
type DhtSensor = class
    inherit ExtendedCommandHandler
Public Class DhtSensor
Inherits ExtendedCommandHandler
Inheritance

Constructors

DhtSensor()

Initializes a new instance of the DhtSensor extended command handler. This handler requires pins with DHT support. This is typically the case for all GPIO pins if the firmata client has the DhtFirmata extension loaded.

Properties

Board

The reference to the arduino board

(Inherited from ExtendedCommandHandler)
HandlesMode

The pin mode this handler supports.

(Inherited from ExtendedCommandHandler)
IsRegistered

Returns true if this command handler is registered. This might need to be checked in Dispose, to make sure an uninitialized component doesn't attempt to send a command.

(Inherited from ExtendedCommandHandler)
Logger

The class-specific logger instance

(Inherited from ExtendedCommandHandler)

Methods

Dispose() (Inherited from ExtendedCommandHandler)
Dispose(Boolean)

Disposes this instance

(Inherited from ExtendedCommandHandler)
HasCommandError(FirmataCommandSequence, Byte[])

Callback function that returns whether the given reply indicates an error

(Inherited from ExtendedCommandHandler)
IsMatchingAck(FirmataCommandSequence, Byte[])

This method is called to check whether the reply is a valid ACK/NOACK for the given command sequence. Can be used to avoid accepting something as command reply that is completely unrelated (such as an asynchronous callback). In different words, this should return false if the given reply is not something that is an answer to a synchronous command.

(Inherited from ExtendedCommandHandler)
OnConnected()

This method is called when a connection to the hardware is established.

(Inherited from ExtendedCommandHandler)
OnErrorMessage(String, Exception)

Called by the infrastructure when the parser reports an error or information message. The default implementation does nothing.

(Inherited from ExtendedCommandHandler)
OnSysexData(ReplyType, Byte[])

This is called when a sysex command is received from the board. This can include the reply to a command sent by a SendCommandAndWait(FirmataCommandSequence) before, in which case the reply should be ignored, as it is returned as result of the call itself. Therefore it is advised to use this function only to listen for data sent by the device automatically (e.g event messages or recurring status reports)

(Inherited from ExtendedCommandHandler)
SendCommand(FirmataCommandSequence)

Sends a command to the device, not expecting an answer.

(Inherited from ExtendedCommandHandler)
SendCommandAndWait(FirmataCommandSequence)

Send a command to the device, expecting a reply. This uses a default timeout.

(Inherited from ExtendedCommandHandler)
SendCommandAndWait(FirmataCommandSequence, TimeSpan)

Send a command to the device, expecting a reply.

(Inherited from ExtendedCommandHandler)
SendCommandAndWait(FirmataCommandSequence, TimeSpan, CommandError)

Send a command to the device, expecting a reply.

(Inherited from ExtendedCommandHandler)
SendCommandsAndWait(IList<FirmataCommandSequence>, TimeSpan, CommandError)

Send a command to the device, expecting a reply.

(Inherited from ExtendedCommandHandler)
TryReadDht(Int32, Int32, Temperature, RelativeHumidity)

Special function to read DHT sensor, if supported

Applies to