mirror of
https://github.com/jopohl/urh.git
synced 2026-03-03 23:14:00 +01:00
* setup environment for native sdrplay support * prepare stream callback * add sdrplay class with error codes and pack complex method * add receive callback for sdrplay * add call in virtual device * simplify unpack complex method * improve initial gain setting * remove debug prints * sdrplay rx prototype * make protocol sniff settings collapsabile * move spectrum analyzer action to the top of signal actions * make device settings collapsable * improve collapse boxes * fix collapse icon * wrap live methods * fix layout * integrate methods * fix gil problems when live setting parameters * enable antenna selection for sdrplay * add optional dependency to readme * add winlibs * improve device list output * increase timeout for travis * consider changed set gr for rsp1
30 lines
884 B
Python
30 lines
884 B
Python
import unittest
|
|
|
|
from urh.dev.native.RTLSDRTCP import RTLSDRTCP
|
|
|
|
class TestRTLSDRTCP(unittest.TestCase):
|
|
|
|
def test_device_communication(self):
|
|
error = 0
|
|
sdr = RTLSDRTCP(0, 0, 0, device_number=0)
|
|
sdr.open(sdr.child_ctrl_conn)
|
|
if sdr.socket_is_open == False:
|
|
error += 1
|
|
if sdr.set_parameter("centerFreq", 927000000, sdr.child_ctrl_conn):
|
|
error += 1
|
|
if sdr.set_parameter("sampleRate", 2000000, sdr.child_ctrl_conn):
|
|
error += 1
|
|
if sdr.set_parameter("bandwidth", 2000000, sdr.child_ctrl_conn):
|
|
error += 1
|
|
if sdr.set_parameter("tunerGain", 200, sdr.child_ctrl_conn):
|
|
error += 1
|
|
data = sdr.read_sync()
|
|
if len(data) < 1:
|
|
error += 1
|
|
sdr.close()
|
|
self.assertEqual(error, 0)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|