main.c
#include <endian.h>
#include <errno.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <usbhost/usbhost.h>
int main(int argc, char **argv)
{
char buff[64];
int i = 0,out =0;
static uint8_t read_ep;
struct usb_descriptor_header* desc;
struct usb_descriptor_iter iter;
struct usb_interface_descriptor *intf = NULL;
struct usb_endpoint_descriptor *ep1 = NULL;
struct usb_endpoint_descriptor *ep2 = NULL;
struct usb_device *p = usb_device_open("/dev/bus/usb/001/002");
int vendorId = usb_device_get_vendor_id(p);
int productId = usb_device_get_product_id(p);
printf("vid = %x, pid = %x\n",vendorId,productId);
usb_descriptor_iter_init(p, &iter);
while ((desc = usb_descriptor_iter_next(&iter)) != NULL