diff --git a/server/fcserver.cpp b/server/fcserver.cpp index 0df601e2c7558edb7ab37057ab093ecfa29eb2f6..f44867f7186f3d2cda484d5f54a73b27814202ee 100644 --- a/server/fcserver.cpp +++ b/server/fcserver.cpp @@ -117,9 +117,22 @@ int FCServer::cbHotplug(libusb_context *ctx, libusb_device *device, libusb_hotpl { FCServer *self = static_cast<FCServer*>(user_data); - printf("Hotplug %d\n", event); + if (event & LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED) { + self->usbDeviceArrived(device); + } + if (event & LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT) { + self->usbDeviceLeft(device); + } return false; } +void FCServer::usbDeviceArrived(libusb_device *device) +{ + // New USB device. Is this a device we recognize? +} +void FCServer::usbDeviceLeft(libusb_device *device) +{ + +} diff --git a/server/fcserver.h b/server/fcserver.h index ab7e6f03d0c9f980aeb607bedae1de0d59e499c1..3a7178b8094d6ce33ede7e473255876360f08b63 100644 --- a/server/fcserver.h +++ b/server/fcserver.h @@ -62,4 +62,6 @@ private: static int cbHotplug(libusb_context *ctx, libusb_device *device, libusb_hotplug_event event, void *user_data); void startUSB(struct ev_loop *loop); + void usbDeviceArrived(libusb_device *device); + void usbDeviceLeft(libusb_device *device); };