Example #1
0
// SetCenterFrequency tunes the device in HZ
func (dev *Radio) SetCenterFrequency(freq uint32) error {
	retval := C.rtlsdr_set_center_freq(dev.devptr, C.uint32_t(freq))

	if retval != 0 {
		return fmt.Errorf("rtlsdr_set_center_freq returned error value: %d", retval)
	}
	return nil
}
Example #2
0
// Set the device center frequency.
//
// int rtlsdr_set_center_freq(rtlsdr_dev_t *dev, uint32_t freq);
// rtlsdr_set_center_freq returns a negative value on error
func (c *Context) SetCenterFreq(freq int) (err int) {
	return int(C.rtlsdr_set_center_freq((*C.rtlsdr_dev_t)(c.dev),
		C.uint32_t(freq)))
}
Example #3
0
// SetCenterFreq sets the center frequency.
func (dev *Context) SetCenterFreq(freqHz int) (err error) {
	i := int(C.rtlsdr_set_center_freq((*C.rtlsdr_dev_t)(dev),
		C.uint32_t(freqHz)))
	return libError(i)
}