mirror of
https://github.com/jopohl/urh.git
synced 2026-03-18 22:26:47 +01:00
Converting Works
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user