rigol-ds: Minor error reporting fix.
This commit is contained in:
parent
91e406b921
commit
7cf1a98d73
|
@ -242,16 +242,16 @@ static int probe_port(const char *resource, const char *serialcomm, GSList **dev
|
||||||
*devices = NULL;
|
*devices = NULL;
|
||||||
|
|
||||||
if (strncmp(resource, usbtmc_prefix, strlen(usbtmc_prefix)) == 0) {
|
if (strncmp(resource, usbtmc_prefix, strlen(usbtmc_prefix)) == 0) {
|
||||||
sr_dbg("Opening USBTMC device %s", resource);
|
sr_dbg("Opening USBTMC device %s.", resource);
|
||||||
if (!(scpi = scpi_usbtmc_dev_inst_new(resource)))
|
if (!(scpi = scpi_usbtmc_dev_inst_new(resource)))
|
||||||
return SR_ERR_MALLOC;
|
return SR_ERR_MALLOC;
|
||||||
} else if (strncmp(resource, tcp_prefix, strlen(tcp_prefix)) == 0) {
|
} else if (strncmp(resource, tcp_prefix, strlen(tcp_prefix)) == 0) {
|
||||||
sr_dbg("Opening TCP connection %s", resource);
|
sr_dbg("Opening TCP connection %s.", resource);
|
||||||
tokens = g_strsplit(resource + strlen(tcp_prefix), "/", 0);
|
tokens = g_strsplit(resource + strlen(tcp_prefix), "/", 0);
|
||||||
address = tokens[0];
|
address = tokens[0];
|
||||||
port = tokens[1];
|
port = tokens[1];
|
||||||
if (!address || !port || tokens[2]) {
|
if (!address || !port || tokens[2]) {
|
||||||
sr_dbg("Invalid parameters");
|
sr_err("Invalid parameters.");
|
||||||
g_strfreev(tokens);
|
g_strfreev(tokens);
|
||||||
return SR_ERR_ARG;
|
return SR_ERR_ARG;
|
||||||
}
|
}
|
||||||
|
@ -260,7 +260,7 @@ static int probe_port(const char *resource, const char *serialcomm, GSList **dev
|
||||||
if (!scpi)
|
if (!scpi)
|
||||||
return SR_ERR_MALLOC;
|
return SR_ERR_MALLOC;
|
||||||
} else {
|
} else {
|
||||||
sr_dbg("Opening serial device %s", resource);
|
sr_dbg("Opening serial device %s.", resource);
|
||||||
if (!(scpi = scpi_serial_dev_inst_new(resource, serialcomm)))
|
if (!(scpi = scpi_serial_dev_inst_new(resource, serialcomm)))
|
||||||
return SR_ERR_MALLOC;
|
return SR_ERR_MALLOC;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue