Discussion:
[libusb] libusb_set_configuration and libusb_claim_interface does not return LIBUSB_ERROR_BUSY
Christopher Flordeliza
2017-07-03 06:50:20 UTC
Permalink
Hi All,

I have a newbie question, hope someone can help me on this one.

Based from the documentation of libusb_set_configuration and libusb_claim_interface when another application is already using the interface you are going to configure or claim these functions will return LIBUSB_ERROR_BUSY (http://libusb.sourceforge.net/api-1.0/group__dev.html#ga32fabedf5f13fdecf1cb33acdb19b57a). I created an application that will set and claim a USB interface and run it twice. Both instances of the application successfully claimed the interface. Is this expected? is the documentation correct?

Another question, is there a way to determine if another application is trying to claim an interface that your application already claimed?

Thank you very much in advanced.

Regards,

Christopher
Peter Stuge
2017-07-03 12:06:19 UTC
Permalink
Hi Christopher,
Post by Christopher Flordeliza
Based from the documentation of libusb_set_configuration and
libusb_claim_interface when another application is already using
the interface you are going to configure or claim these functions
will return LIBUSB_ERROR_BUSY
(http://libusb.sourceforge.net/api-1.0/group__dev.html#ga32fabedf5f13fdecf1cb33acdb19b57a).
I created an application that will set and claim a USB interface
and run it twice. Both instances of the application successfully
claimed the interface. Is this expected? is the documentation
correct?
The claim behavior may be a little bit different on different platforms.

In general it is actually not any other application which will block
an interface, but more specifically another application *using another
kernel driver*.

This means that if you can claim an interface once then yes I would
expect another application with same permissions using the same API
to be able to claim it "away" from the first.
Post by Christopher Flordeliza
Another question, is there a way to determine if another
application is trying to claim an interface that your application
already claimed?
No, but transfers should fail.


//Peter
Christopher Flordeliza
2017-07-04 20:20:09 UTC
Permalink
Hi Peter,

Thank you very much for the support

Regards,

Christopher


-----Original Message-----
From: Peter Stuge [mailto:***@stuge.se]
Sent: Monday, July 3, 2017 10:06 PM
To: libusb-***@lists.sourceforge.net
Subject: Re: [libusb] libusb_set_configuration and libusb_claim_interface does not return LIBUSB_ERROR_BUSY

Hi Christopher,
Post by Christopher Flordeliza
Based from the documentation of libusb_set_configuration and
libusb_claim_interface when another application is already using the
interface you are going to configure or claim these functions will
return LIBUSB_ERROR_BUSY
(http://libusb.sourceforge.net/api-1.0/group__dev.html#ga32fabedf5f13fdecf1cb33acdb19b57a).
I created an application that will set and claim a USB interface and
run it twice. Both instances of the application successfully claimed
the interface. Is this expected? is the documentation correct?
The claim behavior may be a little bit different on different platforms.

In general it is actually not any other application which will block an interface, but more specifically another application *using another kernel driver*.

This means that if you can claim an interface once then yes I would expect another application with same permissions using the same API to be able to claim it "away" from the first.
Post by Christopher Flordeliza
Another question, is there a way to determine if another application
is trying to claim an interface that your application already claimed?
No, but transfers should fail.


//Peter

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________
libusb-devel mailing list
libusb-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusb-devel

Loading...