public class RFIDSensor extends I2CSensor
address, DEFAULT_I2C_ADDRESS, port, REG_PRODUCT_ID, REG_VENDOR_ID, REG_VERSION, retryCount
currentMode, modes
BLACK, BLANK_INDEX, BLUE, BLUE_INDEX, BROWN, GREEN, GREEN_INDEX, MAX_TYPE, MIN_TYPE, MODE_RAW, NXT_ADC_RES, RED, RED_INDEX, TYPE_ANGLE, TYPE_COLORBLUE, TYPE_COLORFULL, TYPE_COLORGREEN, TYPE_COLORNONE, TYPE_COLORRED, TYPE_CUSTOM, TYPE_HIGHSPEED, TYPE_HIGHSPEED_9V, TYPE_HISPEED, TYPE_LIGHT_ACTIVE, TYPE_LIGHT_INACTIVE, TYPE_LOWSPEED, TYPE_LOWSPEED_9V, TYPE_NO_SENSOR, TYPE_REFLECTION, TYPE_SOUND_DB, TYPE_SOUND_DBA, TYPE_SWITCH, TYPE_TEMPERATURE, WHITE, YELLOW
Constructor and Description |
---|
RFIDSensor(I2CPort port)
Create a class to provide access to the device.
|
RFIDSensor(Port port)
Create a class to provide access to the device.
|
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
fetchString(byte register,
int len)
We over-ride the default implementation to ensure that the device is
awake before we talk to it.
|
byte[] |
getSerialNo()
Obtain the serial number of the RFID Sensor.
|
int |
getStatus()
Read the status from the device.
|
byte[] |
readTransponder(boolean continuous)
Read a transponder id.
|
long |
readTransponderAsLong(boolean continuous) |
void |
startBootLoader()
Enter boot loader mode.
|
void |
startContinuousRead()
Start continually reading from the device.
|
void |
startFirmware()
Start the firmware on the RFID device.
|
void |
startSingleRead()
Start a single read from the device.
|
void |
stop()
Send a stop command to the device.
|
void |
wakeUp()
The sensor will go into a power save mode after a short time.
|
getAddress, getData, getData, getPort, getProductID, getRetryCount, getVendorID, getVersion, sendData, sendData, sendData, setAddress, setRetryCount
fetchSample, getAvailableModes, getCurrentMode, getMode, getMode, getModeCount, getName, sampleSize, setCurrentMode, setCurrentMode, setModes
close, releaseOnClose
public RFIDSensor(I2CPort port)
port
- The sensor port to use for this device.public RFIDSensor(Port port)
port
- The sensor port to use for this device.public void wakeUp()
protected java.lang.String fetchString(byte register, int len)
fetchString
in class I2CSensor
register
- The register to read the string from.len
- public void startFirmware()
public void startBootLoader()
public byte[] getSerialNo()
public int getStatus()
public void startSingleRead()
public void startContinuousRead()
public void stop()
public byte[] readTransponder(boolean continuous)
continuous
- Should we use continuous modepublic long readTransponderAsLong(boolean continuous)