From a51f06350eaf45cf19805059d38e37e321638085 Mon Sep 17 00:00:00 2001 From: Michael Ossmann Date: Fri, 3 Feb 2017 17:08:11 -0700 Subject: [PATCH] print actual values for all fields in hackrf_sweep csv output --- host/hackrf-tools/src/hackrf_sweep.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/host/hackrf-tools/src/hackrf_sweep.c b/host/hackrf-tools/src/hackrf_sweep.c index 8d0727a1..03ae392c 100644 --- a/host/hackrf-tools/src/hackrf_sweep.c +++ b/host/hackrf-tools/src/hackrf_sweep.c @@ -34,6 +34,7 @@ #include #include #include +#include #define _FILE_OFFSET_BITS 64 #define BLOCKS_PER_TRANSFER 16 @@ -232,7 +233,12 @@ int rx_callback(hackrf_transfer* transfer) { time_now = time(NULL); fft_time = localtime(&time_now); strftime(time_str, 50, "%Y-%m-%d, %H:%M:%S", fft_time); - printf("%s, hz_low, hz_high, hz_step, num_samples, ", time_str); + printf("%s, %" PRIu64 ", %" PRIu64 ", %f, %d, ", + time_str, + (uint64_t)((FREQ_ONE_MHZ*frequency)-STEP_SIZE_IN_HZ*(FFT_SIZE/2)), + (uint64_t)((FREQ_ONE_MHZ*frequency)+STEP_SIZE_IN_HZ*(FFT_SIZE/2)), + (float)STEP_SIZE_IN_HZ, + FFT_SIZE); for(i=0; i < (fftSize - 1); i++) { printf("%.2f, ", pwr[i]); }