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

open 2 device in the meantime ,some question #548

Closed
snikeguo opened this issue Apr 2, 2019 · 1 comment
Closed

open 2 device in the meantime ,some question #548

snikeguo opened this issue Apr 2, 2019 · 1 comment
Labels
question Technical support, will be closed if deemed not a libusb issue. Please use mailing list.

Comments

@snikeguo
Copy link

snikeguo commented Apr 2, 2019

I have two identical devices: Dev0, Dev1; and wrote some code:
libusb_init(&gloal_ctx);
create_thread(libusb_handle_events_completed); //create a thread
libusb_get_device_list(&devs);

libusb_open(devs[0],&handle0);
libusb_set_configuration(handle0);
libusb_claim_interface(handle0);

libusb_open(devs[1],&handle1);
libusb_set_configuration(handle1);
libusb_claim_interface(handle1);

libusb_bulk_transfer(handle0,some data);
libusb_close(handle0);

libusb_bulk_transfer(handle1,some data);//not return !!why??

libusb_close(handle1);
libusb_exit(&gloal_ctx);
Q1:
if i have 2 device,How many times do I need to call the libusb_init function? 1 or 2?
Q2:
libusb_bulk_transfer(handle1,some data);//not return !!why??

@snikeguo snikeguo changed the title open 2 device open 2 device ,some question Apr 2, 2019
@snikeguo snikeguo changed the title open 2 device ,some question open 2 device in the meantime ,some question Apr 2, 2019
@mcuee mcuee added the question Technical support, will be closed if deemed not a libusb issue. Please use mailing list. label Apr 7, 2019
@mcuee
Copy link
Member

mcuee commented Apr 7, 2019

Q1: one time.
Q2: You have to know the communication protocol.

Question should be asked in the mailing list and not here. Please subscribe to the mailing list and ask there.

@mcuee mcuee closed this as completed Apr 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Technical support, will be closed if deemed not a libusb issue. Please use mailing list.
Projects
None yet
Development

No branches or pull requests

2 participants