]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/agilent-dmm/api.c
agilent-dmm: File naming consistency changes.
[libsigrok.git] / src / hardware / agilent-dmm / api.c
index 47e38fb28ee50a60d375a07c4dc1e2cf090a2399..872b66111f4b30dfdffd8ab9e693e6b21979d1be 100644 (file)
@@ -25,7 +25,7 @@
 #include <string.h>
 #include <libsigrok/libsigrok.h>
 #include "libsigrok-internal.h"
-#include "agilent-dmm.h"
+#include "protocol.h"
 
 static const uint32_t scanopts[] = {
        SR_CONF_CONN,
@@ -46,6 +46,7 @@ extern const struct agdmm_job agdmm_jobs_u12xx[];
 extern const struct agdmm_recv agdmm_recvs_u123x[];
 extern const struct agdmm_recv agdmm_recvs_u124x[];
 extern const struct agdmm_recv agdmm_recvs_u125x[];
+extern const struct agdmm_recv agdmm_recvs_u128x[];
 
 /* This works on all the Agilent U12xxA series, although the
  * U127xA can apparently also run at 19200/8n1. */
@@ -67,6 +68,9 @@ static const struct agdmm_profile supported_agdmm[] = {
        { AGILENT_U1251, "U1251B", agdmm_jobs_u12xx, agdmm_recvs_u125x },
        { AGILENT_U1252, "U1252B", agdmm_jobs_u12xx, agdmm_recvs_u125x },
        { AGILENT_U1253, "U1253B", agdmm_jobs_u12xx, agdmm_recvs_u125x },
+
+       { KEYSIGHT_U1281, "U1281A", agdmm_jobs_u12xx, agdmm_recvs_u128x },
+       { KEYSIGHT_U1282, "U1282A", agdmm_jobs_u12xx, agdmm_recvs_u128x },
        ALL_ZERO
 };
 
@@ -117,20 +121,21 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
                return NULL;
 
        tokens = g_strsplit(buf, ",", 4);
-       if (!strcmp("Agilent Technologies", tokens[0])
+       if ((!strcmp("Agilent Technologies", tokens[0]) ||
+            !strcmp("Keysight Technologies", tokens[0]))
                        && tokens[1] && tokens[2] && tokens[3]) {
                for (i = 0; supported_agdmm[i].model; i++) {
                        if (strcmp(supported_agdmm[i].modelname, tokens[1]))
                                continue;
                        sdi = g_malloc0(sizeof(struct sr_dev_inst));
                        sdi->status = SR_ST_INACTIVE;
-                       sdi->vendor = g_strdup("Agilent");
+                       sdi->vendor = g_strdup(tokens[0][0] == 'A' ? "Agilent" : "Keysight");
                        sdi->model = g_strdup(tokens[1]);
                        sdi->version = g_strdup(tokens[3]);
                        devc = g_malloc0(sizeof(struct dev_context));
                        sr_sw_limits_init(&devc->limits);
                        devc->profile = &supported_agdmm[i];
-                       devc->cur_mq = -1;
+                       devc->cur_mq = 0;
                        sdi->inst_type = SR_INST_SERIAL;
                        sdi->conn = serial;
                        sdi->priv = devc;