The sr_serial_extract_options() routine strictly operates on variables
and is applicable to any driver which accepts conn= specs. No physical
serial communication is involved, the HAVE_SERIAL_COMM condition check
is too strict a constraint.
This silences warnings in build configurations where serial communication
is not available:
../src/scpi/scpi.c: In function 'sr_scpi_scan':
src/scpi/scpi.c:325 col 2: warning: implicit declaration of function 'sr_serial_extract_options' [-Wimplicit-function-declaration]
(void)sr_serial_extract_options(options, &resource, &serialcomm);
^
Implementation detail: List the serial.c source file two times in the
Makefile to avoid confusion when the file is "missing" in the list of
related source files in the "serial comm supported" case. All serial.c
content already was under the HAVE_SERIAL_COMM condition, so compiling
that file in all build configurations is not an issue.
src/serial_hid_victor.c \
src/serial_libsp.c \
src/scpi/scpi_serial.c
src/serial_hid_victor.c \
src/serial_libsp.c \
src/scpi/scpi_serial.c
+else
+libsigrok_la_SOURCES += \
+ src/serial.c
endif
if NEED_USB
libsigrok_la_SOURCES += \
endif
if NEED_USB
libsigrok_la_SOURCES += \
size_t packet_size, packet_valid_callback is_valid,
packet_valid_len_callback is_valid_len, size_t *return_size,
uint64_t timeout_ms);
size_t packet_size, packet_valid_callback is_valid,
packet_valid_len_callback is_valid_len, size_t *return_size,
uint64_t timeout_ms);
-SR_PRIV int sr_serial_extract_options(GSList *options, const char **serial_device,
- const char **serial_options);
SR_PRIV int serial_source_add(struct sr_session *session,
struct sr_serial_dev_inst *serial, int events, int timeout,
sr_receive_data_callback cb, void *cb_data);
SR_PRIV int serial_source_add(struct sr_session *session,
struct sr_serial_dev_inst *serial, int events, int timeout,
sr_receive_data_callback cb, void *cb_data);
+SR_PRIV int sr_serial_extract_options(GSList *options,
+ const char **serial_device, const char **serial_options);
+
/*--- bt/ API ---------------------------------------------------------------*/
#ifdef HAVE_BLUETOOTH
/*--- bt/ API ---------------------------------------------------------------*/
#ifdef HAVE_BLUETOOTH
/**
* Extract the serial device and options from the options linked list.
*
/**
* Extract the serial device and options from the options linked list.
*
+#ifdef HAVE_SERIAL_COMM
+
/** @private */
SR_PRIV int serial_source_add(struct sr_session *session,
struct sr_serial_dev_inst *serial, int events, int timeout,
/** @private */
SR_PRIV int serial_source_add(struct sr_session *session,
struct sr_serial_dev_inst *serial, int events, int timeout,