X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Ffluke-dmm%2Fapi.c;h=808778db136999e3e5d3423255cac205ffae8e58;hb=ce19d4c6157b2998aa88a2f32670dd7bdcca02e8;hp=52bb084adb14e71d08ccea7379a33058f1a9ff20;hpb=4f840ce965b1c30c5ab75afecc56193cbaf5c1b3;p=libsigrok.git
diff --git a/src/hardware/fluke-dmm/api.c b/src/hardware/fluke-dmm/api.c
index 52bb084a..808778db 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"
@@ -41,7 +41,7 @@ static const uint32_t devopts[] = {
SR_PRIV struct sr_dev_driver flukedmm_driver_info;
-static char *scan_conn[] = {
+static const char *scan_conn[] = {
/* 287/289 */
"115200/8n1",
/* 187/189 */
@@ -79,7 +79,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 +181,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 +190,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)
@@ -216,18 +216,10 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd
switch (key) {
case SR_CONF_LIMIT_MSEC:
/* TODO: not yet implemented */
- if (g_variant_get_uint64(data) == 0) {
- sr_err("LIMIT_MSEC can't be 0.");
- return SR_ERR;
- }
devc->limit_msec = g_variant_get_uint64(data);
- sr_dbg("Setting time limit to %" PRIu64 "ms.",
- devc->limit_msec);
break;
case SR_CONF_LIMIT_SAMPLES:
devc->limit_samples = g_variant_get_uint64(data);
- sr_dbg("Setting sample limit to %" PRIu64 ".",
- devc->limit_samples);
break;
default:
return SR_ERR_NA;
@@ -313,5 +305,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,
};