]> sigrok.org Git - libsigrok.git/commitdiff
agilent-dmm: U124x/U125x fixes.
authorBert Vermeulen <redacted>
Mon, 1 Sep 2014 19:44:08 +0000 (21:44 +0200)
committerBert Vermeulen <redacted>
Mon, 1 Sep 2014 19:44:37 +0000 (21:44 +0200)
src/hardware/agilent-dmm/api.c
src/hardware/agilent-dmm/sched.c

index 7e44f96328d15c9be231d8c9d7bf63ed5810be36..55f87416721df2bc198fac3f8ab85f7df33d3508 100644 (file)
@@ -55,6 +55,8 @@ static const struct agdmm_profile supported_agdmm[] = {
 
        { AGILENT_U1241, "U1241A", agdmm_jobs_u12xx, agdmm_recvs_u124x },
        { AGILENT_U1242, "U1242A", agdmm_jobs_u12xx, agdmm_recvs_u124x },
+       { AGILENT_U1241, "U1241B", agdmm_jobs_u12xx, agdmm_recvs_u124x },
+       { AGILENT_U1242, "U1242B", agdmm_jobs_u12xx, agdmm_recvs_u124x },
 
        { AGILENT_U1251, "U1251A", agdmm_jobs_u12xx, agdmm_recvs_u125x },
        { AGILENT_U1252, "U1252A", agdmm_jobs_u12xx, agdmm_recvs_u125x },
@@ -125,7 +127,7 @@ static GSList *scan(GSList *options)
                sr_err("Serial buffer malloc failed.");
                return NULL;
        }
-       serial_readline(serial, &buf, &len, 150);
+       serial_readline(serial, &buf, &len, 250);
        if (!len)
                return NULL;
 
index 3ca525259648df7eec7c29062909056001699cc9..51bf59f30ef40da6272632836957180abc4bf6f4 100644 (file)
@@ -411,11 +411,11 @@ static int recv_conf_u124x_5x(const struct sr_dev_inst *sdi, GMatchInfo *match)
                devc->cur_mqflags = 0;
                devc->cur_divider = 0;
                if (mstr[4] == ':') {
-                       if (!strcmp(mstr + 4, "AC")) {
+                       if (!strncmp(mstr + 5, "AC", 2)) {
                                devc->cur_mqflags |= SR_MQFLAG_AC | SR_MQFLAG_RMS;
-                       } else if (!strcmp(mstr + 4, "DC")) {
+                       } else if (!strncmp(mstr + 5, "DC", 2)) {
                                devc->cur_mqflags |= SR_MQFLAG_DC;
-                       } else if (!strcmp(mstr + 4, "ACDC")) {
+                       } else if (!strncmp(mstr + 5, "ACDC", 4)) {
                                /* AC + DC offset */
                                devc->cur_mqflags |= SR_MQFLAG_AC | SR_MQFLAG_DC | SR_MQFLAG_RMS;
                        } else {
@@ -502,8 +502,8 @@ SR_PRIV const struct agdmm_recv agdmm_recvs_u124x[] = {
        { "^\"(\\d\\d.{18}\\d)\"$", recv_stat_u124x },
        { "^\\*([0-9])$", recv_switch },
        { "^([-+][0-9]\\.[0-9]{8}E[-+][0-9]{2})$", recv_fetc },
-       { "^(VOLT|CURR|RES|CAP) ([-+][0-9\\.E\\-+]+),([-+][0-9\\.E\\-+]+)$", recv_conf_u124x_5x },
-       { "^(VOLT:[ACD]+) ([-+][0-9\\.E\\-+]+),([-+][0-9\\.E\\-+]+)$", recv_conf_u124x_5x },
+       { "^\"(VOLT|CURR|RES|CAP) ([-+][0-9\\.E\\-+]+),([-+][0-9\\.E\\-+]+)\"$", recv_conf_u124x_5x },
+       { "^\"(VOLT:[ACD]+) ([-+][0-9\\.E\\-+]+),([-+][0-9\\.E\\-+]+)\"$", recv_conf_u124x_5x },
        { "^\"(DIOD)\"$", recv_conf },
        { NULL, NULL }
 };
@@ -512,8 +512,8 @@ SR_PRIV const struct agdmm_recv agdmm_recvs_u125x[] = {
        { "^\"(\\d\\d.{18}\\d)\"$", recv_stat_u125x },
        { "^\\*([0-9])$", recv_switch },
        { "^([-+][0-9]\\.[0-9]{8}E[-+][0-9]{2})$", recv_fetc },
-       { "^(VOLT|CURR|RES|CAP) ([-+][0-9\\.E\\-+]+),([-+][0-9\\.E\\-+]+)$", recv_conf_u124x_5x },
-       { "^(VOLT:[ACD]+) ([-+][0-9\\.E\\-+]+),([-+][0-9\\.E\\-+]+)$", recv_conf_u124x_5x },
+       { "^\"(VOLT|CURR|RES|CAP) ([-+][0-9\\.E\\-+]+),([-+][0-9\\.E\\-+]+)\"$", recv_conf_u124x_5x },
+       { "^\"(VOLT:[ACD]+) ([-+][0-9\\.E\\-+]+),([-+][0-9\\.E\\-+]+)\"$", recv_conf_u124x_5x },
        { "^\"(DIOD)\"$", recv_conf },
        { NULL, NULL }
 };