summarylogtreecommitdiffstats
path: root/0002-hackrf-handler-fix-getSamples.patch
blob: 1f4760e41c22bfbbc038092b7c5714d2a55ffec6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
From dd22c358eb27b150a24a51b69e572a845d7b38b3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20La=C3=9F?= <bevan@bi-co.net>
Date: Thu, 26 Dec 2024 14:07:34 +0100
Subject: [PATCH 2/3] hackrf-handler: fix getSamples()

16199306a07a2550722b7305ad73149d90cb7d8b accidentally changed the
datatype of hackrf samples from complex<int8_t> to complex<float>. This
was then again changed to complex<int16_t> in
b3b83093e27bd4b272e5f10c1ffee28c753e254f. However, only complex<int8_t>
allows capturing valid samples from a HackRF.
---
 qt-devices/hackrf-handler/hackrf-handler.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qt-devices/hackrf-handler/hackrf-handler.cpp b/qt-devices/hackrf-handler/hackrf-handler.cpp
index 2e4826d0..c30c9858 100755
--- a/qt-devices/hackrf-handler/hackrf-handler.cpp
+++ b/qt-devices/hackrf-handler/hackrf-handler.cpp
@@ -365,7 +365,7 @@ int	res;
 //	The brave old getSamples. For the hackrf, we get
 //	size still in I/Q pairs
 int32_t	hackrfHandler::getSamples (std::complex<float> *V, int32_t size) { 
-auto *temp = dynVec (std::complex<int16_t>, size);
+auto *temp = dynVec (std::complex<int8_t>, size);
 	int amount      = _I_Buffer. getDataFromBuffer (temp, size);
 	for (int i = 0; i < amount; i ++)
 	   V [i] = std::complex<float> (real (temp [i]) / 127.0f,
-- 
2.47.1