@KurtE I've try that too, without success.
For the record, I finally solved this by using the VID and DID instead of the USB names, and did it with a simplified version of the USBDeviceInfo class from the HIDDeviceInfo example in the Teensy library,
when a USB device is connected it sends the vendor and product id due to that 'claim' thing:
USBDeviceInfo.h
Code:
/* USB Device Info class
...license...
*/
// This simple class does nothing, but print out information about the device it
// extracts from calls to claim...
#ifndef __USBDeviceInfo_h_
#define __USBDeviceInfo_h_
#include <Arduino.h>
#include <USBHost_t36.h>
class USBDeviceInfo : public USBDriver {
public:
USBDeviceInfo(USBHost &host) { init();}
protected:
virtual bool claim(Device_t *dev , int type , const uint8_t *descriptors, uint32_t len
);
virtual void disconnect() {};
void init();
};
#endif
USBDeviceInfo.cpp
Code:
/* USB Device Info class
...license...
*/
// This simple class does nothing, but print out information about the device it
// extracts from calls to claim...
#include <Arduino.h>
#include <USBHost_t36.h>
#include "USBDeviceInfo.h"
extern void vid_did(uint16_t vid, uint16_t did);
void USBDeviceInfo::init()
{
driver_ready_for_device(this);
}
// Again this class is solely to display as much information about a device as we can...
// This all comes from the information passed to it through the claim method.
bool USBDeviceInfo::claim(Device_t *dev , int type , const uint8_t *descriptors, uint32_t len)
{
if (type == 0)
{
// At device level
vid_did(dev->idVendor, dev->idProduct);
return false;
}
return false;
}
this will not work without the USBHub
Code:
#include <USBHost_t36.h>
USBHost myusb;
USBHub hub1(myusb);
#include "USBDeviceInfo.h"
USBDeviceInfo dinfo(myusb);
Maybe the variable used in the vid_did() function should be declared as volatile, but in my case it does work fine as is.