Commit ec2b1cf0 authored by Tammo Jan Dijkema's avatar Tammo Jan Dijkema
Browse files

Check frequency

parent 8356a3cf
......@@ -2,6 +2,7 @@
from argparse import ArgumentParser
import subprocess
import sys
import os
from make_sigmf import make_sigmf, dataformat_to_str
from datetime import datetime
......@@ -70,7 +71,8 @@ if __name__ == "__main__":
raise
if exit_code != 0:
raise RuntimeError("Exit code of usrp_to_file was " + exit_code)
# Let's hope that the C program crashed with a message
sys.exit(1)
sigmf_meta_filename = make_sigmf(args.file + ".metadata")
......
......@@ -426,6 +426,10 @@ int UHD_SAFE_MAIN(int argc, char* argv[])
// set the center frequency
if (vm.count("freq")) { // with default of 0.0 this will always be true
if (freq < 5e6) {
throw std::runtime_error("Frequency should be given in Hz.\n" +
std::to_string(freq) + "Hz is probably not what you meant!");
}
std::cout << boost::format("Setting RX Freq: %f MHz...") % (freq / 1e6)
<< std::endl;
std::cout << boost::format("Setting RX LO Offset: %f MHz...") % (lo_offset / 1e6)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment