X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/hmcfgusb/blobdiff_plain/e75295bb20a25fadb04bf8d8162245de85ba1044..867564c59f3e0687e581efe822365d3ef599c76f:/hmcfgusb.h diff --git a/hmcfgusb.h b/hmcfgusb.h index e33f6e6..42e2eac 100644 --- a/hmcfgusb.h +++ b/hmcfgusb.h @@ -1,6 +1,6 @@ /* HM-CFG-USB libusb-driver * - * Copyright (c) 2013 Michael Gernoth + * Copyright (c) 2013-16 Michael Gernoth * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to @@ -21,7 +21,7 @@ * IN THE SOFTWARE. */ -typedef void (*hmcfgusb_cb_fn)(uint8_t *buf, int buf_len, void *data); +typedef int (*hmcfgusb_cb_fn)(uint8_t *buf, int buf_len, void *data); struct hmcfgusb_dev { libusb_device_handle *usb_devh; @@ -29,11 +29,17 @@ struct hmcfgusb_dev { int n_usb_pfd; struct pollfd *pfd; int n_pfd; + int bootloader; + time_t opened_at; }; int hmcfgusb_send(struct hmcfgusb_dev *usbdev, unsigned char* send_data, int len, int done); -struct hmcfgusb_dev *hmcfgusb_init(hmcfgusb_cb_fn cb, void *data); +int hmcfgusb_send_null_frame(struct hmcfgusb_dev *usbdev, int silent); +struct hmcfgusb_dev *hmcfgusb_init(hmcfgusb_cb_fn cb, void *data, char *serial); int hmcfgusb_add_pfd(struct hmcfgusb_dev *dev, int fd, short events); int hmcfgusb_poll(struct hmcfgusb_dev *dev, int timeout); +void hmcfgusb_enter_bootloader(struct hmcfgusb_dev *dev); +void hmcfgusb_leave_bootloader(struct hmcfgusb_dev *dev); void hmcfgusb_close(struct hmcfgusb_dev *dev); +void hmcfgusb_exit(void); void hmcfgusb_set_debug(int d);