Print CIDs on device connect

This commit is contained in:
pixl
2020-07-15 00:26:12 -04:00
parent 018bdb83ad
commit 56d10898fb
4 changed files with 29 additions and 2 deletions

View File

@@ -92,6 +92,12 @@ void ReprogControls::initCidMap()
_cids_initialized = true;
}
const std::map<uint16_t, ReprogControls::ControlInfo>&
ReprogControls::getControls() const
{
return _cids;
}
ReprogControls::ControlInfo ReprogControls::getControlIdInfo(uint16_t cid)
{
if(!_cids_initialized)

View File

@@ -97,6 +97,8 @@ namespace hidpp20
virtual void initCidMap();
const std::map<uint16_t, ControlInfo>& getControls() const;
// Onlu controlId and flags will be set
virtual ControlInfo getControlReporting(uint16_t cid);

View File

@@ -311,7 +311,7 @@ std::vector<uint8_t> RawDevice::_respondToReport
int RawDevice::_sendReport(const std::vector<uint8_t>& report)
{
std::lock_guard<std::mutex> lock(_dev_io);
if(logid::global_loglevel == LogLevel::RAWREPORT) {
if(logid::global_loglevel <= LogLevel::RAWREPORT) {
printf("[RAWREPORT] %s OUT: ", _path.c_str());
for(auto &i : report)
printf("%02x ", i);
@@ -389,7 +389,7 @@ int RawDevice::_readReport(std::vector<uint8_t> &report,
if(0 == ret)
throw backend::TimeoutError();
if(logid::global_loglevel == LogLevel::RAWREPORT) {
if(logid::global_loglevel <= LogLevel::RAWREPORT) {
printf("[RAWREPORT] %s IN: ", _path.c_str());
for(auto &i : report)
printf("%02x ", i);