* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <config.h>
#include <glib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <string.h>
-#include <errno.h>
-#include "libsigrok.h"
+#include <libsigrok/libsigrok.h>
#include "libsigrok-internal.h"
#include "fluke-dmm.h"
SR_PRIV struct sr_dev_driver flukedmm_driver_info;
-static char *scan_conn[] = {
+static const char *scan_conn[] = {
/* 287/289 */
"115200/8n1",
/* 187/189 */
if (serial_open(serial, SERIAL_RDWR) != SR_OK)
return NULL;
- drvc = di->priv;
+ drvc = di->context;
b = buf;
retry = 0;
devices = NULL;
break;
/* The Scopemeter 199B, at least, requires this
* after all the 115k/9.6k confusion. */
- g_usleep(5000);
+ g_usleep(5 * 1000);
}
}
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)
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;
.dev_close = std_serial_dev_close,
.dev_acquisition_start = dev_acquisition_start,
.dev_acquisition_stop = dev_acquisition_stop,
- .priv = NULL,
+ .context = NULL,
};