Usb device description change

I did follow this little tutorial in order to try to make a little mouse jiggler from a ATtiny85 :

Everything works as expected but I had to make the following few changes to usbconfig.h in order to make the device look and feel like a Lenovo regular mouse :

#define USB_CFG_VENDOR_ID 0xef, 0x17
#define USB_CFG_DEVICE_ID 0x39, 0x60
#define USB_CFG_DEVICE_VERSION 0x70, 0x01
#define USB_CFG_DESCR_PROPS_STRING_VENDOR USB_PROP_IS_DYNAMIC
#define USB_CFG_DESCR_PROPS_STRING_PRODUCT USB_PROP_IS_DYNAMIC

Now that seems to work but I'm still missing how to get the "Lenovo Laser Wireless Mouse" description since I only get "Composite device" instead. Would you have any hint on how I can address that ?

#define USB_CFG_DESCR_PROPS_STRING_VENDOR "Lenovo"
#define USB_CFG_DESCR_PROPS_STRING_PRODUCT "Lenovo Laser Wireless Mouse"

Nah that doesn't work since USB_CFG_DESCR_PROPS_STRING_VENDOR and USB_CFG_DESCR_PROPS_STRING_PRODUCT are looking for USB_PROP_IS_DYNAMIC / USB_PROP_IS_RAM / USB_PROP_LENGTH(len) as value...:

In file included from C:\Users\username\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\DigisparkMouse/usbdrv.h:14:0,
from C:\Users\username\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\DigisparkMouse/DigiMouse.h:24,
from C:\Users\username\Desktop\mousejiggler1\mousejiggler1.ino:1:
C:\Users\username\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\DigisparkMouse/usbconfig.h:355:53: error: token ""Lenovo"" is not valid in preprocessor expressions
#define USB_CFG_DESCR_PROPS_STRING_VENDOR "Lenovo"
^
C:\Users\username\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\DigisparkMouse/usbdrv.h:507:7: note: in expansion of macro 'USB_CFG_DESCR_PROPS_STRING_VENDOR'
#if !(USB_CFG_DESCR_PROPS_STRING_VENDOR & USB_PROP_IS_RAM)
^
C:\Users\username\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\DigisparkMouse/usbconfig.h:356:53: error: token ""Lenovo Laser Wireless Mouse"" is not valid in preprocessor expressions
#define USB_CFG_DESCR_PROPS_STRING_PRODUCT "Lenovo Laser Wireless Mouse"
^
C:\Users\username\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\DigisparkMouse/usbdrv.h:513:7: note: in expansion of macro 'USB_CFG_DESCR_PROPS_STRING_PRODUCT'
#if !(USB_CFG_DESCR_PROPS_STRING_PRODUCT & USB_PROP_IS_RAM)
^
exit status 1
Error compiling for board Digispark (Default - 16.5mhz).

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

without "" ?

without the "" the first Lenovo is accepted. the second string "Lenovo Laser..." is not accepted because of the space. but I tried putting both at Lenovo only and the device still appear as "Composite device" and not "Lenovo"

I assume Windows pegs your device as a "Composite Device" rather than what you specified as product name because it is essentially two devices in one: the fake Lenovo mouse, and the ATtiny's programming interface.

Thank you all,
I probably made a typo earlier making it not to work. All good now :slight_smile:

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.