97c14f3ce411a3a181e64719a10c600bffc54dfc
[project/usbmode.git] / switch.h
1 #ifndef __USBMODE_SWITCH_H
2 #define __USBMODE_SWITCH_H
3
4 #include <libubox/blobmsg.h>
5 #include <libusb.h>
6
7 struct usbdev_data {
8         struct libusb_device_descriptor desc;
9         struct libusb_config_descriptor *config;
10         libusb_device *dev;
11         libusb_device_handle *devh;
12         struct blob_attr *info;
13         int interface;
14         int msg_endpoint;
15         int response_endpoint;
16         int release_delay;
17         bool need_response;
18
19         char idstr[10];
20         char mfg[128], prod[128], serial[128];
21 };
22
23 extern char **messages;
24 extern int *message_len;
25 extern int n_messages;
26 extern struct libusb_context *usb;
27
28 void handle_switch(struct usbdev_data *data);
29
30 #endif