Commit Graph

90 Commits

Author SHA1 Message Date
Peter Wu
b68dc9af6d ltunify: fix harmless compiler warning
bInterfaceNumber is expected to return the `%02x` format according to
the current kernel sources. Even if that is not true, a user can always
manually specify the hidraw device if the wrong device is detected.
2020-06-14 22:59:19 +02:00
Peter Wu
872a781e07 Release 0.3 v0.3 2020-06-14 22:34:05 +02:00
Peter Wu
b639b7f5c6 ltunify: fix minor alignment warning with the receiver-info command
Caught by UndefinedBehaviorSanitizer (UBSan):

    ltunify.c:785:32: runtime error: load of misaligned address
    0x7ffc0e4c38a5 for type 'uint32_t' (aka 'unsigned int'), which
    requires 4 byte alignment
2020-06-14 22:16:49 +02:00
Peter Wu
5c8283480d ltunify: add Nano receiver c534 (MK270) support
Fix "Unknown protocol 0x0a in devcon notif" errors when trying to list
or pair new devices connected to the Nano receiver with device ID c534.
This receiver is limited to 2 devices only and does not allow unpairing.

Update the hidraw autodetection since the first detected hidraw device
is wrong. Check the interface number, similar to Solaar, this avoids
more complicated HID descriptor parsing.

To confirm whether a device supports the HID++ protocol, either use
`sudo lsusb -v046d:` (without a kernel driver bound to it) or use

    hidrd-convert -o spec /sys/class/hidraw/hidrawX/device/report_descriptor output.txt

to find a Vendor-Specific page.
2020-06-14 22:06:58 +02:00
Rob Wu
f664d1d41d Use correct index in process_notif_dev_connect
`devices[dev_idx]` should have been `devices[dev_idx - 1]`, aka `dev`.
2018-03-30 16:36:37 +02:00
Peter Wu
955b9feb9e shell: support ':' separator for multiple args
It becomes a pain to remove all colons just to add a single argument.
2014-04-05 18:41:42 +02:00
Peter Wu
c3a263ff97 shell: support ":" separator
Useful for tshark.
2014-03-31 18:12:12 +02:00
Peter Wu
fe7edfe3a3 shell: extend with string functionality 2014-03-29 16:08:39 +01:00
Peter Wu
222301408b usbmon-setperms: do not grant unnecessary write
Also convert tabs to spaces.
2014-03-18 21:04:09 +01:00
Peter Wu
6a1cf3b75d hidpp20: add more possible features
Added on 24 January 2014, it is possible that features from newer
versions are missing.
2014-02-19 11:14:11 +01:00
Peter Wu
1938dc08d1 Warn when CONFIG_HIDRAW is disabled 2014-02-19 11:13:40 +01:00
Peter Wu
f6523bc6bc ltunify: Add --version (-V) option, use git version if possible 2013-09-28 16:38:04 +02:00
Peter Wu
89dce89837 ltunify: fix crash on unrecognised parameter 2013-09-28 16:37:34 +02:00
Peter Wu
8fbf5f92d2 ltunify: fix do_read failure when receiving unrelated messages
When a touchpad event occurs while the device is being queried (e.g.
for features), then do_io (for do_read) would fail because the report
was not of the correct type (0x20 vs 0x11 for example). To fix this,
make do_read retry reads (within the allowed timeout).

Previously the expected report type was hidden in the msg parameter,
make this expected report type more explicit now in a new parameter.
2013-09-28 16:19:14 +02:00
Peter Wu
bcdc930b76 hidpp20: update feature list from SetPoint 6.61.15
cases are now sorted by feature ID, some names have been adjusted for
consistency with the documented names.

New feature:
- 0x0002 FeatureInfo
- 0x6120 Touchmouse6120

Renamed fetures:
- IRoot -> Root
- IFeatureSet -> FeatureSet
- IFirmwareInfo -> DeviceFwVersion
- GetDeviceNameType -> DeviceName
- DFUControl -> Dfucontrol
- batteryLevelStatus -> BatteryStatus
- SpecialKeysMSEButtons -> ReprogControls
2013-09-28 12:27:32 +02:00
Peter Wu
09219eb747 Revert "Makefile: make user append to CFLAGS instead of overwriting it"
This reverts commit 98f9432088. This was a
lazy trick from me to allow adding `-fsanitize=address` easier, but
apparantly not all users are so happy with it.

Conflicts:
	Makefile
2013-09-04 17:42:23 +02:00
Peter Wu
c42bd6685c hidraw.c: fix permissions
Why the heck was this executable?
2013-09-04 17:40:40 +02:00
Peter Wu
9f243e3704 shell: support DJ reports 2013-08-30 22:48:32 +02:00
Peter Wu
ffaa47be57 hidraw: do not interpret report ID for unknown report type 2013-08-30 22:48:19 +02:00
Peter Wu
2e2b21d3cc ltunify: ignore DJ reports
Fixes the warning messages below:

