Commit Graph

38 Commits

Author SHA1 Message Date
pixl
21ae951f3f
Bind delayed lambda lifetimes to owners
Prevents race conditions when objects are being destructed.
2023-05-02 16:01:09 -04:00
pixl
a578493dba
Require HID++ devices to be made as shared_ptrs
Binds event handlers and tasks to lifetime of object. Ensures no race
conditions occur during destruction of HID++ devices.
2023-05-02 14:30:47 -04:00
pixl
47e4ba2b44
Add exponential backoff to device monitor 2023-05-01 21:51:08 -04:00
pixl
ffd5e054a1
Bind EventHandler lifetimes to owner 2023-05-01 21:44:01 -04:00
pixl
f2fd967865
Fix receivers not seeing device connection events 2023-04-29 18:57:09 -04:00
pixl
fc96bb7b40
Remove DJ support requirement from receivers
Allows Logi Bolt receivers to be detected by logid but not yet used.
2023-04-29 16:49:38 -04:00
pixl
35b4dc03bf
Limit use of C-style definitions 2023-04-29 13:31:44 -04:00
pixl
d7bc4958ba
Clean up includes 2023-04-29 00:24:35 -04:00
pixl
adcb173e4c
I/O fixes, ensure sync and responses are proper 2023-04-28 21:18:33 -04:00
pixl
9d15610596
Update GPL copyright year 2023-04-28 21:18:33 -04:00
pixl
9efd121387
Code cleanup and reformatting 2023-04-28 21:18:33 -04:00
pixl
f76d9dfaf5
Use event handler ids for hidpp::Device 2022-03-05 21:32:12 -05:00
pixl
6e8c24b2f9
Fix a race condition caused by virtual hid nodes
When a virtual hidraw node is being tested while the real one is tested,
this causes the devices to misidentify reports. This solves that by
making the device monitor synchronous.
2022-01-29 00:06:00 -05:00
pixl
f25a1e4657
Ignore hidpp responses to kernel driver
Also fixes a bug where unconfigured devices would error.
2022-01-28 18:28:58 -05:00
pixl
7862c85d71
Use epoll for I/O multiplexing 2022-01-28 15:48:00 -05:00
pixl
dbe24f9350
Phase out workqueue 2022-01-21 23:24:47 -05:00
pixl
9b94fad0a6
Use new config interface 2022-01-20 01:29:18 -05:00
pixl
65fc252607
Eliminate global variables
global_loglevel is kept for the time being and will be replaced
alongside the current logger.
2022-01-07 19:43:41 -05:00
pixl
34b8047360
Refer to receiver from receiver devices 2020-07-20 00:25:04 -04:00
pixl
d59daf86e2
Add ChangeHost hidpp20 feature 2020-07-15 15:18:28 -04:00
pixl
f51ba0f681
Remove unused assert warnings when building Release 2020-07-15 13:27:21 -04:00
pixl
497ec07bdf
Properly set PID on dummy connect events 2020-07-14 16:20:58 -04:00
pixl
de8e453bd3
Fix deadlock issue
RawDevice would deadlock in some situations because I/O occured while
the listener was turning on. This also seems to have fixed logid
sometimes not detecting devices on receivers.
2020-07-12 16:16:24 -04:00
pixl
5bf5dc75b5
Implement RemapButton feature
Many changes were made here, too many to list here.
2020-07-12 16:16:22 -04:00
pixl
0b87d3c664
Fixed bug: odd devices would fail Root GetFeature
Some devices throw an hidpp20::Error InvalidFeatureIndex when Root
GetFeature is called with some features (e.g. 0x1b04) as the parameter.

Since Root is a required feature in the HID++ 2.0 protocol, this error
can safely be ignored and treated as an UnsupportedFeature.

Fixes bug in #20 where the Logitech PRO headset would not work.
2020-07-12 16:15:48 -04:00
pixl
b445b979d3
Remove some useless debug output 2020-07-12 16:15:48 -04:00
pixl
f6b93b94af
Split Configuration into several classes
Each feature should handle its own configuration.
2020-07-12 16:15:48 -04:00
pixl
4ba9248038
Use safe thread class instead of std::thread 2020-07-12 16:15:48 -04:00
pixl
22455af615
Add GPL copyright notice in all C++ source files 2020-07-12 16:15:32 -04:00
pixl
dd75df8c18
Use consistent code style
Only files that are currently used in logid are changed.
2020-07-12 16:14:25 -04:00
pixl
e40da5f0c0
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.
2020-07-12 16:14:24 -04:00
pixl
fb0b8e88ef
Clean up temporary code 2020-07-12 16:14:24 -04:00
pixl
b41649b0de
Implement dj::Receiver class
Again, many things were done here.
2020-07-12 16:13:54 -04:00
pixl
ecc5062e0f
Support getting version of HID++ 1.0 devices 2020-07-12 16:13:53 -04:00
pixl
c21a923ab2
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.
2020-07-12 16:13:53 -04:00
pixl
91954e8a73
Use shared_ptr for devices in DeviceMonitor 2020-07-12 16:13:53 -04:00
pixl
6b895b3015
Monitor all HID++ reports on wireless device 1
Again, many things were done in this commit such as implementing an
I/O queue, a mutex_queue, and implementing the hidpp::Report class.

I'm expecting commits to be like this until I can get a clean
codebase for the backend.
2020-07-12 16:13:53 -04:00
pixl
ec4ae56bc4
Implement raw DeviceMonitor
Multiple things have been done in this commit; the base of the new
backend has effectively been created. This branch currently has many
vital parts commented out. Therefore, this branch is currently only
intended for debugging.
2020-07-12 16:13:40 -04:00