示例#1
0
// Close a handle to the RTLSDR device
func (dev *Radio) Close() error {
	// RTLSDR_API int rtlsdr_close(rtlsdr_dev_t *dev);
	retval := C.rtlsdr_close(dev.devptr)

	if retval != 0 {
		defer dev.Cleanup()
		return fmt.Errorf("rtlsdr_close returned error value: %d", retval)
	}

	return nil
}
示例#2
0
// Close closes a previously opened device context.
//
// int rtlsdr_close(rtlsdr_dev_t *dev);
// rtlsdr_close returns 0 on success
func (c *Context) Close() (err int) {
	return int(C.rtlsdr_close((*C.rtlsdr_dev_t)(c.dev)))
}
示例#3
0
文件: rtlsdr.go 项目: cyoung/gortlsdr
// Close closes the device.
func (dev *Context) Close() (err error) {
	i := int(C.rtlsdr_close((*C.rtlsdr_dev_t)(dev)))
	return libError(i)
}