Re: Litra Glow on Linux

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Sorry, another set of questions - seems like I am a bit dense.

On Thu, 27 Oct 2022 at 11:44, Benjamin Tissoires
<benjamin.tissoires@xxxxxxxxxx> wrote:
> It's just Logitech's common HID protocol. The advantage is that if
> Logitech reuses the feature on a different hardware, we won't have to
> implement anything new in the kernel.
Started implementing some illumination code but will take a while
until I figure out the driver I think.

> But from where you are now, you should probably be able to implement
> the basic on/off feature by looking at the function 0x1000 in the
> hid-logitech-hidpp code:
> - you need define a few macros for your functionality (the class, the
> commands, the events)
So my approach would be to identify the GLOW device and then at some
later point create the
illumination state and from there only handle common illumination.

> - you need to add a hook in connect_event to register the led class
> device that will hook on to the actual LED of the device
I did read all the LED specs/headers that I could find and from what I
have seen all you can currently do with this interface is control
brightness. There seems to be no way of controlling the Color
temperature, though.
So either this then would have to be exposed as a special device or
get handled entirely in userspace.
The latter seems to work against "implementing illumination handling
once in driver and reusing it".

> [0] https://pwr-solaar.github.io/Solaar
> [1] https://github.com/pwr-Solaar/Solaar/blob/master/docs/hidpp-documentation.txt
Thanks. Never would have found the specs on my own.
That said - I read x1990 spec and tried to access getIllumination from
userspace.
The spec seems a bit vague for my limited experience level.
For example I have not yet figured out what the communication (bytes)
difference between _getIllumination()_ and _illuminationChangedEvent_
is.
What seems to work is accessing events:

So I tried:
```c

#define LONG_REPORT_ID 0x11

    struct hiddev_usage_ref_multi multi;
    memset(&multi, 0, sizeof(multi));
    multi.uref.report_type = HID_REPORT_TYPE_INPUT;
    multi.uref.report_id = LONG_REPORT_ID;
    multi.uref.field_index = 0x0;
    multi.uref.usage_index = 0x03;
    multi.uref.usage_code = 0xff430002;
    multi.num_values = 1;

    if (ioctl(fd, HIDIOCGUSAGES, &multi) < 0)
    {
        perror("HIDIOCGUSAGES getIllumination");
        return -11;
    }

    printf("VALUE: %0x\n", multi.values[0]);

```
Which seems to report the illumination state until I press another
hardware button. So this seems to access the last event, which seems
to be _illuminationChangedEvent_ in my case.
No idea currently how to get _getIllumination_ to work.

Cheers
Andreas



[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux