0

On my Linux system I have 2 hiddev files (there could be more in the future):

> ls /dev/usb
hiddev0  hiddev1  lp2

And I have a bunch of USB devices:

> lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 120b:8207 Linux 3.10.14 with dwc2-gadget hidpos
Bus 001 Device 003: ID 1a40:0101 Terminus Technology Inc. Hub
Bus 001 Device 004: ID 0483:4c43 STMicroelectronics PROTOCOL
Bus 001 Device 005: ID 0519:2013 Star Micronics Co., Ltd USB Printer P
Bus 001 Device 006: ID 2575:c300 Weida Hi-Tech Co., Ltd. CoolTouch® System
Bus 001 Device 007: ID 13d3:3548 IMC Networks Bluetooth Radio
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub

I need to determine (in .NET C#) which hiddev entry corresponds to the following device:

Bus 001 Device 004: ID 0483:4c43 STMicroelectronics PROTOCOL

I've been working the problem with ChatGpt, but I keep getting issues with its code. Plus, between having me include two separate NuGet packages, and then making me include libc in order to call ioctl, I'm starting to doubt its solution. At best I think it came up with an over-engineered one, at worst it's leading me on a wild goose chase.

Does anyone know a simple solution for this? Or really any solution that works, although preferably one that doesn't bloat my install package with unnecessary libraries.

With regards to access rights, I can't have my app run with sudo, but I can set up any and all necessary privileges for my user.

Thank you

7
  • Based on the source code example you did not provide, for me it is less a software question and more a question of knowledge. Everything one need to know about the Linux kernel can be found in the Linux Kernel docs, especially under Human Interface Devices (HID). Commented Jul 20, 2024 at 15:00
  • Heh. Without fail. Commented Jul 20, 2024 at 15:15
  • Like Randy Pausch said: “The brick walls are there for a reason. The brick walls are not there to keep us out. The brick walls are there to give us a chance to show how badly we want something. Because the brick walls are there to stop the people who don’t want it badly enough. They’re there to stop the other people.” Commented Jul 21, 2024 at 6:32
  • The difference between the Windows community and the Linux community is that when I ask a Windows question, somebody usually provides the answer, or at least makes a genuine effort to help. And when I ask a Linux question, invariably there's some prick who posts a link to the documentation and says "Here, go learn Linux". They're usually pretty snotty, but this is a whole new level. Congratulations, of all the Linux pricks I've met so far you're by far the most obnoxious. Commented Jul 21, 2024 at 7:31
  • Well, at least you now understand the difference between paid and unpaid services. Commented Jul 21, 2024 at 7:39

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.