X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Ffluke-dmm%2Fapi.c;h=a7b2e14d0d103dbfb25479a6cd9d475e0405d795;hb=208c1d35435626a11afa1ab301b2071b2a4e187b;hp=36142fd5587cd3614259a160dff1642bf94b4472;hpb=dcd438ee3523098201c7937e75e55775da3b506f;p=libsigrok.git diff --git a/src/hardware/fluke-dmm/api.c b/src/hardware/fluke-dmm/api.c index 36142fd5..a7b2e14d 100644 --- a/src/hardware/fluke-dmm/api.c +++ b/src/hardware/fluke-dmm/api.c @@ -17,13 +17,13 @@ * along with this program. If not, see . */ +#include #include #include #include #include #include -#include -#include "libsigrok.h" +#include #include "libsigrok-internal.h" #include "fluke-dmm.h" @@ -56,6 +56,7 @@ static const struct flukedmm_profile supported_flukedmm[] = { { FLUKE_189, "189", 100, 1000 }, { FLUKE_287, "287", 100, 1000 }, { FLUKE_190, "199B", 1000, 3500 }, + { FLUKE_289, "289", 100, 1000 }, }; static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx) @@ -79,7 +80,7 @@ static GSList *fluke_scan(struct sr_dev_driver *di, const char *conn, if (serial_open(serial, SERIAL_RDWR) != SR_OK) return NULL; - drvc = di->priv; + drvc = di->context; b = buf; retry = 0; devices = NULL; @@ -181,7 +182,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) break; /* The Scopemeter 199B, at least, requires this * after all the 115k/9.6k confusion. */ - g_usleep(5000); + g_usleep(5 * 1000); } } @@ -190,7 +191,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) static GSList *dev_list(const struct sr_dev_driver *di) { - return ((struct drv_context *)(di->priv))->instances; + return ((struct drv_context *)(di->context))->instances; } static int cleanup(const struct sr_dev_driver *di) @@ -258,14 +259,9 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data) if (sdi->status != SR_ST_ACTIVE) return SR_ERR_DEV_CLOSED; - if (!(devc = sdi->priv)) { - sr_err("sdi->priv was NULL."); - return SR_ERR_BUG; - } - + devc = sdi->priv; devc->cb_data = cb_data; - /* Send header packet to the session bus. */ std_session_send_df_header(cb_data, LOG_PREFIX); /* Poll every 100ms, or whenever some data comes in. */ @@ -305,5 +301,5 @@ SR_PRIV struct sr_dev_driver flukedmm_driver_info = { .dev_close = std_serial_dev_close, .dev_acquisition_start = dev_acquisition_start, .dev_acquisition_stop = dev_acquisition_stop, - .priv = NULL, + .context = NULL, };