]> sigrok.org Git - libsigrok.git/blobdiff - libsigrok-internal.h
add support for AVG mqflag
[libsigrok.git] / libsigrok-internal.h
index e27955ba20a182e3e2cbfd0a5cc21bbd223f1ca3..c76f5983b7bddccf1d9388d0334ad0822c7fea5d 100644 (file)
@@ -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 <stdarg.h>
 #include <glib.h>
 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