是Android 4.4.2无enableReaderMode不recieving SELECT容器 [英] Android 4.4.2 not recieving SELECT container without enableReaderMode

查看:628
本文介绍了是Android 4.4.2无enableReaderMode不recieving SELECT容器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的银河5有奇怪的行为,当我模拟的ACR122U卡。
我认为,问题发生时,我跑了一个Android更新。当应用程序是不是在前台我的意图过滤器不会再赶上标签,因为标签仿真被看作是一个的 JIS 6319-4 代替 ISO / IEC 14443-4 标记。

My Galaxy 5 has strange behaviour when i'm emulate a card on the ACR122U. I think the problem occured when i ran an Android update. When the application isn't on the foreground my intent filters doesn't catch the tag anymore because the emulated tag is seen as a JIS 6319-4 instead of a ISO/IEC 14443-4 tag.

当应用程序不在前台或我得到的序列的的的前景和运行 foregroundDispatch

The sequence i get when the application isn't on the foreground OR is on the foreground and running in foregroundDispatch:

TgInitAsTarget
>  FF 00 00 00 27 D4 8C 04 04 00 01 23 45 20 000000000000000000000000000000000000000000000000000000000000
<  D5 8D 08 E0 80 90 00

TgGetData
>  FF 00 00 00 02 D4 86

Target has been released error
<  D5 87 29 90 00

我这个循环5次,但没有的 TgInitAsTarget 将工作。当我使用 enableReaderMode (不NDEF跳过)我得到正确的顺序:

I loop this 5 times, but none of the TgInitAsTarget will work. When i'm using enableReaderMode (without NDEF skip) i get the correct sequence:

...
>  FF 00 00 00 02 D4 86 //TgGetData
<  D5 87 00 00 A4 04 00 07 D2 76 00 00 85 01 01 00 9000 //SELECT command
>  FF 00 00 00 05 D4 8E 02 6A 82 //file or application not found
<  D5 8F 00 90 00 //Ack

>  FF 00 00 00 02 D4 86 //TgGetData
<  D5 87 00 00 A4 04 00 07 D2 76 00 00 85 01 00 90 00 //SELECT command
>  FF 00 00 00 05 D4 8E 02 6A 82 //file or application not found
<  D5 8F 00 90 00 //Ack

>  FF 00 00 00 02 D4 86 //TgGetData
<  D5 87 00 00 A4 04 00 07 D2 76 00 00 85 01 00 90 00 //SELECT command
>  FF 00 00 00 05 D4 8E 02 6A 82 //file or application not found
<  D5 8F 00 90 00 //Ack

TgGetData
>  FF 00 00 00 02 D4 86
//Recieving data

问题1

为什么Android的发送任何回报,当应用程序不在前台或 enableForegroundDispatch ?这是非常奇怪的,因为它一直在努力,但它看起来像更新改变了NFC的行为。

Why does Android send nothing back when the application isn't on the foreground or with enableForegroundDispatch? It's very weird because it was always working, but it looks like the update changed the behaviour of NFC.

问题2

这是正常的 enableReaderMode 的行为(不NDEF跳过)从 enableForegroundDispatch 的行为有什么不同?

Is it normal that the behaviour of enableReaderMode (without NDEF skip) is different from the behaviour of enableForegroundDispatch?

需要注意的是读者的母亲模式使用以下命令启用:

Note that reader-moder mode is enabled with the following command:

nfcAdapter.enableReaderMode(this, this, NfcAdapter.FLAG_READER_NFC_A, null);


推荐答案

这似乎是一个已知的问题与PN532 NFC控制器。到目前为止,我没有发现任何解决这个。那是你已经在你这个问题的同样的问题。

Regarding the ACR122U in host card emulation mode being detected as FeliCa (JIS X 6319-4) rather than ISO-DEP (ISO/IEC 14443-4):

This seems to be a known issue with the PN532 NFC controller. So far I did not find any solution to this. That's the same problem that you already discovered in this question of yours.

好了,因为你已经发现了,在Android设备会显示它检测到仿真卡的FeliCa。到tgInitAsTarget命令的响应( D5 8D 08 E0 80 90 00 ),但是指出的是,PN532的的激活为ISO-DEP虽然。因此,似乎Android设备开始与仿真ISO-DEP卡的通讯,但必须立即放弃了它而没有发送命令帧(因此您收到错误响应tgGetData命令)。相反,Android设备必须检测(也可能是跟)仿真的FeliCa(实际上NFCIP-1)卡(关于这个问题我回答的第一部分)。

Well, as you already found out, the Android device shows that it detects the emulated card as FeliCa. The response to the tgInitAsTarget command (D5 8D 08 E0 80 90 00) indicates, however, that the PN532 was activated as ISO-DEP though. Consequently, it seems that the Android device initiated the communication with the emulated ISO-DEP card but must have immediately dropped it without ever sending command frames (hence you receive the error in response to the tgGetData command). Instead, the Android device must have detected (and possibly talked to) the emulated FeliCa (actually NFCIP-1) card (which relates to the problem in the first part of my answer).

由于这是工作之前,更新必须引入一些更改Android设备的轮询/同行发现算法。

As this was working before, the update must have introduced some changes to the polling/peer-discovery algorithm of your Android device.

这要看你考虑什么正常行为。当您启用了Android的阅读器模式使用命令

That depends on what you consider "normal behavior". As you enabled Android's reader-mode with the command

nfcAdapter.enableReaderMode(this, this, NfcAdapter.FLAG_READER_NFC_A, null);

您明确指示Android以不同的表现将比默认标签/端发现机制(即与 enableForegroundDispatch 和普通的标签调度系统使用)。

you explicitly instruct Android to behave differently than with the default tag/peer discovery mechanism (that's used with enableForegroundDispatch and the normal tag dispatch system).

默认轮询将试图发现所有不同的标签技术(NFCA,NfcB,NfcF(快),NfcF(慢),NfcV(可能有多种模式),NFCIP-1工作模式,NfcBar code,通常不按照这个顺序),因此它可以发现在的FeliCa / NFC-DEP模式ACR122U。

The default polling will try to discover all different tag technologies (NfcA, NfcB, NfcF (fast), NfcF (slow), NfcV (possible with multiple modes), NFCIP-1 active mode, NfcBarcode; usually not in this order), hence it can discover the ACR122U in FeliCa/NFC-DEP mode.

通过您的 enableReaderMode 命令,明确指示Android只为NFCA调查。因此,您的设备将正常激活ISO-DEP模式,因此在ACR122U,它将启动NDEF发现过程。

With your enableReaderMode command, you explicitly instruct Android to only poll for NfcA. Hence, your device will properly activate the ACR122U in ISO-DEP mode and, consequently, it will start the NDEF discovery procedure.

这篇关于是Android 4.4.2无enableReaderMode不recieving SELECT容器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