Yes, libusb is the way to go:D
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:p