def open(self, init=True): if not self.is_open: if init: ret = hackrf.setup() else: ret = hackrf.open() self.is_open = ret == self.success self.log_retcode(ret, "open")
def test_c_api(self): def callback(n): print("called") return np.array([1], dtype=np.complex64) print("init", hackrf.init()) print("open", hackrf.open()) print("start_tx", hackrf.start_tx_mode(callback)) time.sleep(1) print("stop_tx", hackrf.stop_tx_mode()) print("close", hackrf.close()) print("exit", hackrf.exit())