#pragma once #include #include #include #include struct usb_detector { atomic_bool is_connected; atomic_bool event_handler_should_exit; thrd_t event_handler_thread; struct libusb_context* usb_context; libusb_hotplug_callback_handle hotplug_handle; }; struct usb_detector* create_detector(uint16_t vendor_id, uint16_t product_id); void destroy_detector(struct usb_detector*);