MCPcopy Create free account
hub / github.com/CalcProgrammer1/OpenRGB / get_first_language

Function get_first_language

dependencies/hidapi/hidapi.c:263–278  ·  view source on GitHub ↗

Get the first language the device says it reports. This comes from USB string #0. */

Source from the content-addressed store, hash-verified

261/* Get the first language the device says it reports. This comes from
262 USB string #0. */
263static uint16_t get_first_language(libusb_device_handle *dev)
264{
265 uint16_t buf[32];
266 int len;
267
268 /* Get the string from libusb. */
269 len = libusb_get_string_descriptor(dev,
270 0x0, /* String ID */
271 0x0, /* Language */
272 (unsigned char*)buf,
273 sizeof(buf));
274 if (len < 4)
275 return 0x0;
276
277 return buf[1]; /* First two bytes are len and descriptor type. */
278}
279
280static int is_language_supported(libusb_device_handle *dev, uint16_t lang)
281{

Callers 1

get_usb_stringFunction · 0.85

Calls 1

Tested by

no test coverage detected