Add ability to ignore devices

This commit is contained in:
pixl
2020-07-14 16:21:14 -04:00
parent 497ec07bdf
commit 018bdb83ad
4 changed files with 66 additions and 0 deletions
+7
View File
@@ -34,6 +34,13 @@ void Receiver::addDevice(hidpp::DeviceConnectionEvent event)
{
std::unique_lock<std::mutex> lock(_devices_change);
try {
// Check if device is ignored before continuing
if(global_config->isIgnored(event.pid)) {
logPrintf(DEBUG, "%s:%d: Device 0x%04x ignored.",
_path.c_str(), event.index, event.pid);
return;
}
auto dev = _devices.find(event.index);
if(dev != _devices.end()) {
if(event.linkEstablished)