You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
forderud
added a commit
to forderud/HIDPowerDevice
that referenced
this issue
Sep 9, 2024
Fixesabratchik#20. Done to make it clear that these virtual methods are defined in the PluggableUSBModule base-class and might be called from external code not seen in this repo.
I see that the
UPS.ino
sample contain aconst 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 thePowerDevice.setSerial(STRING_SERIAL)
call that assigns the string toHID_::serial
. TheHID_::serial
pointer is furthermore only read & returned fromHID_::getShortName
. The weird thing is that theHID_::getShortName
method appears to be dead code that is not called from anywhere. Still, theSTRING_SERIAL
string still somehow manages to be propagated to Windows, which seems like a mystery to me. ModifyingHID_::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?The text was updated successfully, but these errors were encountered: