The libusb version included in FreeBSD < 10 doesn't have this function. In mainline libusb, it's inlined in libusb.h. This function will bear a striking resemblance to that one, because there's about one way to code it. Note that the data parameter is Unicode in UTF-16LE encoding. Return value is the number of bytes in data, or LIBUSB_ERROR_*. */
| 338 | Return value is the number of bytes in data, or LIBUSB_ERROR_*. |
| 339 | */ |
| 340 | static inline int libusb_get_string_descriptor(libusb_device_handle *dev, |
| 341 | uint8_t descriptor_index, uint16_t lang_id, |
| 342 | unsigned char *data, int length) |
| 343 | { |
| 344 | return libusb_control_transfer(dev, |
| 345 | LIBUSB_ENDPOINT_IN | 0x0, /* Endpoint 0 IN */ |
| 346 | LIBUSB_REQUEST_GET_DESCRIPTOR, |
| 347 | (LIBUSB_DT_STRING << 8) | descriptor_index, |
| 348 | lang_id, data, (uint16_t) length, 1000); |
| 349 | } |
| 350 | |
| 351 | #endif |
| 352 |
no outgoing calls
no test coverage detected