MifareUltralight官方文档翻译
原文地址:http://developer.android.com/reference/android/nfc/tech/MifareUltralight.html
1. MifareUltralight Tag结构:
轻型Tag 共64字节,分为16个page,每个page 4字节,
前4页是存放制造商,和卡片相关信息的地方,有些是一次性写入的,有些是只读的,有些是可以写入的。
剩下的12 page 是用户存放数据的地方,是可读可写的。
2.MIFARE Ultralight C Tag 结构:
一共192字节,分为48 page ,同样是每页4字节,前四页是存放存放制造商,和卡片相关信息的地方,有些是一次性写入的,有些是只读的,有些是可以写入的。接下来的36页是用户数据区域,可读可写,接下来四页是存放验证信息的,只读,最后四页是用来证明身份的key,不可读。
在Android NFC设备上实现MifareUltralight是可选的,如果没有实现,当调用 getTechList()时就不会列举出来,如果列举出来,那么 all MifareUltralight I/O operations都会被支持。所有MifareUltralight Tag 都是 NfcA Tag。
常量:
PAGE_SIZE:每页的大写
TYPE_ULTRALIGHT:A MIFARE Ultralight tag
TYPE_ULTRALIGHT_C:A MIFARE Ultralight C tag
TYPE_UNKNOWN:一个MIFARE Ultralight兼容的但是未知类型的Tag
公有方法:
close() 关闭对Tag的读写,释放资源
connect() 连接Tag,成功连接之后就能进行I/O操作
staticMifareUltralightget(Tagtag) 得到给出Tag的一个MifareUltralight类型的实例。
int getMaxTransceiveLength() 返回能被transceive(byte[])方法发送的最大的字节数
TaggetTag() 获得Tag对象
int getTimeout() 获得当前的
transceive(byte[])超时毫秒数
intgetType() 返回MIFARE Ultralight Tag的类型
booleanisConnected() 判断I/O操作是否可以进行。
byte[] readPages(int pageOffset) 从指定的pageOffset处读取四页(16字节的内容)
void setTimeout(int timeout) 设置
transceive(byte[])方法的
超时时间
byte[] transceive(byte[] data) 发送NFCA 类型的数据到Tag并等待回复。
void writePage(int pageOffset, byte[] data) 写如Tag一页内容(4字节)
通过继承的到的方法:
Object | clone() Creates and returns a copy of this Object . |
boolean | equals( Objecto) Compares this instance with the specified object and indicates if they are equal. |
void | finalize() Invoked when the garbage collector has detected that this instance is no longer reachable. |
final Class<?> | getClass() Returns the unique instance of Class that represents this object's class. |
int | hashCode() Returns an integer hash code for this object. |
final void | notify() Causes a thread which is waiting on this object's monitor (by means of calling one of the wait() methods) to be woken up. |
final void | notifyAll() Causes all threads which are waiting on this object's monitor (by means of calling one of the wait() methods) to be woken up. |
String | toString() Returns a string containing a concise, human-readable description of this object. |
final void | wait() Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object. |
final void | wait(long millis, int nanos) Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the specified timeout expires. |
final void | wait(long millis) Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the specified timeout expires. |
From interfaceandroid.nfc.tech.TagTechnology
abstract void | close() Disable I/O operations to the tag from this TagTechnology object, and release resources. |
abstract void | connect() Enable I/O operations to the tag from this TagTechnology object. |
abstract Tag | getTag() Get the Tag object backing this TagTechnology object. |
abstract boolean | isConnected() Helper to indicate if I/O operations should be possible. |
From interfacejava.io.Closeable
abstract void | close() Closes the object and release any system resources it holds. |
abstract void | close() Closes the object and release any system resources it holds. |
更多相关文章
- MD2模型結構解釋
- Android(安卓)-- 系统结构 /system/ 目录下文件夹功能说明
- Android图片加载后变小
- [转]微信ANDROID客户端-会话速度提升70%的背后
- Android(安卓)Studio 加载 .so库出现couldn't find "*.so"
- Android(安卓)App 性能优化之安装包大小
- 树莓派---MAC下安装AndroidThings
- BlobCache算法详解
- android 字节流缓冲区 字节缓冲流 读写SD卡的内容