SCPI: Ignore IDN header in *IDN? response
This commit is contained in:
parent
f55bea7626
commit
47bbc4b531
|
@ -908,6 +908,7 @@ SR_PRIV int sr_scpi_get_hw_id(struct sr_scpi_dev_inst *scpi,
|
||||||
char *response;
|
char *response;
|
||||||
gchar **tokens;
|
gchar **tokens;
|
||||||
struct sr_scpi_hw_info *hw_info;
|
struct sr_scpi_hw_info *hw_info;
|
||||||
|
gchar *idn_substr;
|
||||||
|
|
||||||
response = NULL;
|
response = NULL;
|
||||||
tokens = NULL;
|
tokens = NULL;
|
||||||
|
@ -936,7 +937,13 @@ SR_PRIV int sr_scpi_get_hw_id(struct sr_scpi_dev_inst *scpi,
|
||||||
g_free(response);
|
g_free(response);
|
||||||
|
|
||||||
hw_info = g_malloc0(sizeof(struct sr_scpi_hw_info));
|
hw_info = g_malloc0(sizeof(struct sr_scpi_hw_info));
|
||||||
|
|
||||||
|
idn_substr = g_strstr_len(tokens[0], -1, "IDN ");
|
||||||
|
if (idn_substr == NULL)
|
||||||
hw_info->manufacturer = g_strstrip(g_strdup(tokens[0]));
|
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->model = g_strstrip(g_strdup(tokens[1]));
|
||||||
hw_info->serial_number = g_strstrip(g_strdup(tokens[2]));
|
hw_info->serial_number = g_strstrip(g_strdup(tokens[2]));
|
||||||
hw_info->firmware_version = g_strstrip(g_strdup(tokens[3]));
|
hw_info->firmware_version = g_strstrip(g_strdup(tokens[3]));
|
||||||
|
|
Loading…
Reference in New Issue