X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fscpi%2Fscpi.c;h=511e3cd20bc6e56eca6d711e30991ae00046d1a4;hb=6a25fa42388fa3ddf7f519c7d1f6b641b9d6cf6f;hp=48e6a48495c9bfaba591147a12f715b67fe0b493;hpb=b6be55ce95b8d4d00d64874a05c022846e43cec4;p=libsigrok.git diff --git a/src/scpi/scpi.c b/src/scpi/scpi.c index 48e6a484..511e3cd2 100644 --- a/src/scpi/scpi.c +++ b/src/scpi/scpi.c @@ -627,7 +627,7 @@ SR_PRIV int sr_scpi_get_double(struct sr_scpi_dev_inst *scpi, if (ret != SR_OK && !response) return ret; - if (sr_atod(response, scpi_response) == SR_OK) + if (sr_atod_ascii(response, scpi_response) == SR_OK) ret = SR_OK; else ret = SR_ERR_DATA; @@ -908,6 +908,7 @@ SR_PRIV int sr_scpi_get_hw_id(struct sr_scpi_dev_inst *scpi, char *response; gchar **tokens; struct sr_scpi_hw_info *hw_info; + gchar *idn_substr; response = NULL; tokens = NULL; @@ -936,7 +937,13 @@ SR_PRIV int sr_scpi_get_hw_id(struct sr_scpi_dev_inst *scpi, g_free(response); hw_info = g_malloc0(sizeof(struct sr_scpi_hw_info)); - hw_info->manufacturer = g_strstrip(g_strdup(tokens[0])); + + idn_substr = g_strstr_len(tokens[0], -1, "IDN "); + if (idn_substr == NULL) + hw_info->manufacturer = g_strstrip(g_strdup(tokens[0])); + else + hw_info->manufacturer = g_strstrip(g_strdup(idn_substr + 4)); + hw_info->model = g_strstrip(g_strdup(tokens[1])); hw_info->serial_number = g_strstrip(g_strdup(tokens[2])); hw_info->firmware_version = g_strstrip(g_strdup(tokens[3]));