The 'conn' field in the device context and the CONN values in the
declarations of supported DMM models seemed inappropriate. They specify
the communication parameters (UART frame format and bitrate), not the
connection (port name). Adjust the respective identifiers.
Also rephrase the evaluation logic. Instead of checking for the absence
of user specs and optionally assigning a fallback value, just preset
from defaults and override from user specs when present. This simplifies
the logic (eliminates a check).
dmm = (struct dmm_info *)di;
dmm = (struct dmm_info *)di;
- conn = serialcomm = NULL;
+ conn = NULL;
+ serialcomm = dmm->serialcomm;
for (l = options; l; l = l->next) {
src = l->data;
switch (src->key) {
for (l = options; l; l = l->next) {
src = l->data;
switch (src->key) {
- if (!serialcomm)
- serialcomm = dmm->conn;
-
serial = sr_serial_dev_inst_new(conn, serialcomm);
if (serial_open(serial, SERIAL_RDWR) != SR_OK)
serial = sr_serial_dev_inst_new(conn, serialcomm);
if (serial_open(serial, SERIAL_RDWR) != SR_OK)
-#define DMM(ID, CHIPSET, VENDOR, MODEL, CONN, PACKETSIZE, TIMEOUT, \
+#define DMM(ID, CHIPSET, VENDOR, MODEL, SERIALCOMM, PACKETSIZE, TIMEOUT, \
DELAY, REQUEST, VALID, PARSE, DETAILS) \
&((struct dmm_info) { \
{ \
DELAY, REQUEST, VALID, PARSE, DETAILS) \
&((struct dmm_info) { \
{ \
.dev_acquisition_stop = std_serial_dev_acquisition_stop, \
.context = NULL, \
}, \
.dev_acquisition_stop = std_serial_dev_acquisition_stop, \
.context = NULL, \
}, \
- VENDOR, MODEL, CONN, PACKETSIZE, TIMEOUT, DELAY, \
+ VENDOR, MODEL, SERIALCOMM, PACKETSIZE, TIMEOUT, DELAY, \
REQUEST, 1, NULL, VALID, PARSE, DETAILS, sizeof(struct CHIPSET##_info) \
}).di
REQUEST, 1, NULL, VALID, PARSE, DETAILS, sizeof(struct CHIPSET##_info) \
}).di
const char *vendor;
/** Model. */
const char *device;
const char *vendor;
/** Model. */
const char *device;
- /** serialconn string. */
- const char *conn;
+ /** serialcomm string. */
+ const char *serialcomm;
/** Packet size in bytes. */
int packet_size;
/**
/** Packet size in bytes. */
int packet_size;
/**