示例#1
0
// SetAgcMode Enables or Disables the internal digital AGC of the RTL2832
func (dev *Radio) SetAgcMode(mode AgcMode) error {
	retval := C.rtlsdr_set_agc_mode(dev.devptr, C.int(mode))

	if retval != 0 {
		return fmt.Errorf("rtlsdr_set_agc_mode returned error value: %d", retval)
	}
	return nil
}
示例#2
0
文件: rtlsdr.go 项目: cyoung/gortlsdr
// SetAgcMode sets the AGC mode.
func (dev *Context) SetAgcMode(AGCMode bool) (err error) {
	mode := 0 // AGC off
	if AGCMode {
		mode = 1 // AGC on
	}
	i := int(C.rtlsdr_set_agc_mode((*C.rtlsdr_dev_t)(dev),
		C.int(mode)))
	return libError(i)
}
示例#3
0
// Enable or disable the internal digital AGC of the RTL2832.
//
// Digital AGC mode, 1 means enabled, 0 disabled
//
// int rtlsdr_set_agc_mode(rtlsdr_dev_t *dev, int on);
// rtlsdr_set_agc_mode returns 0 on success
func (c *Context) SetAgcMode(on int) (err int) {
	return int(C.rtlsdr_set_agc_mode((*C.rtlsdr_dev_t)(c.dev),
		C.int(on)))
}