1c964db582f588fccc77b897cac92391e1a5594b
[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_handle *devh;
11         struct blob_attr *info;
12         int interface;
13         int msg_endpoint;
14         int response_endpoint;
15         bool need_response;
16
17         char idstr[10];
18         char mfg[128], prod[128], serial[128];
19 };
20
21 extern struct blob_attr **messages;
22 extern int *message_len;
23 extern int n_messages;
24
25 void handle_switch(struct usbdev_data *data);
26
27 #endif