Skip to content

Commit

Permalink
scan: Show serial number if available
Browse files Browse the repository at this point in the history
Signed-off-by: Andreas Sandberg <andreas@sandberg.pp.se>
  • Loading branch information
andysan authored and uwehermann committed Apr 11, 2020
1 parent cccdd2b commit 6129707
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion show.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,12 +286,13 @@ static void print_dev_line(const struct sr_dev_inst *sdi)
GString *s;
GVariant *gvar;
struct sr_dev_driver *driver;
const char *vendor, *model, *version;
const char *vendor, *model, *version, *sernum;

driver = sr_dev_inst_driver_get(sdi);
vendor = sr_dev_inst_vendor_get(sdi);
model = sr_dev_inst_model_get(sdi);
version = sr_dev_inst_version_get(sdi);
sernum = sr_dev_inst_sernum_get(sdi);
channels = sr_dev_inst_channels_get(sdi);

s = g_string_sized_new(128);
Expand All @@ -308,6 +309,8 @@ static void print_dev_line(const struct sr_dev_inst *sdi)
g_string_append_printf(s, "%s ", model);
if (version && version[0])
g_string_append_printf(s, "%s ", version);
if (sernum && sernum[0])
g_string_append_printf(s, "[S/N: %s] ", sernum);
if (channels) {
if (g_slist_length(channels) == 1) {
ch = channels->data;
Expand Down

0 comments on commit 6129707

Please sign in to comment.