X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=hardware%2Ffluke-dmm%2Ffluke-dmm.h;h=2e09b2d4508512a2c7d0acc7fc6147cba1a8e9d6;hb=1e1bfcd0fef7c397b3d8fc6cd244263e6828a5da;hp=5192ee8727dbf128859b98d517bc02290bdf88d3;hpb=4f958423d17c4c264ae02884888615df28c60f3d;p=libsigrok.git diff --git a/hardware/fluke-dmm/fluke-dmm.h b/hardware/fluke-dmm/fluke-dmm.h index 5192ee87..2e09b2d4 100644 --- a/hardware/fluke-dmm/fluke-dmm.h +++ b/hardware/fluke-dmm/fluke-dmm.h @@ -21,22 +21,32 @@ #ifndef LIBSIGROK_FLUKE_DMM_H #define LIBSIGROK_FLUKE_DMM_H +/* Message logging helpers with driver-specific prefix string. */ +#define DRIVER_LOG_DOMAIN "fluke-dmm: " +#define sr_log(l, s, args...) sr_log(l, DRIVER_LOG_DOMAIN s, ## args) +#define sr_spew(s, args...) sr_spew(DRIVER_LOG_DOMAIN s, ## args) +#define sr_dbg(s, args...) sr_dbg(DRIVER_LOG_DOMAIN s, ## args) +#define sr_info(s, args...) sr_info(DRIVER_LOG_DOMAIN s, ## args) +#define sr_warn(s, args...) sr_warn(DRIVER_LOG_DOMAIN s, ## args) +#define sr_err(s, args...) sr_err(DRIVER_LOG_DOMAIN s, ## args) + #define FLUKEDMM_BUFSIZE 256 /* Supported models */ enum { FLUKE_187 = 1, + FLUKE_287, + FLUKE_190, }; /* Supported device profiles */ struct flukedmm_profile { int model; const char *modelname; -}; - -/* Private driver context. */ -struct drv_context { - GSList *instances; + /* How often to poll, in ms. */ + int poll_period; + /* If no response received, how long to wait before retrying. */ + int timeout; }; /* Private, per-device-instance driver context. */ @@ -44,15 +54,23 @@ struct dev_context { const struct flukedmm_profile *profile; uint64_t limit_samples; uint64_t limit_msec; - struct sr_serial_dev_inst *serial; /* Opaque pointer passed in by the frontend. */ void *cb_data; /* Runtime. */ uint64_t num_samples; - unsigned char buf[FLUKEDMM_BUFSIZE]; + char buf[FLUKEDMM_BUFSIZE]; int buflen; + int64_t cmd_sent_at; + int expect_response; + int meas_type; + int is_relative; + int mq; + int unit; + int mqflags; }; +SR_PRIV int fluke_receive_data(int fd, int revents, void *cb_data); + #endif /* LIBSIGROK_FLUKE_DMM_H */