return frequency and sample rate as unsigned integers

This commit is contained in:
Dimitri Stolnikov 2012-04-24 20:02:53 +02:00
parent 680fe5de03
commit 5f70efd8d1
2 changed files with 18 additions and 6 deletions

View File

@ -41,7 +41,13 @@ RTLSDR_API int rtlsdr_close(rtlsdr_dev_t *dev);
RTLSDR_API int rtlsdr_set_center_freq(rtlsdr_dev_t *dev, uint32_t freq);
RTLSDR_API int rtlsdr_get_center_freq(rtlsdr_dev_t *dev);
/*!
* Get actual frequency the device is tuned to.
*
* \param dev the device handle given by rtlsdr_open()
* \return 0 on error, frequency in Hz otherwise
*/
RTLSDR_API uint32_t rtlsdr_get_center_freq(rtlsdr_dev_t *dev);
RTLSDR_API int rtlsdr_set_freq_correction(rtlsdr_dev_t *dev, int ppm);
@ -54,7 +60,13 @@ RTLSDR_API int rtlsdr_get_tuner_gain(rtlsdr_dev_t *dev);
/* this will select the baseband filters according to the requested sample rate */
RTLSDR_API int rtlsdr_set_sample_rate(rtlsdr_dev_t *dev, uint32_t rate);
RTLSDR_API int rtlsdr_get_sample_rate(rtlsdr_dev_t *dev);
/*!
* Get actual sample rate the device is configured to.
*
* \param dev the device handle given by rtlsdr_open()
* \return 0 on error, sample rate in Hz otherwise
*/
RTLSDR_API uint32_t rtlsdr_get_sample_rate(rtlsdr_dev_t *dev);
/* streaming functions */

View File

@ -459,10 +459,10 @@ int rtlsdr_set_center_freq(rtlsdr_dev_t *dev, uint32_t freq)
return r;
}
int rtlsdr_get_center_freq(rtlsdr_dev_t *dev)
uint32_t rtlsdr_get_center_freq(rtlsdr_dev_t *dev)
{
if (!dev || !dev->tuner)
return -1;
return 0;
return dev->tuner->freq;
}
@ -554,10 +554,10 @@ int rtlsdr_set_sample_rate(rtlsdr_dev_t *dev, uint32_t samp_rate)
return 0;
}
int rtlsdr_get_sample_rate(rtlsdr_dev_t *dev)
uint32_t rtlsdr_get_sample_rate(rtlsdr_dev_t *dev)
{
if (!dev)
return -1;
return 0;
return dev->rate;
}