Esempio n. 1
0
// GetSampleRate gets the actual sample rate the device is configured for
func (dev *Radio) GetSampleRate() (uint32, error) {
	retval := C.rtlsdr_get_sample_rate(dev.devptr)

	if retval == 0 {
		return 0, fmt.Errorf("rtlsdr_get_sample_rate encountered an error")
	}
	return uint32(retval), nil
}
Esempio n. 2
0
// Get actual sample rate the device is configured to.
//
// uint32_t rtlsdr_get_sample_rate(rtlsdr_dev_t *dev);
// rtlsdr_get_sample_rate returns 0 on error or sample rate in Hz
func (c *Context) GetSampleRate() (rate int) {
	return int(C.rtlsdr_get_sample_rate((*C.rtlsdr_dev_t)(c.dev)))
}