X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fhameg-hmo%2Fprotocol.c;h=9137b3b7c9e72e16b3dad518604096fc3716b38f;hb=695dc859c15ba4190f5c1aa2e1a6e2dc6a6e5845;hp=9d32dc67edfe3656cd4a921462e295f4ab396cbe;hpb=356f64f8c735b5432f930872c90923a8e7f82913;p=libsigrok.git diff --git a/src/hardware/hameg-hmo/protocol.c b/src/hardware/hameg-hmo/protocol.c index 9d32dc67..9137b3b7 100644 --- a/src/hardware/hameg-hmo/protocol.c +++ b/src/hardware/hameg-hmo/protocol.c @@ -734,6 +734,7 @@ SR_PRIV int hmo_receive_data(int fd, int revents, void *cb_data) struct sr_datafeed_logic logic; (void)fd; + (void)revents; data = NULL; @@ -743,8 +744,12 @@ SR_PRIV int hmo_receive_data(int fd, int revents, void *cb_data) if (!(devc = sdi->priv)) return TRUE; + /* Although this is correct in general, the USBTMC libusb implementation + * currently does not generate an event prior to the first read. Often + * it is ok to start reading just after the 50ms timeout. See bug #785. if (revents != G_IO_IN) return TRUE; + */ ch = devc->current_channel->data; @@ -768,7 +773,7 @@ SR_PRIV int hmo_receive_data(int fd, int revents, void *cb_data) analog.mqflags = 0; packet.type = SR_DF_ANALOG_OLD; packet.payload = &analog; - sr_session_send(cb_data, &packet); + sr_session_send(sdi, &packet); g_slist_free(analog.channels); g_array_free(data, TRUE); data = NULL; @@ -787,7 +792,7 @@ SR_PRIV int hmo_receive_data(int fd, int revents, void *cb_data) logic.data = data->data; packet.type = SR_DF_LOGIC; packet.payload = &logic; - sr_session_send(cb_data, &packet); + sr_session_send(sdi, &packet); g_array_free(data, TRUE); data = NULL; break; @@ -803,7 +808,7 @@ SR_PRIV int hmo_receive_data(int fd, int revents, void *cb_data) devc->current_channel = devc->current_channel->next; hmo_request_data(sdi); } else if (++devc->num_frames == devc->frame_limit) { - sdi->driver->dev_acquisition_stop(sdi, cb_data); + sdi->driver->dev_acquisition_stop(sdi); } else { devc->current_channel = devc->enabled_channels; hmo_request_data(sdi);