在Linux中获取USB设备在C中添加通知的最佳方法 [英] best way in linux to get usb device added notifications in c

查看:113
本文介绍了在Linux中获取USB设备在C中添加通知的最佳方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我应该使用哪个Linux库来获取已添加USB设备的异步通知?我希望我的程序可以在任何Linux设备上运行,因此我需要使用不特定于一个Linux版本的库

what Linux library should i use to get asynchronous notifications of added usb devices? I'd like my program to work on any Linux device so I'll need to use a library that isn't specific to one Linux version

推荐答案

如果您使用的是'C',那么我建议您使用libudev的通知功能.这是带有示例"C"代码的良好链接.

If you are using 'C' then I would suggest using the notification features of libudev. Here is a good link with example 'C' code.

libudev文档

希望有帮助.

-吉姆

这篇关于在Linux中获取USB设备在C中添加通知的最佳方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