]> sigrok.org Git - libsigrok.git/blobdiff - libsigrok-internal.h
Use libserialport for serial port access.
[libsigrok.git] / libsigrok-internal.h
index a2d9a5a19dbf7c6d7db688b01ad030e25a4e31f2..ebbcca9b21d9f51ea4b9baf1b2802339ed0a2436 100644 (file)
@@ -26,6 +26,7 @@
 #ifdef HAVE_LIBUSB_1_0
 #include <libusb.h>
 #endif
+#include <serialport.h>
 
 /**
  * @file
 #define ARRAY_AND_SIZE(a) (a), ARRAY_SIZE(a)
 #endif
 
+/* Portability fixes for FreeBSD. */
+#ifdef __FreeBSD__
+#define LIBUSB_CLASS_APPLICATION 0xfe
+#define libusb_handle_events_timeout_completed(ctx, tv, c) \
+       libusb_handle_events_timeout(ctx, tv)
+#endif
+
 struct sr_context {
 #ifdef HAVE_LIBUSB_1_0
        libusb_context *libusb_ctx;
@@ -57,13 +65,14 @@ struct sr_usb_dev_inst {
 };
 #endif
 
-#define SERIAL_PARITY_NONE 0
-#define SERIAL_PARITY_EVEN 1
-#define SERIAL_PARITY_ODD  2
+#define SERIAL_PARITY_NONE SP_PARITY_NONE
+#define SERIAL_PARITY_EVEN SP_PARITY_EVEN
+#define SERIAL_PARITY_ODD  SP_PARITY_ODD
 struct sr_serial_dev_inst {
        char *port;
        char *serialcomm;
        int fd;
+       struct sp_port data;
 };
 
 /* Private driver context. */