public class EV3DevDevice extends EV3DevSysfs
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
ADDRESS |
private boolean |
connected |
private java.lang.String |
DEVICE_ROOT_PATH |
protected java.io.File |
PATH_DEVICE |
Constructor and Description |
---|
EV3DevDevice(java.lang.String type,
java.lang.String portName)
Every device connected in a EV3 Brick with EV3Dev appears in /sys/class in a determinated category.
|
Modifier and Type | Method and Description |
---|---|
void |
connect(java.lang.String type,
java.lang.String portName)
This method matches a input with the internal position in EV3Dev.
|
int |
getIntegerAttribute(java.lang.String attribute)
Returns the value of an attribute supported for a Device
|
java.lang.String |
getStringAttribute(java.lang.String attribute)
Returns the value of an attribute supported for a Device
|
void |
setIntegerAttribute(java.lang.String attribute,
int value)
Set a value on an attribute
|
void |
setStringAttribute(java.lang.String attribute,
java.lang.String value)
Set a value on an attribute
|
getElements, readFloat, readInteger, readString, writeInteger, writeString
close, releaseOnClose
private final java.lang.String DEVICE_ROOT_PATH
private final java.lang.String ADDRESS
protected java.io.File PATH_DEVICE
private boolean connected
public EV3DevDevice(java.lang.String type, java.lang.String portName) throws DeviceException
type
- A valid type. Example: tacho-motor, lego-sensor, etc...portName
- The port where is connected the sensor or the actuator.DeviceException
public void connect(java.lang.String type, java.lang.String portName)
type
- portName
- public java.lang.String getStringAttribute(java.lang.String attribute)
attribute
- public int getIntegerAttribute(java.lang.String attribute)
attribute
- public void setStringAttribute(java.lang.String attribute, java.lang.String value)
attribute
- value
- public void setIntegerAttribute(java.lang.String attribute, int value)
attribute
- value
-