| 
      
      
      From: Andrew X. <and...@gm...> - 2006-05-05 14:06:31
      
     | 
| Here is what I have, I try to  if(usb_set_configuration(dev, 1) < 0) but I 
don't see it on the device.
Also, who will set the address? The device needs an address to work.
-Andrew
 struct usb_bus *bus;
  usb_dev_handle *dev = NULL;
    char tmp[BUF_SIZE];
  if (argc > 1 && !strcmp(argv[1], "-v"))
    verbose = 1;
  usb_init();
  usb_set_debug(0xffff);
  usb_find_busses();
  usb_find_devices();
  for (bus = usb_get_busses(); bus; bus = bus->next) {
    if (bus->root_dev && !verbose)
      print_device(bus->root_dev, 0);
    else {
      struct usb_device *dev1;
      for (dev1 = bus->devices; dev1; dev1 = dev1->next)
   {
      //  print_device(dev1, 0);
   }
 }
  }
  if(!(dev = open_dev()))
    {
      printf("error: device not found!\n");
      return 0;
    }
  char temp;
  int ret;
/*int ret=usb_control_msg(dev, 0, USB_REQ_SET_ADDRESS,
                      0, 0, 0, 0,
                      500);
   if(ret<0)
   {
      printf("error: USB_REQ_SET_ADDRESS 3 failed\n");
      usb_close(dev);
      return 0;
    }
    ret=usb_control_msg(dev, 0, USB_REQ_GET_DESCRIPTOR,
                      0, 0, &temp, 0,
                      500);
   if(ret<0)
   {
      printf("error: USB_REQ_GET_DESCRIPTOR 0 failed\n");
      usb_close(dev);
      return 0;
    }*/
  if(usb_set_configuration(dev, 1) < 0)
    {
      printf("error: setting config 1 failed\n");
      usb_close(dev);
      return 0;
    }
  if(usb_claim_interface(dev, 0) < 0)
    {
      printf("error: claiming interface 0 failed\n");
      usb_close(dev);
      return 0;
    }
  if(usb_bulk_write(dev, EP_OUT, tmp, sizeof(tmp), 5000)
     != sizeof(tmp))
    {
      printf("error: bulk write failed\n");
    }
  if(usb_bulk_read(dev, EP_IN, tmp, sizeof(tmp), 5000)
     != sizeof(tmp))
    {
      printf("error: bulk read failed\n");
    }
  usb_release_interface(dev, 0);
  usb_close(dev);
----- Original Message ----- 
From: "Dan Ellis" <Dan...@ne...>
To: <lib...@li...>
Sent: Friday, May 05, 2006 5:23 AM
Subject: RE: [Libusb-win32-devel] usb_set_configuration error
> Andrew Xiang wrote:
>> I don't see the set_configuration 0x0900 come in on the device.
>> I see all the get_descriptor messages, and also, 0x880 to get the
>> configuration, but NOT the 0x0900.
>>
>> I wonder why?
>
> You'll have to provide more description than that for anyone to help.
> Please clarify what the number are you are quoting, e.g. the whole 8
> bytes of the request in order, or name the bytes.
>
> Also, when do you see this happening? When you plug the device in, in
> which case it's just windows interrogating the device, or when you run
> your code.
>
> Dan.
>
>
> -------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job 
> easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd_______________________________________________
> Libusb-win32-devel mailing list
> Lib...@li...
> https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
> 
 |