From: Peter S. <pe...@st...> - 2012-04-19 02:04:34
|
bob 295 wrote: > The relevant libusb-0.1 call I'm trying to emulate in async First do it with sync. > libusb-1.0 is: > > ========= begin Phidget lib snip ============= > BytesWritten = usb_control_msg((usb_dev_handle *)phid->deviceHandle, > USB_ENDPOINT_OUT | USB_TYPE_CLASS | > USB_RECIP_INTERFACE, > USB_REQ_SET_CONFIGURATION, > 0x0200, /* value */ > phid->deviceDef->pdd_iid, /* index*/ > (char *)buffer, > phid->outputReportByteLength, /* size > */ > 500); /* FIXME? timeout */ > =========== end Phidget lib snip =========== BytesWritten = libusb_control_transfer(phid->deviceHandle, LIBUSB_REQUEST_TYPE_CLASS | LIBUSB_RECIPIENT_INTERFACE, 0x09, 0x200, phid->deviceDef->pdd_idd, buffer, phid->outputReportByteLength, 500); As you see the conversion is quite straightforward. But since the Phidgets devices all abuse the HID class you should really be using HIDAPI instead of libusb. For some discussion, see: http://libusb.org/wiki/FAQ#CanIcreateadriverlessdeviceusingHIDclass > What does it mean when the control transfer returns a > LIBUSB_TRANSFER_STALL? That the device does not support your request. See 8.5.3.1 Reporting Status Results page 227 of USB 2.0 spec. //Peter |