public class FirmataAdapter extends Object implements FirmataProtocol, Runnable, Closeable
| Modifier and Type | Class and Description |
|---|---|
static class |
FirmataAdapter.FirmwareDetails |
static class |
FirmataAdapter.I2CResponse |
FirmataProtocol.PinCapability, FirmataProtocol.PinModeANALOG_IO_END, ANALOG_IO_START, ANALOG_MAPPING_QUERY, ANALOG_MAPPING_RESPONSE, CAPABILITY_QUERY, CAPABILITY_RESPONSE, DIGITAL_IO_END, DIGITAL_IO_START, END_SYSEX, EXTENDED_ANALOG, EXTENDED_ID, I2C_REPLY, I2C_REQUEST, PIN_STATE_QUERY, PIN_STATE_RESPONSE, PROTOCOL_VERSION, REPORT_ANALOG_PIN, REPORT_DIGITAL_PORT, REPORT_FIRMWARE, SAMPLING_INTERVAL, SET_DIGITAL_PIN_VALUE, SET_PIN_MODE, START_SYSEX, STRING_DATA, SYSEX_NON_REALTIME, SYSEX_REALTIME, SYSTEM_RESET| Constructor and Description |
|---|
FirmataAdapter(FirmataEventListener eventListener) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
protected void |
connect(InputStream input,
OutputStream output) |
void |
enableDigitalReporting(int gpio,
boolean enabled) |
List<List<FirmataProtocol.PinCapability>> |
getBoardCapabilities() |
boolean |
getDigitalValue(int gpio) |
FirmataAdapter.FirmwareDetails |
getFirmware() |
int |
getMax(int gpio,
FirmataProtocol.PinMode mode) |
FirmataProtocol.PinMode |
getPinMode(int gpio) |
com.diozero.firmata.FirmataAdapter.PinState |
getPinState(int gpio) |
com.diozero.firmata.FirmataAdapter.ProtocolVersion |
getProtocolVersion() |
int |
getValue(int gpio) |
FirmataAdapter.I2CResponse |
i2cRead(int slaveAddress,
boolean autoRestart,
boolean addressSize10Bit,
int length) |
FirmataAdapter.I2CResponse |
i2cReadData(int slaveAddress,
boolean autoRestart,
boolean addressSize10Bit,
int register,
int length) |
void |
i2cWrite(int slaveAddress,
boolean autoRestart,
boolean addressSize10Bit,
byte[] data) |
void |
i2cWriteData(int slaveAddress,
boolean autoRestart,
boolean addressSize10Bit,
int register,
byte[] data) |
void |
initialiseBoard() |
void |
run() |
void |
setDigitalValue(int gpio,
boolean value) |
void |
setDigitalValues(int port,
byte values) |
void |
setPinMode(int gpio,
FirmataProtocol.PinMode pinMode) |
void |
setSamplingInterval(int intervalMs) |
void |
setValue(int gpio,
int value) |
public FirmataAdapter(FirmataEventListener eventListener)
protected void connect(InputStream input, OutputStream output) throws IOException
IOExceptionpublic int getMax(int gpio,
FirmataProtocol.PinMode mode)
public void initialiseBoard()
throws IOException
IOExceptionpublic com.diozero.firmata.FirmataAdapter.ProtocolVersion getProtocolVersion()
throws IOException
IOExceptionpublic FirmataAdapter.FirmwareDetails getFirmware()
public List<List<FirmataProtocol.PinCapability>> getBoardCapabilities()
public com.diozero.firmata.FirmataAdapter.PinState getPinState(int gpio)
throws IOException
IOExceptionpublic void setSamplingInterval(int intervalMs)
throws IOException
IOExceptionpublic void enableDigitalReporting(int gpio,
boolean enabled)
throws IOException
IOExceptionpublic FirmataProtocol.PinMode getPinMode(int gpio)
public void setPinMode(int gpio,
FirmataProtocol.PinMode pinMode)
throws IOException
IOExceptionpublic void setDigitalValues(int port,
byte values)
throws IOException
IOExceptionpublic boolean getDigitalValue(int gpio)
public void setDigitalValue(int gpio,
boolean value)
throws IOException
IOExceptionpublic int getValue(int gpio)
public void setValue(int gpio,
int value)
throws IOException
IOExceptionpublic FirmataAdapter.I2CResponse i2cRead(int slaveAddress, boolean autoRestart, boolean addressSize10Bit, int length) throws IOException
IOExceptionpublic void i2cWrite(int slaveAddress,
boolean autoRestart,
boolean addressSize10Bit,
byte[] data)
throws IOException
IOExceptionpublic FirmataAdapter.I2CResponse i2cReadData(int slaveAddress, boolean autoRestart, boolean addressSize10Bit, int register, int length) throws IOException
IOExceptionpublic void i2cWriteData(int slaveAddress,
boolean autoRestart,
boolean addressSize10Bit,
int register,
byte[] data)
throws IOException
IOExceptionpublic void close()
close in interface Closeableclose in interface AutoCloseableCopyright © 2016–2018 mattjlewis. All rights reserved.