Hi cynfab,
please check, if your code is also working fine after changing the order of the string descriptors
a[8] = { 2,1,3,4,5,6,7};
and
if (a==3){
r = libusb_set_configuration(devh, 3);
this part give as result:
libusb_get_string_descriptor langid=0x409
String descriptor 2: "FLIR ONE Camera"
String descriptor 1: "FLIR Systems"
String descriptor 3: "FLIRONEFXXXXXXXFFF"
Successfully set usb configuration 3
String descriptor 4: "SBIBDP Configuration"
String descriptor 5: "iAP Interface"
String descriptor 6: "com.flir.rosebud.fileio"
String descriptor 7: "com.flir.rosebud.frame"
int a[8] = { 2,1,3,4,5,6,7};
// Get all string descriptors.
for (i = 0; i <= 6; i++)
{
r = libusb_get_string_descriptor(devh, a[i], langid, tbuf, 0xFF);
if (r >= 0)
{
//printf("String descriptor %u: \"%s\"\n", a[i], string_buffer);
int si, di;
for (di = 0, si = 2; si < tbuf[0]; si += 2) {
if ((tbuf[si] & 0x80) || (tbuf[si + 1])) /* non-ASCII */
string_buffer[di++] = '?';
else
string_buffer[di++] = tbuf[si];
}
string_buffer[di] = 0;
printf("String descriptor %u: \"%s\"\n", a[i], string_buffer);
} else {
fprintf(stderr, "libusb_get_string_descriptor wValue=%i error %d\n", a[i], r);
goto out;
}
// after string_descriptor 0303 comes SET_CONFIGURATION = 03
if (a[i]==3){
r = libusb_set_configuration(devh, 3);
if (r < 0) {
fprintf(stderr, "libusb_set_configuration error %d\n", r);
goto out;
}
printf("Successfully set usb configuration 3\n");
}
}