8 main(int argc
, char *argv
[])
11 printf("usage: %s <device> <configuration index>\n", argv
[0]);
15 BUSBDevice
device(argv
[1]);
16 if (device
.InitCheck() != B_OK
) {
17 printf("failed to open device %s\n", argv
[1]);
22 if (sscanf(argv
[2], "%lu", &index
) != 1) {
23 printf("could not parse configuration index\n");
27 const BUSBConfiguration
*config
= device
.ConfigurationAt(index
);
29 printf("couldn't get configuration at %lu\n", index
);
33 status_t result
= device
.SetConfiguration(config
);
35 printf("failed to set configuration: %s\n", strerror(result
));
39 printf("configuration %lu set on device %s\n", index
, argv
[1]);