|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object lejos.nxt.I2CSensor lejos.nxt.addon.RFIDSensor
public class RFIDSensor
Support for the Codatex RFID Sensor. See www.codatex,com for details. Notes this device requires delays between various commands for them to function correctly, it also enters a sleep mode and requires to be woken up. The methods in this class fall into two categories. Basic commands These pretty much match one to one with the device command set. They do not incorporate any delays, or wake up code. They can be used by user programs but if they are then appropriate delays etc. must be used. They are provided to allow more sophisticated user programs access to the low level device. High level commands These provide higher level access to the device and are often implemented via several i2c commands. They do include delays and wake up logic.
Field Summary |
---|
Fields inherited from interface lejos.nxt.SensorConstants |
---|
MODE_ANGLESTEP, MODE_BOOLEAN, MODE_CELSIUS, MODE_FARENHEIT, MODE_PCTFULLSCALE, MODE_PERIODCOUNTER, MODE_RAW, MODE_TRANSITIONCNT, TYPE_ANGLE, TYPE_CUSTOM, 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 |
Constructor Summary | |
---|---|
RFIDSensor(I2CPort port)
Create a class to provide access to the device. |
Method Summary | |
---|---|
protected String |
fetchString(int register)
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 NOTES: To obtain the serial number the device must be in boot loader mode. |
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. |
int |
startContinuousRead()
Start a single read from the device. |
void |
startFirmware()
Start the firmware on the RFID device. |
int |
startSingleRead()
Start a single read from the device. |
int |
stop()
Send a stop command to the device. |
void |
wakeUp()
The sensor will go into a power save mode after a short time. |
Methods inherited from class lejos.nxt.I2CSensor |
---|
getData, getPort, getProductID, getSensorType, getVersion, sendData, sendData, setAddress |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RFIDSensor(I2CPort port)
port
- The sensor port to use for this device.Method Detail |
---|
public void wakeUp()
protected String fetchString(int register)
fetchString
in class I2CSensor
register
- The register to read the string from.
public void startFirmware()
public void startBootLoader()
public byte[] getSerialNo()
public int getStatus()
public int startSingleRead()
public int startContinuousRead()
public int stop()
public byte[] readTransponder(boolean continuous)
continuous
- Should we use continuous mode
public long readTransponderAsLong(boolean continuous)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |