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
+3 -8
View File
@@ -19,13 +19,10 @@ Device::Device(std::shared_ptr<raw::RawDevice> raw_dev,
}
std::vector<uint8_t> Device::getRegister(uint8_t address,
const std::vector<uint8_t>& params)
const std::vector<uint8_t>& params, hidpp::Report::Type type)
{
assert(params.size() <= hidpp::LongParamLength);
hidpp::Report::Type type = params.size() <= hidpp::ShortParamLength ?
hidpp::Report::Type::Short : hidpp::Report::Type::Long;
uint8_t sub_id = type == hidpp::Report::Type::Short ?
GetRegisterShort : GetRegisterLong;
@@ -33,13 +30,11 @@ std::vector<uint8_t> Device::getRegister(uint8_t address,
}
std::vector<uint8_t> Device::setRegister(uint8_t address,
const std::vector<uint8_t>& params)
const std::vector<uint8_t>& params,
hidpp::Report::Type type)
{
assert(params.size() <= hidpp::LongParamLength);
hidpp::Report::Type type = params.size() <= hidpp::ShortParamLength ?
hidpp::Report::Type::Short : hidpp::Report::Type::Long;
uint8_t sub_id = type == hidpp::Report::Type::Short ?
SetRegisterShort : SetRegisterLong;