dispatch(sdi);
- if (devc->num_samples >= devc->limit_samples)
+ if (devc->limit_samples && devc->num_samples >= devc->limit_samples)
sdi->driver->dev_acquisition_stop(sdi, cb_data);
return TRUE;
devc->num_samples += count;
/* Stop acquisition if we acquired enough samples. */
- if (devc->limit_samples > 0) {
- if (devc->num_samples >= devc->limit_samples) {
- sr_info("Requested number of samples reached.");
- sdi->driver->dev_acquisition_stop(sdi, cb_data);
- }
+ if (devc->limit_samples && devc->num_samples >= devc->limit_samples) {
+ sr_info("Requested number of samples reached.");
+ sdi->driver->dev_acquisition_stop(sdi, cb_data);
}
return TRUE;
devc->samples_counter += sending_now;
}
-
- if (devc->samples_counter >= limit_samples) {
- sr_spew("We sent a total of %" PRIu64 " samples.",
- devc->samples_counter);
- /* Make sure we don't receive more packets. */
+ if (limit_samples && devc->samples_counter >= limit_samples) {
+ sr_info("Requested number of samples reached.");
hw_dev_acquisition_stop(NULL, cb_data);
return TRUE;
}
}
if (devc->limit_samples && devc->num_samples >= devc->limit_samples) {
- sr_info("Requested number of samples reached, stopping.");
+ sr_info("Requested number of samples reached.");
sdi->driver->dev_acquisition_stop(sdi, cb_data);
return TRUE;
}
if (devc->limit_msec) {
time = (g_get_monotonic_time() - devc->starttime) / 1000;
if (time > (int64_t)devc->limit_msec) {
- sr_info("Requested time limit reached, stopping.");
+ sr_info("Requested time limit reached.");
sdi->driver->dev_acquisition_stop(sdi, cb_data);
return TRUE;
}
}
/* Stop acquisition if we acquired enough samples. */
- if (devc->limit_samples > 0) {
- if (devc->num_samples >= devc->limit_samples) {
- sr_info("Requested number of samples reached.");
- sdi->driver->dev_acquisition_stop(sdi, cb_data);
- }
+ if (devc->limit_samples && devc->num_samples >= devc->limit_samples) {
+ sr_info("Requested number of samples reached.");
+ sdi->driver->dev_acquisition_stop(sdi, cb_data);
}
return TRUE;
}
/* Abort acquisition if we acquired enough samples. */
- if (devc->num_samples >= devc->limit_samples && devc->limit_samples > 0) {
+ if (devc->limit_samples && devc->num_samples >= devc->limit_samples) {
sr_info("Requested number of samples reached.");
sdi->driver->dev_acquisition_stop(sdi, cb_data);
}