Package com.tinkerforge
Class BrickletNFC
- java.lang.Object
-
- com.tinkerforge.DeviceBase
-
- com.tinkerforge.Device
-
- com.tinkerforge.BrickletNFC
-
public class BrickletNFC extends Device
NFC tag read/write, NFC P2P and Card Emulation
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
BrickletNFC.CardemuGetState
static interface
BrickletNFC.CardemuStateChangedListener
This listener is called if the cardemu state of the NFC Bricklet changes.class
BrickletNFC.P2PGetState
class
BrickletNFC.P2PReadNDEFLowLevel
static interface
BrickletNFC.P2PStateChangedListener
This listener is called if the P2P state of the NFC Bricklet changes.class
BrickletNFC.ReaderGetState
class
BrickletNFC.ReaderGetTagID
class
BrickletNFC.ReaderGetTagIDLowLevel
class
BrickletNFC.ReaderReadNDEFLowLevel
class
BrickletNFC.ReaderReadPageLowLevel
static interface
BrickletNFC.ReaderStateChangedListener
This listener is called if the reader state of the NFC Bricklet changes.class
BrickletNFC.SimpleGetTagID
class
BrickletNFC.SimpleGetTagIDLowLevel
class
BrickletNFC.SPITFPErrorCount
-
Nested classes/interfaces inherited from class com.tinkerforge.Device
Device.Identity
-
-
Field Summary
-
Constructor Summary
Constructors Constructor Description BrickletNFC(java.lang.String uid, IPConnection ipcon)
Creates an object with the unique device ID \c uid.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addCardemuStateChangedListener(BrickletNFC.CardemuStateChangedListener listener)
Adds a CardemuStateChanged listener.void
addP2PStateChangedListener(BrickletNFC.P2PStateChangedListener listener)
Adds a P2PStateChanged listener.void
addReaderStateChangedListener(BrickletNFC.ReaderStateChangedListener listener)
Adds a ReaderStateChanged listener.BrickletNFC.CardemuGetState
cardemuGetState()
Returns the current cardemu state of the NFC Bricklet.void
cardemuStartDiscovery()
Starts the discovery process.void
cardemuStartTransfer(int transfer)
You can start the transfer of a NDEF message if the cardemu state is *CardemuDiscoveryReady*.void
cardemuWriteNDEF(int[] ndef)
Writes the NDEF message that is to be transferred to the NFC peer.void
cardemuWriteNDEFLowLevel(int ndefLength, int ndefChunkOffset, int[] ndefChunkData)
Writes the NDEF message that is to be transferred to the NFC peer.int
getBootloaderMode()
Returns the current bootloader mode, seesetBootloaderMode(int)
.int
getChipTemperature()
Returns the temperature as measured inside the microcontroller.int
getDetectionLEDConfig()
Returns the configuration as set bysetDetectionLEDConfig(int)
Device.Identity
getIdentity()
Returns the UID, the UID where the Bricklet is connected to, the position, the hardware and firmware version as well as the device identifier.int
getMaximumTimeout()
Returns the timeout as set bysetMaximumTimeout(int)
..int
getMode()
Returns the mode as set bysetMode(int)
.BrickletNFC.SPITFPErrorCount
getSPITFPErrorCount()
Returns the error count for the communication between Brick and Bricklet.int
getStatusLEDConfig()
Returns the configuration as set bysetStatusLEDConfig(int)
BrickletNFC.P2PGetState
p2pGetState()
Returns the current P2P state of the NFC Bricklet.int[]
p2pReadNDEF()
Returns the NDEF message that was written by a NFC peer in NFC P2P mode.BrickletNFC.P2PReadNDEFLowLevel
p2pReadNDEFLowLevel()
Returns the NDEF message that was written by a NFC peer in NFC P2P mode.void
p2pStartDiscovery()
Starts the discovery process.void
p2pStartTransfer(int transfer)
You can start the transfer of a NDEF message if the P2P state is *P2PDiscoveryReady*.void
p2pWriteNDEF(int[] ndef)
Writes the NDEF message that is to be transferred to the NFC peer.void
p2pWriteNDEFLowLevel(int ndefLength, int ndefChunkOffset, int[] ndefChunkData)
Writes the NDEF message that is to be transferred to the NFC peer.void
readerAuthenticateMifareClassicPage(int page, int keyNumber, int[] key)
Mifare Classic tags use authentication.BrickletNFC.ReaderGetState
readerGetState()
Returns the current reader state of the NFC Bricklet.BrickletNFC.ReaderGetTagID
readerGetTagID()
Returns the tag type and the tag ID.BrickletNFC.ReaderGetTagIDLowLevel
readerGetTagIDLowLevel()
Returns the tag type and the tag ID.int[]
readerReadNDEF()
Returns the NDEF data from an internal buffer.BrickletNFC.ReaderReadNDEFLowLevel
readerReadNDEFLowLevel()
Returns the NDEF data from an internal buffer.int[]
readerReadPage()
Returns the page data from an internal buffer.BrickletNFC.ReaderReadPageLowLevel
readerReadPageLowLevel()
Returns the page data from an internal buffer.void
readerRequestNDEF()
Reads NDEF formated data from a tag.void
readerRequestPage(int page, int length)
Reads a maximum of 8192 bytes starting from the given page and stores them into a buffer.void
readerRequestTagID()
After you callreaderRequestTagID()
the NFC Bricklet will try to read the tag ID from the tag.void
readerWriteNDEF(int[] ndef)
Writes NDEF formated data.void
readerWriteNDEFLowLevel(int ndefLength, int ndefChunkOffset, int[] ndefChunkData)
Writes NDEF formated data.void
readerWritePage(int page, int[] data)
Writes a maximum of 8192 bytes starting from the given page.void
readerWritePageLowLevel(int page, int dataLength, int dataChunkOffset, int[] dataChunkData)
Writes a maximum of 8192 bytes starting from the given page.long
readUID()
Returns the current UID as an integer.void
removeCardemuStateChangedListener(BrickletNFC.CardemuStateChangedListener listener)
Removes a CardemuStateChanged listener.void
removeP2PStateChangedListener(BrickletNFC.P2PStateChangedListener listener)
Removes a P2PStateChanged listener.void
removeReaderStateChangedListener(BrickletNFC.ReaderStateChangedListener listener)
Removes a ReaderStateChanged listener.void
reset()
Calling this function will reset the Bricklet.int
setBootloaderMode(int mode)
Sets the bootloader mode and returns the status after the requested mode change was instigated.void
setDetectionLEDConfig(int config)
Sets the detection LED configuration.void
setMaximumTimeout(int timeout)
Sets the maximum timeout.void
setMode(int mode)
Sets the mode.void
setStatusLEDConfig(int config)
Sets the status LED configuration.void
setWriteFirmwarePointer(long pointer)
Sets the firmware pointer forwriteFirmware(int[])
.BrickletNFC.SimpleGetTagID
simpleGetTagID(int index)
..BrickletNFC.SimpleGetTagIDLowLevel
simpleGetTagIDLowLevel(int index)
..int
writeFirmware(int[] data)
Writes 64 Bytes of firmware at the position as written bysetWriteFirmwarePointer(long)
before.void
writeUID(long uid)
Writes a new UID into flash.-
Methods inherited from class com.tinkerforge.DeviceBase
getAPIVersion, getResponseExpected, setResponseExpected, setResponseExpectedAll
-
-
-
-
Field Detail
-
DEVICE_IDENTIFIER
public static final int DEVICE_IDENTIFIER
- See Also:
- Constant Field Values
-
DEVICE_DISPLAY_NAME
public static final java.lang.String DEVICE_DISPLAY_NAME
- See Also:
- Constant Field Values
-
FUNCTION_SET_MODE
public static final byte FUNCTION_SET_MODE
- See Also:
- Constant Field Values
-
FUNCTION_GET_MODE
public static final byte FUNCTION_GET_MODE
- See Also:
- Constant Field Values
-
FUNCTION_READER_REQUEST_TAG_ID
public static final byte FUNCTION_READER_REQUEST_TAG_ID
- See Also:
- Constant Field Values
-
FUNCTION_READER_GET_TAG_ID_LOW_LEVEL
public static final byte FUNCTION_READER_GET_TAG_ID_LOW_LEVEL
- See Also:
- Constant Field Values
-
FUNCTION_READER_GET_STATE
public static final byte FUNCTION_READER_GET_STATE
- See Also:
- Constant Field Values
-
FUNCTION_READER_WRITE_NDEF_LOW_LEVEL
public static final byte FUNCTION_READER_WRITE_NDEF_LOW_LEVEL
- See Also:
- Constant Field Values
-
FUNCTION_READER_REQUEST_NDEF
public static final byte FUNCTION_READER_REQUEST_NDEF
- See Also:
- Constant Field Values
-
FUNCTION_READER_READ_NDEF_LOW_LEVEL
public static final byte FUNCTION_READER_READ_NDEF_LOW_LEVEL
- See Also:
- Constant Field Values
-
FUNCTION_READER_AUTHENTICATE_MIFARE_CLASSIC_PAGE
public static final byte FUNCTION_READER_AUTHENTICATE_MIFARE_CLASSIC_PAGE
- See Also:
- Constant Field Values
-
FUNCTION_READER_WRITE_PAGE_LOW_LEVEL
public static final byte FUNCTION_READER_WRITE_PAGE_LOW_LEVEL
- See Also:
- Constant Field Values
-
FUNCTION_READER_REQUEST_PAGE
public static final byte FUNCTION_READER_REQUEST_PAGE
- See Also:
- Constant Field Values
-
FUNCTION_READER_READ_PAGE_LOW_LEVEL
public static final byte FUNCTION_READER_READ_PAGE_LOW_LEVEL
- See Also:
- Constant Field Values
-
FUNCTION_CARDEMU_GET_STATE
public static final byte FUNCTION_CARDEMU_GET_STATE
- See Also:
- Constant Field Values
-
FUNCTION_CARDEMU_START_DISCOVERY
public static final byte FUNCTION_CARDEMU_START_DISCOVERY
- See Also:
- Constant Field Values
-
FUNCTION_CARDEMU_WRITE_NDEF_LOW_LEVEL
public static final byte FUNCTION_CARDEMU_WRITE_NDEF_LOW_LEVEL
- See Also:
- Constant Field Values
-
FUNCTION_CARDEMU_START_TRANSFER
public static final byte FUNCTION_CARDEMU_START_TRANSFER
- See Also:
- Constant Field Values
-
FUNCTION_P2P_GET_STATE
public static final byte FUNCTION_P2P_GET_STATE
- See Also:
- Constant Field Values
-
FUNCTION_P2P_START_DISCOVERY
public static final byte FUNCTION_P2P_START_DISCOVERY
- See Also:
- Constant Field Values
-
FUNCTION_P2P_WRITE_NDEF_LOW_LEVEL
public static final byte FUNCTION_P2P_WRITE_NDEF_LOW_LEVEL
- See Also:
- Constant Field Values
-
FUNCTION_P2P_START_TRANSFER
public static final byte FUNCTION_P2P_START_TRANSFER
- See Also:
- Constant Field Values
-
FUNCTION_P2P_READ_NDEF_LOW_LEVEL
public static final byte FUNCTION_P2P_READ_NDEF_LOW_LEVEL
- See Also:
- Constant Field Values
-
FUNCTION_SET_DETECTION_LED_CONFIG
public static final byte FUNCTION_SET_DETECTION_LED_CONFIG
- See Also:
- Constant Field Values
-
FUNCTION_GET_DETECTION_LED_CONFIG
public static final byte FUNCTION_GET_DETECTION_LED_CONFIG
- See Also:
- Constant Field Values
-
FUNCTION_SET_MAXIMUM_TIMEOUT
public static final byte FUNCTION_SET_MAXIMUM_TIMEOUT
- See Also:
- Constant Field Values
-
FUNCTION_GET_MAXIMUM_TIMEOUT
public static final byte FUNCTION_GET_MAXIMUM_TIMEOUT
- See Also:
- Constant Field Values
-
FUNCTION_SIMPLE_GET_TAG_ID_LOW_LEVEL
public static final byte FUNCTION_SIMPLE_GET_TAG_ID_LOW_LEVEL
- See Also:
- Constant Field Values
-
FUNCTION_GET_SPITFP_ERROR_COUNT
public static final byte FUNCTION_GET_SPITFP_ERROR_COUNT
- See Also:
- Constant Field Values
-
FUNCTION_SET_BOOTLOADER_MODE
public static final byte FUNCTION_SET_BOOTLOADER_MODE
- See Also:
- Constant Field Values
-
FUNCTION_GET_BOOTLOADER_MODE
public static final byte FUNCTION_GET_BOOTLOADER_MODE
- See Also:
- Constant Field Values
-
FUNCTION_SET_WRITE_FIRMWARE_POINTER
public static final byte FUNCTION_SET_WRITE_FIRMWARE_POINTER
- See Also:
- Constant Field Values
-
FUNCTION_WRITE_FIRMWARE
public static final byte FUNCTION_WRITE_FIRMWARE
- See Also:
- Constant Field Values
-
FUNCTION_SET_STATUS_LED_CONFIG
public static final byte FUNCTION_SET_STATUS_LED_CONFIG
- See Also:
- Constant Field Values
-
FUNCTION_GET_STATUS_LED_CONFIG
public static final byte FUNCTION_GET_STATUS_LED_CONFIG
- See Also:
- Constant Field Values
-
FUNCTION_GET_CHIP_TEMPERATURE
public static final byte FUNCTION_GET_CHIP_TEMPERATURE
- See Also:
- Constant Field Values
-
FUNCTION_RESET
public static final byte FUNCTION_RESET
- See Also:
- Constant Field Values
-
FUNCTION_WRITE_UID
public static final byte FUNCTION_WRITE_UID
- See Also:
- Constant Field Values
-
FUNCTION_READ_UID
public static final byte FUNCTION_READ_UID
- See Also:
- Constant Field Values
-
FUNCTION_GET_IDENTITY
public static final byte FUNCTION_GET_IDENTITY
- See Also:
- Constant Field Values
-
MODE_OFF
public static final int MODE_OFF
- See Also:
- Constant Field Values
-
MODE_CARDEMU
public static final int MODE_CARDEMU
- See Also:
- Constant Field Values
-
MODE_P2P
public static final int MODE_P2P
- See Also:
- Constant Field Values
-
MODE_READER
public static final int MODE_READER
- See Also:
- Constant Field Values
-
MODE_SIMPLE
public static final int MODE_SIMPLE
- See Also:
- Constant Field Values
-
TAG_TYPE_MIFARE_CLASSIC
public static final int TAG_TYPE_MIFARE_CLASSIC
- See Also:
- Constant Field Values
-
TAG_TYPE_TYPE1
public static final int TAG_TYPE_TYPE1
- See Also:
- Constant Field Values
-
TAG_TYPE_TYPE2
public static final int TAG_TYPE_TYPE2
- See Also:
- Constant Field Values
-
TAG_TYPE_TYPE3
public static final int TAG_TYPE_TYPE3
- See Also:
- Constant Field Values
-
TAG_TYPE_TYPE4
public static final int TAG_TYPE_TYPE4
- See Also:
- Constant Field Values
-
READER_STATE_INITIALIZATION
public static final int READER_STATE_INITIALIZATION
- See Also:
- Constant Field Values
-
READER_STATE_IDLE
public static final int READER_STATE_IDLE
- See Also:
- Constant Field Values
-
READER_STATE_ERROR
public static final int READER_STATE_ERROR
- See Also:
- Constant Field Values
-
READER_STATE_REQUEST_TAG_ID
public static final int READER_STATE_REQUEST_TAG_ID
- See Also:
- Constant Field Values
-
READER_STATE_REQUEST_TAG_ID_READY
public static final int READER_STATE_REQUEST_TAG_ID_READY
- See Also:
- Constant Field Values
-
READER_STATE_REQUEST_TAG_ID_ERROR
public static final int READER_STATE_REQUEST_TAG_ID_ERROR
- See Also:
- Constant Field Values
-
READER_STATE_AUTHENTICATE_MIFARE_CLASSIC_PAGE
public static final int READER_STATE_AUTHENTICATE_MIFARE_CLASSIC_PAGE
- See Also:
- Constant Field Values
-
READER_STATE_AUTHENTICATE_MIFARE_CLASSIC_PAGE_READY
public static final int READER_STATE_AUTHENTICATE_MIFARE_CLASSIC_PAGE_READY
- See Also:
- Constant Field Values
-
READER_STATE_AUTHENTICATE_MIFARE_CLASSIC_PAGE_ERROR
public static final int READER_STATE_AUTHENTICATE_MIFARE_CLASSIC_PAGE_ERROR
- See Also:
- Constant Field Values
-
READER_STATE_WRITE_PAGE
public static final int READER_STATE_WRITE_PAGE
- See Also:
- Constant Field Values
-
READER_STATE_WRITE_PAGE_READY
public static final int READER_STATE_WRITE_PAGE_READY
- See Also:
- Constant Field Values
-
READER_STATE_WRITE_PAGE_ERROR
public static final int READER_STATE_WRITE_PAGE_ERROR
- See Also:
- Constant Field Values
-
READER_STATE_REQUEST_PAGE
public static final int READER_STATE_REQUEST_PAGE
- See Also:
- Constant Field Values
-
READER_STATE_REQUEST_PAGE_READY
public static final int READER_STATE_REQUEST_PAGE_READY
- See Also:
- Constant Field Values
-
READER_STATE_REQUEST_PAGE_ERROR
public static final int READER_STATE_REQUEST_PAGE_ERROR
- See Also:
- Constant Field Values
-
READER_STATE_WRITE_NDEF
public static final int READER_STATE_WRITE_NDEF
- See Also:
- Constant Field Values
-
READER_STATE_WRITE_NDEF_READY
public static final int READER_STATE_WRITE_NDEF_READY
- See Also:
- Constant Field Values
-
READER_STATE_WRITE_NDEF_ERROR
public static final int READER_STATE_WRITE_NDEF_ERROR
- See Also:
- Constant Field Values
-
READER_STATE_REQUEST_NDEF
public static final int READER_STATE_REQUEST_NDEF
- See Also:
- Constant Field Values
-
READER_STATE_REQUEST_NDEF_READY
public static final int READER_STATE_REQUEST_NDEF_READY
- See Also:
- Constant Field Values
-
READER_STATE_REQUEST_NDEF_ERROR
public static final int READER_STATE_REQUEST_NDEF_ERROR
- See Also:
- Constant Field Values
-
KEY_A
public static final int KEY_A
- See Also:
- Constant Field Values
-
KEY_B
public static final int KEY_B
- See Also:
- Constant Field Values
-
READER_WRITE_TYPE4_CAPABILITY_CONTAINER
public static final int READER_WRITE_TYPE4_CAPABILITY_CONTAINER
- See Also:
- Constant Field Values
-
READER_WRITE_TYPE4_NDEF
public static final int READER_WRITE_TYPE4_NDEF
- See Also:
- Constant Field Values
-
READER_REQUEST_TYPE4_CAPABILITY_CONTAINER
public static final int READER_REQUEST_TYPE4_CAPABILITY_CONTAINER
- See Also:
- Constant Field Values
-
READER_REQUEST_TYPE4_NDEF
public static final int READER_REQUEST_TYPE4_NDEF
- See Also:
- Constant Field Values
-
CARDEMU_STATE_INITIALIZATION
public static final int CARDEMU_STATE_INITIALIZATION
- See Also:
- Constant Field Values
-
CARDEMU_STATE_IDLE
public static final int CARDEMU_STATE_IDLE
- See Also:
- Constant Field Values
-
CARDEMU_STATE_ERROR
public static final int CARDEMU_STATE_ERROR
- See Also:
- Constant Field Values
-
CARDEMU_STATE_DISCOVER
public static final int CARDEMU_STATE_DISCOVER
- See Also:
- Constant Field Values
-
CARDEMU_STATE_DISCOVER_READY
public static final int CARDEMU_STATE_DISCOVER_READY
- See Also:
- Constant Field Values
-
CARDEMU_STATE_DISCOVER_ERROR
public static final int CARDEMU_STATE_DISCOVER_ERROR
- See Also:
- Constant Field Values
-
CARDEMU_STATE_TRANSFER_NDEF
public static final int CARDEMU_STATE_TRANSFER_NDEF
- See Also:
- Constant Field Values
-
CARDEMU_STATE_TRANSFER_NDEF_READY
public static final int CARDEMU_STATE_TRANSFER_NDEF_READY
- See Also:
- Constant Field Values
-
CARDEMU_STATE_TRANSFER_NDEF_ERROR
public static final int CARDEMU_STATE_TRANSFER_NDEF_ERROR
- See Also:
- Constant Field Values
-
CARDEMU_TRANSFER_ABORT
public static final int CARDEMU_TRANSFER_ABORT
- See Also:
- Constant Field Values
-
CARDEMU_TRANSFER_WRITE
public static final int CARDEMU_TRANSFER_WRITE
- See Also:
- Constant Field Values
-
P2P_STATE_INITIALIZATION
public static final int P2P_STATE_INITIALIZATION
- See Also:
- Constant Field Values
-
P2P_STATE_IDLE
public static final int P2P_STATE_IDLE
- See Also:
- Constant Field Values
-
P2P_STATE_ERROR
public static final int P2P_STATE_ERROR
- See Also:
- Constant Field Values
-
P2P_STATE_DISCOVER
public static final int P2P_STATE_DISCOVER
- See Also:
- Constant Field Values
-
P2P_STATE_DISCOVER_READY
public static final int P2P_STATE_DISCOVER_READY
- See Also:
- Constant Field Values
-
P2P_STATE_DISCOVER_ERROR
public static final int P2P_STATE_DISCOVER_ERROR
- See Also:
- Constant Field Values
-
P2P_STATE_TRANSFER_NDEF
public static final int P2P_STATE_TRANSFER_NDEF
- See Also:
- Constant Field Values
-
P2P_STATE_TRANSFER_NDEF_READY
public static final int P2P_STATE_TRANSFER_NDEF_READY
- See Also:
- Constant Field Values
-
P2P_STATE_TRANSFER_NDEF_ERROR
public static final int P2P_STATE_TRANSFER_NDEF_ERROR
- See Also:
- Constant Field Values
-
P2P_TRANSFER_ABORT
public static final int P2P_TRANSFER_ABORT
- See Also:
- Constant Field Values
-
P2P_TRANSFER_WRITE
public static final int P2P_TRANSFER_WRITE
- See Also:
- Constant Field Values
-
P2P_TRANSFER_READ
public static final int P2P_TRANSFER_READ
- See Also:
- Constant Field Values
-
DETECTION_LED_CONFIG_OFF
public static final int DETECTION_LED_CONFIG_OFF
- See Also:
- Constant Field Values
-
DETECTION_LED_CONFIG_ON
public static final int DETECTION_LED_CONFIG_ON
- See Also:
- Constant Field Values
-
DETECTION_LED_CONFIG_SHOW_HEARTBEAT
public static final int DETECTION_LED_CONFIG_SHOW_HEARTBEAT
- See Also:
- Constant Field Values
-
DETECTION_LED_CONFIG_SHOW_DETECTION
public static final int DETECTION_LED_CONFIG_SHOW_DETECTION
- See Also:
- Constant Field Values
-
BOOTLOADER_MODE_BOOTLOADER
public static final int BOOTLOADER_MODE_BOOTLOADER
- See Also:
- Constant Field Values
-
BOOTLOADER_MODE_FIRMWARE
public static final int BOOTLOADER_MODE_FIRMWARE
- See Also:
- Constant Field Values
-
BOOTLOADER_MODE_BOOTLOADER_WAIT_FOR_REBOOT
public static final int BOOTLOADER_MODE_BOOTLOADER_WAIT_FOR_REBOOT
- See Also:
- Constant Field Values
-
BOOTLOADER_MODE_FIRMWARE_WAIT_FOR_REBOOT
public static final int BOOTLOADER_MODE_FIRMWARE_WAIT_FOR_REBOOT
- See Also:
- Constant Field Values
-
BOOTLOADER_MODE_FIRMWARE_WAIT_FOR_ERASE_AND_REBOOT
public static final int BOOTLOADER_MODE_FIRMWARE_WAIT_FOR_ERASE_AND_REBOOT
- See Also:
- Constant Field Values
-
BOOTLOADER_STATUS_OK
public static final int BOOTLOADER_STATUS_OK
- See Also:
- Constant Field Values
-
BOOTLOADER_STATUS_INVALID_MODE
public static final int BOOTLOADER_STATUS_INVALID_MODE
- See Also:
- Constant Field Values
-
BOOTLOADER_STATUS_NO_CHANGE
public static final int BOOTLOADER_STATUS_NO_CHANGE
- See Also:
- Constant Field Values
-
BOOTLOADER_STATUS_ENTRY_FUNCTION_NOT_PRESENT
public static final int BOOTLOADER_STATUS_ENTRY_FUNCTION_NOT_PRESENT
- See Also:
- Constant Field Values
-
BOOTLOADER_STATUS_DEVICE_IDENTIFIER_INCORRECT
public static final int BOOTLOADER_STATUS_DEVICE_IDENTIFIER_INCORRECT
- See Also:
- Constant Field Values
-
BOOTLOADER_STATUS_CRC_MISMATCH
public static final int BOOTLOADER_STATUS_CRC_MISMATCH
- See Also:
- Constant Field Values
-
STATUS_LED_CONFIG_OFF
public static final int STATUS_LED_CONFIG_OFF
- See Also:
- Constant Field Values
-
STATUS_LED_CONFIG_ON
public static final int STATUS_LED_CONFIG_ON
- See Also:
- Constant Field Values
-
STATUS_LED_CONFIG_SHOW_HEARTBEAT
public static final int STATUS_LED_CONFIG_SHOW_HEARTBEAT
- See Also:
- Constant Field Values
-
STATUS_LED_CONFIG_SHOW_STATUS
public static final int STATUS_LED_CONFIG_SHOW_STATUS
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
BrickletNFC
public BrickletNFC(java.lang.String uid, IPConnection ipcon)
Creates an object with the unique device ID \c uid. and adds it to the IP Connection \c ipcon.
-
-
Method Detail
-
setMode
public void setMode(int mode) throws TinkerforgeException
Sets the mode. The NFC Bricklet supports four modes: * Off * Card Emulation (Cardemu): Emulates a tag for other readers * Peer to Peer (P2P): Exchange data with other readers * Reader: Reads and writes tags * Simple: Automatically reads tag IDs If you change a mode, the Bricklet will reconfigure the hardware for this mode. Therefore, you can only use functions corresponding to the current mode. For example, in Reader mode you can only use Reader functions.- Throws:
TinkerforgeException
-
getMode
public int getMode() throws TinkerforgeException
Returns the mode as set bysetMode(int)
.- Throws:
TinkerforgeException
-
readerRequestTagID
public void readerRequestTagID() throws TinkerforgeException
After you callreaderRequestTagID()
the NFC Bricklet will try to read the tag ID from the tag. After this process is done the state will change. You can either register theBrickletNFC.ReaderStateChangedListener
listener or you can pollreaderGetState()
to find out about the state change. If the state changes to *ReaderRequestTagIDError* it means that either there was no tag present or that the tag has an incompatible type. If the state changes to *ReaderRequestTagIDReady* it means that a compatible tag was found and that the tag ID has been saved. You can now read out the tag ID by callingreaderGetTagID()
. If two tags are in the proximity of the NFC Bricklet, this function will cycle through the tags. To select a specific tag you have to callreaderRequestTagID()
until the correct tag ID is found. In case of any *ReaderError* state the selection is lost and you have to start again by callingreaderRequestTagID()
.- Throws:
TinkerforgeException
-
readerGetTagIDLowLevel
public BrickletNFC.ReaderGetTagIDLowLevel readerGetTagIDLowLevel() throws TinkerforgeException
Returns the tag type and the tag ID. This function can only be called if the NFC Bricklet is currently in one of the *ReaderReady* states. The returned tag ID is the tag ID that was saved through the last call ofreaderRequestTagID()
. To get the tag ID of a tag the approach is as follows: 1. CallreaderRequestTagID()
2. Wait for state to change to *ReaderRequestTagIDReady* (seereaderGetState()
orBrickletNFC.ReaderStateChangedListener
listener) 3. CallreaderGetTagID()
- Throws:
TinkerforgeException
-
readerGetState
public BrickletNFC.ReaderGetState readerGetState() throws TinkerforgeException
Returns the current reader state of the NFC Bricklet. On startup the Bricklet will be in the *ReaderInitialization* state. The initialization will only take about 20ms. After that it changes to *ReaderIdle*. The Bricklet is also reinitialized if the mode is changed, seesetMode(int)
. The functions of this Bricklet can be called in the *ReaderIdle* state and all of the *ReaderReady* and *ReaderError* states. Example: If you callreaderRequestPage(int, int)
, the state will change to *ReaderRequestPage* until the reading of the page is finished. Then it will change to either *ReaderRequestPageReady* if it worked or to *ReaderRequestPageError* if it didn't. If the request worked you can get the page by callingreaderReadPage()
. The same approach is used analogously for the other API functions.- Throws:
TinkerforgeException
-
readerWriteNDEFLowLevel
public void readerWriteNDEFLowLevel(int ndefLength, int ndefChunkOffset, int[] ndefChunkData) throws TinkerforgeException
Writes NDEF formated data. This function currently supports NFC Forum Type 2 and 4. The general approach for writing a NDEF message is as follows: 1. CallreaderRequestTagID()
2. Wait for state to change to *ReaderRequestTagIDReady* (seereaderGetState()
orBrickletNFC.ReaderStateChangedListener
listener) 3. If looking for a specific tag then callreaderGetTagID()
and check if the expected tag was found, if it was not found got back to step 1 4. CallreaderWriteNDEF(int[])
with the NDEF message that you want to write 5. Wait for state to change to *ReaderWriteNDEFReady* (seereaderGetState()
orBrickletNFC.ReaderStateChangedListener
listener)- Throws:
TinkerforgeException
-
readerRequestNDEF
public void readerRequestNDEF() throws TinkerforgeException
Reads NDEF formated data from a tag. This function currently supports NFC Forum Type 1, 2, 3 and 4. The general approach for reading a NDEF message is as follows: 1. CallreaderRequestTagID()
2. Wait for state to change to *RequestTagIDReady* (seereaderGetState()
orBrickletNFC.ReaderStateChangedListener
listener) 3. If looking for a specific tag then callreaderGetTagID()
and check if the expected tag was found, if it was not found got back to step 1 4. CallreaderRequestNDEF()
5. Wait for state to change to *ReaderRequestNDEFReady* (seereaderGetState()
orBrickletNFC.ReaderStateChangedListener
listener) 6. CallreaderReadNDEF()
to retrieve the NDEF message from the buffer- Throws:
TinkerforgeException
-
readerReadNDEFLowLevel
public BrickletNFC.ReaderReadNDEFLowLevel readerReadNDEFLowLevel() throws TinkerforgeException
Returns the NDEF data from an internal buffer. To fill the buffer with a NDEF message you have to callreaderRequestNDEF()
beforehand.- Throws:
TinkerforgeException
-
readerAuthenticateMifareClassicPage
public void readerAuthenticateMifareClassicPage(int page, int keyNumber, int[] key) throws TinkerforgeException
Mifare Classic tags use authentication. If you want to read from or write to a Mifare Classic page you have to authenticate it beforehand. Each page can be authenticated with two keys: A (``key_number`` = 0) and B (``key_number`` = 1). A new Mifare Classic tag that has not yet been written to can be accessed with key A and the default key ``[0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF]``. The approach to read or write a Mifare Classic page is as follows: 1. CallreaderRequestTagID()
2. Wait for state to change to *ReaderRequestTagIDReady* (seereaderGetState()
orBrickletNFC.ReaderStateChangedListener
listener) 3. If looking for a specific tag then callreaderGetTagID()
and check if the expected tag was found, if it was not found got back to step 1 4. CallreaderAuthenticateMifareClassicPage(int, int, int[])
with page and key for the page 5. Wait for state to change to *ReaderAuthenticatingMifareClassicPageReady* (seereaderGetState()
orBrickletNFC.ReaderStateChangedListener
listener) 6. CallreaderRequestPage(int, int)
orreaderWritePage(int, int[])
to read/write page The authentication will always work for one whole sector (4 pages).- Throws:
TinkerforgeException
-
readerWritePageLowLevel
public void readerWritePageLowLevel(int page, int dataLength, int dataChunkOffset, int[] dataChunkData) throws TinkerforgeException
Writes a maximum of 8192 bytes starting from the given page. How many pages are written depends on the tag type. The page sizes are as follows: * Mifare Classic page size: 16 byte * NFC Forum Type 1 page size: 8 byte * NFC Forum Type 2 page size: 4 byte * NFC Forum Type 3 page size: 16 byte * NFC Forum Type 4: No pages, page = file selection (CC or NDEF, see below) The general approach for writing to a tag is as follows: 1. CallreaderRequestTagID()
2. Wait for state to change to *ReaderRequestTagIDReady* (seereaderGetState()
orBrickletNFC.ReaderStateChangedListener
listener) 3. If looking for a specific tag then callreaderGetTagID()
and check if the expected tag was found, if it was not found got back to step 1 4. CallreaderWritePage(int, int[])
with page number and data 5. Wait for state to change to *ReaderWritePageReady* (seereaderGetState()
orBrickletNFC.ReaderStateChangedListener
listener) If you use a Mifare Classic tag you have to authenticate a page before you can write to it. SeereaderAuthenticateMifareClassicPage(int, int, int[])
. NFC Forum Type 4 tags are not organized into pages but different files. We currently support two files: Capability Container file (CC) and NDEF file. Choose CC by setting page to 3 or NDEF by setting page to 4.- Throws:
TinkerforgeException
-
readerRequestPage
public void readerRequestPage(int page, int length) throws TinkerforgeException
Reads a maximum of 8192 bytes starting from the given page and stores them into a buffer. The buffer can then be read out withreaderReadPage()
. How many pages are read depends on the tag type. The page sizes are as follows: * Mifare Classic page size: 16 byte * NFC Forum Type 1 page size: 8 byte * NFC Forum Type 2 page size: 4 byte * NFC Forum Type 3 page size: 16 byte * NFC Forum Type 4: No pages, page = file selection (CC or NDEF, see below) The general approach for reading a tag is as follows: 1. CallreaderRequestTagID()
2. Wait for state to change to *RequestTagIDReady* (seereaderGetState()
orBrickletNFC.ReaderStateChangedListener
listener) 3. If looking for a specific tag then callreaderGetTagID()
and check if the expected tag was found, if it was not found got back to step 1 4. CallreaderRequestPage(int, int)
with page number 5. Wait for state to change to *ReaderRequestPageReady* (seereaderGetState()
orBrickletNFC.ReaderStateChangedListener
listener) 6. CallreaderReadPage()
to retrieve the page from the buffer If you use a Mifare Classic tag you have to authenticate a page before you can read it. SeereaderAuthenticateMifareClassicPage(int, int, int[])
. NFC Forum Type 4 tags are not organized into pages but different files. We currently support two files: Capability Container file (CC) and NDEF file. Choose CC by setting page to 3 or NDEF by setting page to 4.- Throws:
TinkerforgeException
-
readerReadPageLowLevel
public BrickletNFC.ReaderReadPageLowLevel readerReadPageLowLevel() throws TinkerforgeException
Returns the page data from an internal buffer. To fill the buffer with specific pages you have to callreaderRequestPage(int, int)
beforehand.- Throws:
TinkerforgeException
-
cardemuGetState
public BrickletNFC.CardemuGetState cardemuGetState() throws TinkerforgeException
Returns the current cardemu state of the NFC Bricklet. On startup the Bricklet will be in the *CardemuInitialization* state. The initialization will only take about 20ms. After that it changes to *CardemuIdle*. The Bricklet is also reinitialized if the mode is changed, seesetMode(int)
. The functions of this Bricklet can be called in the *CardemuIdle* state and all of the *CardemuReady* and *CardemuError* states. Example: If you callcardemuStartDiscovery()
, the state will change to *CardemuDiscover* until the discovery is finished. Then it will change to either *CardemuDiscoverReady* if it worked or to *CardemuDiscoverError* if it didn't. The same approach is used analogously for the other API functions.- Throws:
TinkerforgeException
-
cardemuStartDiscovery
public void cardemuStartDiscovery() throws TinkerforgeException
Starts the discovery process. If you call this function while a NFC reader device is near to the NFC Bricklet the state will change from *CardemuDiscovery* to *CardemuDiscoveryReady*. If no NFC reader device can be found or if there is an error during discovery the cardemu state will change to *CardemuDiscoveryError*. In this case you have to restart the discovery process. If the cardemu state changes to *CardemuDiscoveryReady* you can start the NDEF message transfer withcardemuWriteNDEF(int[])
andcardemuStartTransfer(int)
.- Throws:
TinkerforgeException
-
cardemuWriteNDEFLowLevel
public void cardemuWriteNDEFLowLevel(int ndefLength, int ndefChunkOffset, int[] ndefChunkData) throws TinkerforgeException
Writes the NDEF message that is to be transferred to the NFC peer. The maximum supported NDEF message size in Cardemu mode is 255 byte. You can call this function at any time in Cardemu mode. The internal buffer will not be overwritten until you call this function again or change the mode.- Throws:
TinkerforgeException
-
cardemuStartTransfer
public void cardemuStartTransfer(int transfer) throws TinkerforgeException
You can start the transfer of a NDEF message if the cardemu state is *CardemuDiscoveryReady*. Before you call this function to start a write transfer, the NDEF message that is to be transferred has to be written viacardemuWriteNDEF(int[])
first. After you call this function the state will change to *CardemuTransferNDEF*. It will change to *CardemuTransferNDEFReady* if the transfer was successful or *CardemuTransferNDEFError* if it wasn't.- Throws:
TinkerforgeException
-
p2pGetState
public BrickletNFC.P2PGetState p2pGetState() throws TinkerforgeException
Returns the current P2P state of the NFC Bricklet. On startup the Bricklet will be in the *P2PInitialization* state. The initialization will only take about 20ms. After that it changes to *P2PIdle*. The Bricklet is also reinitialized if the mode is changed, seesetMode(int)
. The functions of this Bricklet can be called in the *P2PIdle* state and all of the *P2PReady* and *P2PError* states. Example: If you callp2pStartDiscovery()
, the state will change to *P2PDiscover* until the discovery is finished. Then it will change to either P2PDiscoverReady* if it worked or to *P2PDiscoverError* if it didn't. The same approach is used analogously for the other API functions.- Throws:
TinkerforgeException
-
p2pStartDiscovery
public void p2pStartDiscovery() throws TinkerforgeException
Starts the discovery process. If you call this function while another NFC P2P enabled device is near to the NFC Bricklet the state will change from *P2PDiscovery* to *P2PDiscoveryReady*. If no NFC P2P enabled device can be found or if there is an error during discovery the P2P state will change to *P2PDiscoveryError*. In this case you have to restart the discovery process. If the P2P state changes to *P2PDiscoveryReady* you can start the NDEF message transfer withp2pStartTransfer(int)
.- Throws:
TinkerforgeException
-
p2pWriteNDEFLowLevel
public void p2pWriteNDEFLowLevel(int ndefLength, int ndefChunkOffset, int[] ndefChunkData) throws TinkerforgeException
Writes the NDEF message that is to be transferred to the NFC peer. The maximum supported NDEF message size for P2P transfer is 255 byte. You can call this function at any time in P2P mode. The internal buffer will not be overwritten until you call this function again, change the mode or use P2P to read an NDEF messages.- Throws:
TinkerforgeException
-
p2pStartTransfer
public void p2pStartTransfer(int transfer) throws TinkerforgeException
You can start the transfer of a NDEF message if the P2P state is *P2PDiscoveryReady*. Before you call this function to start a write transfer, the NDEF message that is to be transferred has to be written viap2pWriteNDEF(int[])
first. After you call this function the P2P state will change to *P2PTransferNDEF*. It will change to *P2PTransferNDEFReady* if the transfer was successfull or *P2PTransferNDEFError* if it wasn't. If you started a write transfer you are now done. If you started a read transfer you can now usep2pReadNDEF()
to read the NDEF message that was written by the NFC peer.- Throws:
TinkerforgeException
-
p2pReadNDEFLowLevel
public BrickletNFC.P2PReadNDEFLowLevel p2pReadNDEFLowLevel() throws TinkerforgeException
Returns the NDEF message that was written by a NFC peer in NFC P2P mode. The NDEF message is ready if you calledp2pStartTransfer(int)
with a read transfer and the P2P state changed to *P2PTransferNDEFReady*.- Throws:
TinkerforgeException
-
setDetectionLEDConfig
public void setDetectionLEDConfig(int config) throws TinkerforgeException
Sets the detection LED configuration. By default the LED shows if a card/reader is detected. You can also turn the LED permanently on/off or show a heartbeat. If the Bricklet is in bootloader mode, the LED is off.- Throws:
TinkerforgeException
-
getDetectionLEDConfig
public int getDetectionLEDConfig() throws TinkerforgeException
Returns the configuration as set bysetDetectionLEDConfig(int)
- Throws:
TinkerforgeException
-
setMaximumTimeout
public void setMaximumTimeout(int timeout) throws TinkerforgeException
Sets the maximum timeout. This is a global maximum used for all internal state timeouts. The timeouts depend heavily on the used tags etc. For example: If you use a Type 2 tag and you want to detect if it is present, you have to usereaderRequestTagID()
and wait for the state to change to either the error state or the ready state. With the default configuration this takes 2-3 seconds. By setting the maximum timeout to 100ms you can reduce this time to ~150-200ms. For Type 2 this would also still work with a 20ms timeout (a Type 2 tag answers usually within 10ms). A type 4 tag can take up to 500ms in our tests. If you need a fast response time to discover if a tag is present or not you can find a good timeout value by trial and error for your specific tag. By default we use a very conservative timeout, to be sure that any tag can always answer in time. .. versionadded:: 2.0.1$nbsp;(Plugin)- Throws:
TinkerforgeException
-
getMaximumTimeout
public int getMaximumTimeout() throws TinkerforgeException
Returns the timeout as set bysetMaximumTimeout(int)
.. versionadded:: 2.0.1$nbsp;(Plugin)- Throws:
TinkerforgeException
-
simpleGetTagIDLowLevel
public BrickletNFC.SimpleGetTagIDLowLevel simpleGetTagIDLowLevel(int index) throws TinkerforgeException
.. versionadded:: 2.0.6$nbsp;(Plugin)- Throws:
TinkerforgeException
-
getSPITFPErrorCount
public BrickletNFC.SPITFPErrorCount getSPITFPErrorCount() throws TinkerforgeException
Returns the error count for the communication between Brick and Bricklet. The errors are divided into * ACK checksum errors, * message checksum errors, * framing errors and * overflow errors. The errors counts are for errors that occur on the Bricklet side. All Bricks have a similar function that returns the errors on the Brick side.- Throws:
TinkerforgeException
-
setBootloaderMode
public int setBootloaderMode(int mode) throws TinkerforgeException
Sets the bootloader mode and returns the status after the requested mode change was instigated. You can change from bootloader mode to firmware mode and vice versa. A change from bootloader mode to firmware mode will only take place if the entry function, device identifier and CRC are present and correct. This function is used by Brick Viewer during flashing. It should not be necessary to call it in a normal user program.- Throws:
TinkerforgeException
-
getBootloaderMode
public int getBootloaderMode() throws TinkerforgeException
Returns the current bootloader mode, seesetBootloaderMode(int)
.- Throws:
TinkerforgeException
-
setWriteFirmwarePointer
public void setWriteFirmwarePointer(long pointer) throws TinkerforgeException
Sets the firmware pointer forwriteFirmware(int[])
. The pointer has to be increased by chunks of size 64. The data is written to flash every 4 chunks (which equals to one page of size 256). This function is used by Brick Viewer during flashing. It should not be necessary to call it in a normal user program.- Throws:
TinkerforgeException
-
writeFirmware
public int writeFirmware(int[] data) throws TinkerforgeException
Writes 64 Bytes of firmware at the position as written bysetWriteFirmwarePointer(long)
before. The firmware is written to flash every 4 chunks. You can only write firmware in bootloader mode. This function is used by Brick Viewer during flashing. It should not be necessary to call it in a normal user program.- Throws:
TinkerforgeException
-
setStatusLEDConfig
public void setStatusLEDConfig(int config) throws TinkerforgeException
Sets the status LED configuration. By default the LED shows communication traffic between Brick and Bricklet, it flickers once for every 10 received data packets. You can also turn the LED permanently on/off or show a heartbeat. If the Bricklet is in bootloader mode, the LED is will show heartbeat by default.- Throws:
TinkerforgeException
-
getStatusLEDConfig
public int getStatusLEDConfig() throws TinkerforgeException
Returns the configuration as set bysetStatusLEDConfig(int)
- Throws:
TinkerforgeException
-
getChipTemperature
public int getChipTemperature() throws TinkerforgeException
Returns the temperature as measured inside the microcontroller. The value returned is not the ambient temperature! The temperature is only proportional to the real temperature and it has bad accuracy. Practically it is only useful as an indicator for temperature changes.- Throws:
TinkerforgeException
-
reset
public void reset() throws TinkerforgeException
Calling this function will reset the Bricklet. All configurations will be lost. After a reset you have to create new device objects, calling functions on the existing ones will result in undefined behavior!- Throws:
TinkerforgeException
-
writeUID
public void writeUID(long uid) throws TinkerforgeException
Writes a new UID into flash. If you want to set a new UID you have to decode the Base58 encoded UID string into an integer first. We recommend that you use Brick Viewer to change the UID.- Throws:
TinkerforgeException
-
readUID
public long readUID() throws TinkerforgeException
Returns the current UID as an integer. Encode as Base58 to get the usual string version.- Throws:
TinkerforgeException
-
getIdentity
public Device.Identity getIdentity() throws TinkerforgeException
Returns the UID, the UID where the Bricklet is connected to, the position, the hardware and firmware version as well as the device identifier. The position can be 'a', 'b', 'c', 'd', 'e', 'f', 'g' or 'h' (Bricklet Port). A Bricklet connected to an :ref:`Isolator Bricklet <isolator_bricklet>` is always at position 'z'. The device identifier numbers can be found :ref:`here <device_identifier>`. |device_identifier_constant|- Specified by:
getIdentity
in classDevice
- Throws:
TinkerforgeException
-
readerGetTagID
public BrickletNFC.ReaderGetTagID readerGetTagID() throws TinkerforgeException
Returns the tag type and the tag ID. This function can only be called if the NFC Bricklet is currently in one of the *ReaderReady* states. The returned tag ID is the tag ID that was saved through the last call ofreaderRequestTagID()
. To get the tag ID of a tag the approach is as follows: 1. CallreaderRequestTagID()
2. Wait for state to change to *ReaderRequestTagIDReady* (seereaderGetState()
orBrickletNFC.ReaderStateChangedListener
listener) 3. CallreaderGetTagID()
- Throws:
TinkerforgeException
-
readerWriteNDEF
public void readerWriteNDEF(int[] ndef) throws TinkerforgeException
Writes NDEF formated data. This function currently supports NFC Forum Type 2 and 4. The general approach for writing a NDEF message is as follows: 1. CallreaderRequestTagID()
2. Wait for state to change to *ReaderRequestTagIDReady* (seereaderGetState()
orBrickletNFC.ReaderStateChangedListener
listener) 3. If looking for a specific tag then callreaderGetTagID()
and check if the expected tag was found, if it was not found got back to step 1 4. CallreaderWriteNDEF(int[])
with the NDEF message that you want to write 5. Wait for state to change to *ReaderWriteNDEFReady* (seereaderGetState()
orBrickletNFC.ReaderStateChangedListener
listener)- Throws:
TinkerforgeException
-
readerReadNDEF
public int[] readerReadNDEF() throws TinkerforgeException
Returns the NDEF data from an internal buffer. To fill the buffer with a NDEF message you have to callreaderRequestNDEF()
beforehand.- Throws:
TinkerforgeException
-
readerWritePage
public void readerWritePage(int page, int[] data) throws TinkerforgeException
Writes a maximum of 8192 bytes starting from the given page. How many pages are written depends on the tag type. The page sizes are as follows: * Mifare Classic page size: 16 byte * NFC Forum Type 1 page size: 8 byte * NFC Forum Type 2 page size: 4 byte * NFC Forum Type 3 page size: 16 byte * NFC Forum Type 4: No pages, page = file selection (CC or NDEF, see below) The general approach for writing to a tag is as follows: 1. CallreaderRequestTagID()
2. Wait for state to change to *ReaderRequestTagIDReady* (seereaderGetState()
orBrickletNFC.ReaderStateChangedListener
listener) 3. If looking for a specific tag then callreaderGetTagID()
and check if the expected tag was found, if it was not found got back to step 1 4. CallreaderWritePage(int, int[])
with page number and data 5. Wait for state to change to *ReaderWritePageReady* (seereaderGetState()
orBrickletNFC.ReaderStateChangedListener
listener) If you use a Mifare Classic tag you have to authenticate a page before you can write to it. SeereaderAuthenticateMifareClassicPage(int, int, int[])
. NFC Forum Type 4 tags are not organized into pages but different files. We currently support two files: Capability Container file (CC) and NDEF file. Choose CC by setting page to 3 or NDEF by setting page to 4.- Throws:
TinkerforgeException
-
readerReadPage
public int[] readerReadPage() throws TinkerforgeException
Returns the page data from an internal buffer. To fill the buffer with specific pages you have to callreaderRequestPage(int, int)
beforehand.- Throws:
TinkerforgeException
-
cardemuWriteNDEF
public void cardemuWriteNDEF(int[] ndef) throws TinkerforgeException
Writes the NDEF message that is to be transferred to the NFC peer. The maximum supported NDEF message size in Cardemu mode is 255 byte. You can call this function at any time in Cardemu mode. The internal buffer will not be overwritten until you call this function again or change the mode.- Throws:
TinkerforgeException
-
p2pWriteNDEF
public void p2pWriteNDEF(int[] ndef) throws TinkerforgeException
Writes the NDEF message that is to be transferred to the NFC peer. The maximum supported NDEF message size for P2P transfer is 255 byte. You can call this function at any time in P2P mode. The internal buffer will not be overwritten until you call this function again, change the mode or use P2P to read an NDEF messages.- Throws:
TinkerforgeException
-
p2pReadNDEF
public int[] p2pReadNDEF() throws TinkerforgeException
Returns the NDEF message that was written by a NFC peer in NFC P2P mode. The NDEF message is ready if you calledp2pStartTransfer(int)
with a read transfer and the P2P state changed to *P2PTransferNDEFReady*.- Throws:
TinkerforgeException
-
simpleGetTagID
public BrickletNFC.SimpleGetTagID simpleGetTagID(int index) throws TinkerforgeException
.. versionadded:: 2.0.6$nbsp;(Plugin)- Throws:
TinkerforgeException
-
addReaderStateChangedListener
public void addReaderStateChangedListener(BrickletNFC.ReaderStateChangedListener listener)
Adds a ReaderStateChanged listener.
-
removeReaderStateChangedListener
public void removeReaderStateChangedListener(BrickletNFC.ReaderStateChangedListener listener)
Removes a ReaderStateChanged listener.
-
addCardemuStateChangedListener
public void addCardemuStateChangedListener(BrickletNFC.CardemuStateChangedListener listener)
Adds a CardemuStateChanged listener.
-
removeCardemuStateChangedListener
public void removeCardemuStateChangedListener(BrickletNFC.CardemuStateChangedListener listener)
Removes a CardemuStateChanged listener.
-
addP2PStateChangedListener
public void addP2PStateChangedListener(BrickletNFC.P2PStateChangedListener listener)
Adds a P2PStateChanged listener.
-
removeP2PStateChangedListener
public void removeP2PStateChangedListener(BrickletNFC.P2PStateChangedListener listener)
Removes a P2PStateChanged listener.
-
-