Skip to content

Commit

Permalink
Merge pull request #237 from anarkiwi/sf3
Browse files Browse the repository at this point in the history
fix missing version and datatype in sigmf.
  • Loading branch information
anarkiwi authored Apr 4, 2024
2 parents a3e75f9 + 389d4f1 commit aa51952
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions lib/base_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ void base_impl::write_sigmf(const std::string &filename,
record;
record.global.access<sigmf::core::GlobalT>().datatype = datatype;
record.global.access<sigmf::core::GlobalT>().sample_rate = sample_rate;
record.global.access<sigmf::core::GlobalT>().version = "1.0.0";
auto capture =
sigmf::Capture<sigmf::core::DescrT, sigmf::capture_details::DescrT>();
capture.get<sigmf::core::DescrT>().sample_start = 0;
Expand Down
5 changes: 3 additions & 2 deletions lib/write_freq_samples_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,9 @@ write_freq_samples_impl::write_freq_samples_impl(
gr::io_signature::make(1 /* min inputs */, 1 /* max inputs */,
vlen * itemsize),
gr::io_signature::make(0, 0, 0)),
tag_(pmt::intern(tag)), itemsize_(itemsize), vlen_(vlen), sdir_(sdir),
prefix_(prefix), write_step_samples_(write_step_samples),
tag_(pmt::intern(tag)), itemsize_(itemsize), datatype_(datatype),
vlen_(vlen), sdir_(sdir), prefix_(prefix),
write_step_samples_(write_step_samples),
skip_tune_step_samples_(skip_tune_step_samples), samp_rate_(samp_rate),
write_step_samples_count_(0), skip_tune_step_samples_count_(0),
last_rx_freq_(0), rotate_secs_(rotate_secs), gain_(gain), sigmf_(sigmf) {
Expand Down
6 changes: 4 additions & 2 deletions python/iqtlabs/qa_write_freq_samples.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@

import json
import glob
import subprocess
import os
import subprocess
import tempfile
import time
import pmt
Expand Down Expand Up @@ -236,7 +236,7 @@ def run_flowgraph(
write_freq_samples_0 = write_freq_samples(
"rx_freq",
gr.sizeof_gr_complex * 1,
"cf32",
"cf32_le",
points,
tmpdir,
"samples",
Expand Down Expand Up @@ -284,6 +284,8 @@ def test_write_freq_samples(self):
sigmf_global = sigmf["global"]
sigmf_capture = sigmf["captures"][0]
self.assertEqual(samp_rate, sigmf_global["core:sample_rate"], sigmf)
self.assertEqual("1.0.0", sigmf_global["core:version"], sigmf)
self.assertTrue(sigmf_global["core:datatype"])
self.assertEqual(tune_freq, sigmf_capture["core:frequency"], sigmf)
source_file = sigmf_capture["capture_details:source_file"]
self.assertEqual(
Expand Down

0 comments on commit aa51952

Please sign in to comment.