• AVR Freaks

Jan Axelson's Generic HID example under Linux with libusb

Author
xiaofan
Super Member
  • Total Posts : 6247
  • Reward points : 0
  • Joined: 2005/04/14 07:05:25
  • Location: Singapore
  • Status: offline
2008/05/25 07:01:57 (permalink)
0

Jan Axelson's Generic HID example under Linux with libusb

A simple libusb program to test the Generic HID example from Jan Axelson's Generic HID example.




#include <usb.h>
#include <stdio.h>

#define VERSION "0.1.0"
#define VENDOR_ID 0x0925
#define PRODUCT_ID 0x7001
#define INTERFACE 0
const static int reqIntLen=2;
const static int endpoint_Int_in=0x81; /* endpoint 0x81 address for IN */
const static int endpoint_Int_out=0x01; /* endpoint 1 address for OUT */

const static int timeout=5000; /* timeout in ms */

void bad(const char *why) {
  fprintf(stderr,"Fatal error> %s\n",why);
  exit(17);
}

usb_dev_handle *find_lvr_hid();

usb_dev_handle* setup_libusb_access() {
    usb_dev_handle *lvr_hid;
    int retval;
    char dname[32] = {0};
    usb_set_debug(255);
    usb_init();
    usb_find_busses();
    usb_find_devices();
           
    if(!(lvr_hid = find_lvr_hid())) {
    printf("Couldn't find the USB device, Exiting\n");
    return NULL;
  }

#ifdef LINUX
  retval = usb_get_driver_np(lvr_hid, 0, dname, 31);
  if (!retval)
    usb_detach_kernel_driver_np(lvr_hid, 0);

#endif


  retval=usb_set_configuration(lvr_hid, 1);
  if ( retval < 0) {
    printf("Could not set configuration 1 : %d\n", retval);
    return NULL;
  }
  retval = retval=usb_claim_interface(lvr_hid, INTERFACE);
  if ( retval < 0) {
    printf("Could not claim interface: %d\n", retval);
    return NULL;
  }

  return lvr_hid;
}

usb_dev_handle *find_lvr_hid()
{
    struct usb_bus *bus;
  struct usb_device *dev;

  for (bus = usb_get_busses(); bus; bus = bus->next) {
      for (dev = bus->devices; dev; dev = dev->next) {
        if (dev->descriptor.idVendor == VENDOR_ID &&
          dev->descriptor.idProduct == PRODUCT_ID ) {
        usb_dev_handle *handle;
          printf("lvr_hid with Vendor Id: %x and Product Id: %x found.\n", VENDOR_ID, PRODUCT_ID);
        if (!(handle = usb_open(dev))) {
          printf("Could not open USB device\n");
          return NULL;
        }

        return handle;
      }
   
    }
  }
 
  return NULL;
}

/*
 void test_control_transfer(usb_dev_handle *dev)
 {
//   usb_set_altinterface(dev, 0);
   usb_release_interface(dev, 0);
 }
*/
 void test_interrupt_transfer(usb_dev_handle *dev)
 {
   int r,i;
   char answer[reqIntLen];
   char question[reqIntLen];
   for (i=0;i<reqIntLen; i++) question[i]=i;
   r = usb_interrupt_write(dev, endpoint_Int_out, question, reqIntLen, timeout);
   if( r < 0 )
   {
    perror("USB interrupt write"); bad("USB write failed");
   }
   r = usb_interrupt_read(dev, endpoint_Int_in, answer, reqIntLen, timeout);
   if( r != reqIntLen )
   {
    perror("USB interrupt read"); bad("USB read failed");
   }
   for (i=0;i<reqIntLen; i++) printf("%i, %i, \n",question[i],answer[i]);
//   usb_set_altinterface(dev, 0);
   usb_release_interface(dev, 0);
 }


int main( int argc, char **argv)
{
  usb_dev_handle *lvr_hid;
  if ((lvr_hid = setup_libusb_access()) == NULL) {
    exit(-1);
  }
//  test_control_transfer(lvr_hid); //not implemented yet
  test_interrupt_transfer(lvr_hid);
  usb_close(lvr_hid);

  return 0;
}



mcuee@ubuntu804:~/Desktop/build/winusb$ gcc -o libusb_lvrhid libusb_lvrhid.c -I/usr/local -L/usr/local -lusb

