Page 1 of 1

Serial number to distinguish HID devices?

Posted: Fri May 10, 2024 1:16 pm
by qfulmina
I'd like to propose the addition of the serial numbers to distinguish multiple HID devices of the same kind.

The easiest way would be appending the number to the name (maybe in parenthesis).
forum.png
Otherwise it's hard to tell the devices apart correctly.

Since I'm already working at the HID section at the moment, I could prepare a pull request.

What do you think?

Re: Serial number to distinguish HID devices?

Posted: Fri May 10, 2024 3:05 pm
by mcallegari
I think I already evaluated this for the HID plugin and as far as I remember, joysticks and alike didn't expose a serial number.
Are you sure this information is available on every HID device?

Re: Serial number to distinguish HID devices?

Posted: Fri May 10, 2024 5:44 pm
by janosvitok
If it's possible to implement, it may help even if some devices expose the serial number -- at least those that do will keep their order/position.

Jano

Re: Serial number to distinguish HID devices?

Posted: Wed May 15, 2024 3:33 pm
by qfulmina
Okay, I dug a bit into this:

FX5 and Nodle R4S expose a specific serial number. And for their self-made siblings DE and Nodle U1 the maker has the ability and responsibility to add a serial number.

So far for all HIDDMXDevices we get useful information. I'd go for adding this in parenthesis prepending their name. Makes it longer but more useful.

For other HID devices I tested two identical joysticks. Both expose a serial number, but it's identical. (So no information gain here. But no loss either.)

I'd like to add serial numbers to the names (at least for HIDDMXDevices) and prepare a PR.

Re: Serial number to distinguish HID devices?

Posted: Wed May 15, 2024 3:34 pm
by qfulmina
PS Unfortunately I don't have any device that does not expose any serial number at all...

Re: Serial number to distinguish HID devices?

Posted: Thu May 16, 2024 6:38 am
by mcallegari
OK, I'll check also with the HID devices that I have
Thanks for the PR, I'll review it soon

Re: Serial number to distinguish HID devices?

Posted: Thu May 16, 2024 7:51 pm
by qfulmina
Okay, I found a device that doesn't expose a serial number and more horribly doesn't even expose any manufacturer_string or product_string at all.
When connected its name is just empty.

That led me to implement a (yet experimental) logic:

The devices name is manufacturer_string plus product_string as ever. If there is neither, the hexadecimal vendor_id plus : plus hexadecimal product_id is used.

In case there is a non empty serial number it is (in parenthesis) appended to the name.
vendor and product ID if no name available and serial number appended in parenthesis if available
vendor and product ID if no name available and serial number appended in parenthesis if available
forum.jpg (9.43 KiB) Viewed 1644 times
Makes sense to me.
What do you think?

(The actual device without a name is a footswitch/footpedal which is treated by QLC+ as a joystick but cannot be used like this. It acts like a keyboard sending letters a, b, and c respectively for the three pedals. I'll dig into that maybe another time. Might be useful to assign it to an input of a universe without having it to behave like a keyboard. Some useful information on that: https://github.com/rgerganov/footswitch )

Re: Serial number to distinguish HID devices?

Posted: Fri May 17, 2024 7:50 am
by qfulmina
(Please ignore my last part about the foot switch. Had some misinterpretation going on there. In fact that switch registers itself (amongst others) as a joystick because it can be programmed to send such signals on pressing the pedal.)