Serial number to distinguish HID devices?

Post Reply
qfulmina
Posts: 14
Joined: Thu May 09, 2024 10:17 pm
Real Name:

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?
User avatar
mcallegari
Posts: 4572
Joined: Sun Apr 12, 2015 9:09 am
Location: Italy
Real Name: Massimo Callegari
Contact:

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?
janosvitok
Posts: 1290
Joined: Mon Apr 13, 2015 7:05 am
Location: Bratislava, Slovakia
Real Name: Jano Svitok
Contact:

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
qfulmina
Posts: 14
Joined: Thu May 09, 2024 10:17 pm
Real Name:

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.
qfulmina
Posts: 14
Joined: Thu May 09, 2024 10:17 pm
Real Name:

PS Unfortunately I don't have any device that does not expose any serial number at all...
User avatar
mcallegari
Posts: 4572
Joined: Sun Apr 12, 2015 9:09 am
Location: Italy
Real Name: Massimo Callegari
Contact:

OK, I'll check also with the HID devices that I have
Thanks for the PR, I'll review it soon
qfulmina
Posts: 14
Joined: Thu May 09, 2024 10:17 pm
Real Name:

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 275 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 )
qfulmina
Posts: 14
Joined: Thu May 09, 2024 10:17 pm
Real Name:

(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.)
Post Reply