Skip to content
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

Switch from libusb-0.1 to libusb-1.0 #191

Open
GoogleCodeExporter opened this issue Apr 3, 2015 · 23 comments · May be fixed by #673
Open

Switch from libusb-0.1 to libusb-1.0 #191

GoogleCodeExporter opened this issue Apr 3, 2015 · 23 comments · May be fixed by #673
Milestone

Comments

@GoogleCodeExporter
Copy link

libnfc is using the old libusb-0.1 API.
Maybe you can switch to libusb-1.0 instead?

Original issue reported on code.google.com by [email protected] on 12 May 2012 at 8:22

@depau
Copy link

depau commented Dec 10, 2017

Hello,
I see this is a very old issue. I see there's still the libusb10 branch in the repository. I was wondering why it hasn't been worked on in years. Do you have any news?

@neomilium
Copy link
Member

Hello,
@doegox worked on it few years ago, then we worked on other subject.
If you want to update this branch to finalize the switch you are more than welcome !
Feel free to fork libnfc and bring libnfc to libusb 1.0, we will be happy to merge it upstream and made a new major release.

@Hamid-Najafi
Copy link

please update libusb. I have trouble to run on Macos, neither ubuntu :(

@kuquert
Copy link

kuquert commented Sep 2, 2018

You can use the compat version of libusb by installing it using mac port
sudo port install libusb-compat
sudo activate libusb-compat

It will make libnfc work

@xavave
Copy link

xavave commented Jan 16, 2020

Hello,
Is there a way to get rid of libusbk when using a ACR-122U USB reader with libnfc.dll on windows ?

  • with libusb1.0-libnfc ported on Windows, would we still need libusbK driver wrapper when using libnfc.dll on Windows ?
    (when I don't install libusbK on native ACR122U USB driver --> No NFC device found. ; with LibusbK --> NFC device: ACS / ACR122U PICC Interface opened )
    My goal is to be able to use nfc-tools (nfc-list, nfc-mfcclassic, ...) directly with (ACR122U) USB native driver

@xavave
Copy link

xavave commented Jan 17, 2020

If anyone is interested, I've tested a solution:
cross compilation of libusb 1.0 then using this version in libnfc fork-libusb10, cross compiled to windows : more infos on my blog post here : http://legacy.averbouch.biz/libnfc-and-nfc-utils-binaries-on-windows-10/#libnfc-libusb10
https://blog.avxt.fr/libnfc-and-nfc-utils-binaries-on-windows-10/#libnfc-libusb10
The answer to my question seems to be : NO --> I still need LibUSBK driver to be able to use nfc-list.exe with my ACR122U
But, when I run libusb10/listdevs.exe the app sees ACR122U even without installing Libusbk driver wrapper. So I guess that the issue (ACR 122U not detected in Libnfc with native driver) comes from the ACR122_USB driver code in libnfc/driver/acr_122usb.c ...--> Is there anyone that can confirm that point please ?

below : test with libusb/listdevs.exe (with or without Libusbk, same detection OK)
image

below: test with nfc-list and libnfc-libusb10 (WITH LibUsbK installed)
image

dumpbin /EXPORTS libusb1-0.dll (to check if functions are really the 1.0 ones)
image

below dumpbin /EXPORTS libnfc_libusb10 to check list of functions
image

@ghost
Copy link

ghost commented Jan 3, 2021

Switching to libusb1.0 would indeed be a favorable option.

Compiling this for iOS devices and the ARM Mac has been a pain as somehow it's still relying on the compat layer, which honestly isn't that much of a problem but still shouldn't be there when a better libusb is available. Would make sense to migrate away from the old library at this point.

@kenspeckle1 kenspeckle1 linked a pull request Jul 11, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants