示例#1
0
文件: rtlsdr.go 项目: cyoung/gortlsdr
// GetOffsetTuning returns the offset tuning mode.
func (dev *Context) GetOffsetTuning() (enabled bool, err error) {
	i := int(C.rtlsdr_get_offset_tuning((*C.rtlsdr_dev_t)(dev)))
	switch i {
	case -1:
		err = errors.New("error getting offset tuning mode")
	case 0:
		enabled = false
	case 1:
		enabled = true
	default:
		err = errors.New("unknown offset tuning mode state")
	}
	return
}
示例#2
0
// Get state of the offset tuning mode
//
// int rtlsdr_get_offset_tuning(rtlsdr_dev_t *dev);
// rtlsdr_get_offset_tuning returns -1 on error, 0 means disabled, 1 enabled
func (c *Context) GetOffsetTuning() (err int) {
	return int(C.rtlsdr_get_offset_tuning((*C.rtlsdr_dev_t)(c.dev)))
}