$ ltunify unpair 2
Unexpected disconnection type 0000
Device 0x02 Touchpad successfully unpaired
$ ltunify pair
Please turn your wireless device off and on to start pairing.
Found new device, id=0x02 Touchpad
Dev conn notif is expected to be short, got 0x20 instead
Dev conn notif is expected to be short, got 0x20 instead
Dev conn notif is expected to be short, got 0x20 instead
Dev conn notif is expected to be short, got 0x20 instead
Dev conn notif is expected to be short, got 0x20 instead
2013-08-30 12:01:05 +02:00
Peter Wu
ab2cd7e619 hidraw: document DJ report types 2013-08-30 11:57:49 +02:00
Peter Wu
14c1aa6fbf shell: convenience script for accessing hidraw dev 2013-08-28 11:46:31 +02:00
Peter Wu
87c92eac32 usbmon-setperms: ignore duplicate devices 2013-08-25 16:31:37 +02:00
Peter Wu
be1199bc79 usbmon-setperms: fix when group does not match user 2013-08-25 16:29:50 +02:00
Peter Wu
7e7bbbdabd Fix missing device version information for hid10
This got broken in e2faf04 (version 0.2).
2013-08-21 00:57:05 +02:00
Peter Wu
590422bf54 hidpp20: add flag 0x20 for feature type
featureType flag 0x20 is "Reserved for Logitech internal use" according
to hidpp20 spec.
2013-08-20 12:31:39 +02:00
Peter Wu
fbfd70a51a usbmon-setperms: add helper for usbmon permissions
For unprivileged use of usbmon.
2013-08-06 15:55:25 +02:00
Peter Wu
9591ee2254 Fix wrong names for HID++ 1.0 error codes 2013-08-06 15:45:19 +02:00
Peter Wu
63064a01f1 Add NEWS file, update to 0.2 v0.2 2013-07-23 14:22:20 +02:00
Peter Wu
9d5ac81f32 Makefile: add install{,-udevrule} and uninstall
This is supposed to help distro packagers of ltunify.
2013-07-23 14:10:36 +02:00
Peter Wu
137bd026ce Fix compile error due to u8
Reported by Harry Weston, a compilation error occurs with GCC 4.4.4
because the u8 type is already defined in ltunify.c
2013-07-23 13:53:43 +02:00
Peter Wu
883e9af8d3 registers: add DFU bits
I found these somewhere in the binaries.
2013-07-23 13:51:01 +02:00
Peter Wu
1e9b8779f2 udev: add more IDs
- Add second official Unifying receiver (mentioned in from hid-logitech-dj.c)
  and "Unifying Ready" Nano receiver (mentioned in Solaar).
- Introduce an extra label for easier extension.
- Remove world-writable suggestion, no reason to do so with uaccess.
2013-06-16 10:38:00 +02:00
Peter Wu
8a8d93620a udev: use uaccess and udev-acl 2013-06-13 15:32:04 +02:00
Peter Wu
d39c477544 ltunify: fix wrong serial number 2013-06-05 12:35:09 +02:00
Peter Wu
b493f9bd3c ltunify: document more advertised HID++2 features 2013-05-26 21:06:07 +02:00
Peter Wu
b73fcc67e7 ltunify: Add support for c52f nano receiver 2013-05-22 12:34:11 +02:00
Peter Wu
c8916f18f6 ltunify: make hidraw device path more obvious 2013-05-22 12:04:55 +02:00
Peter Wu
446ac25139 ltunify: make driver name matching more obvious
Use basename instead of memcmp with some calculations. Move the hiddraw device
matching outside a block in preparation for adding multiple match conditions.
2013-05-22 11:47:51 +02:00
Peter Wu
878ed69e40 keyboard: confirmed padding bytes 2013-05-07 14:56:15 +02:00
Peter Wu
70f33c0906 keyboard.txt: documentation for key customization 2013-05-05 17:42:06 +02:00
Peter Wu
32fbe354fb registers.txt: document notif r1bit1 for k800 2013-05-05 11:21:55 +02:00
Peter Wu
e2faf04f8f ltunify: preliminary HID++ 2.0 support, add TODO 2013-04-30 17:40:53 +02:00
Peter Wu
cfbf072a9c hidraw: annotate HID++ 2.0 errors and IRoot feature 2013-04-30 17:39:23 +02:00
Peter Wu
793070ba82 ltunify: show HID++ version 2013-04-29 19:52:39 +02:00
Peter Wu
e9bb1ae6ff ltunify: introduce read timeouts
In case a message does not get a response (user pulled out the receiver,
thunder hit the device, coke has fallen on a keyboard, etc.), do not wait
`for(;;)`. (2 seconds because accessing registers may be slow)
2013-04-29 19:05:28 +02:00
Peter Wu
0c6200cd5f read-dev-usbmon: prepend time to message 2013-04-29 19:03:35 +02:00
Peter Wu
20ae5c63cf registers: document backlight notif flag 2013-04-28 11:58:04 +02:00
Peter Wu
bfcf1487ae read-dev-usbmon: retry ioctl when interrupted
Allows read-dev-usbmon to function after suspend/resume.
2013-04-27 21:33:19 +02:00
Peter Wu
af94dbf89b registers.txt: update with battery/receiver notifs 2013-04-27 19:14:55 +02:00