Detecting USB devices with libudev

Below you can find code snippets that match USB devices using libudev. A good tutorial is available here: libudev and Sysfs Tutorial. Listing and monitoring USB devices The snippet first prints all detected USB devices, and then enters monitoring mode and prints USB devices when they are inserted or removed. Source code on …