예제 #1
0
// GetCenterFrequency gets the actual frequency the device is tuned to in HZ
func (dev *Radio) GetCenterFrequency() (uint32, error) {
	retval := C.rtlsdr_get_center_freq(dev.devptr)

	if retval == 0 {
		return 0, fmt.Errorf("rtlsdr_get_center_freq encountered an error")
	}
	return uint32(retval), nil
}
예제 #2
0
파일: rtlsdr.go 프로젝트: nlefler/gortlsdr
// Get actual frequency the device is tuned to.
//
// Frequency values are in Hz.
//
// uint32_t rtlsdr_get_center_freq(rtlsdr_dev_t *dev);
// rtlsdr_get_center_freq returns frequency in Hz or 0 on error
func (c *Context) GetCenterFreq() (freq int) {
	return int(C.rtlsdr_get_center_freq((*C.rtlsdr_dev_t)(c.dev)))
}