aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arguments.hpp10
-rw-r--r--main.cpp3
-rw-r--r--topblock.hpp5
3 files changed, 15 insertions, 3 deletions
diff --git a/arguments.hpp b/arguments.hpp
index 8075236..9b25112 100644
--- a/arguments.hpp
+++ b/arguments.hpp
@@ -106,6 +106,11 @@ public:
return outcsv;
}
+ std::string get_device_args()
+ {
+ return device_args;
+ }
+
private:
static error_t s_parse_opt(int key, char *arg, struct argp_state *state)
{
@@ -153,6 +158,9 @@ private:
case 'o':
outcsv = std::string(arg);
break;
+ case 'd':
+ device_args = std::string(arg);
+ break;
case ARGP_KEY_ARG:
if (state->arg_num > 0)
argp_usage(state);
@@ -180,6 +188,7 @@ private:
double step;
double ptime;
std::string outcsv;
+ std::string device_args;
};
argp_option Arguments::options[] = {
@@ -195,6 +204,7 @@ argp_option Arguments::options[] = {
{"step", 'z', "FREQ", 0, "Increment step in MHz (default: sample-rate / 4)"},
{"time", 'p', "TIME", 0, "Time in seconds to scan on each frequency (default: 1)"},
{"output-csv", 'o', "OUTCSV", 0, "Output results to CSV file (default: [none])"},
+ {"device-args", 'd', "DEVICEARGS", 0, "Device arguments for OsmoSDR (default: [none])"},
{0}
};
diff --git a/main.cpp b/main.cpp
index a6f3438..8da42e6 100644
--- a/main.cpp
+++ b/main.cpp
@@ -38,7 +38,8 @@ int main(int argc, char **argv)
arguments.get_spread(),
arguments.get_threshold(),
arguments.get_time(),
- arguments.get_outcsv());
+ arguments.get_outcsv(),
+ arguments.get_device_args());
top_block.run();
return 0; //actually, we never get here because of the rude way in which we end the scan
}
diff --git a/topblock.hpp b/topblock.hpp
index 33e9484..d341a71 100644
--- a/topblock.hpp
+++ b/topblock.hpp
@@ -36,11 +36,12 @@ public:
TopBlock(double centre_freq_1, double centre_freq_2, double sample_rate,
double fft_width, double bandwidth1, double bandwidth2,
double step, unsigned int avg_size, double spread,
- double threshold, double ptime, const std::string &outcsv) :
+ double threshold, double ptime, const std::string &outcsv,
+ const std::string &device_args) :
gr::top_block("Top Block"),
vector_length(sample_rate / fft_width),
window(GetWindow(vector_length)),
- source(osmosdr::source::make()), /* OsmoSDR Source */
+ source(osmosdr::source::make(device_args)), /* OsmoSDR Source */
stv(gr::blocks::stream_to_vector::make(sizeof(float) * 2, vector_length)), /* Stream to vector */
/* Based on the logpwrfft (a block implemented in python) */
fft(gr::fft::fft_vcc::make(vector_length, true, window, false, 1)),