usb_device_detection: Don't assume basestation is unplugged by default
This commit is contained in:
parent
f5cac7f6d9
commit
64d2566649
|
@ -46,6 +46,8 @@ struct usb_detector* create_detector(uint16_t vendor_id, uint16_t product_id)
|
|||
|
||||
struct usb_detector* detector = calloc(1, sizeof(struct usb_detector));
|
||||
detector->usb_context = usb_context;
|
||||
detector->is_connected = false;
|
||||
detector->event_handler_should_exit = false;
|
||||
|
||||
if (libusb_hotplug_register_callback(detector->usb_context,
|
||||
LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED |
|
||||
|
@ -66,9 +68,6 @@ struct usb_detector* create_detector(uint16_t vendor_id, uint16_t product_id)
|
|||
return 0;
|
||||
}
|
||||
|
||||
detector->is_connected = false;
|
||||
detector->event_handler_should_exit = false;
|
||||
|
||||
if (thrd_create(&detector->event_handler_thread,
|
||||
&libusb_event_handler,
|
||||
detector) != thrd_success) {
|
||||
|
|
Loading…
Reference in a new issue