Results 1 to 8 of 8

Thread: USB programming

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #6
    Quote Originally Posted by wpte View Post
    Yes, libusb is the way to go
    Last time I tried with the optware compiler on the router it didn't work tho... maybe it's also because the webcam driver claimed the xbox360 controller I was attempting to read out.
    Maybe you have better luck with the crosscompiler

    quick example:
    Code:
    #include <stdio.h>
    #include <stdlib.h>
    #include <libusb.h>
    
    int Send(libusb_device_handle *h, unsigned char data[], unsigned char endpoint)
    {
        int transferred, r;
        r = libusb_interrupt_transfer(h, endpoint, data, sizeof data, &transferred, 0);
        return r;
    }
    
    int Init(void)
    {
        libusb_device_handle *Controller;
        libusb_init(NULL);
        Controller = libusb_open_device_with_vid_pid(NULL, 0x045e, 0x028e);
    }
    With the init function you start the libusb and open the first (unclaimed) device with a specific vid and pid.

    Depending on the AVR configuration you can also read data from a specific usb endpoint when the buffer (data) is empty (or needs to be filled).

    usb on avr can be a little messy btw
    at least, it's not my favourite thing to do
    Thanks for help. I've got some experience with my AVR and Windows libusb-0.1 library so I hope it won't be so hard to compile one simple USB data sending program. (never say never...)
    Last edited by Blackbirdrozd; 12-01-2011 at 15:22.

Similar Threads

  1. linuxrc bug? - WL-500g not booting from usb drive with hub
    By daniel632 in forum WL-500g Custom Development
    Replies: 5
    Last Post: 14-03-2012, 15:28
  2. Unstable boot from USB
    By Tamadite in forum WL-500g Q&A
    Replies: 6
    Last Post: 20-08-2008, 15:19
  3. 7.09 + USB + hotplug
    By oilinki in forum WL-700g Q&A
    Replies: 0
    Last Post: 18-11-2007, 12:51

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •