Пример #1
0
    def shutdown_device(cls, ctrl_connection, is_tx=False):
        logger.debug("AirSpy: closing device")
        ret = airspy.stop_rx()
        ctrl_connection.send("Stop RX:" + str(ret))

        ret = airspy.close()
        ctrl_connection.send("EXIT:" + str(ret))

        return True
Пример #2
0
    def shutdown_airspy(ctrl_conn):
        logger.debug("AirSpy: closing device")
        ret = airspy.stop_rx()
        ctrl_conn.send("Stop RX:" + str(ret))

        ret = airspy.close()
        ctrl_conn.send("EXIT:" + str(ret))

        return True
Пример #3
0
    def shutdown_device(cls, ctrl_connection):
        logger.debug("AirSpy: closing device")
        ret = airspy.stop_rx()
        ctrl_connection.send("Stop RX:" + str(ret))

        ret = airspy.close()
        ctrl_connection.send("EXIT:" + str(ret))

        return True
Пример #4
0
    def test_cython_wrapper(self):
        result = airspy.open()
        print("Open:", airspy.error_name(result), result)

        sample_rates = airspy.get_sample_rates()
        print("Samples rates:", sample_rates)

        result = airspy.set_sample_rate(10**6)
        print("Set sample rate", airspy.error_name(result), result)

        result = airspy.set_center_frequency(int(433.92e6))
        print("Set center frequency", airspy.error_name(result), result)

        result = airspy.set_if_rx_gain(5)
        print("Set lna gain", airspy.error_name(result), result)

        result = airspy.set_rf_gain(8)
        print("Set mixer gain", airspy.error_name(result), result)

        result = airspy.set_baseband_gain(10)
        print("Set vga gain", airspy.error_name(result), result)

        parent_conn, child_conn = Pipe()

        result = airspy.start_rx(child_conn.send_bytes)
        print("Set start rx", airspy.error_name(result), result)

        time.sleep(0.01)
        print(np.fromstring(parent_conn.recv_bytes(8*65536), dtype=np.complex64))

        print("Closing")

        parent_conn.close()
        child_conn.close()

        result = airspy.stop_rx()
        print("Set stop rx", airspy.error_name(result), result)

        result = airspy.close()
        print("Close:", airspy.error_name(result), result)