- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一些 ISO15693/Tag-it HF-I Plus 芯片,需要在上面写点东西。这些薯片是完全新鲜的,我现在读了很多 pdf 都告诉我同样的事情。但没有任何效果,而且我一直收到“收发失败”错误。
我在收发命令中发送这些数据:
Byte: <data>
0: 0x00 // pdf says the tag understands only flag = 0x00
1: 0x21 // write single block
2-10: ID // needs to be send for this tag, only supports addressed mode
11: 0x00 // Block ID, try to write to block 0
12-16: DATA // LSB First
17-18: CRC16 // do i need to send this? and if yes, LSB first?
我尝试了非常不同的标志和写入模式,但它们都不起作用:
Flags: 0x01, 0x02, 0x20,0x22,0x42,0x40,0x80,0x82
Modes: 0x21,0xA2 (+ Vendor Mode 0x07)
这是我的写函数:
private void write(Tag tag) throws IOException, FormatException {
if (tag == null) {
return;
}
NfcV nfc = NfcV.get(tag);
byte[] ID = tag.getId();
nfc.connect();
Log.d(TAG, "Data: " + new String(((EmergencyApplication) getApplication()).getData()));
byte[] data = ((EmergencyApplication) getApplication()).getData();
// NfcV Tag has 64 Blocks with 4 Byte
if ((data.length / 4) > 64) {
// ERROR HERE!
Log.d(TAG, "too much data...");
}
for (int i = 0; i < data.length; i++) {
byte[] arrByte = new byte[17];
// Flags
arrByte[0] = 0x00; // Tag only supports flags = 0
// Command
arrByte[1] = 0x21;
// ID
Log.d(TAG, "Found ID length: " + ID.length + "... ID: " + Arrays.toString(ID));
System.arraycopy(ID, 0, arrByte, 2, 8);
// block number
arrByte[10] = (byte) (i);
// data
// TODO send LSB first...
System.arraycopy(data, i * 4, arrByte, 11, 4);
// CRC 16 of all command
byte[] check = new byte[15];
System.arraycopy(arrByte, 0, check, 0, 15);
int crc = CRC.crc16(check);
arrByte[15] = (byte) (crc >> 8);
arrByte[16] = (byte) (crc & 0xFF);
Log.d(TAG, "Writing Data: " + Arrays.toString(arrByte));
byte[] result = nfc.transceive(arrByte);
Log.d(TAG, "got result: " + Arrays.toString(result));
}
nfc.close();
Toast.makeText(this, "wrote to tag", Toast.LENGTH_LONG).show();
}
这是 Nexus S 的另一个错误吗?我使用 Cyanogenmod 10.1.2,所以我认为 Tag Lost Bug 已修复...我显然可以读取标签,如果我使用 NFC Tag Info App,它会显示所有 block 清晰且可写。我阅读了这些 PDF:
http://rfidshop.com.hk/datasheet%20tag/philip%20icode%20SLI.pdf - 我的标签数据表 http://www.waazaa.org/download/fcd-15693-3.pdf - ISO15693-3 数据表 http://www.ti.com/lit/ug/scbu003a/scbu003a.pdf - Tag-it HF-I Plus 数据表
我用这里的代码测试了阅读:Reading a NXP ICODE SLI-L tag with Android - 它适用于所有 64 个 block ,但写入仍然不起作用...即使标志 = 0x20...
编辑:我现在看到卡上的 DSFID 是 0x00
,这意味着对于 ISO15693-3 卡根本不可写:
If its programming is not supported by the VICC, the VICC shall respond with the value zero ('00')
这是发送0x2B
时的byte[]:
DSFID \ / AFI
| |
v v
infoRmation: [0, 15, 120, 40, -51, -51, 119, -128, 7, -32, 0, 0, 63, 3, -117]
最佳答案
发现了一些东西,我想分享一下:
但最糟糕的是,标签在编译到标签编写器中时没有响应。您将得到一个 Tag is lost.
异常,但数据将写入标签!所以解决方案是忽略这个异常,也许在写入后验证数据,如果它不起作用再试一次。
我目前写的代码是这样的:
public static void write(Tag tag, byte[] data) throws IOException, FormatException,
InterruptedException {
if (tag == null) {
return;
}
NfcV nfc = NfcV.get(tag);
nfc.connect();
Log.d(TAG, "Max Transceive Bytes: " + nfc.getMaxTransceiveLength());
// NfcV Tag has 64 Blocks with 4 Byte
if ((data.length / 4) > 64) {
// ERROR HERE!
Log.d(TAG, "too much data...");
}
if ((data.length % 4) != 0) {
byte[] ndata = new byte[(data.length) + (4 - (data.length % 4))];
Arrays.fill(ndata, (byte) 0x00);
System.arraycopy(data, 0, ndata, 0, data.length);
data = ndata;
}
byte[] arrByte = new byte[7];
// Flags
arrByte[0] = 0x42;
// Command
arrByte[1] = 0x21;
for (int i = 0; i < (data.length / 4); i++) {
// block number
arrByte[2] = (byte) (i);
// data, DONT SEND LSB FIRST!
arrByte[3] = data[(i * 4)];
arrByte[4] = data[(i * 4) + 1];
arrByte[5] = data[(i * 4) + 2];
arrByte[6] = data[(i * 4) + 3];
Log.d(TAG, "Writing Data to block " + i + " [" + printHexString(arrByte) + "]");
try {
nfc.transceive(arrByte);
} catch (IOException e) {
if (e.getMessage().equals("Tag was lost.")) {
// continue, because of Tag bug
} else {
throw e;
}
}
}
nfc.close();
}
而且效果很好。如果存在真正的错误,例如消息未被理解,您将收到 Transceive Failed
消息。
关于android - ISO15693/Tag-it HF-I 收发失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18211548/
我想为使用 RFID 实现多项功能的系统提案指定设备。它可能会在未来扩展到包括交易,所以我正在努力寻找合适的技术来使用。 计划是使用被动卡。 HF/NFC 卡/读卡器以相同的频率运行,但它们可以互换使
我有一些 ISO15693/Tag-it HF-I Plus 芯片,需要在上面写点东西。这些薯片是完全新鲜的,我现在读了很多 pdf 都告诉我同样的事情。但没有任何效果,而且我一直收到“收发失败”错误
我正在尝试为我的 sphinx 矩阵添加一些颜色。我正在使用 hf-tikz为它之前。但是,当我将它添加到 Sphinx 时,它会错误地呈现它。 我想要得到的结果是 我得到的结果是 这是我拥有的代码。
我正在读这本书(《深入浅出面向对象设计与分析》)。在第 5 章中有一个建议,我想对此有一些其他的看法。书上说: "When you have a set of properties that vary
我正在使用 Azure 建议(自动完成)API 此 API 对于按关键字搜索运行良好 但有一种情况像关键字“HF - 心力衰竭”尝试搜索 我得到了结果,但不是很快,这意味着它应该在第一个选择上显示这个
关闭。这个问题不满足Stack Overflow guidelines .它目前不接受答案。 想改善这个问题吗?更新问题,使其成为 on-topic对于堆栈溢出。 1年前关闭。 Improve thi
已结束。此问题不符合 Stack Overflow guidelines .它目前不接受答案。 我们不允许提出有关书籍、工具、软件库等方面的建议的问题。您可以编辑问题,以便用事实和引用来回答它。 关闭
我看到很多论坛都说 RFID 不同于 NFC。我完全同意这一点,因为两者都有不同的标准并且在不同的频率上运行。 经过进一步研究,我发现 13.56 MHz 频段中存在一些 RFID 标准 (HF-RF
我想在我的树莓派上安装一个RFID阅读器的驱动程序,这样我的PC/SC守护进程就可以在我插入时识别阅读器。不幸的是,公司打包的驱动程序只适用于i386或amd64架构。我在 Pi 上安装了 Raspi
下面是使用 NFC 读取 HF RFID 标签的示例通用 Win10 应用程序代码。当设备读取 RFID 标签时,不会触发“ReadTag”方法。我尝试将消息类型从 NDEF 更改为 Windows,
我是一名优秀的程序员,十分优秀!