2 * Copyright (C) 2014 by Kyle Keen <keenerd@gmail.com>
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 /* a collection of user friendly tools */
21 * Convert standard suffixes (k, M, G) to double
23 * \param s a string to be parsed
27 double atofs(char *s);
30 * Convert time suffixes (s, m, h) to double
32 * \param s a string to be parsed
33 * \return seconds as double
36 double atoft(char *s);
39 * Convert percent suffixe (%) to double
41 * \param s a string to be parsed
45 double atofp(char *s);
48 * Find nearest supported gain
50 * \param dev the device handle given by rtlsdr_open()
51 * \param target_gain in tenths of a dB
52 * \return 0 on success
55 int nearest_gain(rtlsdr_dev_t *dev, int target_gain);
58 * Set device frequency and report status on stderr
60 * \param dev the device handle given by rtlsdr_open()
61 * \param frequency in Hz
62 * \return 0 on success
65 int verbose_set_frequency(rtlsdr_dev_t *dev, uint32_t frequency);
68 * Set device sample rate and report status on stderr
70 * \param dev the device handle given by rtlsdr_open()
71 * \param samp_rate in samples/second
72 * \return 0 on success
75 int verbose_set_sample_rate(rtlsdr_dev_t *dev, uint32_t samp_rate);
78 * Enable or disable the direct sampling mode and report status on stderr
80 * \param dev the device handle given by rtlsdr_open()
81 * \param on 0 means disabled, 1 I-ADC input enabled, 2 Q-ADC input enabled
82 * \return 0 on success
85 int verbose_direct_sampling(rtlsdr_dev_t *dev, int on);
88 * Enable offset tuning and report status on stderr
90 * \param dev the device handle given by rtlsdr_open()
91 * \return 0 on success
94 int verbose_offset_tuning(rtlsdr_dev_t *dev);
97 * Enable auto gain and report status on stderr
99 * \param dev the device handle given by rtlsdr_open()
100 * \return 0 on success
103 int verbose_auto_gain(rtlsdr_dev_t *dev);
106 * Set tuner gain and report status on stderr
108 * \param dev the device handle given by rtlsdr_open()
109 * \param gain in tenths of a dB
110 * \return 0 on success
113 int verbose_gain_set(rtlsdr_dev_t *dev, int gain);
116 * Set the frequency correction value for the device and report status on stderr.
118 * \param dev the device handle given by rtlsdr_open()
119 * \param ppm_error correction value in parts per million (ppm)
120 * \return 0 on success
123 int verbose_ppm_set(rtlsdr_dev_t *dev, int ppm_error);
128 * \param dev the device handle given by rtlsdr_open()
129 * \return 0 on success
132 int verbose_reset_buffer(rtlsdr_dev_t *dev);
135 * Find the closest matching device.
137 * \param s a string to be parsed
138 * \return dev_index int, -1 on error
141 int verbose_device_search(char *s);