]> sigrok.org Git - libsigrok.git/commitdiff
rigol-ds: Shorten vendor name.
authorBert Vermeulen <redacted>
Mon, 20 Jan 2014 18:08:10 +0000 (19:08 +0100)
committerBert Vermeulen <redacted>
Mon, 20 Jan 2014 18:08:10 +0000 (19:08 +0100)
hardware/rigol-ds/api.c

index d3d5d2109ba31e621959f819b5af8fc034c359ba..52c72a4451d9e798cddab38d9d62bde48dc0bec4 100644 (file)
@@ -163,6 +163,8 @@ static const char *data_sources[] = {
 
 #define RIGOL "Rigol Technologies"
 #define AGILENT "Agilent Technologies"
+#define RIGOL_SHORT "Rigol"
+#define AGILENT_SHORT "Agilent"
 
 static const struct rigol_ds_model supported_models[] = {
        {RIGOL, "DS1052E", RIGOL_DS1000, PROTOCOL_IEEE488_2, {5, 1000000000}, {50, 1}, {2, 1000}, 2, false, 12},
@@ -250,7 +252,7 @@ static int probe_port(const char *resource, const char *serialcomm, GSList **dev
        struct sr_probe *probe;
        unsigned int i;
        const struct rigol_ds_model *model = NULL;
-       gchar *channel_name;
+       gchar *channel_name, *vendor;
 
        *devices = NULL;
 
@@ -278,8 +280,14 @@ static int probe_port(const char *resource, const char *serialcomm, GSList **dev
                }
        }
 
+       if (!strcmp(hw_info->manufacturer, RIGOL))
+               vendor = RIGOL_SHORT;
+       else if (!strcmp(hw_info->manufacturer, AGILENT))
+               vendor = AGILENT_SHORT;
+       else
+               vendor = hw_info->manufacturer;
        if (!model || !(sdi = sr_dev_inst_new(0, SR_ST_ACTIVE,
-                                             hw_info->manufacturer, hw_info->model,
+                                             vendor, hw_info->model,
                                                  hw_info->firmware_version))) {
                sr_scpi_hw_info_free(hw_info);
                sr_scpi_close(scpi);