Print version number of device 1 on each raw dev.
Only works on HID++ >=2.0 so far. Also solves a race condition where the wrong response can be sent to a request.
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
#include "Root.h"
|
||||
|
||||
using namespace logid::backend::hidpp20;
|
||||
|
||||
Root::Root(Device* dev) : Feature(dev, ID)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
feature_info Root::getFeature(uint16_t feature_id)
|
||||
{
|
||||
feature_info info;
|
||||
std::vector<uint8_t> params(2);
|
||||
params[0] = feature_id & 0xff;
|
||||
params[1] = (feature_id >> 8) & 0xff;
|
||||
|
||||
auto response = this->callFunction(Function::Ping, params);
|
||||
|
||||
info.feature_id = response[0];
|
||||
info.hidden = response[1] & FeatureFlag::Hidden;
|
||||
info.obsolete = response[1] & FeatureFlag::Obsolete;
|
||||
info.internal = response[1] & FeatureFlag::Internal;
|
||||
|
||||
return info;
|
||||
}
|
||||
Reference in New Issue
Block a user