Skip to content

firmata::FirmataMarshaller

詳細情報

メンバー

FirmataMarshaller()

The class.

FirmataMarshaller::FirmataMarshaller()

begin()

void FirmataMarshaller::begin(Stream &s)

引数

  • Stream& s A reference to the transport object. This can be any type of transport that implements the interface. Some examples include Ethernet, WiFi and other UARTs on the board (Serial1, Serial2, etc).

end()

Closes the stream by setting its stream reference to

void FirmataMarshaller::end()

queryFirmwareVersion()

Query the target's firmware name and version

void FirmataMarshaller::queryFirmwareVersion(void) const

queryVersion()

Query the target's Firmata protocol version

void FirmataMarshaller::queryVersion(void) const

reportAnalogDisable()

void FirmataMarshaller::reportAnalogDisable(uint8_t pin) const

引数

  • uint8_t pin The analog pin for which to request the value (limited to pins 0 - 15).

reportAnalogEnable()

void FirmataMarshaller::reportAnalogEnable(uint8_t pin) const

引数

  • uint8_t pin The analog pin for which to request the value (limited to pins 0 - 15).

reportDigitalPortDisable()

void FirmataMarshaller::reportDigitalPortDisable(uint8_t portNumber) const

引数

  • uint8_t portNumber The port number for which to request the value. Note that this is not the same as a "port" on the physical microcontroller. Ports are defined in order per every 8 pins in ascending order of the Arduino digital pin numbering scheme. Port 0 = pins D0 - D7, port 1 = pins D8 - D15, etc.

reportDigitalPortEnable()

void FirmataMarshaller::reportDigitalPortEnable(uint8_t portNumber) const

引数

  • uint8_t portNumber The port number for which to request the value. Note that this is not the same as a "port" on the physical microcontroller. Ports are defined in order per every 8 pins in ascending order of the Arduino digital pin numbering scheme. Port 0 = pins D0 - D7, port 1 = pins D8 - D15, etc.

sendAnalog()

void FirmataMarshaller::sendAnalog(uint8_t pin, uint16_t value) const

引数

  • uint8_t pin The analog pin to which the value is sent.
  • uint16_t value The value of the analog pin (0 - 1024 for 10-bit analog, 0 - 4096 for 12-bit, etc).

sendAnalogMappingQuery()

Send an analog mapping query to the Firmata host application. The resulting sysex message will have an ANALOG_MAPPING_RESPONSE command byte, followed by a list of pins [0-n]; where each pin will specify its corresponding analog pin number or 0x7F (127) if not applicable.

void FirmataMarshaller::sendAnalogMappingQuery(void) const

sendCapabilityQuery()

Send a capability query to the Firmata host application. The resulting sysex message will have a CAPABILITY_RESPONSE command byte, followed by a list of byte tuples (mode and mode resolution) for each pin; where each pin list is terminated by 0x7F (127).

void FirmataMarshaller::sendCapabilityQuery(void) const

sendDigital()

void FirmataMarshaller::sendDigital(uint8_t pin, uint8_t value) const

引数

  • uint8_t pin The digital pin to send the value of.
  • uint8_t value The value of the pin.

sendDigitalPort()

void FirmataMarshaller::sendDigitalPort(uint8_t portNumber, uint16_t portData) const

引数

  • uint8_t portNumber The port number to send. Note that this is not the same as a "port" on the physical microcontroller. Ports are defined in order per every 8 pins in ascending order of the Arduino digital pin numbering scheme. Port 0 = pins D0 - D7, port 1 = pins D8 - D15, etc.
  • uint16_t portData The value of the port. The value of each pin in the port is represented by a bit.

sendFirmwareVersion()

void FirmataMarshaller::sendFirmwareVersion(uint8_t major, uint8_t minor, size_t bytec, uint8_t *bytev) const

引数

  • uint8_t major The major verison number
  • uint8_t minor The minor version number
  • size_t bytec The length of the firmware name
  • uint8_t * bytev The firmware name array

sendVersion()

void FirmataMarshaller::sendVersion(uint8_t major, uint8_t minor) const

引数

  • uint8_t major The major verison number
  • uint8_t minor The minor version number

sendPinMode()

void FirmataMarshaller::sendPinMode(uint8_t pin, uint8_t config) const

引数

  • uint8_t pin The pin to configure.
  • uint8_t config The configuration value for the specified pin.

sendPinStateQuery()

void FirmataMarshaller::sendPinStateQuery(uint8_t pin) const

引数

  • uint8_t pin The pin to query

sendString()

void FirmataMarshaller::sendString(const char *string) const

引数

  • constchar * string A pointer to the char string

sendSysex()

void FirmataMarshaller::sendSysex(uint8_t command, size_t bytec, uint8_t *bytev) const

引数

  • uint8_t command The sysex command byte.
  • size_t bytec The number of data bytes in the message (excludes start, command and end bytes).
  • uint8_t * bytev A pointer to the array of data bytes to send in the message.

setSamplingInterval()

void FirmataMarshaller::setSamplingInterval(uint16_t interval_ms) const

引数

  • uint16_t interval_ms The interval (in milliseconds) at which to sample

systemReset()

Perform a software reset on the target. For example, StandardFirmata.ino will initialize everything to a known state and reset the parsing buffer.

void FirmataMarshaller::systemReset(void) const