public class DeviceIdentifier extends Device implements EV3SensorConstants
Modifier and Type | Field and Description |
---|---|
protected static int |
ANALOG_ID_VAR |
protected ConfigurationPort |
configPort |
protected static java.util.List<java.util.AbstractMap.SimpleEntry<java.lang.Integer,java.lang.String>> |
EV3AnalogMap |
protected static long |
MIN_TIME |
protected long |
openTime |
protected Port |
port |
protected static long |
VALID_TIME |
ADC_REF, ADC_RES, CMD_AUTOMATIC, CMD_COL_AMB, CMD_COL_BLU, CMD_COL_COL, CMD_COL_GRN, CMD_COL_RED, CMD_CONNECTED, CMD_DISCONNECTED, CMD_FLOAT, CMD_NONE, CMD_PIN1, CMD_PIN5, CMD_SET, CONN_DAISYCHAIN, CONN_ERROR, CONN_INPUT_DUMB, CONN_INPUT_UART, CONN_NONE, CONN_NXT_COLOR, CONN_NXT_DUMB, CONN_NXT_IIC, CONN_OUTPUT_DUMB, CONN_OUTPUT_INTELLIGENT, CONN_OUTPUT_TACHO, CONN_UNKNOWN, IIC_DATA_LENGTH, MAX_DEVICE_DATALENGTH, MOTORS, PORTS, STATUS_BUSY, STATUS_FAIL, STATUS_OK, STATUS_STOP, TYPE_ERROR, TYPE_IIC_UNKNOWN, TYPE_MINITACHO, TYPE_NEWTACHO, TYPE_NONE, TYPE_NXT_COLOR, TYPE_NXT_IIC, TYPE_NXT_LIGHT, TYPE_NXT_SOUND, TYPE_NXT_TEST, TYPE_NXT_TOUCH, TYPE_TACHO, TYPE_TERMINAL, TYPE_THIRD_PARTY_END, TYPE_THIRD_PARTY_START, TYPE_UNKNOWN, UART_MAX_MODES
Constructor and Description |
---|
DeviceIdentifier(Port port)
Create an instance of the device identifier for a particular port
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the sensor.
|
java.lang.String |
getDeviceSignature(boolean full)
return the signature of the attached device.
|
int |
getDeviceType()
This method returns information on the sensor/motor that is attached to the
specified port.
|
protected java.lang.String |
getEV3DumbSignature()
Returns the signature for a dumb EV3 sensor
|
protected java.lang.String |
getI2CSignature(boolean full)
Returns the signature for a i2c sensor
|
protected java.lang.String |
getMotorSignature()
Returns the signature for a motor/output device
|
protected java.lang.String |
getNXTDumbSignature()
Returns the signature for a dumb NXT sensor
|
int |
getPortType()
Get the type classification for the port.
|
protected java.lang.String |
getUARTSignature()
Returns the signature for a UART sensor
|
protected void |
openConfigPort() |
protected void |
waitValid()
Wait until the identification data for this port is valid
|
releaseOnClose
protected static final int ANALOG_ID_VAR
protected static final long VALID_TIME
protected static final long MIN_TIME
protected long openTime
protected Port port
protected ConfigurationPort configPort
protected static java.util.List<java.util.AbstractMap.SimpleEntry<java.lang.Integer,java.lang.String>> EV3AnalogMap
public DeviceIdentifier(Port port)
port
- The port to operate withpublic void close()
Device
protected void openConfigPort()
protected void waitValid()
public int getPortType()
public int getDeviceType()
protected java.lang.String getNXTDumbSignature()
protected java.lang.String getI2CSignature(boolean full)
protected java.lang.String getEV3DumbSignature()
protected java.lang.String getUARTSignature()
protected java.lang.String getMotorSignature()
public java.lang.String getDeviceSignature(boolean full)
full
- true to return all available information, false for basic information