struct slogic_sample_rate *slogic_parse_sample_rate(const char *str){ struct slogic_sample_rate *sample_rate = slogic_get_sample_rates(); while (sample_rate->text != NULL) { if (strcmp(sample_rate->text, str) == 0) { return sample_rate; } sample_rate++; } return NULL; }
void full_usage() { const struct slogic_sample_rate *sample_iterator = slogic_get_sample_rates(); fprintf(stderr, "usage: %s -f <output file> -r <sample rate> [-n <number of samples>]\n", me); fprintf(stderr, "\n"); fprintf(stderr, " -n: Number of samples to record\n"); fprintf(stderr, " Defaults to one second of samples for the specified sample rate\n"); fprintf(stderr, " -f: The output file. Using '-' means that the bytes will be output to stdout.\n"); fprintf(stderr, " -h: This help message.\n"); fprintf(stderr, " -r: Select sample rate for the Logic.\n"); fprintf(stderr, " Available sample rates:\n"); while (sample_iterator->text != NULL) { fprintf(stderr, " o %s\n", sample_iterator->text); sample_iterator++; } fprintf(stderr, "\n"); fprintf(stderr, "Advanced options:\n"); fprintf(stderr, " -b: Transfer buffer size.\n"); fprintf(stderr, " -t: Number of transfer buffers.\n"); fprintf(stderr, " -o: Transfer timeout.\n"); fprintf(stderr, " -u: libusb debug level: 0 to 3, 3 is most verbose. Defaults to '0'.\n"); fprintf(stderr, "\n"); }