Ejemplo n.º 1
0
// SetTunerGainMode Sets the tuner gain mode to manual or automatic
func (dev *Radio) SetTunerGainMode(mode GainMode) error {
	retval := C.rtlsdr_set_tuner_gain_mode(dev.devptr, C.int(mode))

	if retval != 0 {
		return fmt.Errorf("rtlsdr_set_tuner_gain_mode returned error value: %d", retval)
	}
	return nil
}
Ejemplo n.º 2
0
// SetTunerGainMode sets the gain mode (automatic/manual).
// Manual gain mode must be enabled for the gain setter function to work.
func (dev *Context) SetTunerGainMode(manualMode bool) (err error) {
	mode := 0 // automatic tuner gain
	if manualMode {
		mode = 1 // manual tuner gain
	}
	i := int(C.rtlsdr_set_tuner_gain_mode((*C.rtlsdr_dev_t)(dev),
		C.int(mode)))
	return libError(i)
}
Ejemplo n.º 3
0
// Set the gain mode (automatic/manual) for the device.
// Manual gain mode must be enabled for the gain setter function to work.
//
// manual gain mode, 1 means manual gain mode shall be enabled.
//
// int rtlsdr_set_tuner_gain_mode(rtlsdr_dev_t *dev, int manual);
// rtlsdr_set_tuner_gain_mode returns 0 on success
func (c *Context) SetTunerGainMode(manual int) (err int) {
	return int(C.rtlsdr_set_tuner_gain_mode((*C.rtlsdr_dev_t)(c.dev),
		C.int(manual)))
}