From: Bert Vermeulen Date: Fri, 29 Aug 2014 21:39:00 +0000 (+0200) Subject: agilent-dmm: Assume all A and B models are identical on the wire. X-Git-Tag: libsigrok-0.4.0~1077 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=f857bd928da912b0b451893dd720ef909b2577ab;p=libsigrok.git agilent-dmm: Assume all A and B models are identical on the wire. --- diff --git a/src/hardware/agilent-dmm/agilent-dmm.h b/src/hardware/agilent-dmm/agilent-dmm.h index 2277111f..789358c4 100644 --- a/src/hardware/agilent-dmm/agilent-dmm.h +++ b/src/hardware/agilent-dmm/agilent-dmm.h @@ -26,12 +26,13 @@ /* Supported models */ enum { - AGILENT_U1231A = 1, - AGILENT_U1232A, - AGILENT_U1233A, - AGILENT_U1251A, - AGILENT_U1252A, - AGILENT_U1253A, + AGILENT_U1231 = 1, + AGILENT_U1232, + AGILENT_U1233, + + AGILENT_U1251, + AGILENT_U1252, + AGILENT_U1253, }; /* Supported device profiles */ diff --git a/src/hardware/agilent-dmm/api.c b/src/hardware/agilent-dmm/api.c index cb7baa60..40c7990d 100644 --- a/src/hardware/agilent-dmm/api.c +++ b/src/hardware/agilent-dmm/api.c @@ -39,9 +39,8 @@ static const int32_t hwcaps[] = { SR_CONF_CONTINUOUS, }; -extern const struct agdmm_job agdmm_jobs_u123x[]; +extern const struct agdmm_job agdmm_jobs_u12xx[]; extern const struct agdmm_recv agdmm_recvs_u123x[]; -extern const struct agdmm_job agdmm_jobs_u125x[]; extern const struct agdmm_recv agdmm_recvs_u125x[]; /* This works on all the Agilent U12xxA series, although the @@ -49,13 +48,17 @@ extern const struct agdmm_recv agdmm_recvs_u125x[]; #define SERIALCOMM "9600/8n1" static const struct agdmm_profile supported_agdmm[] = { - { AGILENT_U1231A, "U1231A", agdmm_jobs_u123x, agdmm_recvs_u123x }, - { AGILENT_U1232A, "U1232A", agdmm_jobs_u123x, agdmm_recvs_u123x }, - { AGILENT_U1233A, "U1233A", agdmm_jobs_u123x, agdmm_recvs_u123x }, - { AGILENT_U1251A, "U1251A", agdmm_jobs_u125x, agdmm_recvs_u125x }, - { AGILENT_U1252A, "U1252A", agdmm_jobs_u125x, agdmm_recvs_u125x }, - { AGILENT_U1253A, "U1253A", agdmm_jobs_u125x, agdmm_recvs_u125x }, - { 0, NULL, NULL, NULL } + { AGILENT_U1231, "U1231A", agdmm_jobs_u12xx, agdmm_recvs_u123x }, + { AGILENT_U1232, "U1232A", agdmm_jobs_u12xx, agdmm_recvs_u123x }, + { AGILENT_U1233, "U1233A", agdmm_jobs_u12xx, agdmm_recvs_u123x }, + + { AGILENT_U1251, "U1251A", agdmm_jobs_u12xx, agdmm_recvs_u125x }, + { AGILENT_U1252, "U1252A", agdmm_jobs_u12xx, agdmm_recvs_u125x }, + { AGILENT_U1253, "U1253A", agdmm_jobs_u12xx, agdmm_recvs_u125x }, + { 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 }, + ALL_ZERO }; SR_PRIV struct sr_dev_driver agdmm_driver_info; diff --git a/src/hardware/agilent-dmm/sched.c b/src/hardware/agilent-dmm/sched.c index a697e1ec..08292585 100644 --- a/src/hardware/agilent-dmm/sched.c +++ b/src/hardware/agilent-dmm/sched.c @@ -448,7 +448,8 @@ static int recv_switch(const struct sr_dev_inst *sdi, GMatchInfo *match) return SR_OK; } -SR_PRIV const struct agdmm_job agdmm_jobs_u123x[] = { +/* Poll keys/switches and values at 7Hz, mode at 1Hz. */ +SR_PRIV const struct agdmm_job agdmm_jobs_u12xx[] = { { 143, send_stat }, { 1000, send_conf }, { 143, send_fetc }, @@ -465,13 +466,6 @@ SR_PRIV const struct agdmm_recv agdmm_recvs_u123x[] = { { NULL, NULL } }; -SR_PRIV const struct agdmm_job agdmm_jobs_u125x[] = { - { 143, send_stat }, - { 1000, send_conf }, - { 143, send_fetc }, - { 0, NULL } -}; - SR_PRIV const struct agdmm_recv agdmm_recvs_u125x[] = { { "^\"(\\d\\d.{18}\\d)\"$", recv_stat_u125x }, { "^\\*([0-9])$", recv_switch },