April 2020
Intermediate to advanced
412 pages
9h 58m
English
We are going to create an application that can monitor USB devices and wait until a specific device appears:
#include <iostream>#include <functional>#include <libudev.h>#include <poll.h>namespace usb {
class Device { struct udev_device *dev{0}; public: Device(struct udev_device* dev) : dev(dev) { } Device(const Device& other) : dev(other.dev) { udev_device_ref(dev); } ~Device() { udev_device_unref(dev); } std::string action() const { return udev_device_get_action(dev); ...Read now
Unlock full access