move some code to a separate source file
[project/usbmode.git] / switch.h
diff --git a/switch.h b/switch.h
new file mode 100644 (file)
index 0000000..eda94c2
--- /dev/null
+++ b/switch.h
@@ -0,0 +1,26 @@
+#ifndef __USBMODE_SWITCH_H
+#define __USBMODE_SWITCH_H
+
+#include <libubox/blobmsg.h>
+#include <libusb.h>
+
+struct usbdev_data {
+       struct libusb_device_descriptor desc;
+       libusb_device_handle *devh;
+       struct blob_attr *info;
+
+       char idstr[10];
+       char mfg[128], prod[128], serial[128];
+};
+
+enum {
+       DATA_MODE,
+       DATA_MSG,
+       DATA_MSG2,
+       DATA_MSG3,
+       __DATA_MAX
+};
+
+void handle_switch(struct usbdev_data *data);
+
+#endif