};
#endif
+struct sr_serial_dev_inst;
#ifdef HAVE_SERIAL_COMM
struct ser_lib_functions;
struct sr_serial_dev_inst {
#endif
#ifdef HAVE_SERIAL_COMM
+#ifndef HAVE_LIBSERIALPORT
+/*
+ * Some identifiers which initially got provided by libserialport are
+ * used internally within the libsigrok serial layer's implementation,
+ * while libserialport no longer is the exclusive provider of serial
+ * communication support. Declare the identifiers here so they remain
+ * available across all build configurations.
+ */
+enum libsp_parity {
+ SP_PARITY_NONE = 0,
+ SP_PARITY_ODD = 1,
+ SP_PARITY_EVEN = 2,
+ SP_PARITY_MARK = 3,
+ SP_PARITY_SPACE = 4,
+};
+
+enum libsp_flowcontrol {
+ SP_FLOWCONTROL_NONE = 0,
+ SP_FLOWCONTROL_XONXOFF = 1,
+ SP_FLOWCONTROL_RTSCTS = 2,
+ SP_FLOWCONTROL_DTRDSR = 3,
+};
+#endif
+
/* Serial-specific instances */
SR_PRIV struct sr_serial_dev_inst *sr_serial_dev_inst_new(const char *port,
const char *serialcomm);
#include <stdlib.h>
#include <glib.h>
#include <glib/gstdio.h>
+#ifdef HAVE_LIBSERIALPORT
#include <libserialport.h>
+#endif
#include <libsigrok/libsigrok.h>
#include "libsigrok-internal.h"
#ifdef _WIN32
* @{
*/
+#ifdef HAVE_SERIAL_COMM
+
/* See if a (assumed opened) serial port is of any supported type. */
static int dev_is_supported(struct sr_serial_dev_inst *serial)
{
return timeout_ms;
}
+#else
+
+/* TODO Put fallback.c content here? */
+
+#endif
+
/** @} */