dmms[dmm].packet_parse(buf, &floatval, analog, info);
analog->data = &floatval;
- dmms[dmm].dmm_details(analog, info);
+ if (dmms[dmm].dmm_details)
+ dmms[dmm].dmm_details(analog, info);
if (analog->mq != -1) {
/* Got a measurement. */
{
struct sr_dev_inst *sdi;
struct dev_context *devc;
+ int ret;
(void)fd;
if (revents == G_IO_IN) {
/* Serial data arrived. */
handle_new_data(devc, dmm, info);
+ } else {
+ /* Timeout, send another packet request (if DMM needs it). */
+ if (dmms[dmm].packet_request) {
+ ret = dmms[dmm].packet_request(devc->serial);
+ if (ret < 0) {
+ sr_err("Failed to request packet: %d.", ret);
+ return FALSE;
+ }
+ }
}
if (devc->num_samples >= devc->limit_samples) {
return receive_data(fd, revents, TEKPOWER_TP4000ZC, &info, cb_data);
}
+
+SR_PRIV int metex_me31_receive_data(int fd, int revents, void *cb_data)
+{
+ struct metex14_info info;
+
+ return receive_data(fd, revents, METEX_ME31, &info, cb_data);
+}