jpoirier / gortlsdr Goto Github PK
View Code? Open in Web Editor NEWA Go wrapper for librtlsdr (a driver for Realtek RTL2832U based SDR's)
License: BSD 3-Clause "New" or "Revised" License
A Go wrapper for librtlsdr (a driver for Realtek RTL2832U based SDR's)
License: BSD 3-Clause "New" or "Revised" License
Line 32 in 8185285
#ifdef rtlsdr_set_bias_tee
static int rtlsdr_set_bias_tee_wrap(rtlsdr_dev_t* d, int i) { return rtlsdr_set_bias_tee(d,i); }
#else
static int rtlsdr_set_bias_tee_wrap(rtlsdr_dev_t* d, int i) { return -12; }
#endif
And call rtlsdr_set_bias_tee_wrap instead of rtlsdr_set_bias_tee
Thanks.
I'm trying to understand how gortlsdr uses cgo to interface with the C library, in particular the callback function used in the async read. clientCb
is set inside ReadAsync()
yet doesn't get passed to a C function or referenced from the C preamble!?
The Go docs http://golang.org/cmd/cgo/ talk about using //export
before the Go function to be exported...yet gortlsdr doesn't do this. Could you explain how this works?
It would be nice to hide the C-isms as much as possible e.g. rather than returning ints, return Go errors
To this end I've created a branch which includes:
Possibly a candidate for v2.0 ๐
function rtlsdr_set_tuner_bandwidth()
is not present in Linux distro releases of rtl-sdr package. Go packages that have gortlsdr as a depencency will fail to compile when using distro packaged librtlsdr.
I've confirmed this on Fedora 23 and Ubuntu 14.04.
Could SetTunerBw()
be modified to return an error if rtlsdr_set_tuner_bandwidth()
can't be found?
I get
exec: "gcc": executable file not found in %PATH%
message after go install github.com/jpoirier/gortlsdr command
OS: Windows 7 64 bit
-lusb
here appears to be redundant and removing it makes no difference to compilation on Linux.
I found that having the flag there actually causes compilation to fail if legacy libusb is not installed. For example Arch linux uses the current 1.0 library which is referenced by -lusb-1.0
@jpoirier do you foresee see any issues in removing this flag?
when i run "go get -u github.com/jpoirier/gortlsdr" i get this error does anyone know how to fix it?
# github.com/jpoirier/gortlsdr /tmp/go-build505426775/github.com/jpoirier/gortlsdr/_obj/rtlsdr.cgo2.o: In function
_cgo_1debe9789e24_Cfunc_rtlsdr_set_bias_tee':
go/src/github.com/jpoirier/gortlsdr/rtlsdr.go:355: undefined reference to rtlsdr_set_bias_tee' /tmp/go-build505426775/github.com/jpoirier/gortlsdr/_obj/rtlsdr.cgo2.o: In function
_cgo_1debe9789e24_Cfunc_rtlsdr_set_tuner_bandwidth':
go/src/github.com/jpoirier/gortlsdr/rtlsdr.go:446: undefined reference to rtlsdr_set_tuner_bandwidth' collect2: error: ld returned 1 exit status
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.