X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Ffluke-dmm%2Ffluke.c;h=7a1fbf92022b0111115581eb5cc3a2f8f999e966;hb=c04ca4da177bbd718be4de11e40a4ef5cbf3df7a;hp=159a4f9f291d1761e72c72cccbc2375c9f759103;hpb=8d5228015d0f07ce6626aa52ffb80bc4129f7dbe;p=libsigrok.git diff --git a/src/hardware/fluke-dmm/fluke.c b/src/hardware/fluke-dmm/fluke.c index 159a4f9f..7a1fbf92 100644 --- a/src/hardware/fluke-dmm/fluke.c +++ b/src/hardware/fluke-dmm/fluke.c @@ -17,18 +17,19 @@ * along with this program. If not, see . */ +#include #include #include #include #include -#include "libsigrok.h" +#include #include "libsigrok-internal.h" #include "fluke-dmm.h" -static struct sr_datafeed_analog *handle_qm_18x(const struct sr_dev_inst *sdi, +static struct sr_datafeed_analog_old *handle_qm_18x(const struct sr_dev_inst *sdi, char **tokens) { - struct sr_datafeed_analog *analog; + struct sr_datafeed_analog_old *analog; float fvalue; char *e, *u; gboolean is_oor; @@ -58,7 +59,7 @@ static struct sr_datafeed_analog *handle_qm_18x(const struct sr_dev_inst *sdi, while (*e && *e == ' ') e++; - analog = g_malloc0(sizeof(struct sr_datafeed_analog)); + analog = g_malloc0(sizeof(struct sr_datafeed_analog_old)); analog->data = g_malloc(sizeof(float)); analog->channels = sdi->channels; analog->num_samples = 1; @@ -153,10 +154,10 @@ static struct sr_datafeed_analog *handle_qm_18x(const struct sr_dev_inst *sdi, return analog; } -static struct sr_datafeed_analog *handle_qm_28x(const struct sr_dev_inst *sdi, +static struct sr_datafeed_analog_old *handle_qm_28x(const struct sr_dev_inst *sdi, char **tokens) { - struct sr_datafeed_analog *analog; + struct sr_datafeed_analog_old *analog; float fvalue; if (!tokens[1]) @@ -167,7 +168,7 @@ static struct sr_datafeed_analog *handle_qm_28x(const struct sr_dev_inst *sdi, return NULL; } - analog = g_malloc0(sizeof(struct sr_datafeed_analog)); + analog = g_malloc0(sizeof(struct sr_datafeed_analog_old)); analog->data = g_malloc(sizeof(float)); analog->channels = sdi->channels; analog->num_samples = 1; @@ -361,7 +362,7 @@ static void handle_qm_19x_data(const struct sr_dev_inst *sdi, char **tokens) { struct dev_context *devc; struct sr_datafeed_packet packet; - struct sr_datafeed_analog analog; + struct sr_datafeed_analog_old analog; float fvalue; if (!strcmp(tokens[0], "9.9E+37")) { @@ -396,7 +397,7 @@ static void handle_qm_19x_data(const struct sr_dev_inst *sdi, char **tokens) analog.mq = devc->mq; analog.unit = devc->unit; analog.mqflags = 0; - packet.type = SR_DF_ANALOG; + packet.type = SR_DF_ANALOG_OLD; packet.payload = &analog; sr_session_send(devc->cb_data, &packet); devc->num_samples++; @@ -408,7 +409,7 @@ static void handle_line(const struct sr_dev_inst *sdi) struct dev_context *devc; struct sr_serial_dev_inst *serial; struct sr_datafeed_packet packet; - struct sr_datafeed_analog *analog; + struct sr_datafeed_analog_old *analog; int num_tokens, n, i; char cmd[16], **tokens; @@ -432,7 +433,7 @@ static void handle_line(const struct sr_dev_inst *sdi) if (devc->profile->model == FLUKE_187 || devc->profile->model == FLUKE_189) { devc->expect_response = FALSE; analog = handle_qm_18x(sdi, tokens); - } else if (devc->profile->model == FLUKE_287) { + } else if (devc->profile->model == FLUKE_287 || devc->profile->model == FLUKE_289) { devc->expect_response = FALSE; analog = handle_qm_28x(sdi, tokens); } else if (devc->profile->model == FLUKE_190) { @@ -464,7 +465,7 @@ static void handle_line(const struct sr_dev_inst *sdi) if (analog) { /* Got a measurement. */ - packet.type = SR_DF_ANALOG; + packet.type = SR_DF_ANALOG_OLD; packet.payload = analog; sr_session_send(devc->cb_data, &packet); devc->num_samples++;