+#endif
+
+#ifdef HAVE_LIBSERIALPORT
+
+/**
+ * @private
+ *
+ * Both parameters are copied to newly allocated strings, and freed
+ * automatically by sr_serial_dev_inst_free().
+ *
+ * @param[in] port OS-specific serial port specification. Examples:
+ * "/dev/ttyUSB0", "/dev/ttyACM1", "/dev/tty.Modem-0", "COM1".
+ * @param[in] serialcomm A serial communication parameters string, in the form
+ * of \<speed\>/\<data bits\>\<parity\>\<stopbits\>, for example
+ * "9600/8n1" or "600/7o2". This is an optional parameter;
+ * it may be filled in later.
+ *
+ * @return A pointer to a newly initialized struct sr_serial_dev_inst,
+ * or NULL on error.
+ */
+SR_PRIV struct sr_serial_dev_inst *sr_serial_dev_inst_new(const char *port,
+ const char *serialcomm)
+{
+ struct sr_serial_dev_inst *serial;