Ejemplo n.º 1
0
// GetDirectSampling returns the state of direct sampling mode.
func (dev *Context) GetDirectSampling() (mode SamplingMode, err error) {
	i := int(C.rtlsdr_get_direct_sampling((*C.rtlsdr_dev_t)(dev)))
	switch i {
	case -1:
		err = errors.New("error getting sampling mode")
	case 0:
		mode = SamplingNone
	case 1:
		mode = SamplingIADC
	case 2:
		mode = SamplingQADC
	default:
		mode = SamplingUnknown
		err = errors.New("unknown sampling mode state")
	}
	return
}
Ejemplo n.º 2
0
// Get state of the direct sampling mode
//
// int rtlsdr_get_direct_sampling(rtlsdr_dev_t *dev);
// rtlsdr_get_direct_sampling returns -1 on error, 0 means disabled,
// 1 I-ADC input enabled, 2 Q-ADC input enabled
func (c *Context) GetDirectSampling() (err int) {
	return int(C.rtlsdr_get_direct_sampling((*C.rtlsdr_dev_t)(c.dev)))
}