/* We name the probes 0-7 on our demo driver. */
static const char *probe_names[NUM_PROBES + 1] = {
- "0",
- "1",
- "2",
- "3",
- "4",
- "5",
- "6",
- "7",
+ "0", "1", "2", "3", "4", "5", "6", "7",
NULL,
};
case SR_DI_HWCAPS:
*data = hwcaps;
break;
- case SR_DI_NUM_PROBES:
- *data = GINT_TO_POINTER(NUM_PROBES);
- break;
- case SR_DI_PROBE_NAMES:
- *data = probe_names;
- break;
case SR_DI_SAMPLERATES:
*data = &samplerates;
break;
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;
}
{
struct sr_datafeed_packet *packet;
struct sr_datafeed_header *header;
- struct sr_datafeed_meta_logic meta;
struct dev_context *devc;
(void)sdi;
gettimeofday(&header->starttime, NULL);
sr_session_send(devc->session_dev_id, packet);
- /* Send metadata about the SR_DF_LOGIC packets to come. */
- packet->type = SR_DF_META_LOGIC;
- packet->payload = &meta;
- meta.samplerate = cur_samplerate;
- meta.num_probes = NUM_PROBES;
- sr_session_send(devc->session_dev_id, packet);
-
/* We use this timestamp to decide how many more samples to send. */
devc->starttime = g_get_monotonic_time();