Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed soapy api #220

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ The newly prepared SDCard can be inserted into the Raspberry Pi.
sudo make install
```
Soapy SDR is a third party generic SDR API that can interact with CaribouLite (in addition to the native c/c++ APIs)

note: rpi-zero might struggle with compiling the python swig wrappers that SoapySDR uses. If this occurs, feel free to remove the `add_subdirectory(swig)` from their CMakeLists.txt to remove python support for Soapy.

4. Install the software using CaribouLite's dedicated install script:
```
Expand Down
7 changes: 4 additions & 3 deletions software/libcariboulite/src/soapy_api/Cariboulite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,16 +245,17 @@ void Cariboulite::setSampleRate( const int direction, const size_t channel, cons
if (std::fabs(rate - (500000.0)) < 1) fs = cariboulite_radio_rx_sample_rate_500khz;
if (std::fabs(rate - (666000.0)) < 1)
{
fs = cariboulite_radio_rx_sample_rate_666khz;
SoapySDR::logf(SOAPY_SDR_WARNING, "setSampleRate: using rounded rate 666000 is deprecated; use 2e6/3 or 666666.7.");
fs = cariboulite_radio_rx_sample_rate_666khz;
//SoapySDR::logf() is not exposed in the C header
SoapySDR_logf(SOAPY_SDR_WARNING, "setSampleRate: using rounded rate 666000 is deprecated; use 2e6/3 or 666666.7.");
}
if (std::fabs(rate - (2000000.0/3)) < 1) fs = cariboulite_radio_rx_sample_rate_666khz;
if (std::fabs(rate - (800000.0)) < 1) fs = cariboulite_radio_rx_sample_rate_800khz;
if (std::fabs(rate - (1000000.0)) < 1) fs = cariboulite_radio_rx_sample_rate_1000khz;
if (std::fabs(rate - (1333000.0)) < 1) fs = cariboulite_radio_rx_sample_rate_1333khz;
{
fs = cariboulite_radio_rx_sample_rate_1333khz;
SoapySDR::logf(SOAPY_SDR_WARNING, "setSampleRate: using rounded rate 1333000 is deprecated; use 4e6/3 or 1333333.3.");
SoapySDR_logf(SOAPY_SDR_WARNING, "setSampleRate: using rounded rate 1333000 is deprecated; use 4e6/3 or 1333333.3.");
}
if (std::fabs(rate - (4000000.0/3)) < 1) fs = cariboulite_radio_rx_sample_rate_1333khz;
if (std::fabs(rate - (2000000.0)) < 1) fs = cariboulite_radio_rx_sample_rate_2000khz;
Expand Down
6 changes: 3 additions & 3 deletions software/libcariboulite/src/soapy_api/CaribouliteStream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ class SoapySDR::Stream
cariboulite_channel_dir_en getInnerStreamType(void);
void setInnerStreamType(cariboulite_channel_dir_en dir);
void setDigitalFilter(DigitalFilterType type);
DigitalFilterType getDigitalFilter() const { return filterType };
DigitalFilterType getDigitalFilter() const { return filterType;};
int setFormat(const std::string &fmt);
inline int readerThreadRunning() {return reader_thread_running;}
void activateStream(int active) {stream_active = active;}
inline int readerThreadRunning() {return reader_thread_running;};
void activateStream(int active) {stream_active = active;};

public:
cariboulite_radio_state_st *radio;
Expand Down