From a70b964dd304078d88b13c19a91530864dad0409 Mon Sep 17 00:00:00 2001 From: Arturs Artamonovs Date: Mon, 13 Mar 2023 22:42:11 +0000 Subject: Fixed API for AirSpyHF class. --- test_class.py | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) (limited to 'test_class.py') diff --git a/test_class.py b/test_class.py index 35a6fd3..b8eea64 100755 --- a/test_class.py +++ b/test_class.py @@ -8,6 +8,45 @@ import argparse airspy = AirSpyHF() -airspy.open(device_index=0) +if -1 == airspy.open(device_index=0): + print("Couldnt open device") + sys.exit(1) +print("1") +airspy.set_samplerate(192000) +print("1") +airspy.set_hf_agc(1) +print("1") +airspy.set_hf_agc_threshold(0) +print("1") +airspy.set_hf_lna(1) +print("1") +sample_count = 0 +def read_samples(transfer): + global sample_count + global wave_file + print("Python call back") + t = transfer.contents + bytes_to_write = t.sample_count * 4 * 2 + rx_buffer = t.samples + #print(f"{bytes_to_write} bytes receieved") + sample_count += t.sample_count + #for i in range(0,t.sample_count): + #d_re = t.samples[i].re + #d_im = t.samples[i].im + #data = struct.pack("