X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=libsigrok-internal.h;h=c76f5983b7bddccf1d9388d0334ad0822c7fea5d;hb=f5027ca481d91fc92ec878d2eec2b6b446d3b7de;hp=e27955ba20a182e3e2cbfd0a5cc21bbd223f1ca3;hpb=98582bf53f61043e6918be291648f8f6dfb5f6b4;p=libsigrok.git diff --git a/libsigrok-internal.h b/libsigrok-internal.h index e27955ba..c76f5983 100644 --- a/libsigrok-internal.h +++ b/libsigrok-internal.h @@ -21,8 +21,8 @@ * @internal */ -#ifndef LIBSIGROK_SIGROK_INTERNAL_H -#define LIBSIGROK_SIGROK_INTERNAL_H +#ifndef LIBSIGROK_LIBSIGROK_INTERNAL_H +#define LIBSIGROK_LIBSIGROK_INTERNAL_H #include #include @@ -60,6 +60,16 @@ struct sr_context { #ifdef HAVE_LIBUSB_1_0 libusb_context *libusb_ctx; + gboolean usb_source_present; +#ifdef _WIN32 + GThread *usb_thread; + gboolean usb_thread_running; + GMutex usb_mutex; + HANDLE usb_event; + GPollFD usb_pollfd; + sr_receive_data_callback_t usb_cb; + void *usb_cb_data; +#endif #endif }; @@ -88,6 +98,10 @@ struct sr_serial_dev_inst { int nonblocking; /** libserialport port handle */ struct sp_port *data; + /** libserialport event set */ + struct sp_event_set *event_set; + /** GPollFDs for event polling */ + GPollFD *pollfds; }; #endif @@ -264,6 +278,9 @@ SR_PRIV int ezusb_upload_firmware(libusb_device *dev, int configuration, #ifdef HAVE_LIBUSB_1_0 SR_PRIV GSList *sr_usb_find(libusb_context *usb_ctx, const char *conn); SR_PRIV int sr_usb_open(libusb_context *usb_ctx, struct sr_usb_dev_inst *usb); +SR_PRIV int usb_source_add(struct sr_context *ctx, int timeout, + sr_receive_data_callback_t cb, void *cb_data); +SR_PRIV int usb_source_remove(struct sr_context *ctx); #endif /*--- hardware/common/scpi.c ------------------------------------------------*/ @@ -460,6 +477,14 @@ SR_PRIV void sr_fs9721_01_temp_c(struct sr_datafeed_analog *analog, void *info); SR_PRIV void sr_fs9721_10_temp_c(struct sr_datafeed_analog *analog, void *info); SR_PRIV void sr_fs9721_01_10_temp_f_c(struct sr_datafeed_analog *analog, void *info); +/*--- hardware/common/dmm/m2110.c -----------------------------------------*/ + +#define BBCGM_M2110_PACKET_SIZE 9 + +SR_PRIV gboolean sr_m2110_packet_valid(const uint8_t *buf); +SR_PRIV int sr_m2110_parse(const uint8_t *buf, float *floatval, + struct sr_datafeed_analog *analog, void *info); + /*--- hardware/common/dmm/metex14.c -----------------------------------------*/ #define METEX14_PACKET_SIZE 14