diff --git a/src/urh/dev/Device.py b/src/urh/dev/Device.py index 6855d07f..f015e2d5 100644 --- a/src/urh/dev/Device.py +++ b/src/urh/dev/Device.py @@ -18,7 +18,7 @@ class Device(metaclass=ABCMeta): self.current_index = 0 while True: try: - self.receive_buffer = np.zeros(int(buf_size), dtype=np.complex64) + self.receive_buffer = np.zeros(int(buf_size), dtype=np.complex64, order='C') break except (MemoryError, ValueError): buf_size //= 2 diff --git a/src/urh/dev/HackRF.py b/src/urh/dev/HackRF.py index de95f5ef..f2ca674b 100644 --- a/src/urh/dev/HackRF.py +++ b/src/urh/dev/HackRF.py @@ -12,8 +12,8 @@ class HackRF(Device): self.is_open = False self.success = 0 - self.__lut = np.empty(0xffff + 1, dtype=np.complex64) - self.little_endian = True + self.__lut = np.zeros(0xffff + 1, dtype=np.complex64) + self.little_endian = False for i in range(0, 0xffff + 1): if self.little_endian: real = (float(np.int8(i & 0xff))) * (1.0 / 128.0) diff --git a/tests/HackRF.py b/tests/HackRF.py index 9178038c..1b0e4138 100644 --- a/tests/HackRF.py +++ b/tests/HackRF.py @@ -70,17 +70,15 @@ class TestHackRF(unittest.TestCase): def test_hackrf_class(self): - hfc = HackRF(1e6, 433e6, 20, 10e6) + hfc = HackRF(1e6, 433.92e6, 20, 1e6) hfc.open() hfc.start_rx_mode() time.sleep(5) print(hfc.current_index) print(hfc.received_data) - hfc.stop_rx_mode("Finished test") hfc.received_data.tofile("/tmp/hackrf.complex") print("Wrote Data") - - + hfc.stop_rx_mode("Finished test") hfc.close() def test_lookup(self):