implement hid_get_input_report for Linux hidraw backend #351

Merged
Be-ing merged 1 commit from hidraw_get_input_report into master 2021-12-10 06:48:57 -06:00
Be-ing commented 2021-11-13 19:23:31 -06:00 (Migrated from github.com)
Fixes https://github.com/libusb/hidapi/issues/259
Be-ing commented 2021-11-13 19:34:16 -06:00 (Migrated from github.com)

I don't know if this actually works with Linux < 5.11, but at least it should build.

I don't know if this actually works with Linux < 5.11, but at least it should build.
Be-ing commented 2021-11-13 20:15:44 -06:00 (Migrated from github.com)

Looking closer at the commit that implemented this in Linux, simply defining the macro won't do anything in Linux < 5.11 without the other changes in that commit. So I changed this to keep the old dummy code that just returns an error for old versions of Linux.

Looking closer at the [commit that implemented this in Linux](https://github.com/torvalds/linux/commit/f43d3870cafa2a0f3854c1819c8385733db8f9ae#), simply defining the macro won't do anything in Linux < 5.11 without the other changes in that commit. So I changed this to keep the old dummy code that just returns an error for old versions of Linux.
JoergAtGithub commented 2021-11-14 00:26:57 -06:00 (Migrated from github.com)

The ifdef checks the Kernel at compile time and returns the error if it was compiled on a too old Kernel.
But what happens if the executable is compiled on a new kernel, but executed on an old one?

The ifdef checks the Kernel at compile time and returns the error if it was compiled on a too old Kernel. But what happens if the executable is compiled on a new kernel, but executed on an old one?
Be-ing commented 2021-11-14 03:09:43 -06:00 (Migrated from github.com)

I have not tested that.

I have not tested that.
Be-ing commented 2021-11-14 08:01:53 -06:00 (Migrated from github.com)

I suppose that could actually happen with Flatpak... I'll test what happens with a VM running an old kernel.

I suppose that could actually happen with Flatpak... I'll test what happens with a VM running an old kernel.
Youw commented 2021-11-14 08:27:19 -06:00 (Migrated from github.com)

Lets have the functionality compile regardless of the kernel version (e.g. if not defined HIDIOCGINPUT - define it);
As fo running on the older kernel - I'm pretty sure the call will simply fail, since the correspondind ioctl isn't supported.

Lets have the functionality compile regardless of the kernel version (e.g. if not defined HIDIOCGINPUT - define it); As fo running on the older kernel - I'm pretty sure the call will simply fail, since the correspondind ioctl isn't supported.
Be-ing commented 2021-11-14 09:02:35 -06:00 (Migrated from github.com)

Okay I switched it back to the original implementation copying the definition from hidraw.h.

Okay I switched it back to the original implementation copying the definition from hidraw.h.
Youw (Migrated from github.com) approved these changes 2021-11-14 10:11:42 -06:00
Youw (Migrated from github.com) left a comment

This looks good.
I'd like to check it locally with my device(s) befor having it merged.

This looks good. I'd like to check it locally with my device(s) befor having it merged.
Youw (Migrated from github.com) commented 2021-11-14 10:08:47 -06:00

move it to line 64 of this file

move it to line 64 of this file
Be-ing commented 2021-12-05 13:21:38 -06:00 (Migrated from github.com)

Have you had a chance to test this yet?

Have you had a chance to test this yet?
Youw (Migrated from github.com) approved these changes 2021-12-10 06:48:18 -06:00
Youw (Migrated from github.com) left a comment

I finally had.
Everything looks perfect. Thanks!

I finally had. Everything looks perfect. Thanks!
Be-ing commented 2021-12-10 07:10:44 -06:00 (Migrated from github.com)

Thanks. Do you have a plan when you will make the next release?

Thanks. Do you have a plan when you will make the next release?
Youw commented 2021-12-10 08:23:45 -06:00 (Migrated from github.com)

The major (minor actually) release is not going to happen soon - nothing really done for that.
But I'll try to make a patch release soon.

The major (minor actually) release is not going to happen soon - nothing really done for that. But I'll try to make a patch release soon.
Be-ing commented 2021-12-10 08:35:10 -06:00 (Migrated from github.com)

A patch release soon with this fix would be good.

A patch release soon with this fix would be good.
Be-ing commented 2022-01-02 18:26:31 -06:00 (Migrated from github.com)

Any further updates about a patch release?

Any further updates about a patch release?
Youw commented 2022-01-03 07:14:03 -06:00 (Migrated from github.com)

@Be-ing I know you've waited for 0.11.1 the most of all, but be aware, that I've removed 0.11.1 release due to non-updated version file in that release (see #366).
0.11.2 is as good for you.

@Be-ing I know you've waited for 0.11.1 the most of all, but be aware, that I've removed 0.11.1 release due to non-updated version file in that release (see #366). [0.11.2](https://github.com/libusb/hidapi/releases/tag/hidapi-0.11.2) is as good for you.
Be-ing commented 2022-01-03 07:15:12 -06:00 (Migrated from github.com)

Thanks! I made a PR to update vcpkg.

Thanks! I made a [PR to update vcpkg](https://github.com/microsoft/vcpkg/pull/22304).
Be-ing commented 2022-01-03 07:30:17 -06:00 (Migrated from github.com)
I also made a [PR to update the Rust bindings](https://github.com/ruabmbua/hidapi-rs/pull/75).
Sign in to join this conversation.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-libusb/hidapi!351
No description provided.