From 5998f459c8b1e2320ae8907df5fefb60e28d0e34 Mon Sep 17 00:00:00 2001 From: Ryan Thompson Date: Mon, 22 May 2023 13:59:06 -0500 Subject: [PATCH] test: txrx_hwloop: sample rate arg added to binary --- .../test_timestamps/src/test_txrx_hwloop.c | 8 ++++++++ .../test_timestamps/src/test_txrx_hwloop.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/host/libraries/libbladeRF_test/test_timestamps/src/test_txrx_hwloop.c b/host/libraries/libbladeRF_test/test_timestamps/src/test_txrx_hwloop.c index 91c3d6ca..3df03ee8 100644 --- a/host/libraries/libbladeRF_test/test_timestamps/src/test_txrx_hwloop.c +++ b/host/libraries/libbladeRF_test/test_timestamps/src/test_txrx_hwloop.c @@ -111,6 +111,14 @@ int main(int argc, char *argv[]) { strcpy(test.dev_rx_str, optarg); break; + case 's': + p.samplerate = str2uint(optarg, 0, UINT32_MAX, &ok); + if (!ok) { + fprintf(stderr, "Invalid sample rate: %s\n", optarg); + return -1; + } + break; + case 'b': test.burst_len = str2uint(optarg, 0, UINT32_MAX, &ok); if (!ok) { diff --git a/host/libraries/libbladeRF_test/test_timestamps/src/test_txrx_hwloop.h b/host/libraries/libbladeRF_test/test_timestamps/src/test_txrx_hwloop.h index 942af5f4..508fb1b7 100644 --- a/host/libraries/libbladeRF_test/test_timestamps/src/test_txrx_hwloop.h +++ b/host/libraries/libbladeRF_test/test_timestamps/src/test_txrx_hwloop.h @@ -43,6 +43,7 @@ struct test_case { static struct option const long_options[] = { { "txdev", required_argument, NULL, 't' }, { "rxdev", required_argument, NULL, 'r' }, + { "samprate", required_argument, NULL, 's' }, { "burst", required_argument, NULL, 'b' }, { "compare", no_argument, NULL, 'c' }, { "period", required_argument, NULL, 'p' }, @@ -88,6 +89,7 @@ static void usage() printf("Test configuration:\n"); printf(" -t, --txdev TX bladeRF device string.\n"); printf(" -r, --rxdev RX bladeRF device string.\n"); + printf(" -s, --samprate Sample Rate\n"); printf(" -b, --burst Number of samples in a burst.\n"); printf(" -p, --period Length between timestamps in samples\n"); printf(" -f, --fill %% of burst to fill with [2000,2000]\n");