From: Soeren Apel Date: Tue, 23 Sep 2014 15:43:27 +0000 (+0200) Subject: Add serial_num and connection_id fields to sr_dev_inst X-Git-Tag: libsigrok-0.4.0~987 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=2fe6210af6a1e8028967fa267dac9429b7952eef;p=libsigrok.git Add serial_num and connection_id fields to sr_dev_inst --- diff --git a/include/libsigrok/libsigrok.h b/include/libsigrok/libsigrok.h index 4f3510d8..655a4a0a 100644 --- a/include/libsigrok/libsigrok.h +++ b/include/libsigrok/libsigrok.h @@ -868,6 +868,10 @@ struct sr_dev_inst { char *model; /** Device version. */ char *version; + /** Serial number. */ + char *serial_num; + /** Connection string to uniquely identify devices. */ + char *connection_id; /** List of channels. */ GSList *channels; /** List of sr_channel_group structs */ diff --git a/src/device.c b/src/device.c index a331536c..054c7347 100644 --- a/src/device.c +++ b/src/device.c @@ -230,6 +230,8 @@ SR_PRIV struct sr_dev_inst *sr_dev_inst_new(int index, int status, sdi->vendor = vendor ? g_strdup(vendor) : NULL; sdi->model = model ? g_strdup(model) : NULL; sdi->version = version ? g_strdup(version) : NULL; + sdi->serial_num = NULL; + sdi->connection_id = NULL; sdi->channels = NULL; sdi->channel_groups = NULL; sdi->session = NULL; @@ -262,6 +264,8 @@ SR_PRIV void sr_dev_inst_free(struct sr_dev_inst *sdi) g_free(sdi->vendor); g_free(sdi->model); g_free(sdi->version); + g_free(sdi->serial_num); + g_free(sdi->connection_id); g_free(sdi); }