From 34f2c3c9da51d3d9a51c442d99653dd323b07795 Mon Sep 17 00:00:00 2001 From: Josh Bailey Date: Thu, 4 Apr 2024 00:39:40 +0000 Subject: [PATCH] Add sigmf version number. --- bin/install-deps.sh | 2 ++ lib/sample_pipeline_test.cpp | 3 +++ lib/sample_writer.cpp | 1 + 3 files changed, 6 insertions(+) diff --git a/bin/install-deps.sh b/bin/install-deps.sh index e06d8f7..d6e9cb9 100755 --- a/bin/install-deps.sh +++ b/bin/install-deps.sh @@ -8,10 +8,12 @@ sudo apt-get update && sudo apt-get install -qy \ libboost-all-dev \ libuhd-dev \ libvulkan-dev \ + python3-pip \ unzip \ valgrind \ wget \ && \ + pip install sigmf && \ wget https://sourceforge.net/projects/sigpack/files/sigpack-1.2.7.zip -O sigpack.zip && unzip sigpack.zip && ln -s sigpack-*/sigpack . && \ git clone https://github.com/google/flatbuffers -b v23.5.26 && \ git clone https://github.com/nlohmann/json -b v3.11.2 && \ diff --git a/lib/sample_pipeline_test.cpp b/lib/sample_pipeline_test.cpp index 3cdc493..96ff269 100644 --- a/lib/sample_pipeline_test.cpp +++ b/lib/sample_pipeline_test.cpp @@ -34,6 +34,9 @@ BOOST_AUTO_TEST_CASE(RandomFFTTest) { samples.size() * sizeof(std::complex)); enqueue_samples(write_ptr); sample_pipeline_stop(0, file, 1e3 * 1024, 100e6, 1.1, -1, "cf32_le"); + std::string sigmf_validate_cli = + "sigmf_validate --skip-checksum " + file + ".sigmf-meta"; + BOOST_TEST(std::system(sigmf_validate_cli.c_str()) == 0); arma::Col> disk_samples; disk_samples.copy_size(samples); FILE *samples_fp = fopen(file.c_str(), "rb"); diff --git a/lib/sample_writer.cpp b/lib/sample_writer.cpp index dbe290a..08b09fc 100644 --- a/lib/sample_writer.cpp +++ b/lib/sample_writer.cpp @@ -75,6 +75,7 @@ void SampleWriter::write_sigmf(const std::string &filename, double timestamp, record; record.global.access().datatype = datatype; record.global.access().sample_rate = sample_rate; + record.global.access().version = "1.0.0"; auto capture = sigmf::Capture(); capture.get().sample_start = 0;