| 1 |
#ifndef DFU_UTIL_H |
| 2 |
#define DFU_UTIL_H |
| 3 |
|
| 4 |
/* USB string descriptor should contain max 126 UTF-16 characters |
| 5 |
* but 254 would even accommodate a UTF-8 encoding + NUL terminator */ |
| 6 |
#define MAX_DESC_STR_LEN 254 |
| 7 |
|
| 8 |
enum mode { |
| 9 |
MODE_NONE, |
| 10 |
MODE_VERSION, |
| 11 |
MODE_LIST, |
| 12 |
MODE_DETACH, |
| 13 |
MODE_UPLOAD, |
| 14 |
MODE_DOWNLOAD |
| 15 |
}; |
| 16 |
|
| 17 |
extern struct dfu_if *dfu_root; |
| 18 |
extern char *match_path; |
| 19 |
extern int match_vendor; |
| 20 |
extern int match_product; |
| 21 |
extern int match_vendor_dfu; |
| 22 |
extern int match_product_dfu; |
| 23 |
extern int match_config_index; |
| 24 |
extern int match_iface_index; |
| 25 |
extern int match_iface_alt_index; |
| 26 |
extern int match_devnum; |
| 27 |
extern const char *match_iface_alt_name; |
| 28 |
extern const char *match_serial; |
| 29 |
extern const char *match_serial_dfu; |
| 30 |
|
| 31 |
void probe_devices(libusb_context *); |
| 32 |
void disconnect_devices(void); |
| 33 |
void print_dfu_if(struct dfu_if *); |
| 34 |
void list_dfu_interfaces(void); |
| 35 |
|
| 36 |
#endif /* DFU_UTIL_H */ |