public class MifareUltralightTag extends TagManager
This class inherits from the TagManager abstract class and provides interfaces to create a MIFARE
Ultralight tag, obtain the tag type, and read and write pages of the tag.
| 限定符和类型 | 字段 | 说明 |
|---|---|---|
static int |
MIFARE_ULTRALIGHT |
A MIFARE Ultralight tag.
|
static int |
MIFARE_ULTRALIGHT_C |
A MIFARE Ultralight C tag.
|
static int |
MIFARE_UNKNOWN |
A MIFARE Ultralight tag of an unknown type.
|
ISO_DEP, MIFARE_CLASSIC, NDEF, NFC_A, NFC_B, NFC_F, NFC_V| 限定符和类型 | 方法 | 说明 |
|---|---|---|
static MifareUltralightTag |
getInstance(TagInfo tagInfo) |
Obtains a
MifareUltralightTag object based on the given tag information. |
int |
getMifareType() |
Obtains the type of the MIFARE Ultralight tag.
|
byte[] |
readFourPages(int pageOffset) |
Reads four pages (16 bytes) starting from the specified page offset.
|
void |
writeOnePage(int pageOffset,
byte[] data) |
Writes data to the specified page.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcheckConnected, connectTag, getMaxSendLength, getSendDataTimeout, getTagInfo, isTagConnected, reset, sendData, setSendDataTimeoutpublic static final int MIFARE_ULTRALIGHT
public static final int MIFARE_ULTRALIGHT_C
public static final int MIFARE_UNKNOWN
public static MifareUltralightTag getInstance(TagInfo tagInfo)
MifareUltralightTag object based on the given tag information.
During tag reading, if the tag supports the NFC-A technology, a MifareUltralightTag object will be
created based on the given tag information.
tagInfo - Indicates the information about the given tag.MifareUltralightTag object.public int getMifareType()
MIFARE_ULTRALIGHT,
MIFARE_ULTRALIGHT_C, or MIFARE_UNKNOWN.public byte[] readFourPages(int pageOffset)
throws IOException
pageOffset - Indicates the specified page offset, starting from 0.IOException - if there is an I/O failure, or the operation is canceled.public void writeOnePage(int pageOffset,
byte[] data)
throws IOException
pageOffset - Indicates the offset of the page, starting from 0.data - Indicates the data to write to the page.IOException - if there is an I/O failure, or the operation is canceled.