Implement receiver HID++ connect/disconnect events

Many changes were made here but that was the biggest one.

There's currently a bug where std::system_error: Broken pipe is thrown
after launching the daemon with a receiver connector.

A workaround for this bug is to simply shake the mouse while starting
the daemon. I will investigate this soon.
This commit is contained in:
pixl
2020-06-21 05:33:33 -04:00
parent b05e525bbc
commit e40da5f0c0
24 changed files with 689 additions and 181 deletions
+8
View File
@@ -2,6 +2,7 @@
#include "Device.h"
using namespace logid;
using namespace logid::backend;
Device::Device(std::string path, backend::hidpp::DeviceIndex index) :
_hidpp20 (path, index), _path (path), _index (index)
@@ -9,6 +10,13 @@ Device::Device(std::string path, backend::hidpp::DeviceIndex index) :
log_printf(DEBUG, "logid::Device created on %s:%d", _path.c_str(), _index);
}
Device::Device(const std::shared_ptr<backend::raw::RawDevice>& raw_device,
hidpp::DeviceIndex index) : _hidpp20(raw_device, index), _path
(raw_device->hidrawPath()), _index (index)
{
log_printf(DEBUG, "logid::Device created on %s:%d", _path.c_str(), _index);
}
void Device::sleep()
{
log_printf(INFO, "%s:%d fell asleep.", _path.c_str(), _index);