How to detect USB device disconnect under Linux/Qt/C++

后端 未结 5 1327
孤街浪徒
孤街浪徒 2021-01-03 03:37

I\'m writing a system (X-Platform Windows/Linux) that talks to a custom device using an FTDI USB chip. I use their D2XX driver for device open/close/read/write. So far, so

5条回答
  •  长情又很酷
    2021-01-03 04:04

    You'll probably want to use HAL (freedesktop.org's Hardware Abstraction Layer).

    In the future you will probably want to use DeviceKit. It is a project fix the many problems with HAL. It hasn't been adopted by all major distros yet though (I think just Fedora), so you probably don't want to use it right now.

    Edit: As Jeach said, you can use udev also. I wouldn't suggest this, as it is much lower level, and harder to program, but if latency is very important, this might be the best option.

提交回复
热议问题