mcuee@ubuntu804:~/Desktop/build/winusb$ sudo ./libusb_lvrhid lvr_hid with Vendor Id: 925 and Product Id: 7001 found.
0, 0,
1, 1,
post edited by xiaofan - 2010/02/18 05:48:28

  USB_Links and libusb
#1

6 Replies Related Threads

    xiaofan
    Super Member
    • Total Posts : 6247
    • Reward points : 0
    • Joined: 2005/04/14 07:05:25
    • Location: Singapore
    • Status: offline
    RE: Jan Axelson`s Generic HID example under Linux with libusb 2010/02/02 08:24:49 (permalink)
    0
    The above is only tested using the Stack V2.1 version and under Linux using the PIC18F87J50PIM..

    The following is the libusb 1.0 version of the above program and tested under Linux.

    I tend to think this example is not totally correct. I have problems to get it working with libusb 1.0 Windows backend. And I have not tested the Stack V2.5 version of the example.


    #include <errno.h>
    #include <signal.h>
    #include <string.h>
    #include <stdio.h>
    #include <stdlib.h>
    #include <libusb-1.0/libusb.h>

    #define VERSION "0.1.0"
    #define VENDOR_ID 0x0925
    #define PRODUCT_ID 0x7001

    const static int PACKET_INT_LEN=2;
    const static int INTERFACE=0;
    const static int ENDPOINT_INT_IN=0x81; /* endpoint 0x81 address for IN */
    const static int ENDPOINT_INT_OUT=0x01; /* endpoint 1 address for OUT */
    const static int TIMEOUT=5000; /* timeout in ms */

    void bad(const char *why) {
      fprintf(stderr,"Fatal error> %s\n",why);
      exit(17);
    }

    static struct libusb_device_handle *devh = NULL;

    static int find_lvr_hidusb(void)
    {
      devh = libusb_open_device_with_vid_pid(NULL, VENDOR_ID, PRODUCT_ID);
      return devh ? 0 : -EIO;
    }

    static int test_interrupt_transfer(void)
    {
        int r,i;
        int transferred;
        char answer[PACKET_INT_LEN];
        char question[PACKET_INT_LEN];
        for (i=0;i<PACKET_INT_LEN; i++) question[i]=i;

        r = libusb_interrupt_transfer(devh, ENDPOINT_INT_OUT, question, PACKET_INT_LEN,
        &transferred,TIMEOUT);
        if (r < 0) {
            fprintf(stderr, "Interrupt write error %d\n", r);
        return r;
        }
        r = libusb_interrupt_transfer(devh, ENDPOINT_INT_IN, answer,PACKET_INT_LEN,
            &transferred, TIMEOUT);
        if (r < 0) {
            fprintf(stderr, "Interrupt read error %d\n", r);
            return r;
        }
        if (transferred < PACKET_INT_LEN) {
            fprintf(stderr, "Interrupt transfer short read (%d)\n", r);
            return -1;
        }

        for(i = 0;i < PACKET_INT_LEN; i++) {
           if(i%8 == 0)
              printf("\n");
              printf("%02x, %02x; ",question[i],answer[i]);
           }
        printf("\n");
        return 0;
    }

    int main(void)
    {
      int r = 1;

      r = libusb_init(NULL);
      if (r < 0) {
        fprintf(stderr, "Failed to initialise libusb\n");
        exit(1);
      }

      r = find_lvr_hidusb();
      if (r < 0) {
        fprintf(stderr, "Could not find/open LVR Generic HID device\n");
        goto out;
      }
      printf("Successfully find the LVR Generic HID device\n");

    #ifdef LINUX
      libusb_detach_kernel_driver(devh, 0);
    #endif

      r = libusb_set_configuration(devh, 1);
      if (r < 0) {
        fprintf(stderr, "libusb_set_configuration error %d\n", r);
        goto out;
      }
      printf("Successfully set usb configuration 1\n");
      r = libusb_claim_interface(devh, 0);
      if (r < 0) {
        fprintf(stderr, "libusb_claim_interface error %d\n", r);
        goto out;
      }
      printf("Successfully claimed interface\n");

      test_interrupt_transfer();
      libusb_release_interface(devh, 0);
    out:
    //  libusb_reset_device(devh);
      libusb_close(devh);
      libusb_exit(NULL);
      return r >= 0 ? r : -r;
    }



      USB_Links and libusb
    #2
    xiaofan
    Super Member
    • Total Posts : 6247
    • Reward points : 0
    • Joined: 2005/04/14 07:05:25
    • Location: Singapore
    • Status: offline
    RE: Jan Axelson`s Generic HID example under Linux with libusb 2010/02/07 02:11:30 (permalink)
    0
    The above test program is incomplete since it does not test the feature report.
    Here is the full test program using libusb 1.0, tested under Ubuntu 9.10 32bit.

     
    #include <errno.h>
    #include <signal.h>
    #include <string.h>
    #include <stdio.h>
    #include <stdlib.h>
    #include <libusb-1.0/libusb.h>

    #define VERSION "0.1.0"

    #define VENDOR_ID 0x0925

    #define PRODUCT_ID 0x7001

    // HID Class-Specific Requests values. See section 7.2 of the HID specifications
    #define HID_GET_REPORT 0x01
    #define HID_GET_IDLE 0x02
    #define HID_GET_PROTOCOL 0x03
    #define HID_SET_REPORT 0x09
    #define HID_SET_IDLE 0x0A
    #define HID_SET_PROTOCOL 0x0B
    #define HID_REPORT_TYPE_INPUT 0x01
    #define HID_REPORT_TYPE_OUTPUT 0x02
    #define HID_REPORT_TYPE_FEATURE 0x03


    #define CTRL_IN LIBUSB_ENDPOINT_IN|LIBUSB_REQUEST_TYPE_CLASS|LIBUSB_RECIPIENT_INTERFACE
    #define CTRL_OUT LIBUSB_ENDPOINT_OUT|LIBUSB_REQUEST_TYPE_CLASS|LIBUSB_RECIPIENT_INTERFACE


    const static int PACKET_CTRL_LEN=2;

    const static int PACKET_INT_LEN=2;
    const static int INTERFACE=0;
    const static int ENDPOINT_INT_IN=0x81; /* endpoint 0x81 address for IN */
    const static int ENDPOINT_INT_OUT=0x01; /* endpoint 1 address for OUT */
    const static int TIMEOUT=5000; /* timeout in ms */


    void bad(const char *why) {
    fprintf(stderr,"Fatal error> %s\n",why);
    exit(17);
    }


    static struct libusb_device_handle *devh = NULL;



    static int find_lvr_hidusb(void)
    {
    devh = libusb_open_device_with_vid_pid(NULL, VENDOR_ID, PRODUCT_ID);
    return devh ? 0 : -EIO;
    }



    static int test_control_transfer(void)
    {
    int r,i;
    char answer[PACKET_CTRL_LEN];
    char question[PACKET_CTRL_LEN];
    for (i=0;i<PACKET_CTRL_LEN; i++) question[i]=0x20+i;

    r = libusb_control_transfer(devh,CTRL_OUT,HID_SET_REPORT,(HID_REPORT_TYPE_FEATURE<<8)|0x00, 0,question, PACKET_CTRL_LEN,TIMEOUT);
    if (r < 0) {
    fprintf(stderr, "Control Out error %d\n", r);
    return r;
    }
    r = libusb_control_transfer(devh,CTRL_IN,HID_GET_REPORT,(HID_REPORT_TYPE_FEATURE<<8)|0x00,0, answer,PACKET_CTRL_LEN, TIMEOUT);
    if (r < 0) {
    fprintf(stderr, "Control IN error %d\n", r);
    return r;
    }
    for(i = 0;i < PACKET_CTRL_LEN; i++) {
    if(i%8 == 0)
    printf("\n");
    printf("%02x, %02x; ",question[i],answer[i]);
    }
    printf("\n");

    return 0;
    }

    static int test_interrupt_transfer(void)
    {
    int r,i;
    int transferred;
    char answer[PACKET_INT_LEN];
    char question[PACKET_INT_LEN];
    for (i=0;i<PACKET_INT_LEN; i++) question[i]=0x40+i;

    r = libusb_interrupt_transfer(devh, ENDPOINT_INT_OUT, question, PACKET_INT_LEN,
    &transferred,TIMEOUT);
    if (r < 0) {
    fprintf(stderr, "Interrupt write error %d\n", r);
    return r;
    }
    r = libusb_interrupt_transfer(devh, ENDPOINT_INT_IN, answer,PACKET_INT_LEN,
    &transferred, TIMEOUT);
    if (r < 0) {
    fprintf(stderr, "Interrupt read error %d\n", r);
    return r;
    }
    if (transferred < PACKET_INT_LEN) {
    fprintf(stderr, "Interrupt transfer short read (%d)\n", r);
    return -1;
    }

    for(i = 0;i < PACKET_INT_LEN; i++) {
    if(i%8 == 0)
    printf("\n");
    printf("%02x, %02x; ",question[i],answer[i]);
    }
    printf("\n");

    return 0;
    }


    int main(void)
    {
    int r = 1;

    r = libusb_init(NULL);
    if (r < 0) {
    fprintf(stderr, "Failed to initialise libusb\n");
    exit(1);
    }

    r = find_lvr_hidusb();
    if (r < 0) {
    fprintf(stderr, "Could not find/open LVR Generic HID device\n");
    goto out;
    }
    printf("Successfully find the LVR Generic HID device\n");

    #ifdef LINUX
    libusb_detach_kernel_driver(devh, 0);
    #endif

    r = libusb_set_configuration(devh, 1);
    if (r < 0) {
    fprintf(stderr, "libusb_set_configuration error %d\n", r);
    goto out;
    }
    printf("Successfully set usb configuration 1\n");
    r = libusb_claim_interface(devh, 0);
    if (r < 0) {
    fprintf(stderr, "libusb_claim_interface error %d\n", r);
    goto out;
    }
    printf("Successfully claimed interface\n");

    printf("Testing control transfer using loop back test of feature report");
    test_control_transfer();
    printf("Testing interrupt transfer using loop back test of input/output report");
    test_interrupt_transfer();

    libusb_release_interface(devh, 0);
    out:
    // libusb_reset_device(devh);
    libusb_close(devh);
    libusb_exit(NULL);
    return r >= 0 ? r : -r;

    }

     
    mcuee@ubuntu:~/Desktop/build/libusb1/examples/lvrhid_libusb1$gcc -DLINUX -o libusb1_hidusb3
    libusb1_lvrhid3.c -I/usr/local /usr/local/lib/libusb-1.0.a -lrt
    mcuee@ubuntu:~/Desktop/build/libusb1/examples/lvrhid_libusb1$ sudo ./libusb1_hidusb3
    Successfully find the LVR Generic HID device
    Successfully set usb configuration 1
    Successfully claimed interface
    Testing control transfer using loop back test of feature report
    20, 20; 21, 21;
    Testing interrupt transfer using loop back test of input/output report
    40, 40; 41, 41;
    post edited by xiaofan - 2011/01/10 19:12:34
    #3
    xiaofan
    Super Member
    • Total Posts : 6247
    • Reward points : 0
    • Joined: 2005/04/14 07:05:25
    • Location: Singapore
    • Status: offline
    RE: Jan Axelson`s Generic HID example under Linux with libusb 2010/02/07 04:33:08 (permalink)
    0
    For the latest Stack V2.5, the above libusb 1.0 program is also working. But I need to uncomment the following line.
    // libusb_reset_device(devh);

    If not, there will be problems like this.
    mcuee@ubuntu:~/Desktop/build/libusb1/examples/lvrhid_libusb1$ sudo ./libusb1_hidusb4
    Successfully find the LVR Generic HID device
    Successfully set usb configuration 1
    Successfully claimed interface
    Testing control transfer using loop back test of feature report
    20, 20; 21, 21;
    Interrupt read error -7
    Testing interrupt transfer using loop back test of input/output report

    This is similar to the fix to the libusb 1.0 program for the V2.5 Stack based Generic WinUSB firmware. It seems to me that there is a potential bug for the V2.5 stack.
    http://www.microchip.com/forums/tm.aspx?m=340892&mpage=4

      USB_Links and libusb
    #4
    xiaofan
    Super Member
    • Total Posts : 6247
    • Reward points : 0
    • Joined: 2005/04/14 07:05:25
    • Location: Singapore
    • Status: offline
    RE: Jan Axelson`s Generic HID example under Linux with libusb 2010/10/31 20:11:33 (permalink)
    0
    For USB Stack 2.7, it seems to be okay now without the reset code. The following code is more complete than the above. Tested under Ubuntu 10.04/10.10 and Windows XP/Vista/Win7 using libusb-1.0.

     
    #include <errno.h>
    #include <string.h>
    #include <stdio.h>
    #include <stdlib.h>
    #include <libusb-1.0/libusb.h>

    #define VERSION "0.1.0"
    #define VENDOR_ID 0x0925
    #define PRODUCT_ID 0x7001

    // HID Class-Specific Requests values. See section 7.2 of the HID specifications
    #define HID_GET_REPORT                0x01
    #define HID_GET_IDLE                  0x02
    #define HID_GET_PROTOCOL              0x03
    #define HID_SET_REPORT                0x09
    #define HID_SET_IDLE                  0x0A
    #define HID_SET_PROTOCOL              0x0B
    #define HID_REPORT_TYPE_INPUT         0x01
    #define HID_REPORT_TYPE_OUTPUT        0x02
    #define HID_REPORT_TYPE_FEATURE       0x03
     
    #define CTRL_IN        LIBUSB_ENDPOINT_IN|LIBUSB_REQUEST_TYPE_CLASS|LIBUSB_RECIPIENT_INTERFACE
    #define CTRL_OUT    LIBUSB_ENDPOINT_OUT|LIBUSB_REQUEST_TYPE_CLASS|LIBUSB_RECIPIENT_INTERFACE


    const static int PACKET_CTRL_LEN=2; 
    const static int PACKET_INT_LEN=2;
    const static int INTERFACE=0;
    const static int ENDPOINT_INT_IN=0x81; /* endpoint 0x81 address for IN */
    const static int ENDPOINT_INT_OUT=0x01; /* endpoint 1 address for OUT */
    const static int TIMEOUT=5000; /* timeout in ms */

    void bad(const char *why) {
        fprintf(stderr,"Fatal error> %s\n",why);
        exit(17);
    }
     
    static struct libusb_device_handle *devh = NULL;
     
    static int find_lvr_hidusb(void)
    {
        devh = libusb_open_device_with_vid_pid(NULL, VENDOR_ID, PRODUCT_ID);
        return devh ? 0 : -EIO;
    }


    static int test_control_transfer(void)
    {
           int r,i;
           char answer[PACKET_CTRL_LEN];
           char question[PACKET_CTRL_LEN];
           for (i=0;i<PACKET_CTRL_LEN; i++) question[i]=0x20+i;

        r = libusb_control_transfer(devh,CTRL_OUT,HID_SET_REPORT,(HID_REPORT_TYPE_FEATURE<<8)|0x00, 0,question, PACKET_CTRL_LEN,TIMEOUT);
        if (r < 0) {
            fprintf(stderr, "Control Out error %d\n", r);
            return r;
        }
        r = libusb_control_transfer(devh,CTRL_IN,HID_GET_REPORT,(HID_REPORT_TYPE_FEATURE<<8)|0x00,0, answer,PACKET_CTRL_LEN, TIMEOUT);
        if (r < 0) {
            fprintf(stderr, "Control IN error %d\n", r);
            return r;
        }
        for(i = 0;i < PACKET_CTRL_LEN; i++) {
            if(i%8 == 0)
                printf("\n");
            printf("%02x, %02x; ",question[i],answer[i]);
        }
        printf("\n");

        return 0;
    }

    static int test_control_transfer_in_out(void)
    {
           int r,i;
           char answer[PACKET_INT_LEN];
           char question[PACKET_INT_LEN];
           for (i=0;i<PACKET_INT_LEN; i++) question[i]=0x30+i;
           for (i=1;i<PACKET_INT_LEN; i++) answer[i]=0;

        r = libusb_control_transfer(devh,CTRL_OUT,HID_SET_REPORT,(HID_REPORT_TYPE_OUTPUT<<8)|0x00, 0,question, PACKET_INT_LEN,TIMEOUT);
        if (r < 0) {
            fprintf(stderr, "Control Out error %d\n", r);
            return r;
        }
        r = libusb_control_transfer(devh,CTRL_IN,HID_GET_REPORT,(HID_REPORT_TYPE_INPUT<<8)|0x00, 0, answer,PACKET_INT_LEN, TIMEOUT);
        if (r < 0) {
            fprintf(stderr, "Control IN error %d\n", r);
            return r;
        }
        for(i = 0;i < PACKET_INT_LEN; i++) {
            if(i%8 == 0)
                printf("\n");
            printf("%02x, %02x; ",question[i],answer[i]);
        }
        printf("\n");

        return 0;
    }


    static int test_interrupt_transfer(void)
    {
           int r,i;
        int transferred;
           char answer[PACKET_INT_LEN];
           char question[PACKET_INT_LEN];
           for (i=0;i<PACKET_INT_LEN; i++) question[i]=0x40+i;

        r = libusb_interrupt_transfer(devh, ENDPOINT_INT_OUT, question, PACKET_INT_LEN,
            &transferred,TIMEOUT);
        if (r < 0) {
            fprintf(stderr, "Interrupt write error %d\n", r);
            return r;
        }
        r = libusb_interrupt_transfer(devh, ENDPOINT_INT_IN, answer,PACKET_INT_LEN,
            &transferred, TIMEOUT);
        if (r < 0) {
            fprintf(stderr, "Interrupt read error %d\n", r);
            return r;
        }
        if (transferred < PACKET_INT_LEN) {
            fprintf(stderr, "Interrupt transfer short read (%d)\n", r);
            return -1;
        }

        for(i = 0;i < PACKET_INT_LEN; i++) {
            if(i%8 == 0)
                printf("\n");
            printf("%02x, %02x; ",question[i],answer[i]);
        }
        printf("\n");

        return 0;
    }
     
    int main(void)
    {
        int r = 1;

        r = libusb_init(NULL);
        if (r < 0) {
            fprintf(stderr, "Failed to initialise libusb\n");
            exit(1);
        }

        r = find_lvr_hidusb();
        if (r < 0) {
            fprintf(stderr, "Could not find/open LVR Generic HID device\n");
            goto out;
        }
        printf("Successfully find the LVR Generic HID device\n");

    #ifdef LINUX
         libusb_detach_kernel_driver(devh, 0);    
    #endif

        r = libusb_set_configuration(devh, 1);
        if (r < 0) {
            fprintf(stderr, "libusb_set_configuration error %d\n", r);
            goto out;
        }
        printf("Successfully set usb configuration 1\n");
        r = libusb_claim_interface(devh, 0);
        if (r < 0) {
            fprintf(stderr, "libusb_claim_interface error %d\n", r);
            goto out;
        }
        printf("Successfully claimed interface\n");

        printf("Testing control transfer using loop back test of feature report");
        test_control_transfer();

        printf("Testing control transfer using loop back test of input/output report");
        test_control_transfer_in_out();
       
        printf("Testing interrupt transfer using loop back test of input/output report");
        test_interrupt_transfer();

        printf("\n");
     
        libusb_release_interface(devh, 0);
    out:
    //    libusb_reset_device(devh);
        libusb_close(devh);
        libusb_exit(NULL);
        return r >= 0 ? r : -r;
    }



    mcuee@Ubuntu1010:~/Desktop/build/picusb/lvr_hid/lvrhid1$ ./libusb1_hidusb5
    Successfully find the LVR Generic HID device
    Successfully set usb configuration 1
    Successfully claimed interface
    Testing control transfer using loop back test of feature report
    20, 20; 21, 21;
    Testing control transfer using loop back test of input/output report
    30, 30; 31, 31;
    Testing interrupt transfer using loop back test of input/output report
    40, 40; 41, 41;


    post edited by xiaofan - 2011/01/10 19:10:43

      USB_Links and libusb
    #5
    Pajn
    New Member
    • Total Posts : 2
    • Reward points : 0
    • Joined: 2011/02/01 10:02:57
    • Location: 0
    • Status: offline
    RE: Jan Axelson`s Generic HID example under Linux with libusb 2011/02/01 10:07:34 (permalink)
    0
    I have problems with that libusb example.

    rasmus@Rasmus-Ubuntu:~/Skrivbord/untitled folder$ sudo ./NexaTransmitter
    Successfully find the LVR Generic HID device
    Successfully find the LVR Generic HID device
    Successfully set usb configuration 1
    Successfully claimed interface
    Testing control transfer using loop back test of feature report
    Control Out error -9
    Testing control transfer using loop back test of input/output report
    Control Out error -9
    Testing interrupt transfer using loop back test of input/output report
    Interrupt read error -7

    EDIT: The first time I run the program after pluging it in it returns
    Interrupt read error -8
    It's just the following times that returns -7

    post edited by Pajn - 2011/02/01 11:57:07
    #6
    xiaofan
    Super Member
    • Total Posts : 6247
    • Reward points : 0
    • Joined: 2005/04/14 07:05:25
    • Location: Singapore
    • Status: offline
    RE: Jan Axelson`s Generic HID example under Linux with libusb 2011/02/11 19:22:00 (permalink)
    0
    Make sure your firmware works first.

      USB_Links and libusb
    #7
    Jump to:
    © 2019 APG vNext Commercial Version 4.5