ExtendedCommandHandler Class

Definition

Base class for specific command handlers for the Arduino firmware This class can be derived to support special features of the Arduino firmware for a specific board. See DhtSensor or FrequencySensor as examples. See https://github.com/firmata/ConfigurableFirmata for a list of possible extensions.

public abstract class ExtendedCommandHandler : IDisposable
type ExtendedCommandHandler = class
    interface IDisposable
Public MustInherit Class ExtendedCommandHandler
Implements IDisposable
Inheritance
ExtendedCommandHandler
Derived
Implements

Constructors

ExtendedCommandHandler()

Constructs an instance of this class without a specific pin assignment.

ExtendedCommandHandler(SupportedMode)

Constructs an instance of this class.

Properties

Board

The reference to the arduino board

HandlesMode

The pin mode this handler supports.

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.

Logger

The class-specific logger instance

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Dispose(Boolean)

Disposes this instance

HasCommandError(FirmataCommandSequence, Byte[])

Callback function that returns whether the given reply indicates an error

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.

OnConnected()

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

OnErrorMessage(String, Exception)

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

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)

SendCommand(FirmataCommandSequence)

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

SendCommandAndWait(FirmataCommandSequence)

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

SendCommandAndWait(FirmataCommandSequence, TimeSpan)

Send a command to the device, expecting a reply.

SendCommandAndWait(FirmataCommandSequence, TimeSpan, CommandError)

Send a command to the device, expecting a reply.

SendCommandsAndWait(IList<FirmataCommandSequence>, TimeSpan, CommandError)

Send a command to the device, expecting a reply.

Applies to