-
Notifications
You must be signed in to change notification settings - Fork 53
Description
I see that the UPS.ino sample contain a const char STRING_SERIAL[] PROGMEM = "UPS10" string that is correctly picked up as BatterySerialNumber in Windows. This seem to work in practice, but I'm struggling to understand why & how it works.
The only place where STRING_SERIAL string is accessed is in the PowerDevice.setSerial(STRING_SERIAL) call that assigns the string to HID_::serial. The HID_::serial pointer is furthermore only read & returned from HID_::getShortName. The weird thing is that the HID_::getShortName method appears to be dead code that is not called from anywhere. Still, the STRING_SERIAL string still somehow manages to be propagated to Windows, which seems like a mystery to me. Modifying HID_::getShortName will also change the battery serial number reported by Windows.
Is the HID_::getShortName method automatically called by some external Arduino code, or is there some other mechanism in play here that I don't understand?