X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Flascar-el-usb%2Fprotocol.h;h=bc7e6ebd442449c6afb474d84b4f5d40e8ec76b0;hb=b15ff1c92aabeea04649de25a3a01f851ab0a1ec;hp=a94bd8a59da2c6c51b7b418045edf6b547cab170;hpb=155b680da482cea2381becb73c51cfb838bff31e;p=libsigrok.git diff --git a/src/hardware/lascar-el-usb/protocol.h b/src/hardware/lascar-el-usb/protocol.h index a94bd8a5..bc7e6ebd 100644 --- a/src/hardware/lascar-el-usb/protocol.h +++ b/src/hardware/lascar-el-usb/protocol.h @@ -21,23 +21,26 @@ #define LIBSIGROK_HARDWARE_LASCAR_EL_USB_PROTOCOL_H #include -#include "libsigrok.h" +#include #include "libsigrok-internal.h" #define LOG_PREFIX "lascar-el-usb" -#define LASCAR_VENDOR "Lascar" #define LASCAR_INTERFACE 0 #define LASCAR_EP_IN 0x82 #define LASCAR_EP_OUT 2 -/* Max 100ms for a device to positively identify. */ -#define SCAN_TIMEOUT 100000 #define MAX_CONFIGBLOCK_SIZE 256 -/** Private, per-device-instance driver context. */ +/* Max 100ms for a device to positively identify. */ +#define SCAN_TIMEOUT (100 * 1000) +#define BULK_XFER_TIMEOUT (10 * 1000) +#define EVENTS_TIMEOUT (10 * 1000) +#define SLEEP_US_LONG (5 * 1000) +#define SLEEP_US_SHORT (1 * 1000) + struct dev_context { - void *cb_data; const struct elusb_profile *profile; + /* Generic EL-USB */ unsigned char config[MAX_CONFIGBLOCK_SIZE]; unsigned int log_size; @@ -46,6 +49,7 @@ struct dev_context { unsigned int logged_samples; unsigned int rcvd_samples; uint64_t limit_samples; + /* Model-specific */ /* EL-USB-CO: these are something like scaling and calibration values * fixed per device, used to convert the sample values to CO ppm. */ @@ -63,7 +67,7 @@ enum { struct elusb_profile { int modelid; - char *modelname; + const char *modelname; int logformat; }; @@ -71,10 +75,9 @@ SR_PRIV int lascar_get_config(libusb_device_handle *dev_hdl, unsigned char *configblock, int *configlen); SR_PRIV struct sr_dev_inst *lascar_scan(int bus, int address); SR_PRIV int lascar_el_usb_handle_events(int fd, int revents, void *cb_data); -SR_PRIV void lascar_el_usb_receive_transfer(struct libusb_transfer *transfer); +SR_PRIV void LIBUSB_CALL lascar_el_usb_receive_transfer(struct libusb_transfer *transfer); SR_PRIV int lascar_start_logging(const struct sr_dev_inst *sdi); SR_PRIV int lascar_stop_logging(const struct sr_dev_inst *sdi); SR_PRIV int lascar_is_logging(const struct sr_dev_inst *sdi); -SR_PRIV int dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data); #endif