X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Flecroy-xstream%2Fprotocol.c;h=802cda32efe38f147387457c81ae1ee387eeeff9;hb=2142a79b53e7fb2d9d050c382b624820601c1bd6;hp=03cf88ce7e73d42375c79b5644afdb6225e3a2fc;hpb=3f4c1174b66620c2a66ab8cf39865c717577debf;p=libsigrok.git diff --git a/src/hardware/lecroy-xstream/protocol.c b/src/hardware/lecroy-xstream/protocol.c index 03cf88ce..802cda32 100644 --- a/src/hardware/lecroy-xstream/protocol.c +++ b/src/hardware/lecroy-xstream/protocol.c @@ -626,7 +626,6 @@ SR_PRIV int lecroy_xstream_receive_data(int fd, int revents, void *cb_data) struct sr_analog_encoding encoding; struct sr_analog_meaning meaning; struct sr_analog_spec spec; - char buf[8]; (void)fd; (void)revents; @@ -645,12 +644,6 @@ SR_PRIV int lecroy_xstream_receive_data(int fd, int revents, void *cb_data) if (ch->type != SR_CHANNEL_ANALOG) return SR_ERR; - /* Pass on the received data of the channel(s). */ - if (sr_scpi_read_data(sdi->conn, buf, 4) != 4) { - sr_err("Reading header failed, scope probably didn't send any data."); - return TRUE; - } - if (sr_scpi_get_block(sdi->conn, NULL, &data) != SR_OK) { if (data) g_byte_array_free(data, TRUE); @@ -676,8 +669,10 @@ SR_PRIV int lecroy_xstream_receive_data(int fd, int revents, void *cb_data) } else { /* Update sample rate if needed. */ if (state->sample_rate == 0) - if (lecroy_xstream_update_sample_rate(sdi, analog.num_samples) != SR_OK) + if (lecroy_xstream_update_sample_rate(sdi, analog.num_samples) != SR_OK) { + g_free(analog.data); return SR_ERR; + } } /*