HackRF_Phase_Scripts/hack_depreciated.py

18 lines
468 B
Python
Raw Permalink Normal View History

2022-08-01 09:31:00 +00:00
from hackrf import *
def open_hackrf(num):
# Opens the desired number of HackRFs
hackrf = [None] * int(num) #Declare empty list
for i in range(int(num)):
print()
try:
hackrf[i] = HackRF(device_index = i)
except Exception as e:
print(e)
print(f"Error opening device: {i}")
hackrf = hackrf[:-1] # Decrease list size
else:
print(f"device {i} opened")
print(hackrf[i].get_serial_no())
return(hackrf) #return list of opened HackRFs