X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fscpi%2Fscpi.c;h=c3ef6ff74c4b9527f7080beca92f5cc8dcddabe6;hb=81b3ce374c3b6d48e5ed321ac7a871ce4248a0bb;hp=ce3cb99d2362be792549d8e1970a76ebb1b35f57;hpb=3b95bd9152e6f54e259caf0909af86768c518e7a;p=libsigrok.git diff --git a/src/scpi/scpi.c b/src/scpi/scpi.c index ce3cb99d..c3ef6ff7 100644 --- a/src/scpi/scpi.c +++ b/src/scpi/scpi.c @@ -17,16 +17,15 @@ * along with this program. If not, see . */ -#include "libsigrok.h" -#include "libsigrok-internal.h" - #include #include +#include "libsigrok.h" +#include "libsigrok-internal.h" #define LOG_PREFIX "scpi" #define SCPI_READ_RETRIES 100 -#define SCPI_READ_RETRY_TIMEOUT 10000 +#define SCPI_READ_RETRY_TIMEOUT_US (10 * 1000) /** * Parse a string representation of a boolean-like value into a gboolean. @@ -578,7 +577,7 @@ SR_PRIV int sr_scpi_get_opc(struct sr_scpi_dev_inst *scpi) sr_scpi_get_bool(scpi, SCPI_CMD_OPC, &opc); if (opc) return SR_OK; - g_usleep(SCPI_READ_RETRY_TIMEOUT); + g_usleep(SCPI_READ_RETRY_TIMEOUT_US); } return SR_ERR; @@ -736,7 +735,7 @@ SR_PRIV int sr_scpi_get_hw_id(struct sr_scpi_dev_inst *scpi, for (num_tokens = 0; tokens[num_tokens] != NULL; num_tokens++); - if (num_tokens != 4) { + if (num_tokens < 4) { sr_dbg("IDN response not according to spec: %80.s.", response); g_strfreev(tokens); g_free(response);