* The response to a '*IDN?' is specified by the SCPI spec. It contains
* a comma-separated list containing the manufacturer name, instrument
* model, serial number of the instrument and the firmware version.
+ *
+ * BEWARE! Although strictly speaking a smaller field count is invalid,
+ * this implementation also accepts IDN responses with one field less,
+ * and assumes that the serial number is missing. Some GWInstek DMMs
+ * were found to do this. Keep warning about this condition, which may
+ * need more consideration later.
*/
tokens = g_strsplit(response, ",", 0);
num_tokens = g_strv_length(tokens);
g_free(response);
return SR_ERR_DATA;
}
+ if (num_tokens < 4) {
+ sr_warn("Short IDN response, assume missing serial number.");
+ }
g_free(response);
hw_info = g_malloc0(sizeof(struct sr_scpi_hw_info));