/* -*- Mode: C; indent-tabs-mode:t ; c-basic-offset:8 -*- */
/*
* libusb example program for hotplug API
- * Copyright © 2012-2013 Nathan Hjelm <hjelmn@mac.ccom>
+ * Copyright © 2012-2013 Nathan Hjelm <hjelmn@mac.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
struct libusb_device_descriptor desc;
int rc;
+ (void)ctx;
+ (void)dev;
+ (void)event;
+ (void)user_data;
+
rc = libusb_get_device_descriptor(dev, &desc);
if (LIBUSB_SUCCESS != rc) {
fprintf (stderr, "Error getting device descriptor\n");
static int LIBUSB_CALL hotplug_callback_detach(libusb_context *ctx, libusb_device *dev, libusb_hotplug_event event, void *user_data)
{
+ (void)ctx;
+ (void)dev;
+ (void)event;
+ (void)user_data;
+
printf ("Device detached\n");
if (handle) {
int product_id, vendor_id, class_id;
int rc;
- vendor_id = (argc > 1) ? strtol (argv[1], NULL, 0) : 0x045a;
- product_id = (argc > 2) ? strtol (argv[2], NULL, 0) : 0x5005;
- class_id = (argc > 3) ? strtol (argv[3], NULL, 0) : LIBUSB_HOTPLUG_MATCH_ANY;
+ vendor_id = (argc > 1) ? (int)strtol (argv[1], NULL, 0) : 0x045a;
+ product_id = (argc > 2) ? (int)strtol (argv[2], NULL, 0) : 0x5005;
+ class_id = (argc > 3) ? (int)strtol (argv[3], NULL, 0) : LIBUSB_HOTPLUG_MATCH_ANY;
rc = libusb_init (NULL);
if (rc < 0)
}
if (!libusb_has_capability (LIBUSB_CAP_HAS_HOTPLUG)) {
- printf ("Hotplug capabilites are not supported on this platform\n");
+ printf ("Hotplug capabilities are not supported on this platform\n");
libusb_exit (NULL);
return EXIT_FAILURE;
}