linux usb connect/disconnect event
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Hello I am working on an embedded linux device with a usb port that uses the g_ether driver for usb networking. When the usb plug is connected the dmesg output is: g_ether gadget: full speed config #2: RNDIS When the usb cable is unplugged no message is written to dmesg. Using C how can I listen for the connect/disconnect events? The embedded linux OS does not have any extras. There is no dbus daemon or hotplug helper script. I am not even sure if these would of been helpful. 回答1: If you want everything in your single process, you'll have to