Discussion:
[Libusb-devel] LIBUSB_ERROR_NOT_SUPPORTED
Quân Phạm Minh
2012-04-04 08:25:47 UTC
Permalink
when I use libusb_open() get error: "operation not supported or
unimplemented on platform"
I use libusb1.x. Please help me fix bug, thank in advance
Xiaofan Chen
2012-04-04 09:28:32 UTC
Permalink
Post by Quân Phạm Minh
when I use libusb_open() get error: "operation not supported or
unimplemented on platform"
I use libusb1.x. Please help me fix bug, thank in advance
What is the OS and what is the libusb-1.0 version you are using?
--
Xiaofan
Xiaofan Chen
2012-04-04 13:35:44 UTC
Permalink
Post by Xiaofan Chen
Post by Quân Phạm Minh
when I use libusb_open() get error: "operation not supported or
unimplemented on platform"
I use libusb1.x. Please help me fix bug, thank in advance
What is the OS and what is the libusb-1.0 version you are using?
I use window 7 ultimate and libusb-1.0.9 (lastest)
sorry I use lisbusb-1.0.8
You should try the latest git or at least rc3.
http://git.libusb.org/?p=libusb.git;a=summary

Did you install the WinUSB driver using Zadig?
http://www.libusb.org/wiki/windows_backend
--
Xiaofan
Xiaofan Chen
2012-04-04 23:30:34 UTC
Permalink
thank you very much! I haven't been install winusb driver yet
Then you can not use libusb_open() and it will fail.
--
Xiaofan
Xiaofan Chen
2012-04-04 23:34:02 UTC
Permalink
although I never install winusb driver but I use libusb to get
information of my usb (kingston usb, and already
recognize by system)
Yes that is possible. But you can not open the device
and do further things. That is the confusing part for
new users with regard to libusb Windows backend,
and similarly for Mac OS X as well. libusb can
get some basic information for device with a
non-proper driver (e.g.: USB mass storage device), but
will not be able to open the device without changing
the driver to a supported one.
--
Xiaofan
Xiaofan Chen
2012-04-07 01:12:02 UTC
Permalink
Please reply to the list instead of replying to me. Thanks.
    libusb_context *ctx = NULL;
    int r;
    r = libusb_init(&ctx);
    libusb_device **devs;
    ssize_t k = libusb_get_device_list(ctx, &devs);
    qDebug() <<"number of device:" <<k;
    qDebug() <<"";
    libusb_device_descriptor desc;
    for(ssize_t i = 0; i < k; i++){
        libusb_device_handle *handler;
        int er = libusb_open(devs[i], &handler);
        switch(er){
                qDebug() <<"device opened";
                break;
                qDebug() <<"memory allocation failure";
                break;
                qDebug() <<"the user has insufficient permissions";
                break;
                qDebug() <<"the device has been disconnected ";
                break;
                qDebug() <<"resource busy";
                break;
                qDebug() <<"system call interrupted";
                break;
                qDebug() <<"invalid parameter";
                break;
                qDebug() <<"input/output error";
                break;
                qDebug() <<"entity not found";
                break;
                qDebug() <<"operation not supported or unimplemented on
platform";
                break;
                qDebug() <<"overflow error";
                break;
                qDebug() <<"pipe error";
                break;
                qDebug() <<"timeout error";
                break;
                qDebug() <<"other error";
                break;
        }
    }
    libusb_free_device_list(devs, 0);
    libusb_exit(ctx);
Looks okay, but I am not a programmer
Peter Stuge
2012-04-19 02:09:59 UTC
Permalink
..
    for(ssize_t i = 0; i < k; i++){
        libusb_device_handle *handler;
        int er = libusb_open(devs[i], &handler);
        switch(er){
                qDebug() <<"device opened";
                break;
                qDebug() <<"memory allocation failure";
I suggest to replace the entire switch() with perhaps:

qDebug() << er ? libusb_error_name(er) : "device opened";


//Peter

Loading...