Пример #1
0
// SetTunerGain Sets the tuner gain.
// Gain is specified as an int in tenths of dB, 115 means 11.5dB
// See: GetTunerGains to get a list of valid options
func (dev *Radio) SetTunerGain(gain int) error {
	retval := C.rtlsdr_set_tuner_gain(dev.devptr, C.int(gain))

	if retval != 0 {
		return fmt.Errorf("rtlsdr_set_tuner_gain returned error value: %d", retval)
	}
	return nil
}
Пример #2
0
// Set the gain for the device.
// Manual gain mode must be enabled for this to work.
//
// Valid gain values (in tenths of a dB) for the E4000 tuner:
// -10, 15, 40, 65, 90, 115, 140, 165, 190, 215, 240, 290,
// 340, 420, 430, 450, 470, 490
// Gain values are in tenths of dB, e.g. 115 means 11.5 dB.
//
// int rtlsdr_set_tuner_gain(rtlsdr_dev_t *dev, int gain);
// rtlsdr_set_tuner_gain returns 0 on success
func (c *Context) SetTunerGain(gain int) (err int) {
	return int(C.rtlsdr_set_tuner_gain((*C.rtlsdr_dev_t)(c.dev),
		C.int(gain)))
}
Пример #3
0
// SetTunerGain sets the tuner gain. Note, manual gain mode
// must be enabled for this to work. Valid gain values may be
// queried using GetTunerGains.
//
// Gain values are in tenths of dB, e.g. 115 means 11.5 dB.
func (dev *Context) SetTunerGain(gainTenthsDb int) (err error) {
	i := int(C.rtlsdr_set_tuner_gain((*C.rtlsdr_dev_t)(dev),
		C.int(gainTenthsDb)))
	return libError(i)
}