fvalue = strtof(tokens[1], &e);
if (fvalue == 0.0 && e == tokens[1]) {
/* Happens all the time, when switching modes. */
- sr_dbg("fluke-dmm: invalid float");
+ sr_dbg("Invalid float.");
return NULL;
}
}
while(*e && *e == ' ')
e++;
+ /* TODO: Check malloc return value. */
analog = g_try_malloc0(sizeof(struct sr_datafeed_analog));
analog->num_samples = 1;
+ /* TODO: Check malloc return value. */
analog->data = g_try_malloc(sizeof(float));
if (is_oor)
*analog->data = NAN;
(void)sdi;
fvalue = strtof(tokens[0], &eptr);
if (fvalue == 0.0 && eptr == tokens[0]) {
- sr_err("fluke-dmm: invalid float");
+ sr_err("Invalid float.");
return NULL;
}
+ /* TODO: Check malloc return value. */
analog = g_try_malloc0(sizeof(struct sr_datafeed_analog));
analog->num_samples = 1;
+ /* TODO: Check malloc return value. */
analog->data = g_try_malloc(sizeof(float));
*analog->data = fvalue;
analog->mq = -1;
char **tokens;
devc = sdi->priv;
- sr_spew("fluke-dmm: received line '%s' (%d)", devc->buf, devc->buflen);
+ sr_spew("Received line '%s' (%d).", devc->buf, devc->buflen);
if (devc->buflen == 1) {
if (devc->buf[0] != '0') {
/* Not just a CMD_ACK from the query command. */
- sr_dbg("fluke-dmm: got CMD_ACK '%c'", devc->buf[0]);
+ sr_dbg("Got CMD_ACK '%c'.", devc->buf[0]);
devc->expect_response = FALSE;
}
devc->buflen = 0;
* or temporary disconnect issues. */
if ((devc->expect_response == FALSE && elapsed > devc->profile->poll_period)
|| elapsed > 1000) {
- sr_spew("fluke-dmm: sending QM");
+ sr_spew("Sending QM.");
if (serial_write(devc->serial->fd, "QM\r", 3) == -1)
- sr_err("fluke-dmm: unable to send QM: %s", strerror(errno));
+ sr_err("Unable to send QM: %s.", strerror(errno));
devc->cmd_sent_at = now;
devc->expect_response = TRUE;
}