If you wish to get the product name of a device that has connected to one of your USB Host objects, there are methods on them to do so:
Most of the examples with the library have code like:
Code:
for (uint8_t i = 0; i < CNT_DEVICES; i++) {
if (*drivers[i] != driver_active[i]) {
if (driver_active[i]) {
Serial.printf("*** Device %s - disconnected ***\n", driver_names[i]);
driver_active[i] = false;
} else {
Serial.printf("*** Device %s %x:%x - connected ***\n", driver_names[i], drivers[i]->idVendor(), drivers[i]->idProduct());
driver_active[i] = true;
const uint8_t *psz = drivers[i]->manufacturer();
if (psz && *psz) Serial.printf(" manufacturer: %s\n", psz);
psz = drivers[i]->product();
if (psz && *psz) Serial.printf(" product: %s\n", psz);
psz = drivers[i]->serialNumber();
if (psz && *psz) Serial.printf(" Serial: %s\n", psz);
}
}
}
for (uint8_t i = 0; i < CNT_HIDDEVICES; i++) {
if (*hiddrivers[i] != hid_driver_active[i]) {
if (hid_driver_active[i]) {
Serial.printf("*** HID Device %s - disconnected ***\n", hid_driver_names[i]);
hid_driver_active[i] = false;
} else {
Serial.printf("*** HID Device %s %x:%x - connected ***\n", hid_driver_names[i], hiddrivers[i]->idVendor(), hiddrivers[i]->idProduct());
hid_driver_active[i] = true;
const uint8_t *psz = hiddrivers[i]->manufacturer();
if (psz && *psz) Serial.printf(" manufacturer: %s\n", psz);
psz = hiddrivers[i]->product();
if (psz && *psz) Serial.printf(" product: %s\n", psz);
psz = hiddrivers[i]->serialNumber();
if (psz && *psz) Serial.printf(" Serial: %s\n", psz);
}
}
}
The first loop prints out all of the top level object that have connected. By top level, these are ones that connect up at the USBDriver level, like keyboard, hub, ...
The second loop are those who then connect up at a HID level (Human Interface Device). That is ones who are driven by a table that is loaded from the device that describes the format of the data. This often includes ones like Mouse, joystick, ... At times it is hard to know the differentiation between these groups, as for example some Joysticks may work at HID level others directly... This code does not show it but there is a third version, of those that connect up through bluetooth... There are examples that show this as well.
Now if you are wanting to see the name of a device that connects that tries to connect that no driver claims, I am not sure we exported anything to do so. Probably could if needed.