Hi everyone,
I'd like to buy a KSDR for some applications I have in mind but I could not find out yet how to interface the KSDR from my own software. In my case this is a C++ application. Is there some sort of C/C++ library that sits on top of librtlsdr or do I have to control the KSDR (the noise source) manually and do the correlation/correction my self?
Best regards,
Fabian
Interfacing KSDR in C/C++
Re: Interfacing KSDR in C/C++
grab a copy of the KSDR code and see how it's done
Last edited by kb3cs on Sun May 05, 2019 12:54 pm, edited 1 time in total.
Re: Interfacing KSDR in C/C++
OK, so no C library?
I know how to do it, but I am lazy and was hoping to save some time
I know how to do it, but I am lazy and was hoping to save some time

Re: Interfacing KSDR in C/C++
but allow yourself a full review of the existing code first before declaring yourself too lazy to be lazy 

-
- Site Admin
- Posts: 2434
- Joined: Mon Nov 19, 2012 11:54 pm
Re: Interfacing KSDR in C/C++
The code is all open source, so please feel free to take a look. It's not in API form though, you'd need to build your own interface.
The core C code handles the RTL-SDR driver interface and control, plus the syncing and gate functions. The Python code does the DSP and GUI. You can see how the Python code interfaces with the core C code, and then build a similar interface in your C++ program.
The core C code handles the RTL-SDR driver interface and control, plus the syncing and gate functions. The Python code does the DSP and GUI. You can see how the Python code interfaces with the core C code, and then build a similar interface in your C++ program.
Re: Interfacing KSDR in C/C++
I've had a quick look, but there aren't really any comments (and still lots of occurences of Hydra). It would be highly appreciated if the general structure of the code and the layout of the FIFO / control channels was explained somewhere.
From my reading of the code (mostly just the C) the most highlevel structure is this: a thread per receiver to read into a circular buffer. Syncing the receivers produces an offset into each circular buffer (except one, I guess) to align the samples. Control (configuring the receivers) goes through some sort of FIFO and is then dispatched to all four receivers.
One of the questions I have is if you need to re-sync after each control change?
From my reading of the code (mostly just the C) the most highlevel structure is this: a thread per receiver to read into a circular buffer. Syncing the receivers produces an offset into each circular buffer (except one, I guess) to align the samples. Control (configuring the receivers) goes through some sort of FIFO and is then dispatched to all four receivers.
One of the questions I have is if you need to re-sync after each control change?