|
From: Andrew X. <and...@gm...> - 2006-05-04 01:31:10
|
How come there is not control message going to the USB device when doing
usb_set_configuration???
static int usb_get_configuration(usb_dev_handle *dev)
{
int ret;
char config;
ret = usb_control_msg(dev, USB_RECIP_DEVICE | USB_ENDPOINT_IN,
USB_REQ_GET_CONFIGURATION ,
0, 0, &config, 1, LIBUSB_DEFAULT_TIMEOUT);
if(ret >= 0)
{
return config;
}
return ret;
}
int usb_set_configuration(usb_dev_handle *dev, int configuration)
{
DWORD sent;
libusb_request req;
if(dev->impl_info == INVALID_HANDLE_VALUE)
{
usb_error("usb_set_configuration: error: device not open");
return -EINVAL;
}
req.configuration.configuration = configuration;
req.timeout = LIBUSB_DEFAULT_TIMEOUT;
if(!DeviceIoControl(dev->impl_info, LIBUSB_IOCTL_SET_CONFIGURATION,
&req, sizeof(libusb_request),
NULL, 0, &sent, NULL))
{
usb_error("usb_set_configuration: could not set config %d: "
"win error: %s", configuration, usb_win_error_to_string());
return -usb_win_error_to_errno();
}
dev->config = configuration;
dev->interface = -1;
dev->altsetting = -1;
return 0;
}
----- Original Message -----
From: "Stephan Meyer" <ste...@we...>
To: <lib...@li...>
Sent: Wednesday, May 03, 2006 3:47 PM
Subject: Re: [Libusb-win32-devel] simple example on bulkread/bulkwrite?
>
>> Does anyone have a simple example of bulkread/bulkwrite?
>>
>
> see attachment.
>
>>
>> Also, why no name show up for the device in the device manager? I ran the
>> info maker and put in some names, but it did not show up on the device
>> manager, I am running winxp.
>>
>>
>>
>> thanks
>>
>> Andrew
>>
>>
>
>
> _______________________________________________________________
> SMS schreiben mit WEB.DE FreeMail - einfach, schnell und
> kostenguenstig. Jetzt gleich testen! http://f.web.de/?mc=021192
>
>
|