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

Switched HID Host App to hidapi instead of libusb #82

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

NicoHood
Copy link
Contributor

@NicoHood NicoHood commented Apr 9, 2016

Makes things a lot simpler, the older libusb option is still kept though.
sudo apt-get install libhidapi*

See the single commits, the 2nd is just for correct github indention.

@@ -7,7 +7,8 @@ ifeq ($(OS), LINUX) # also works on FreeBSD
CC ?= gcc
CFLAGS ?= -O2 -Wall
hid_bootloader_cli: hid_bootloader_cli.c
$(CC) $(CFLAGS) -s -DUSE_LIBUSB -o hid_bootloader_cli hid_bootloader_cli.c -lusb
#$(CC) $(CFLAGS) -s -DUSE_LIBUSB -o hid_bootloader_cli hid_bootloader_cli.c ../AES/aes.c -lusb
$(CC) $(CFLAGS) -s -DUSE_HIDAPI -o hid_bootloader_cli hid_bootloader_cli.c ../AES/aes.c -I/usr/include/hidapi/ -lhidapi-libusb
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where does this new AES source file come from?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh good point. That was because I modified the Host app. You have to remove it of course.

@abcminiuser
Copy link
Owner

HIDAPI isn't supported in the (modified) Teensy CLI loader app - compilation doesn't work without libUSB as there's no HIDAPI fallback. Did you perhaps use a different version of the app modified somewhere else?

Closing for now - please re-open if you have a full patch with the HIDAPI backend.

@NicoHood
Copy link
Contributor Author

I do not really understand what you mean? HIDAPI has libusb as dependency, yes. But the HID API is simpler and easier to use.

@abcminiuser
Copy link
Owner

HIDAPI is probably a better solution to generic LibUSB code, but I thought there was more to it than just changing -DUSE_LIBUSB to -DUSE_HIDAPI like your proposed patch does. I did try compiling it locally and got compile errors - have you forked the HIDLoaderApp source code to include new code paths to use HIDAPI that weren't included in this PR perhaps?

@NicoHood
Copy link
Contributor Author

Hu? Sure I edited hid_bootloader_cli.c which is part of the PR. I've compiled it on ubuntu 14 at that time. I have not tried it again and I currently have no hardware and time to test. Sorry.

@abcminiuser
Copy link
Owner

Whoopsiedaisy - the diff to hid_bootloader_cli.c was so large GitHub was hiding it by default, which confused me 😞. I'll do a proper re-review of this.

@abcminiuser abcminiuser reopened this Feb 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants