-
Notifications
You must be signed in to change notification settings - Fork 442
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added check for USB alternate settings #561
Conversation
Quick and dirty fix for nfc-tools#535
This is already recognized by @melchips in #542 (comment) |
If there are alternative interfaces, claim interface 0. Otherwise skip this step.
I provided another patch about the same problem (#563). IMO there are two different ACR122 models, the old, with alternate support (at least, reply the usb call) and the new without support (timeout in the usb call). This patch is nice, because checks the compatibility with alternate settings. My patch is less conservative, and removes the call to set alternate settings. The question is: do we need with this device (old and new) the usage of set alternate settings? If the answer is "no", we can remove all these lines. If we want to be more conservative, then this patch is preferred. I tested both devices with my patch, and they works fine. IMO, I prefer delete all these lines, less code is better, and then if in the future there are some trouble, we can undo the patch and apply this, but is only my opinion. |
To be honest: It is not completly clear to me, what the side-effects of the alternate settings is. If there is no side-effect, I'm completely on your side - less code less problems (: |
I tried to find more info about alternate devices, and I didn't find info about it. For this reason I did this patch. After testing (see #564) reading, writing and Writing (sector 0) with the patch provided (#563) and with new and the old devices, it works fine. IMO, the patch removing the alternate calls is better, because removes code not needed by these devices. |
I can confirm that this patch fixes issues on my reader.
|
For me „nfc-list“ still results in „Unable to set alternate setting on USB interface“, however when running „/utils/nfc-list“ in my libnfc folder cloned from github it works...I did sudo make uninstall beforehand, cloned libnfc again and deleted these lines as described, compiling then and finally running sudo make install. |
Quick and dirty fix #535
I'm not sure but I think, that the 072f:2200-device does not support alernative usb modes:
Bus 001 Device 013: ID 072f:2200 Advanced Card Systems, Ltd ACR122U: # lsusb -v -s 001:013 | grep bAlter bAlternateSetting 0
Disabling allows to read and write:
I'm not sure. But does any of these acr122-devices has an alternative usb mode?