From: Bert Vermeulen Date: Mon, 1 Sep 2014 19:44:08 +0000 (+0200) Subject: agilent-dmm: U124x/U125x fixes. X-Git-Tag: libsigrok-0.4.0~1060 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=ee2bcdfc44f285c5a7b93fcba625409fdd25dcc3;p=libsigrok.git agilent-dmm: U124x/U125x fixes. --- diff --git a/src/hardware/agilent-dmm/api.c b/src/hardware/agilent-dmm/api.c index 7e44f963..55f87416 100644 --- a/src/hardware/agilent-dmm/api.c +++ b/src/hardware/agilent-dmm/api.c @@ -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; diff --git a/src/hardware/agilent-dmm/sched.c b/src/hardware/agilent-dmm/sched.c index 3ca52525..51bf59f3 100644 --- a/src/hardware/agilent-dmm/sched.c +++ b/src/hardware/agilent-dmm/sched.c @@ -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 } };