Merge pull request #68 from zv0n/master

Log device's available CIDs
This commit is contained in:
pixl 2020-06-13 01:09:29 -04:00 committed by GitHub
commit e66039ae41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 1 deletions

View File

@ -247,8 +247,30 @@ void Device::waitForReceiver()
this->start();
}
void Device::printCIDs() {
try
{
HIDPP20::IReprogControls irc = HIDPP20::IReprogControls::auto_version(hidpp_dev);
if(disconnected)
return;
int controlCount = irc.getControlCount();
for(int i = 0; i < controlCount; i++)
{
if(disconnected)
return;
uint16_t cid = irc.getControlInfo(i).control_id;
log_printf(DEBUG, "Available CID: 0x%x", cid);
}
}
catch(HIDPP20::UnsupportedFeature &e)
{
log_printf(DEBUG, "%s does not support Reprog controls, not diverting!", name.c_str());
}
}
void Device::start()
{
printCIDs();
configure();
try { listener->addEventHandler(std::make_unique<ButtonHandler>(this)); }
catch(HIDPP20::UnsupportedFeature &e) { }

View File

@ -58,6 +58,7 @@ namespace logid
EventListener* listener;
void divert_buttons();
void printCIDs();
void setSmartShift(HIDPP20::ISmartShift::SmartshiftStatus ops);
void setHiresScroll(uint8_t flags);
void setDPI(int dpi);
@ -158,4 +159,4 @@ namespace logid
}
#endif //LOGID_DEVICE_H
#endif //LOGID_DEVICE_H