aura  0.1
 All Data Structures Functions Variables Modules Pages
usb_helpers.h
1 #ifndef USB_HELPERS_H
2 #define USB_HELPERS_H
3 
4 #include <libusb.h>
5 void ncusb_print_libusb_transfer(struct libusb_transfer *p_t);
6 int ncusb_match_string(libusb_device_handle *dev, int index, const char* string);
7 
8 struct ncusb_devwatch_data {
9  int (*device_found_func)(struct libusb_device_handle *, void *arg);
10  void *arg;
11  int vid;
12  int pid;
13  char *vendor;
14  char *product;
15  char *serial;
16 };
17 
18 int ncusb_watch_for_device(libusb_context *ctx,
19  struct ncusb_devwatch_data* dwatch);
20 
21 struct libusb_device_handle *ncusb_try_device(struct libusb_context *ctx,
22  libusb_device *device,
23  int vid, int pid,
24  const char *vendor_name,
25  const char *product_name,
26  const char *serial);
27 
28 struct libusb_device_handle *ncusb_find_and_open(struct libusb_context *ctx,
29  int vendor, int product,
30  const char *vendor_name,
31  const char *product_name,
32  const char *serial);
33 
34 int ncusb_watch_for_device(libusb_context *ctx,
35  struct ncusb_devwatch_data* dwatch);
36 void ncusb_start_descriptor_watching(struct aura_node *node, libusb_context *ctx);
37 
38 #endif